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