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;
256 class CWindowEyedropCheckBox;
257 class CWindowEyedropGUI : public CWindowToolGUI
260 CWindowEyedropGUI(MWindow *mwindow, CWindowTool *thread);
261 ~CWindowEyedropGUI();
264 void create_objects();
268 CWindowCoord *radius;
269 CWindowEyedropCheckBox *use_max;
270 BC_Title *red, *green, *blue, *y, *u, *v;
271 BC_Title *rgb_hex, *yuv_hex;
272 BC_SubWindow *sample;
276 class CWindowEyedropCheckBox : public BC_CheckBox
279 CWindowEyedropCheckBox(MWindow *mwindow,
280 CWindowEyedropGUI *gui,
286 CWindowEyedropGUI *gui;
291 class CWindowCameraGUI : public CWindowToolGUI
294 CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread);
296 void create_objects();
298 void update_preview();
300 // Update the keyframe from text boxes
302 // BezierAuto* get_keyframe();
303 CWindowCoord *x, *y, *z;
305 // Toggles for keyframe curve mode (for camera automation only)
306 CWindowCurveToggle *t_smooth, *t_linear;
309 class CWindowCameraLeft : public BC_Button
312 CWindowCameraLeft(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
315 CWindowCameraGUI *gui;
318 class CWindowCameraCenter : public BC_Button
321 CWindowCameraCenter(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
324 CWindowCameraGUI *gui;
327 class CWindowCameraRight : public BC_Button
330 CWindowCameraRight(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
333 CWindowCameraGUI *gui;
336 class CWindowCameraTop : public BC_Button
339 CWindowCameraTop(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
342 CWindowCameraGUI *gui;
345 class CWindowCameraMiddle : public BC_Button
348 CWindowCameraMiddle(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
351 CWindowCameraGUI *gui;
354 class CWindowCameraBottom : public BC_Button
357 CWindowCameraBottom(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
360 CWindowCameraGUI *gui;
363 class CWindowProjectorGUI : public CWindowToolGUI
366 CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread);
367 ~CWindowProjectorGUI();
368 void create_objects();
370 void update_preview();
372 // BezierAuto* get_keyframe();
373 CWindowCoord *x, *y, *z;
375 // Toggles for keyframe curve mode (projector automation only)
376 CWindowCurveToggle *t_smooth, *t_linear;
379 class CWindowProjectorLeft : public BC_Button
382 CWindowProjectorLeft(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
385 CWindowProjectorGUI *gui;
388 class CWindowProjectorCenter : public BC_Button
391 CWindowProjectorCenter(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
394 CWindowProjectorGUI *gui;
397 class CWindowProjectorRight : public BC_Button
400 CWindowProjectorRight(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
403 CWindowProjectorGUI *gui;
406 class CWindowProjectorTop : public BC_Button
409 CWindowProjectorTop(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
412 CWindowProjectorGUI *gui;
415 class CWindowProjectorMiddle : public BC_Button
418 CWindowProjectorMiddle(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
421 CWindowProjectorGUI *gui;
424 class CWindowProjectorBottom : public BC_Button
427 CWindowProjectorBottom(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
430 CWindowProjectorGUI *gui;
436 class CWindowRulerGUI : public CWindowToolGUI
439 CWindowRulerGUI(MWindow *mwindow, CWindowTool *thread);
441 void create_objects();
450 BC_TextBox *distance;