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"
37 // This common thread supports all the tool GUI's.
38 class CWindowTool : public Thread
41 CWindowTool(MWindow *mwindow, CWindowGUI *gui);
44 // Called depending on state of toggle button
45 void start_tool(int operation);
48 // Called when window is visible
53 void update_show_window();
59 CWindowToolGUI *tool_gui;
62 Condition *input_lock;
63 Condition *output_lock;
64 // Lock run and update_values
68 class CWindowToolGUI : public BC_Window
71 CWindowToolGUI(MWindow *mwindow,
78 virtual void create_objects() {};
79 // Update the keyframe from text boxes
80 virtual void handle_event() {};
81 // Update text boxes from keyframe here
82 virtual void update() {};
83 // Update EDL and preview only
84 virtual void update_preview() {};
85 int current_operation;
88 int translation_event();
92 CWindowCoord *event_caller;
95 class CWindowCoord : public BC_TumbleTextBox
98 CWindowCoord(CWindowToolGUI *gui, int x, int y, float value);
99 CWindowCoord(CWindowToolGUI *gui, int x, int y, int value);
101 // Calls the window's handle_event
107 class CWindowCropOK : public BC_GenericButton
110 CWindowCropOK(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
111 // Perform the cropping operation
113 int keypress_event();
118 class CWindowCropGUI : public CWindowToolGUI
121 CWindowCropGUI(MWindow *mwindow, CWindowTool *thread);
123 void create_objects();
127 CWindowCoord *x1, *y1, *width, *height;
130 class CWindowMaskMode : public BC_PopupMenu
133 CWindowMaskMode(MWindow *mwindow, CWindowToolGUI *gui, int x, int y, const char *text);
134 void create_objects();
136 static char* mode_to_text(int mode);
137 int text_to_mode(char *text);
142 class CWindowMaskDelete : public BC_GenericButton
145 CWindowMaskDelete(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
147 int keypress_event();
152 class CWindowMaskCycleNext : public BC_GenericButton
155 CWindowMaskCycleNext(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
161 class CWindowMaskCyclePrev : public BC_GenericButton
164 CWindowMaskCyclePrev(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
170 class CWindowMaskNumber : public BC_TumbleTextBox
173 CWindowMaskNumber(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
174 ~CWindowMaskNumber();
180 class CWindowMaskFeather : public BC_TumbleTextBox
183 CWindowMaskFeather(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
184 ~CWindowMaskFeather();
190 class CWindowMaskValue : public BC_ISlider
193 CWindowMaskValue(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
201 class CWindowMaskGUI : public CWindowToolGUI
204 CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread);
206 void create_objects();
209 void get_keyframe(Track* &track,
215 void update_preview();
218 CWindowMaskMode *mode;
219 CWindowMaskFeather *feather;
220 CWindowMaskDelete *delete_point;
221 // Not necessary if all keyframes have same points
222 // CWindowMaskCycleNext *next_point;
223 // CWindowMaskCyclePrev *prev_point;
224 CWindowMaskNumber *number;
225 CWindowMaskValue *value;
230 class CWindowEyedropGUI : public CWindowToolGUI
233 CWindowEyedropGUI(MWindow *mwindow, CWindowTool *thread);
234 ~CWindowEyedropGUI();
237 void create_objects();
240 CWindowCoord *radius;
241 BC_Title *red, *green, *blue;
242 BC_SubWindow *sample;
247 class CWindowCameraGUI : public CWindowToolGUI
250 CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread);
252 void create_objects();
254 void update_preview();
256 // Update the keyframe from text boxes
258 // BezierAuto* get_keyframe();
259 CWindowCoord *x, *y, *z;
262 class CWindowCameraLeft : public BC_Button
265 CWindowCameraLeft(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
268 CWindowCameraGUI *gui;
271 class CWindowCameraCenter : public BC_Button
274 CWindowCameraCenter(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
277 CWindowCameraGUI *gui;
280 class CWindowCameraRight : public BC_Button
283 CWindowCameraRight(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
286 CWindowCameraGUI *gui;
289 class CWindowCameraTop : public BC_Button
292 CWindowCameraTop(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
295 CWindowCameraGUI *gui;
298 class CWindowCameraMiddle : public BC_Button
301 CWindowCameraMiddle(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
304 CWindowCameraGUI *gui;
307 class CWindowCameraBottom : public BC_Button
310 CWindowCameraBottom(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
313 CWindowCameraGUI *gui;
316 class CWindowProjectorGUI : public CWindowToolGUI
319 CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread);
320 ~CWindowProjectorGUI();
321 void create_objects();
323 void update_preview();
325 // BezierAuto* get_keyframe();
326 CWindowCoord *x, *y, *z;
329 class CWindowProjectorLeft : public BC_Button
332 CWindowProjectorLeft(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
335 CWindowProjectorGUI *gui;
338 class CWindowProjectorCenter : public BC_Button
341 CWindowProjectorCenter(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
344 CWindowProjectorGUI *gui;
347 class CWindowProjectorRight : public BC_Button
350 CWindowProjectorRight(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
353 CWindowProjectorGUI *gui;
356 class CWindowProjectorTop : public BC_Button
359 CWindowProjectorTop(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
362 CWindowProjectorGUI *gui;
365 class CWindowProjectorMiddle : public BC_Button
368 CWindowProjectorMiddle(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
371 CWindowProjectorGUI *gui;
374 class CWindowProjectorBottom : public BC_Button
377 CWindowProjectorBottom(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
380 CWindowProjectorGUI *gui;
386 class CWindowRulerGUI : public CWindowToolGUI
389 CWindowRulerGUI(MWindow *mwindow, CWindowTool *thread);
391 void create_objects();