4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "condition.inc"
26 #include "cwindowgui.inc"
28 #include "maskauto.inc"
29 #include "maskautos.inc"
30 #include "mwindow.inc"
35 class CWindowCurveToggle;
38 // This common thread supports all the tool GUI's.
39 class CWindowTool : public Thread
42 CWindowTool(MWindow *mwindow, CWindowGUI *gui);
45 // Called depending on state of toggle button
46 void start_tool(int operation);
49 // Called when window is visible
54 void update_show_window();
60 CWindowToolGUI *tool_gui;
63 Condition *input_lock;
64 Condition *output_lock;
65 // Lock run and update_values
69 class CWindowToolGUI : public BC_Window
72 CWindowToolGUI(MWindow *mwindow,
79 virtual void create_objects() {};
80 // Update the keyframe from text boxes
81 virtual void handle_event() {};
82 // Update text boxes from keyframe here
83 virtual void update() {};
84 // Update EDL and preview only
85 virtual void update_preview() {};
86 int current_operation;
89 int translation_event();
93 CWindowCoord *event_caller;
96 class CWindowCoord : public BC_TumbleTextBox
99 CWindowCoord(CWindowToolGUI *gui, int x, int y, float value, int logincrement);
100 CWindowCoord(CWindowToolGUI *gui, int x, int y, int value);
102 // Calls the window's handle_event
108 class CWindowCropOK : public BC_GenericButton
111 CWindowCropOK(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
112 // Perform the cropping operation
114 int keypress_event();
119 class CWindowCropGUI : public CWindowToolGUI
122 CWindowCropGUI(MWindow *mwindow, CWindowTool *thread);
124 void create_objects();
128 CWindowCoord *x1, *y1, *width, *height;
131 class CWindowMaskMode : public BC_PopupMenu
134 CWindowMaskMode(MWindow *mwindow, CWindowToolGUI *gui, int x, int y, const char *text);
135 void create_objects();
137 static char* mode_to_text(int mode);
138 int text_to_mode(char *text);
143 class CWindowMaskDelete : public BC_GenericButton
146 CWindowMaskDelete(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
148 int keypress_event();
153 class CWindowMaskCycleNext : public BC_GenericButton
156 CWindowMaskCycleNext(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
162 class CWindowMaskCyclePrev : public BC_GenericButton
165 CWindowMaskCyclePrev(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
171 class CWindowMaskNumber : public BC_TumbleTextBox
174 CWindowMaskNumber(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
175 ~CWindowMaskNumber();
182 class CWindowMaskAffectedPoint : public BC_TumbleTextBox
185 CWindowMaskAffectedPoint(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
186 ~CWindowMaskAffectedPoint();
193 class CWindowMaskFeather : public BC_TumbleTextBox
196 CWindowMaskFeather(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
197 ~CWindowMaskFeather();
203 class CWindowMaskValue : public BC_ISlider
206 CWindowMaskValue(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
213 class CWindowMaskBeforePlugins : public BC_CheckBox
216 CWindowMaskBeforePlugins(CWindowToolGUI *gui, int x, int y);
221 class CWindowDisableOpenGLMasking : public BC_CheckBox
224 CWindowDisableOpenGLMasking(CWindowToolGUI *gui, int x, int y);
229 class CWindowMaskGUI : public CWindowToolGUI
232 CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread);
234 void create_objects();
237 void get_keyframe(Track* &track, MaskAutos* &autos, MaskAuto* &keyframe,
238 SubMask* &mask, MaskPoint* &point, int create_it);
239 void update_preview();
242 CWindowMaskMode *mode;
243 CWindowMaskFeather *feather;
244 CWindowMaskDelete *delete_point;
245 CWindowMaskAffectedPoint *active_point;
246 // Not necessary if all keyframes have same points
247 // CWindowMaskCycleNext *next_point;
248 // CWindowMaskCyclePrev *prev_point;
249 CWindowMaskNumber *number;
250 CWindowMaskValue *value;
251 CWindowMaskBeforePlugins *apply_before_plugins;
252 CWindowDisableOpenGLMasking *disable_opengl_masking;
257 class CWindowEyedropGUI : public CWindowToolGUI
260 CWindowEyedropGUI(MWindow *mwindow, CWindowTool *thread);
261 ~CWindowEyedropGUI();
264 void create_objects();
267 CWindowCoord *radius;
268 BC_Title *red, *green, *blue, *y, *u, *v;
269 BC_SubWindow *sample;
274 class CWindowCameraGUI : public CWindowToolGUI
277 CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread);
279 void create_objects();
281 void update_preview();
283 // Update the keyframe from text boxes
285 // BezierAuto* get_keyframe();
286 CWindowCoord *x, *y, *z;
288 // Toggles for keyframe curve mode (for camera automation only)
289 CWindowCurveToggle *t_smooth, *t_linear;
292 class CWindowCameraLeft : public BC_Button
295 CWindowCameraLeft(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
298 CWindowCameraGUI *gui;
301 class CWindowCameraCenter : public BC_Button
304 CWindowCameraCenter(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
307 CWindowCameraGUI *gui;
310 class CWindowCameraRight : public BC_Button
313 CWindowCameraRight(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
316 CWindowCameraGUI *gui;
319 class CWindowCameraTop : public BC_Button
322 CWindowCameraTop(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
325 CWindowCameraGUI *gui;
328 class CWindowCameraMiddle : public BC_Button
331 CWindowCameraMiddle(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
334 CWindowCameraGUI *gui;
337 class CWindowCameraBottom : public BC_Button
340 CWindowCameraBottom(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
343 CWindowCameraGUI *gui;
346 class CWindowProjectorGUI : public CWindowToolGUI
349 CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread);
350 ~CWindowProjectorGUI();
351 void create_objects();
353 void update_preview();
355 // BezierAuto* get_keyframe();
356 CWindowCoord *x, *y, *z;
358 // Toggles for keyframe curve mode (projector automation only)
359 CWindowCurveToggle *t_smooth, *t_linear;
362 class CWindowProjectorLeft : public BC_Button
365 CWindowProjectorLeft(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
368 CWindowProjectorGUI *gui;
371 class CWindowProjectorCenter : public BC_Button
374 CWindowProjectorCenter(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
377 CWindowProjectorGUI *gui;
380 class CWindowProjectorRight : public BC_Button
383 CWindowProjectorRight(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
386 CWindowProjectorGUI *gui;
389 class CWindowProjectorTop : public BC_Button
392 CWindowProjectorTop(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
395 CWindowProjectorGUI *gui;
398 class CWindowProjectorMiddle : public BC_Button
401 CWindowProjectorMiddle(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
404 CWindowProjectorGUI *gui;
407 class CWindowProjectorBottom : public BC_Button
410 CWindowProjectorBottom(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
413 CWindowProjectorGUI *gui;
419 class CWindowRulerGUI : public CWindowToolGUI
422 CWindowRulerGUI(MWindow *mwindow, CWindowTool *thread);
424 void create_objects();