Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / cinelerra / cwindowtool.h
blobd7e3fdf742562422e3a427295e795363b115c0bd
1 #ifndef CWINDOWTOOL_H
2 #define CWINDOWTOOL_H
4 #include "condition.inc"
5 #include "cwindowgui.inc"
6 #include "guicast.h"
7 #include "maskauto.inc"
8 #include "mwindow.inc"
11 class CWindowToolGUI;
12 class CWindowCoord;
15 // This common thread supports all the tool GUI's.
16 class CWindowTool : public Thread
18 public:
19 CWindowTool(MWindow *mwindow, CWindowGUI *gui);
20 ~CWindowTool();
22 // Called depending on state of toggle button
23 void start_tool(int operation);
24 void stop_tool();
26 // Called when window is visible
27 void show_tool();
28 void hide_tool();
30 void run();
31 void update_show_window();
32 void update_values();
34 MWindow *mwindow;
35 CWindowGUI *gui;
36 CWindowToolGUI *tool_gui;
37 int done;
38 int current_tool;
39 Condition *input_lock;
40 Condition *output_lock;
41 // Lock run and update_values
42 Mutex *tool_gui_lock;
45 class CWindowToolGUI : public BC_Window
47 public:
48 CWindowToolGUI(MWindow *mwindow,
49 CWindowTool *thread,
50 char *title,
51 int w,
52 int h);
53 ~CWindowToolGUI();
55 virtual void create_objects() {};
56 // Update the keyframe from text boxes
57 virtual void handle_event() {};
58 // Update text boxes from keyframe here
59 virtual void update() {};
60 // Update EDL and preview only
61 virtual void update_preview() {};
62 int current_operation;
63 int close_event();
64 int keypress_event();
65 int translation_event();
67 MWindow *mwindow;
68 CWindowTool *thread;
69 CWindowCoord *event_caller;
72 class CWindowCoord : public BC_TumbleTextBox
74 public:
75 CWindowCoord(CWindowToolGUI *gui, int x, int y, float value, int logincrement);
76 CWindowCoord(CWindowToolGUI *gui, int x, int y, int value);
78 // Calls the window's handle_event
79 int handle_event();
81 CWindowToolGUI *gui;
84 class CWindowCropOK : public BC_GenericButton
86 public:
87 CWindowCropOK(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
88 // Perform the cropping operation
89 int handle_event();
90 int keypress_event();
91 MWindow *mwindow;
92 CWindowToolGUI *gui;
95 class CWindowCropGUI : public CWindowToolGUI
97 public:
98 CWindowCropGUI(MWindow *mwindow, CWindowTool *thread);
99 ~CWindowCropGUI();
100 void create_objects();
101 void update();
102 // Update the gui
103 void handle_event();
104 CWindowCoord *x1, *y1, *width, *height;
107 class CWindowMaskMode : public BC_PopupMenu
109 public:
110 CWindowMaskMode(MWindow *mwindow, CWindowToolGUI *gui, int x, int y, char *text);
111 void create_objects();
112 int handle_event();
113 static char* mode_to_text(int mode);
114 int text_to_mode(char *text);
115 MWindow *mwindow;
116 CWindowToolGUI *gui;
119 class CWindowMaskDelete : public BC_GenericButton
121 public:
122 CWindowMaskDelete(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
123 int handle_event();
124 int keypress_event();
125 MWindow *mwindow;
126 CWindowToolGUI *gui;
129 class CWindowMaskCycleNext : public BC_GenericButton
131 public:
132 CWindowMaskCycleNext(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
133 int handle_event();
134 MWindow *mwindow;
135 CWindowToolGUI *gui;
138 class CWindowMaskCyclePrev : public BC_GenericButton
140 public:
141 CWindowMaskCyclePrev(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
142 int handle_event();
143 MWindow *mwindow;
144 CWindowToolGUI *gui;
147 class CWindowMaskNumber : public BC_TumbleTextBox
149 public:
150 CWindowMaskNumber(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
151 ~CWindowMaskNumber();
152 int handle_event();
153 MWindow *mwindow;
154 CWindowToolGUI *gui;
157 class CWindowMaskFeather : public BC_TumbleTextBox
159 public:
160 CWindowMaskFeather(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
161 ~CWindowMaskFeather();
162 int handle_event();
163 MWindow *mwindow;
164 CWindowToolGUI *gui;
167 class CWindowMaskValue : public BC_ISlider
169 public:
170 CWindowMaskValue(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
171 ~CWindowMaskValue();
172 int handle_event();
173 MWindow *mwindow;
174 CWindowToolGUI *gui;
177 class CWindowMaskBeforePlugins : public BC_CheckBox
179 public:
180 CWindowMaskBeforePlugins(CWindowToolGUI *gui, int x, int y);
181 int handle_event();
182 CWindowToolGUI *gui;
188 class CWindowMaskGUI : public CWindowToolGUI
190 public:
191 CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread);
192 ~CWindowMaskGUI();
193 void create_objects();
194 void update();
195 void handle_event();
196 void get_keyframe(Track* &track,
197 MaskAuto* &keyframe,
198 SubMask* &mask,
199 MaskPoint* &point,
200 int create_it);
201 void update_preview();
203 CWindowCoord *x, *y;
204 CWindowMaskMode *mode;
205 CWindowMaskFeather *feather;
206 CWindowMaskDelete *delete_point;
207 // Not necessary if all keyframes have same points
208 // CWindowMaskCycleNext *next_point;
209 // CWindowMaskCyclePrev *prev_point;
210 CWindowMaskNumber *number;
211 CWindowMaskValue *value;
212 CWindowMaskBeforePlugins *apply_before_plugins;
217 class CWindowEyedropGUI : public CWindowToolGUI
219 public:
220 CWindowEyedropGUI(MWindow *mwindow, CWindowTool *thread);
221 ~CWindowEyedropGUI();
223 void create_objects();
224 void update();
226 BC_Title *red, *green, *blue;
227 BC_SubWindow *sample;
232 class CWindowCameraGUI : public CWindowToolGUI
234 public:
235 CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread);
236 ~CWindowCameraGUI();
237 void create_objects();
238 void update();
239 void update_preview();
241 // Update the keyframe from text boxes
242 void handle_event();
243 // BezierAuto* get_keyframe();
244 CWindowCoord *x, *y, *z;
247 class CWindowCameraLeft : public BC_Button
249 public:
250 CWindowCameraLeft(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
251 int handle_event();
252 MWindow *mwindow;
253 CWindowCameraGUI *gui;
256 class CWindowCameraCenter : public BC_Button
258 public:
259 CWindowCameraCenter(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
260 int handle_event();
261 MWindow *mwindow;
262 CWindowCameraGUI *gui;
265 class CWindowCameraRight : public BC_Button
267 public:
268 CWindowCameraRight(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
269 int handle_event();
270 MWindow *mwindow;
271 CWindowCameraGUI *gui;
274 class CWindowCameraTop : public BC_Button
276 public:
277 CWindowCameraTop(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
278 int handle_event();
279 MWindow *mwindow;
280 CWindowCameraGUI *gui;
283 class CWindowCameraMiddle : public BC_Button
285 public:
286 CWindowCameraMiddle(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
287 int handle_event();
288 MWindow *mwindow;
289 CWindowCameraGUI *gui;
292 class CWindowCameraBottom : public BC_Button
294 public:
295 CWindowCameraBottom(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
296 int handle_event();
297 MWindow *mwindow;
298 CWindowCameraGUI *gui;
301 class CWindowProjectorGUI : public CWindowToolGUI
303 public:
304 CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread);
305 ~CWindowProjectorGUI();
306 void create_objects();
307 void update();
308 void update_preview();
309 void handle_event();
310 // BezierAuto* get_keyframe();
311 CWindowCoord *x, *y, *z;
314 class CWindowProjectorLeft : public BC_Button
316 public:
317 CWindowProjectorLeft(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
318 int handle_event();
319 MWindow *mwindow;
320 CWindowProjectorGUI *gui;
323 class CWindowProjectorCenter : public BC_Button
325 public:
326 CWindowProjectorCenter(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
327 int handle_event();
328 MWindow *mwindow;
329 CWindowProjectorGUI *gui;
332 class CWindowProjectorRight : public BC_Button
334 public:
335 CWindowProjectorRight(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
336 int handle_event();
337 MWindow *mwindow;
338 CWindowProjectorGUI *gui;
341 class CWindowProjectorTop : public BC_Button
343 public:
344 CWindowProjectorTop(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
345 int handle_event();
346 MWindow *mwindow;
347 CWindowProjectorGUI *gui;
350 class CWindowProjectorMiddle : public BC_Button
352 public:
353 CWindowProjectorMiddle(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
354 int handle_event();
355 MWindow *mwindow;
356 CWindowProjectorGUI *gui;
359 class CWindowProjectorBottom : public BC_Button
361 public:
362 CWindowProjectorBottom(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
363 int handle_event();
364 MWindow *mwindow;
365 CWindowProjectorGUI *gui;
370 #endif
372 // Local Variables:
373 // mode: C++
374 // c-file-style: "linux"
375 // End: