r370: Heroine Virutal's official release 1.2.1
[cinelerra_cv/mob.git] / hvirtual / cinelerra / cwindowtool.h
blob3c7590622aa4979f69789514ee1eb069e6eaa7b3
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 void start_tool(int operation);
23 void stop_tool();
24 void run();
25 void update_show_window();
26 void update_values();
28 MWindow *mwindow;
29 CWindowGUI *gui;
30 CWindowToolGUI *tool_gui;
31 int done;
32 int current_tool;
33 Condition *input_lock;
34 Condition *output_lock;
35 // Lock run and update_values
36 Mutex *tool_gui_lock;
39 class CWindowToolGUI : public BC_Window
41 public:
42 CWindowToolGUI(MWindow *mwindow,
43 CWindowTool *thread,
44 char *title,
45 int w,
46 int h);
47 ~CWindowToolGUI();
49 virtual void create_objects() {};
50 // Update the keyframe from text boxes
51 virtual void handle_event() {};
52 // Update text boxes from keyframe here
53 virtual void update() {};
54 // Update EDL and preview only
55 virtual void update_preview() {};
56 int current_operation;
57 int close_event();
58 int keypress_event();
59 int translation_event();
61 MWindow *mwindow;
62 CWindowTool *thread;
63 CWindowCoord *event_caller;
66 class CWindowCoord : public BC_TumbleTextBox
68 public:
69 CWindowCoord(CWindowToolGUI *gui, int x, int y, float value);
70 CWindowCoord(CWindowToolGUI *gui, int x, int y, int value);
72 // Calls the window's handle_event
73 int handle_event();
75 CWindowToolGUI *gui;
78 class CWindowCropOK : public BC_GenericButton
80 public:
81 CWindowCropOK(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
82 // Perform the cropping operation
83 int handle_event();
84 int keypress_event();
85 MWindow *mwindow;
86 CWindowToolGUI *gui;
89 class CWindowCropGUI : public CWindowToolGUI
91 public:
92 CWindowCropGUI(MWindow *mwindow, CWindowTool *thread);
93 ~CWindowCropGUI();
94 void create_objects();
95 void update();
96 // Update the gui
97 void handle_event();
98 CWindowCoord *x1, *y1, *x2, *y2;
101 class CWindowMaskMode : public BC_PopupMenu
103 public:
104 CWindowMaskMode(MWindow *mwindow, CWindowToolGUI *gui, int x, int y, char *text);
105 void create_objects();
106 int handle_event();
107 static char* mode_to_text(int mode);
108 int text_to_mode(char *text);
109 MWindow *mwindow;
110 CWindowToolGUI *gui;
113 class CWindowMaskDelete : public BC_GenericButton
115 public:
116 CWindowMaskDelete(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
117 int handle_event();
118 int keypress_event();
119 MWindow *mwindow;
120 CWindowToolGUI *gui;
123 class CWindowMaskCycleNext : public BC_GenericButton
125 public:
126 CWindowMaskCycleNext(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
127 int handle_event();
128 MWindow *mwindow;
129 CWindowToolGUI *gui;
132 class CWindowMaskCyclePrev : public BC_GenericButton
134 public:
135 CWindowMaskCyclePrev(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
136 int handle_event();
137 MWindow *mwindow;
138 CWindowToolGUI *gui;
141 class CWindowMaskNumber : public BC_TumbleTextBox
143 public:
144 CWindowMaskNumber(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
145 ~CWindowMaskNumber();
146 int handle_event();
147 MWindow *mwindow;
148 CWindowToolGUI *gui;
151 class CWindowMaskFeather : public BC_TumbleTextBox
153 public:
154 CWindowMaskFeather(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
155 ~CWindowMaskFeather();
156 int handle_event();
157 MWindow *mwindow;
158 CWindowToolGUI *gui;
161 class CWindowMaskValue : public BC_ISlider
163 public:
164 CWindowMaskValue(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
165 ~CWindowMaskValue();
166 int handle_event();
167 MWindow *mwindow;
168 CWindowToolGUI *gui;
172 class CWindowMaskGUI : public CWindowToolGUI
174 public:
175 CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread);
176 ~CWindowMaskGUI();
177 void create_objects();
178 void update();
179 void handle_event();
180 void get_keyframe(Track* &track,
181 MaskAuto* &keyframe,
182 SubMask* &mask,
183 MaskPoint* &point,
184 int create_it);
185 void update_preview();
187 CWindowCoord *x, *y;
188 CWindowMaskMode *mode;
189 CWindowMaskFeather *feather;
190 CWindowMaskDelete *delete_point;
191 // Not necessary if all keyframes have same points
192 // CWindowMaskCycleNext *next_point;
193 // CWindowMaskCyclePrev *prev_point;
194 CWindowMaskNumber *number;
195 CWindowMaskValue *value;
200 class CWindowCameraGUI : public CWindowToolGUI
202 public:
203 CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread);
204 ~CWindowCameraGUI();
205 void create_objects();
206 void update();
207 void update_preview();
209 // Update the keyframe from text boxes
210 void handle_event();
211 BezierAuto* get_keyframe();
212 CWindowCoord *x, *y, *z;
215 class CWindowCameraLeft : public BC_Button
217 public:
218 CWindowCameraLeft(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
219 int handle_event();
220 MWindow *mwindow;
221 CWindowCameraGUI *gui;
224 class CWindowCameraCenter : public BC_Button
226 public:
227 CWindowCameraCenter(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
228 int handle_event();
229 MWindow *mwindow;
230 CWindowCameraGUI *gui;
233 class CWindowCameraRight : public BC_Button
235 public:
236 CWindowCameraRight(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
237 int handle_event();
238 MWindow *mwindow;
239 CWindowCameraGUI *gui;
242 class CWindowCameraTop : public BC_Button
244 public:
245 CWindowCameraTop(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
246 int handle_event();
247 MWindow *mwindow;
248 CWindowCameraGUI *gui;
251 class CWindowCameraMiddle : public BC_Button
253 public:
254 CWindowCameraMiddle(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
255 int handle_event();
256 MWindow *mwindow;
257 CWindowCameraGUI *gui;
260 class CWindowCameraBottom : public BC_Button
262 public:
263 CWindowCameraBottom(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
264 int handle_event();
265 MWindow *mwindow;
266 CWindowCameraGUI *gui;
269 class CWindowProjectorGUI : public CWindowToolGUI
271 public:
272 CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread);
273 ~CWindowProjectorGUI();
274 void create_objects();
275 void update();
276 void update_preview();
277 void handle_event();
278 BezierAuto* get_keyframe();
279 CWindowCoord *x, *y, *z;
282 class CWindowProjectorLeft : public BC_Button
284 public:
285 CWindowProjectorLeft(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
286 int handle_event();
287 MWindow *mwindow;
288 CWindowProjectorGUI *gui;
291 class CWindowProjectorCenter : public BC_Button
293 public:
294 CWindowProjectorCenter(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
295 int handle_event();
296 MWindow *mwindow;
297 CWindowProjectorGUI *gui;
300 class CWindowProjectorRight : public BC_Button
302 public:
303 CWindowProjectorRight(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
304 int handle_event();
305 MWindow *mwindow;
306 CWindowProjectorGUI *gui;
309 class CWindowProjectorTop : public BC_Button
311 public:
312 CWindowProjectorTop(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
313 int handle_event();
314 MWindow *mwindow;
315 CWindowProjectorGUI *gui;
318 class CWindowProjectorMiddle : public BC_Button
320 public:
321 CWindowProjectorMiddle(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
322 int handle_event();
323 MWindow *mwindow;
324 CWindowProjectorGUI *gui;
327 class CWindowProjectorBottom : public BC_Button
329 public:
330 CWindowProjectorBottom(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
331 int handle_event();
332 MWindow *mwindow;
333 CWindowProjectorGUI *gui;
338 #endif