00001 #ifndef CWINDOWTOOL_H
00002 #define CWINDOWTOOL_H
00003
00004 #include "condition.inc"
00005 #include "cwindowgui.inc"
00006 #include "guicast.h"
00007 #include "maskauto.inc"
00008 #include "mwindow.inc"
00009
00010
00011 class CWindowToolGUI;
00012 class CWindowCoord;
00013
00014
00015
00016 class CWindowTool : public Thread
00017 {
00018 public:
00019 CWindowTool(MWindow *mwindow, CWindowGUI *gui);
00020 ~CWindowTool();
00021
00022
00023 void start_tool(int operation);
00024 void stop_tool();
00025
00026
00027 void show_tool();
00028 void hide_tool();
00029
00030 void run();
00031 void update_show_window();
00032 void update_values();
00033
00034 MWindow *mwindow;
00035 CWindowGUI *gui;
00036 CWindowToolGUI *tool_gui;
00037 int done;
00038 int current_tool;
00039 Condition *input_lock;
00040 Condition *output_lock;
00041
00042 Mutex *tool_gui_lock;
00043 };
00044
00045 class CWindowToolGUI : public BC_Window
00046 {
00047 public:
00048 CWindowToolGUI(MWindow *mwindow,
00049 CWindowTool *thread,
00050 char *title,
00051 int w,
00052 int h);
00053 ~CWindowToolGUI();
00054
00055 virtual void create_objects() {};
00056
00057 virtual void handle_event() {};
00058
00059 virtual void update() {};
00060
00061 virtual void update_preview() {};
00062 int current_operation;
00063 int close_event();
00064 int keypress_event();
00065 int translation_event();
00066
00067 MWindow *mwindow;
00068 CWindowTool *thread;
00069 CWindowCoord *event_caller;
00070 };
00071
00072 class CWindowCoord : public BC_TumbleTextBox
00073 {
00074 public:
00075 CWindowCoord(CWindowToolGUI *gui, int x, int y, float value, int logincrement);
00076 CWindowCoord(CWindowToolGUI *gui, int x, int y, int value);
00077
00078
00079 int handle_event();
00080
00081 CWindowToolGUI *gui;
00082 };
00083
00084 class CWindowCropOK : public BC_GenericButton
00085 {
00086 public:
00087 CWindowCropOK(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
00088
00089 int handle_event();
00090 int keypress_event();
00091 MWindow *mwindow;
00092 CWindowToolGUI *gui;
00093 };
00094
00095 class CWindowCropGUI : public CWindowToolGUI
00096 {
00097 public:
00098 CWindowCropGUI(MWindow *mwindow, CWindowTool *thread);
00099 ~CWindowCropGUI();
00100 void create_objects();
00101 void update();
00102
00103 void handle_event();
00104 CWindowCoord *x1, *y1, *width, *height;
00105 };
00106
00107 class CWindowMaskMode : public BC_PopupMenu
00108 {
00109 public:
00110 CWindowMaskMode(MWindow *mwindow, CWindowToolGUI *gui, int x, int y, char *text);
00111 void create_objects();
00112 int handle_event();
00113 static char* mode_to_text(int mode);
00114 int text_to_mode(char *text);
00115 MWindow *mwindow;
00116 CWindowToolGUI *gui;
00117 };
00118
00119 class CWindowMaskDelete : public BC_GenericButton
00120 {
00121 public:
00122 CWindowMaskDelete(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
00123 int handle_event();
00124 int keypress_event();
00125 MWindow *mwindow;
00126 CWindowToolGUI *gui;
00127 };
00128
00129 class CWindowMaskCycleNext : public BC_GenericButton
00130 {
00131 public:
00132 CWindowMaskCycleNext(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
00133 int handle_event();
00134 MWindow *mwindow;
00135 CWindowToolGUI *gui;
00136 };
00137
00138 class CWindowMaskCyclePrev : public BC_GenericButton
00139 {
00140 public:
00141 CWindowMaskCyclePrev(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
00142 int handle_event();
00143 MWindow *mwindow;
00144 CWindowToolGUI *gui;
00145 };
00146
00147 class CWindowMaskNumber : public BC_TumbleTextBox
00148 {
00149 public:
00150 CWindowMaskNumber(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
00151 ~CWindowMaskNumber();
00152 int handle_event();
00153 MWindow *mwindow;
00154 CWindowToolGUI *gui;
00155 };
00156
00157 class CWindowMaskFeather : public BC_TumbleTextBox
00158 {
00159 public:
00160 CWindowMaskFeather(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
00161 ~CWindowMaskFeather();
00162 int handle_event();
00163 MWindow *mwindow;
00164 CWindowToolGUI *gui;
00165 };
00166
00167 class CWindowMaskValue : public BC_ISlider
00168 {
00169 public:
00170 CWindowMaskValue(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
00171 ~CWindowMaskValue();
00172 int handle_event();
00173 MWindow *mwindow;
00174 CWindowToolGUI *gui;
00175 };
00176
00177 class CWindowMaskBeforePlugins : public BC_CheckBox
00178 {
00179 public:
00180 CWindowMaskBeforePlugins(CWindowToolGUI *gui, int x, int y);
00181 int handle_event();
00182 CWindowToolGUI *gui;
00183 };
00184
00185
00186
00187
00188 class CWindowMaskGUI : public CWindowToolGUI
00189 {
00190 public:
00191 CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread);
00192 ~CWindowMaskGUI();
00193 void create_objects();
00194 void update();
00195 void handle_event();
00196 void get_keyframe(Track* &track,
00197 MaskAuto* &keyframe,
00198 SubMask* &mask,
00199 MaskPoint* &point,
00200 int create_it);
00201 void update_preview();
00202
00203 CWindowCoord *x, *y;
00204 CWindowMaskMode *mode;
00205 CWindowMaskFeather *feather;
00206 CWindowMaskDelete *delete_point;
00207
00208
00209
00210 CWindowMaskNumber *number;
00211 CWindowMaskValue *value;
00212 CWindowMaskBeforePlugins *apply_before_plugins;
00213 };
00214
00215
00216
00217 class CWindowEyedropGUI : public CWindowToolGUI
00218 {
00219 public:
00220 CWindowEyedropGUI(MWindow *mwindow, CWindowTool *thread);
00221 ~CWindowEyedropGUI();
00222
00223 void create_objects();
00224 void update();
00225
00226 BC_Title *red, *green, *blue;
00227 BC_SubWindow *sample;
00228 };
00229
00230
00231
00232 class CWindowCameraGUI : public CWindowToolGUI
00233 {
00234 public:
00235 CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread);
00236 ~CWindowCameraGUI();
00237 void create_objects();
00238 void update();
00239 void update_preview();
00240
00241
00242 void handle_event();
00243
00244 CWindowCoord *x, *y, *z;
00245 };
00246
00247 class CWindowCameraLeft : public BC_Button
00248 {
00249 public:
00250 CWindowCameraLeft(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
00251 int handle_event();
00252 MWindow *mwindow;
00253 CWindowCameraGUI *gui;
00254 };
00255
00256 class CWindowCameraCenter : public BC_Button
00257 {
00258 public:
00259 CWindowCameraCenter(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
00260 int handle_event();
00261 MWindow *mwindow;
00262 CWindowCameraGUI *gui;
00263 };
00264
00265 class CWindowCameraRight : public BC_Button
00266 {
00267 public:
00268 CWindowCameraRight(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
00269 int handle_event();
00270 MWindow *mwindow;
00271 CWindowCameraGUI *gui;
00272 };
00273
00274 class CWindowCameraTop : public BC_Button
00275 {
00276 public:
00277 CWindowCameraTop(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
00278 int handle_event();
00279 MWindow *mwindow;
00280 CWindowCameraGUI *gui;
00281 };
00282
00283 class CWindowCameraMiddle : public BC_Button
00284 {
00285 public:
00286 CWindowCameraMiddle(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
00287 int handle_event();
00288 MWindow *mwindow;
00289 CWindowCameraGUI *gui;
00290 };
00291
00292 class CWindowCameraBottom : public BC_Button
00293 {
00294 public:
00295 CWindowCameraBottom(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
00296 int handle_event();
00297 MWindow *mwindow;
00298 CWindowCameraGUI *gui;
00299 };
00300
00301 class CWindowProjectorGUI : public CWindowToolGUI
00302 {
00303 public:
00304 CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread);
00305 ~CWindowProjectorGUI();
00306 void create_objects();
00307 void update();
00308 void update_preview();
00309 void handle_event();
00310
00311 CWindowCoord *x, *y, *z;
00312 };
00313
00314 class CWindowProjectorLeft : public BC_Button
00315 {
00316 public:
00317 CWindowProjectorLeft(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
00318 int handle_event();
00319 MWindow *mwindow;
00320 CWindowProjectorGUI *gui;
00321 };
00322
00323 class CWindowProjectorCenter : public BC_Button
00324 {
00325 public:
00326 CWindowProjectorCenter(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
00327 int handle_event();
00328 MWindow *mwindow;
00329 CWindowProjectorGUI *gui;
00330 };
00331
00332 class CWindowProjectorRight : public BC_Button
00333 {
00334 public:
00335 CWindowProjectorRight(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
00336 int handle_event();
00337 MWindow *mwindow;
00338 CWindowProjectorGUI *gui;
00339 };
00340
00341 class CWindowProjectorTop : public BC_Button
00342 {
00343 public:
00344 CWindowProjectorTop(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
00345 int handle_event();
00346 MWindow *mwindow;
00347 CWindowProjectorGUI *gui;
00348 };
00349
00350 class CWindowProjectorMiddle : public BC_Button
00351 {
00352 public:
00353 CWindowProjectorMiddle(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
00354 int handle_event();
00355 MWindow *mwindow;
00356 CWindowProjectorGUI *gui;
00357 };
00358
00359 class CWindowProjectorBottom : public BC_Button
00360 {
00361 public:
00362 CWindowProjectorBottom(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
00363 int handle_event();
00364 MWindow *mwindow;
00365 CWindowProjectorGUI *gui;
00366 };
00367
00368
00369
00370 #endif