no longer need ffmpeg patch0 which was for Termux
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / tracer / tracerwindow.h
1 /*
2  * CINELERRA
3  * Copyright (C) 2008-2015 Adam Williams <broadcast at earthling dot net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *
19  */
20
21 #ifndef __TRACERWINDOW_H__
22 #define __TRACERWINDOW_H__
23
24 #include "guicast.h"
25
26 class Tracer;
27 class TracerWindow;
28 class TracerNum;
29 class TracerPointX;
30 class TracerPointY;
31 class TracerDrag;
32 class TracerDraw;
33 class TracerFill;
34 class TracerFeather;
35 class TracerRadius;
36 class TracerPointList;
37 class TracerNewPoint;
38 class TracerDelPoint;
39 class TracerPointUp;
40 class TracerPointDn;
41 class TracerReset;
42 class TracerInvert;
43
44
45 class TracerNum : public BC_TumbleTextBox
46 {
47 public:
48         TracerWindow *gui;
49
50         TracerNum(TracerWindow *gui, int x, int y, float output);
51         ~TracerNum();
52 };
53 class TracerPointX : public TracerNum
54 {
55 public:
56         TracerPointX(TracerWindow *gui, int x, int y, float output)
57          : TracerNum(gui, x, y, output) {}
58         ~TracerPointX() {}
59
60         int handle_event();
61 };
62 class TracerPointY : public TracerNum
63 {
64 public:
65         TracerPointY(TracerWindow *gui, int x, int y, float output)
66          : TracerNum(gui, x, y, output) {}
67         ~TracerPointY() {}
68
69         int handle_event();
70 };
71
72 class TracerThreshold : public BC_FSlider
73 {
74 public:
75         TracerThreshold(TracerWindow *gui, int x, int y, int w);
76         int handle_event();
77         int wheel_event(int v);
78         TracerWindow *gui;
79 };
80
81 class TracerDrag : public BC_CheckBox
82 {
83 public:
84         TracerDrag(TracerWindow *gui, int x, int y);
85
86         int handle_event();
87         TracerWindow *gui;
88 };
89
90 class TracerDraw : public BC_CheckBox
91 {
92 public:
93         TracerDraw(TracerWindow *gui, int x, int y);
94
95         int handle_event();
96         TracerWindow *gui;
97 };
98
99 class TracerFill : public BC_CheckBox
100 {
101 public:
102         TracerFill(TracerWindow *gui, int x, int y);
103
104         int handle_event();
105         TracerWindow *gui;
106 };
107
108 class TracerFeather : public BC_ISlider
109 {
110 public:
111         TracerFeather(TracerWindow *gui, int x, int y, int w);
112
113         int handle_event();
114         TracerWindow *gui;
115 };
116
117 class TracerRadius : public BC_FSlider
118 {
119 public:
120         TracerRadius(TracerWindow *gui, int x, int y, int w);
121
122         int handle_event();
123         TracerWindow *gui;
124 };
125
126 class TracerPointList : public BC_ListBox
127 {
128 public:
129         TracerPointList(TracerWindow *gui, Tracer *plugin, int x, int y);
130         ~TracerPointList();
131
132         int handle_event();
133         int selection_changed();
134         int column_resize_event();
135         ArrayList<BC_ListBoxItem*> cols[PT_SZ];
136         void clear();
137         void new_point(const char *xp, const char *yp);
138         void del_point(int i);
139         void set_point(int i, int c, float v);
140         void set_point(int i, int c, const char *cp);
141         int set_selected(int k);
142         void update(int k);
143         void update_list(int k);
144
145
146         TracerWindow *gui;
147         Tracer *plugin;
148         const char *titles[PT_SZ];
149         int widths[PT_SZ];
150 };
151
152 class TracerNewPoint : public BC_GenericButton
153 {
154 public:
155         TracerNewPoint(TracerWindow *gui, Tracer *plugin, int x, int y);
156         ~TracerNewPoint();
157
158         int handle_event();
159
160         TracerWindow *gui;
161         Tracer *plugin;
162 };
163
164 class TracerDelPoint : public BC_GenericButton
165 {
166 public:
167         TracerDelPoint(TracerWindow *gui, Tracer *plugin, int x, int y);
168         ~TracerDelPoint();
169
170         int handle_event();
171
172         Tracer *plugin;
173         TracerWindow *gui;
174 };
175
176 class TracerPointUp : public BC_GenericButton
177 {
178 public:
179         TracerPointUp(TracerWindow *gui, int x, int y);
180         ~TracerPointUp();
181
182         int handle_event();
183
184         TracerWindow *gui;
185 };
186
187 class TracerPointDn : public BC_GenericButton
188 {
189 public:
190         TracerPointDn(TracerWindow *gui, int x, int y);
191         ~TracerPointDn();
192
193         int handle_event();
194
195         TracerWindow *gui;
196 };
197
198 class TracerReset : public BC_GenericButton
199 {
200 public:
201         TracerReset(TracerWindow *gui, Tracer *plugin, int x, int y);
202         ~TracerReset();
203
204         int handle_event();
205
206         Tracer *plugin;
207         TracerWindow *gui;
208 };
209
210 class TracerInvert : public BC_CheckBox
211 {
212 public:
213         TracerInvert(TracerWindow *gui, Tracer *plugin, int x, int y);
214         ~TracerInvert();
215
216         int handle_event();
217
218         Tracer *plugin;
219         TracerWindow *gui;
220 };
221
222
223 class TracerWindow : public PluginClientWindow
224 {
225 public:
226         TracerWindow(Tracer *plugin);
227         ~TracerWindow();
228
229         void create_objects();
230         void update_gui();
231         void start_color_thread();
232         int grab_event(XEvent *event);
233         int do_grab_event(XEvent *event);
234         int handle_ungrab();
235         void done_event(int result);
236         void send_configure_change();
237
238         Tracer *plugin;
239         BC_Title *title_x, *title_y;
240         TracerPointX *point_x;
241         TracerPointY *point_y;
242         TracerNewPoint *new_point;
243         TracerDelPoint *del_point;
244         TracerPointUp *point_up;
245         TracerPointDn *point_dn;
246         int button_no, pending_config;
247         float last_x, last_y;
248         TracerDrag *drag;
249         TracerDraw *draw;
250         TracerFill *fill;
251         BC_Title *title_r, *title_s;
252         TracerFeather *feather;
253         TracerRadius *radius;
254         TracerPointList *point_list;
255         TracerReset *reset;
256         TracerInvert *invert;
257 };
258
259 #endif
260