RafaMar + programmer friend Help button in Batch Render addition
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / cwindowtool.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef CWINDOWTOOL_H
23 #define CWINDOWTOOL_H
24
25 #include "condition.inc"
26 #include "cwindowgui.inc"
27 #include "cwindowtool.inc"
28 #include "guicast.h"
29 #include "keyframe.inc"
30 #include "maskauto.inc"
31 #include "maskautos.inc"
32 #include "mwindow.inc"
33
34 enum {
35         MASK_SHAPE_SQUARE,
36         MASK_SHAPE_CIRCLE,
37         MASK_SHAPE_TRIANGLE,
38         MASK_SHAPE_OVAL,
39 };
40 enum {
41         MASK_SCALE_X,
42         MASK_SCALE_Y,
43         MASK_SCALE_XY,
44 };
45
46 // This common thread supports all the tool GUI's.
47 class CWindowTool : public Thread
48 {
49 public:
50         CWindowTool(MWindow *mwindow, CWindowGUI *gui);
51         ~CWindowTool();
52
53 // Called depending on state of toggle button
54         void start_tool(int operation);
55         void stop_tool();
56
57 // Called when window is visible
58         void show_tool();
59         void hide_tool();
60         void raise_tool();
61
62         void run();
63         void update_show_window();
64         void raise_window();
65         void update_values();
66
67         MWindow *mwindow;
68         CWindowGUI *gui;
69         CWindowToolGUI *tool_gui;
70         int done;
71         int current_tool;
72         Condition *input_lock;
73         Condition *output_lock;
74 // Lock run and update_values
75         Mutex *tool_gui_lock;
76 };
77
78 class CWindowToolGUI : public BC_Window
79 {
80 public:
81         CWindowToolGUI(MWindow *mwindow,
82                 CWindowTool *thread,
83                 const char *title,
84                 int w,
85                 int h);
86         ~CWindowToolGUI();
87
88         virtual void create_objects() {};
89 // Update the keyframe from text boxes
90         virtual void handle_event() {};
91 // Update text boxes from keyframe here
92         virtual void update() {};
93
94 // Update EDL and preview only
95         void update_preview(int changed_edl=0);
96         void update_auto(Track *track, int idx, CWindowCoord *vp);
97         void draw_preview(int changed_edl);
98         int current_operation;
99         virtual int close_event();
100         int keypress_event();
101         int translation_event();
102         int press(void (CWindowCanvas::*fn)());
103
104         MWindow *mwindow;
105         CWindowTool *thread;
106         CWindowCoord *event_caller;
107         int edge, span;
108 };
109
110 class CWindowCoord : public BC_TumbleTextBox
111 {
112 public:
113         CWindowCoord(CWindowToolGUI *gui, int x, int y, float value, int group=-1);
114         CWindowCoord(CWindowToolGUI *gui, int x, int y, int value, int group=-1);
115         void create_objects();
116         void update_gui(float value);
117 // Calls the window's handle_event
118         int handle_event();
119
120         CWindowToolGUI *gui;
121         int type;
122         CWindowToolAutoRangeTumbler *min_tumbler;
123         CWindowCoordSlider *slider;
124         CWindowToolAutoRangeTumbler *max_tumbler;
125         CWindowToolAutoRangeReset *range_reset;
126         CWindowToolAutoRangeTextBox *range_text;
127         CWindowCoordRangeTumbler *range;
128 };
129
130 class CWindowCoordSlider : public BC_FSlider
131 {
132 public:
133         CWindowCoordSlider(CWindowCoord *coord, int x, int y, int w,
134                 float mn, float mx, float value);
135         ~CWindowCoordSlider();
136         int handle_event();
137
138         CWindowCoord *coord;
139 };
140
141 class CWindowCoordRangeTumbler : public BC_Tumbler
142 {
143 public:
144         CWindowCoordRangeTumbler(CWindowCoord *coord, int x, int y);
145         ~CWindowCoordRangeTumbler();
146         int update(float scale);
147         int handle_up_event();
148         int handle_down_event();
149
150         CWindowCoord *coord;
151 };
152
153 class CWindowCurveAutoEdge : public BC_Toggle
154 {
155 public:
156         CWindowCurveAutoEdge(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
157         int handle_event();
158
159         MWindow *mwindow;
160         CWindowToolGUI *gui;
161 };
162
163 class CWindowCurveAutoSpan : public BC_Toggle
164 {
165 public:
166         CWindowCurveAutoSpan(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
167
168         int handle_event();
169         MWindow *mwindow;
170         CWindowToolGUI *gui;
171 };
172
173
174 class CWindowCropApply : public BC_GenericButton
175 {
176 public:
177         CWindowCropApply(MWindow *mwindow, CWindowCropGUI *crop_gui,
178                         int x, int y);
179 // Perform the cropping operation
180         int handle_event();
181         int keypress_event();
182         MWindow *mwindow;
183         CWindowCropGUI *crop_gui;
184 };
185
186 class CWindowCropOpMode : public BC_PopupMenu
187 {
188         static const char *crop_ops[CROP_MODES];
189 public:
190         CWindowCropOpMode(MWindow *mwindow, CWindowCropGUI *crop_gui,
191                         int mode, int x, int y);
192         ~CWindowCropOpMode();
193         void create_objects();
194         int handle_event();
195
196         MWindow *mwindow;
197         CWindowCropGUI *crop_gui;
198         int mode;
199 };
200
201 class CWindowCropOpItem : public BC_MenuItem
202 {
203 public:
204         CWindowCropOpItem(CWindowCropOpMode *popup, const char *text, int id);
205         int handle_event();
206
207         CWindowCropOpMode *popup;
208         int id;
209 };
210
211
212 class CWindowCropGUI : public CWindowToolGUI
213 {
214 public:
215         CWindowCropGUI(MWindow *mwindow, CWindowTool *thread);
216         ~CWindowCropGUI();
217         void create_objects();
218         void update();
219 // Update the gui
220         void handle_event();
221         CWindowCoord *x1, *y1, *width, *height;
222         CWindowCropOpMode *crop_mode;
223 };
224
225 class CWindowMaskItem : public BC_ListBoxItem
226 {
227 public:
228         CWindowMaskItem(const char *text, int id=-1, int color=-1)
229          : BC_ListBoxItem(text, color), id(id) {}
230         ~CWindowMaskItem() {}
231         int id;
232 };
233
234 class CWindowMaskItems : public ArrayList<BC_ListBoxItem*>
235 {
236 public:
237         CWindowMaskItems() {}
238         ~CWindowMaskItems() { remove_all_objects(); }
239 };
240
241 class CWindowMaskOnTrack : public BC_PopupTextBox
242 {
243 public:
244         CWindowMaskOnTrack(MWindow *mwindow, CWindowMaskGUI *gui,
245                         int x, int y, int w, const char *text);
246         ~CWindowMaskOnTrack();
247         MWindow *mwindow;
248         CWindowMaskGUI *gui;
249         CWindowMaskItems track_items;
250
251         int handle_event();
252         void update_items();
253 };
254
255 class CWindowMaskTrackTumbler : public BC_Tumbler
256 {
257 public:
258         CWindowMaskTrackTumbler(MWindow *mwindow, CWindowMaskGUI *gui,
259                         int x, int y);
260         ~CWindowMaskTrackTumbler();
261         int handle_up_event();
262         int handle_down_event();
263         int do_event(int dir);
264
265         MWindow *mwindow;
266         CWindowMaskGUI *gui;
267 };
268
269
270 class CWindowMaskName : public BC_PopupTextBox
271 {
272 public:
273         CWindowMaskName(MWindow *mwindow, CWindowMaskGUI *gui,
274                         int x, int y, const char *text);
275         ~CWindowMaskName();
276         MWindow *mwindow;
277         CWindowMaskGUI *gui;
278         CWindowMaskItems mask_items;
279
280         int handle_event();
281         void update_items(MaskAuto *keyframe);
282 };
283
284 class CWindowMaskUnclear : public BC_Button
285 {
286 public:
287         CWindowMaskUnclear(MWindow *mwindow, CWindowMaskGUI *gui,
288                         int x, int y);
289         int handle_event();
290         MWindow *mwindow;
291         CWindowMaskGUI *gui;
292 };
293
294 class CWindowMaskSoloTrack : public BC_CheckBox
295 {
296 public:
297         CWindowMaskSoloTrack(MWindow *mwindow, CWindowMaskGUI *gui,
298                         int x, int y, int v);
299         static int calculate_w(BC_WindowBase *gui);
300         int handle_event();
301         MWindow *mwindow;
302         CWindowMaskGUI *gui;
303 };
304
305 class CWindowMaskDelMask : public BC_GenericButton
306 {
307 public:
308         CWindowMaskDelMask(MWindow *mwindow, CWindowMaskGUI *gui,
309                         int x, int y);
310         int handle_event();
311         MWindow *mwindow;
312         CWindowMaskGUI *gui;
313 };
314
315 class CWindowMaskClrMask : public BC_Button
316 {
317 public:
318         CWindowMaskClrMask(MWindow *mwindow, CWindowMaskGUI *gui,
319                         int x, int y);
320         ~CWindowMaskClrMask();
321         static int calculate_w(MWindow *mwindow);
322         int handle_event();
323         MWindow *mwindow;
324         CWindowMaskGUI *gui;
325 };
326
327 class CWindowMaskButton : public BC_CheckBox
328 {
329 public:
330         CWindowMaskButton(MWindow *mwindow, CWindowMaskGUI *gui,
331                          int x, int y, int no, int v);
332         ~CWindowMaskButton();
333
334         int handle_event();
335         MWindow *mwindow;
336         CWindowMaskGUI *gui;
337         int no;
338 };
339
340 class CWindowMaskThumbler : public BC_Tumbler
341 {
342 public:
343         CWindowMaskThumbler(MWindow *mwindow, CWindowMaskGUI *gui,
344                         int x, int y);
345         ~CWindowMaskThumbler();
346         int handle_up_event();
347         int handle_down_event();
348         int do_event(int dir);
349
350         MWindow *mwindow;
351         CWindowMaskGUI *gui;
352 };
353
354 class CWindowMaskEnable : public BC_CheckBox
355 {
356 public:
357         CWindowMaskEnable(MWindow *mwindow, CWindowMaskGUI *gui,
358                          int x, int y, int no, int v);
359         ~CWindowMaskEnable();
360
361         int handle_event();
362         MWindow *mwindow;
363         CWindowMaskGUI *gui;
364         int no;
365 };
366
367 class CWindowMaskFade : public BC_TumbleTextBox
368 {
369 public:
370         CWindowMaskFade(MWindow *mwindow, CWindowMaskGUI *gui,
371                         int x, int y);
372         ~CWindowMaskFade();
373         int update(float v);
374         int update_value(float v);
375         int handle_event();
376         MWindow *mwindow;
377         CWindowMaskGUI *gui;
378 };
379
380 class CWindowMaskFadeSlider : public BC_ISlider
381 {
382 public:
383         CWindowMaskFadeSlider(MWindow *mwindow, CWindowMaskGUI *gui,
384                 int x, int y, int w);
385         ~CWindowMaskFadeSlider();
386         int handle_event();
387         int update(int64_t v);
388         char *get_caption() { return 0; }
389         MWindow *mwindow;
390         CWindowMaskGUI *gui;
391         int stick;
392         float last_v;
393         Timer *timer;
394 };
395
396 class CWindowMaskGangFader : public BC_Toggle
397 {
398 public:
399         CWindowMaskGangFader(MWindow *mwindow, CWindowMaskGUI *gui,
400                         int x, int y);
401         ~CWindowMaskGangFader();
402         int handle_event();
403         MWindow *mwindow;
404         CWindowMaskGUI *gui;
405 };
406
407 class CWindowMaskGangFocus : public BC_Toggle
408 {
409 public:
410         CWindowMaskGangFocus(MWindow *mwindow, CWindowMaskGUI *gui,
411                         int x, int y);
412         ~CWindowMaskGangFocus();
413         int handle_event();
414         MWindow *mwindow;
415         CWindowMaskGUI *gui;
416 };
417
418 class CWindowMaskGangPoint : public BC_Toggle
419 {
420 public:
421         CWindowMaskGangPoint(MWindow *mwindow, CWindowMaskGUI *gui,
422                         int x, int y);
423         ~CWindowMaskGangPoint();
424         int handle_event();
425         MWindow *mwindow;
426         CWindowMaskGUI *gui;
427 };
428
429 class CWindowMaskSmoothButton : public BC_Button
430 {
431 public:
432         CWindowMaskSmoothButton(MWindow *mwindow, CWindowMaskGUI *gui,
433                 const char *tip, int type, int on, int x, int y, const char *images);
434         int handle_event();
435         MWindow *mwindow;
436         CWindowMaskGUI *gui;
437         int type, on;
438 };
439
440 class CWindowMaskAffectedPoint : public BC_TumbleTextBox
441 {
442 public:
443         CWindowMaskAffectedPoint(MWindow *mwindow, CWindowMaskGUI *gui,
444                         int x, int y);
445         ~CWindowMaskAffectedPoint();
446         int handle_event();
447         MWindow *mwindow;
448         CWindowMaskGUI *gui;
449 };
450
451 class CWindowMaskFocus : public BC_CheckBox
452 {
453 public:
454         CWindowMaskFocus(MWindow *mwindow, CWindowMaskGUI *gui,
455                         int x, int y);
456         ~CWindowMaskFocus();
457         int handle_event();
458         MWindow *mwindow;
459         CWindowMaskGUI *gui;
460         static int calculate_w(CWindowMaskGUI *gui);
461 };
462
463 class CWindowMaskScaleXY : public BC_Toggle
464 {
465 public:
466         CWindowMaskScaleXY(MWindow *mwindow, CWindowMaskGUI *gui,
467                         int x, int y, VFrame **data, int v,
468                         int id, const char *tip);
469         ~CWindowMaskScaleXY();
470         int handle_event();
471         MWindow *mwindow;
472         CWindowMaskGUI *gui;
473         int id;
474 };
475
476 class CWindowMaskHelp : public BC_CheckBox
477 {
478 public:
479         CWindowMaskHelp(MWindow *mwindow, CWindowMaskGUI *gui,
480                         int x, int y);
481         ~CWindowMaskHelp();
482         int handle_event();
483         MWindow *mwindow;
484         CWindowMaskGUI *gui;
485 };
486
487 class CWindowMaskDrawMarkers : public BC_CheckBox
488 {
489 public:
490         CWindowMaskDrawMarkers(MWindow *mwindow, CWindowMaskGUI *gui,
491                         int x, int y);
492         ~CWindowMaskDrawMarkers();
493         int handle_event();
494         MWindow *mwindow;
495         CWindowMaskGUI *gui;
496 };
497
498 class CWindowMaskDrawBoundary : public BC_CheckBox
499 {
500 public:
501         CWindowMaskDrawBoundary(MWindow *mwindow, CWindowMaskGUI *gui,
502                         int x, int y);
503         ~CWindowMaskDrawBoundary();
504         int handle_event();
505         MWindow *mwindow;
506         CWindowMaskGUI *gui;
507 };
508
509 class CWindowMaskDelPoint : public BC_GenericButton
510 {
511 public:
512         CWindowMaskDelPoint(MWindow *mwindow, CWindowMaskGUI *gui,
513                         int x, int y);
514         int handle_event();
515         MWindow *mwindow;
516         CWindowMaskGUI *gui;
517 };
518
519 class CWindowMaskFeather : public BC_TumbleTextBox
520 {
521 public:
522         CWindowMaskFeather(MWindow *mwindow, CWindowMaskGUI *gui,
523                         int x, int y);
524         ~CWindowMaskFeather();
525         int update(float v);
526         int update_value(float v);
527         int handle_event();
528         MWindow *mwindow;
529         CWindowMaskGUI *gui;
530 };
531
532 class CWindowMaskFeatherSlider : public BC_FSlider
533 {
534 public:
535         CWindowMaskFeatherSlider(MWindow *mwindow, CWindowMaskGUI *gui,
536                 int x, int y, int w, float v);
537         ~CWindowMaskFeatherSlider();
538         int handle_event();
539         int update(float v);
540         int update(int r, float v, float mn, float mx);
541         char *get_caption() { return 0; }
542         MWindow *mwindow;
543         CWindowMaskGUI *gui;
544         int stick;
545         float last_v;
546         float max;
547         Timer *timer;
548 };
549
550 class CWindowMaskGangFeather : public BC_Toggle
551 {
552 public:
553         CWindowMaskGangFeather(MWindow *mwindow, CWindowMaskGUI *gui,
554                         int x, int y);
555         ~CWindowMaskGangFeather();
556         int handle_event();
557         MWindow *mwindow;
558         CWindowMaskGUI *gui;
559 };
560
561 class CWindowMaskBeforePlugins : public BC_CheckBox
562 {
563 public:
564         CWindowMaskBeforePlugins(CWindowMaskGUI *gui,
565                         int x, int y);
566         int handle_event();
567         CWindowMaskGUI *gui;
568 };
569
570 class CWindowMaskLoadList : public BC_ListBox
571 {
572 public:
573         CWindowMaskLoadList(MWindow *mwindow, CWindowMaskGUI *gui);
574         ~CWindowMaskLoadList();
575         void create_objects();
576         int handle_event();
577
578         MWindow *mwindow;
579         CWindowMaskGUI *gui;
580         CWindowMaskItems shape_items;
581 };
582
583 class CWindowMaskLoad : public BC_Button
584 {
585 public:
586         CWindowMaskLoad(MWindow *mwindow, CWindowMaskGUI *gui,
587                         int x, int y, int w);
588         int handle_event();
589
590         MWindow *mwindow;
591         CWindowMaskGUI *gui;
592 };
593
594 class CWindowMaskSave : public BC_Button
595 {
596 public:
597         CWindowMaskSave(MWindow *mwindow, CWindowMaskGUI *gui,
598                         int x, int y, int w);
599         ~CWindowMaskSave();
600         int handle_event();
601
602         MWindow *mwindow;
603         CWindowMaskGUI *gui;
604         CWindowMaskPresetDialog *preset_dialog;
605 };
606
607 class CWindowMaskPresetDialog : public BC_DialogThread
608 {
609 public:
610         CWindowMaskPresetDialog(MWindow *mwindow, CWindowMaskGUI *gui);
611         ~CWindowMaskPresetDialog();
612         void handle_close_event(int result);
613         void handle_done_event(int result);
614         BC_Window* new_gui();
615         void start_dialog(int sx, int sy, MaskAuto *keyframe);
616
617         MWindow *mwindow;
618         CWindowMaskGUI *gui;
619         CWindowMaskPresetGUI *pgui;
620         int sx, sy;
621         MaskAuto *keyframe;
622 };
623
624 class CWindowMaskPresetGUI : public BC_Window
625 {
626 public:
627         CWindowMaskPresetGUI(CWindowMaskPresetDialog *preset_dialog,
628                         int x, int y, const char *title);
629         void create_objects();
630
631         CWindowMaskPresetDialog *preset_dialog;
632         CWindowMaskPresetText *preset_text;
633 };
634
635 class CWindowMaskPresetText : public BC_PopupTextBox
636 {
637 public:
638         CWindowMaskPresetText(CWindowMaskPresetGUI *pgui,
639                 int x, int y, int w, int h, const char *text);
640         int handle_event();
641         void update_items();
642
643         CWindowMaskPresetGUI *pgui;
644         CWindowMaskItems mask_items;
645 };
646
647 class CWindowMaskDelete : public BC_Button
648 {
649 public:
650         CWindowMaskDelete(MWindow *mwindow, CWindowMaskGUI *gui,
651                         int x, int y, int w);
652         int handle_event();
653
654         MWindow *mwindow;
655         CWindowMaskGUI *gui;
656 };
657
658 class CWindowMaskCenter : public BC_Button
659 {
660 public:
661         CWindowMaskCenter(MWindow *mwindow, CWindowMaskGUI *gui,
662                         int x, int y, int w);
663         int handle_event();
664
665         MWindow *mwindow;
666         CWindowMaskGUI *gui;
667 };
668
669 class CWindowMaskNormal : public BC_Button
670 {
671 public:
672         CWindowMaskNormal(MWindow *mwindow, CWindowMaskGUI *gui,
673                         int x, int y, int w);
674         int handle_event();
675
676         MWindow *mwindow;
677         CWindowMaskGUI *gui;
678 };
679
680 class CWindowMaskShape : public BC_Button
681 {
682 public:
683         CWindowMaskShape(MWindow *mwindow, CWindowMaskGUI *gui,
684                 const char *images, int shape, int x, int y, const char *tip);
685         ~CWindowMaskShape();
686         void builtin_shape(int i, SubMask *sub_mask);
687         int handle_event();
688
689         MWindow *mwindow;
690         CWindowMaskGUI *gui;
691         int shape;
692         CWindowMaskItems shape_items;
693 };
694
695 class CWindowDisableOpenGLMasking : public BC_CheckBox
696 {
697 public:
698         CWindowDisableOpenGLMasking(CWindowMaskGUI *gui,
699                         int x, int y);
700         int handle_event();
701         CWindowMaskGUI *gui;
702 };
703
704 class CWindowMaskGUI : public CWindowToolGUI
705 {
706 public:
707         CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread);
708         ~CWindowMaskGUI();
709         void create_objects();
710         void update();
711         int close_event();
712         void done_event();
713         void handle_event();
714         void set_focused(int v, float cx, float cy);
715         void update_buttons(MaskAuto *keyframe, int k);
716         void get_keyframe(Track* &track, MaskAutos* &autos, MaskAuto* &keyframe,
717                 SubMask* &mask, MaskPoint* &point, int create_it);
718         void load_masks(ArrayList<SubMask *> &masks);
719         void save_masks(ArrayList<SubMask *> &masks);
720         int smooth_mask(int typ, int on);
721         int save_mask(const char *nm);
722         int del_mask(const char *nm);
723         int center_mask();
724         int normal_mask();
725
726         CWindowMaskOnTrack *mask_on_track;
727         CWindowMaskTrackTumbler *mask_track_tumbler;
728         CWindowMaskName *mask_name;
729         CWindowMaskButton *mask_buttons[SUBMASKS];
730         CWindowMaskThumbler *mask_thumbler;
731         BC_Title *mask_blabels[SUBMASKS];
732         CWindowMaskEnable *mask_enables[SUBMASKS];
733         CWindowMaskSoloTrack *mask_solo_track;
734         CWindowMaskDelMask *mask_del;
735         CWindowMaskUnclear *mask_unclr;
736         CWindowMaskClrMask *mask_clr;
737         CWindowMaskShape *mask_shape_sqr;
738         CWindowMaskShape *mask_shape_crc;
739         CWindowMaskShape *mask_shape_tri;
740         CWindowMaskShape *mask_shape_ovl;
741         CWindowMaskLoadList *mask_load_list;
742         CWindowMaskLoad *mask_load;
743         CWindowMaskSave *mask_save;
744         CWindowMaskDelete *mask_delete;
745         CWindowMaskPresetDialog *preset_dialog;
746         CWindowMaskCenter *mask_center;
747         CWindowMaskNormal *mask_normal;
748         CWindowMaskFade *fade;
749         CWindowMaskFadeSlider *fade_slider;
750         CWindowMaskGangFader *gang_fader;
751         CWindowMaskAffectedPoint *active_point;
752         CWindowMaskDelPoint *del_point;
753         CWindowMaskGangPoint *gang_point;
754         CWindowMaskSmoothButton *mask_pnt_linear, *mask_pnt_smooth;
755         CWindowMaskSmoothButton *mask_crv_linear, *mask_crv_smooth;
756         CWindowMaskSmoothButton *mask_all_linear, *mask_all_smooth;
757         CWindowCoord *x, *y;
758         CWindowMaskScaleXY *mask_scale_x, *mask_scale_y, *mask_scale_xy;
759         int scale_mode;
760         CWindowMaskFocus *focus;
761         int focused;
762         CWindowMaskGangFocus *gang_focus;
763         CWindowMaskHelp *help;
764         int helped, help_y, help_h;
765         CWindowMaskDrawMarkers *draw_markers;
766         int markers;
767         CWindowMaskDrawBoundary *draw_boundary;
768         int boundary;
769         CWindowCoord *focus_x, *focus_y;
770         CWindowMaskFeather *feather;
771         CWindowMaskFeatherSlider *feather_slider;
772         CWindowMaskGangFeather *gang_feather;
773         CWindowMaskBeforePlugins *apply_before_plugins;
774         CWindowDisableOpenGLMasking *disable_opengl_masking;
775 };
776
777
778 class CWindowEyedropGUI : public CWindowToolGUI
779 {
780 public:
781         CWindowEyedropGUI(MWindow *mwindow, CWindowTool *thread);
782         ~CWindowEyedropGUI();
783
784         void handle_event();
785         void create_objects();
786         void update();
787
788         BC_Title *current;
789         CWindowCoord *radius;
790         CWindowEyedropCheckBox *use_max;
791         BC_Title *red, *green, *blue, *y, *u, *v;
792         BC_Title *rgb_hex, *yuv_hex;
793         BC_SubWindow *sample;
794 };
795
796
797 class CWindowEyedropCheckBox : public BC_CheckBox
798 {
799 public:
800         CWindowEyedropCheckBox(MWindow *mwindow, 
801                 CWindowEyedropGUI *gui,
802                 int x, 
803                 int y);
804
805         int handle_event();
806         MWindow *mwindow;
807         CWindowEyedropGUI *gui;
808 };
809
810
811 class CWindowToolAutoRangeTumbler : public BC_Tumbler
812 {
813 public:
814         CWindowToolAutoRangeTumbler(CWindowCoord *coord, int x, int y,
815                         int use_max, const char *tip);
816         int handle_up_event();
817         int handle_down_event();
818
819         CWindowCoord *coord;
820         int use_max;
821 };
822
823 class CWindowToolAutoRangeReset : public BC_Button
824 {
825 public:
826         CWindowToolAutoRangeReset(CWindowCoord *coord, int x, int y);
827         int handle_event();
828
829         CWindowCoord *coord;
830 };
831
832 class CWindowToolAutoRangeTextBox : public BC_TextBox
833 {
834 public:
835         CWindowToolAutoRangeTextBox(CWindowCoord *coord, int x, int y);
836         int button_press_event();
837         int handle_event();
838         int update_range();
839
840         CWindowCoord *coord;
841 };
842
843
844 class CWindowCameraGUI : public CWindowToolGUI
845 {
846 public:
847         CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread);
848         ~CWindowCameraGUI();
849         void handle_event();
850         void create_objects();
851         void update();
852
853         BC_TitleBar *bar1, *bar2;
854         CWindowCoord *x, *y, *z;
855         CWindowCameraAddKeyframe *add_keyframe;
856         CWindowCameraReset *reset;
857         BC_TitleBar *bar3, *bar4, *bar5;
858         CWindowCurveToggle *t_smooth, *t_linear, *t_tangent, *t_free, *t_bump;
859         CWindowCurveAutoSpan *auto_span;
860         CWindowCurveAutoEdge *auto_edge;
861 };
862
863 class CWindowCameraLeft : public BC_Button
864 {
865 public:
866         CWindowCameraLeft(MWindow *mwindow, CWindowCameraGUI *gui,
867                         int x, int y);
868         int handle_event();
869         MWindow *mwindow;
870         CWindowCameraGUI *gui;
871 };
872
873 class CWindowCameraCenter : public BC_Button
874 {
875 public:
876         CWindowCameraCenter(MWindow *mwindow, CWindowCameraGUI *gui,
877                         int x, int y);
878         int handle_event();
879         MWindow *mwindow;
880         CWindowCameraGUI *gui;
881 };
882
883 class CWindowCameraRight : public BC_Button
884 {
885 public:
886         CWindowCameraRight(MWindow *mwindow, CWindowCameraGUI *gui,
887                         int x, int y);
888         int handle_event();
889         MWindow *mwindow;
890         CWindowCameraGUI *gui;
891 };
892
893 class CWindowCameraTop : public BC_Button
894 {
895 public:
896         CWindowCameraTop(MWindow *mwindow, CWindowCameraGUI *gui,
897                         int x, int y);
898         int handle_event();
899         MWindow *mwindow;
900         CWindowCameraGUI *gui;
901 };
902
903 class CWindowCameraMiddle : public BC_Button
904 {
905 public:
906         CWindowCameraMiddle(MWindow *mwindow, CWindowCameraGUI *gui,
907                         int x, int y);
908         int handle_event();
909         MWindow *mwindow;
910         CWindowCameraGUI *gui;
911 };
912
913 class CWindowCameraBottom : public BC_Button
914 {
915 public:
916         CWindowCameraBottom(MWindow *mwindow, CWindowCameraGUI *gui,
917                         int x, int y);
918         int handle_event();
919         MWindow *mwindow;
920         CWindowCameraGUI *gui;
921 };
922
923 class CWindowCameraAddKeyframe : public BC_Button
924 {
925 public:
926         CWindowCameraAddKeyframe(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
927         int handle_event();
928
929         MWindow *mwindow;
930         CWindowToolGUI *gui;
931 };
932
933 class CWindowCameraReset : public BC_Button
934 {
935 public:
936         CWindowCameraReset(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
937         int handle_event();
938
939         MWindow *mwindow;
940         CWindowToolGUI *gui;
941 };
942
943
944 class CWindowProjectorGUI : public CWindowToolGUI
945 {
946 public:
947         CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread);
948         ~CWindowProjectorGUI();
949         void handle_event();
950         void create_objects();
951         void update();
952
953         BC_TitleBar *bar1, *bar2;
954         CWindowCoord *x, *y, *z;
955         CWindowProjectorAddKeyframe *add_keyframe;
956         CWindowProjectorReset *reset;
957         BC_TitleBar *bar3, *bar4, *bar5;
958         CWindowCurveToggle *t_smooth, *t_linear, *t_tangent, *t_free, *t_bump;
959         CWindowCurveAutoSpan *auto_span;
960         CWindowCurveAutoEdge *auto_edge;
961 };
962
963 class CWindowProjectorLeft : public BC_Button
964 {
965 public:
966         CWindowProjectorLeft(MWindow *mwindow, CWindowProjectorGUI *gui,
967                         int x, int y);
968         int handle_event();
969         MWindow *mwindow;
970         CWindowProjectorGUI *gui;
971 };
972
973 class CWindowProjectorCenter : public BC_Button
974 {
975 public:
976         CWindowProjectorCenter(MWindow *mwindow, CWindowProjectorGUI *gui,
977                         int x, int y);
978         int handle_event();
979         MWindow *mwindow;
980         CWindowProjectorGUI *gui;
981 };
982
983 class CWindowProjectorRight : public BC_Button
984 {
985 public:
986         CWindowProjectorRight(MWindow *mwindow, CWindowProjectorGUI *gui,
987                         int x, int y);
988         int handle_event();
989         MWindow *mwindow;
990         CWindowProjectorGUI *gui;
991 };
992
993 class CWindowProjectorTop : public BC_Button
994 {
995 public:
996         CWindowProjectorTop(MWindow *mwindow, CWindowProjectorGUI *gui,
997                         int x, int y);
998         int handle_event();
999         MWindow *mwindow;
1000         CWindowProjectorGUI *gui;
1001 };
1002
1003 class CWindowProjectorMiddle : public BC_Button
1004 {
1005 public:
1006         CWindowProjectorMiddle(MWindow *mwindow, CWindowProjectorGUI *gui,
1007                         int x, int y);
1008         int handle_event();
1009         MWindow *mwindow;
1010         CWindowProjectorGUI *gui;
1011 };
1012
1013 class CWindowProjectorBottom : public BC_Button
1014 {
1015 public:
1016         CWindowProjectorBottom(MWindow *mwindow, CWindowProjectorGUI *gui,
1017                         int x, int y);
1018         int handle_event();
1019         MWindow *mwindow;
1020         CWindowProjectorGUI *gui;
1021 };
1022
1023 class CWindowProjectorAddKeyframe : public BC_Button
1024 {
1025 public:
1026         CWindowProjectorAddKeyframe(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
1027         int handle_event();
1028
1029         MWindow *mwindow;
1030         CWindowToolGUI *gui;
1031 };
1032
1033 class CWindowProjectorReset : public BC_Button
1034 {
1035 public:
1036         CWindowProjectorReset(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
1037         int handle_event();
1038
1039         MWindow *mwindow;
1040         CWindowToolGUI *gui;
1041 };
1042
1043
1044
1045
1046 class CWindowRulerGUI : public CWindowToolGUI
1047 {
1048 public:
1049         CWindowRulerGUI(MWindow *mwindow, CWindowTool *thread);
1050         ~CWindowRulerGUI();
1051         void create_objects();
1052         void update();
1053 // Update the gui
1054         void handle_event();
1055
1056         BC_TextBox *current;
1057         BC_TextBox *point1;
1058         BC_TextBox *point2;
1059         BC_TextBox *deltas;
1060         BC_TextBox *distance;
1061         BC_TextBox *angle;
1062 };
1063
1064
1065 #endif