confirm prefs update, fix bg_pixmap sz, plugin layout tweaks
[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 // Update EDL and preview only
94         void update_preview(int changed_edl=0);
95         void draw_preview(int changed_edl);
96         int current_operation;
97         virtual int close_event();
98         int keypress_event();
99         int translation_event();
100         int press(void (CWindowCanvas::*fn)());
101
102         MWindow *mwindow;
103         CWindowTool *thread;
104         CWindowCoord *event_caller;
105 };
106
107 class CWindowCoord : public BC_TumbleTextBox
108 {
109 public:
110         CWindowCoord(CWindowToolGUI *gui, int x, int y,
111                         float value, int logincrement);
112         CWindowCoord(CWindowToolGUI *gui, int x, int y,
113                         int value);
114
115 // Calls the window's handle_event
116         int handle_event();
117
118         CWindowToolGUI *gui;
119 };
120
121 class CWindowCropApply : public BC_GenericButton
122 {
123 public:
124         CWindowCropApply(MWindow *mwindow, CWindowCropGUI *crop_gui,
125                         int x, int y);
126 // Perform the cropping operation
127         int handle_event();
128         int keypress_event();
129         MWindow *mwindow;
130         CWindowCropGUI *crop_gui;
131 };
132
133 class CWindowCropOpMode : public BC_PopupMenu
134 {
135         static const char *crop_ops[CROP_MODES];
136 public:
137         CWindowCropOpMode(MWindow *mwindow, CWindowCropGUI *crop_gui,
138                         int mode, int x, int y);
139         ~CWindowCropOpMode();
140         void create_objects();
141         int handle_event();
142
143         MWindow *mwindow;
144         CWindowCropGUI *crop_gui;
145         int mode;
146 };
147
148 class CWindowCropOpItem : public BC_MenuItem
149 {
150 public:
151         CWindowCropOpItem(CWindowCropOpMode *popup, const char *text, int id);
152         int handle_event();
153
154         CWindowCropOpMode *popup;
155         int id;
156 };
157
158
159 class CWindowCropGUI : public CWindowToolGUI
160 {
161 public:
162         CWindowCropGUI(MWindow *mwindow, CWindowTool *thread);
163         ~CWindowCropGUI();
164         void create_objects();
165         void update();
166 // Update the gui
167         void handle_event();
168         CWindowCoord *x1, *y1, *width, *height;
169         CWindowCropOpMode *crop_mode;
170 };
171
172 class CWindowMaskItem : public BC_ListBoxItem
173 {
174 public:
175         CWindowMaskItem(const char *text, int id=-1, int color=-1)
176          : BC_ListBoxItem(text, color), id(id) {}
177         ~CWindowMaskItem() {}
178         int id;
179 };
180
181 class CWindowMaskItems : public ArrayList<BC_ListBoxItem*>
182 {
183 public:
184         CWindowMaskItems() {}
185         ~CWindowMaskItems() { remove_all_objects(); }
186 };
187
188 class CWindowMaskOnTrack : public BC_PopupTextBox
189 {
190 public:
191         CWindowMaskOnTrack(MWindow *mwindow, CWindowMaskGUI *gui,
192                         int x, int y, int w, const char *text);
193         ~CWindowMaskOnTrack();
194         MWindow *mwindow;
195         CWindowMaskGUI *gui;
196         CWindowMaskItems track_items;
197
198         int handle_event();
199         void update_items();
200 };
201
202 class CWindowMaskTrackTumbler : public BC_Tumbler
203 {
204 public:
205         CWindowMaskTrackTumbler(MWindow *mwindow, CWindowMaskGUI *gui,
206                         int x, int y);
207         ~CWindowMaskTrackTumbler();
208         int handle_up_event();
209         int handle_down_event();
210         int do_event(int dir);
211
212         MWindow *mwindow;
213         CWindowMaskGUI *gui;
214 };
215
216
217 class CWindowMaskName : public BC_PopupTextBox
218 {
219 public:
220         CWindowMaskName(MWindow *mwindow, CWindowMaskGUI *gui,
221                         int x, int y, const char *text);
222         ~CWindowMaskName();
223         MWindow *mwindow;
224         CWindowMaskGUI *gui;
225         CWindowMaskItems mask_items;
226
227         int handle_event();
228         void update_items(MaskAuto *keyframe);
229 };
230
231 class CWindowMaskUnclear : public BC_Button
232 {
233 public:
234         CWindowMaskUnclear(MWindow *mwindow, CWindowMaskGUI *gui,
235                         int x, int y);
236         int handle_event();
237         MWindow *mwindow;
238         CWindowMaskGUI *gui;
239 };
240
241 class CWindowMaskSoloTrack : public BC_CheckBox
242 {
243 public:
244         CWindowMaskSoloTrack(MWindow *mwindow, CWindowMaskGUI *gui,
245                         int x, int y, int v);
246         static int calculate_w(BC_WindowBase *gui);
247         int handle_event();
248         MWindow *mwindow;
249         CWindowMaskGUI *gui;
250 };
251
252 class CWindowMaskDelMask : public BC_GenericButton
253 {
254 public:
255         CWindowMaskDelMask(MWindow *mwindow, CWindowMaskGUI *gui,
256                         int x, int y);
257         int handle_event();
258         MWindow *mwindow;
259         CWindowMaskGUI *gui;
260 };
261
262 class CWindowMaskClrMask : public BC_Button
263 {
264 public:
265         CWindowMaskClrMask(MWindow *mwindow, CWindowMaskGUI *gui,
266                         int x, int y);
267         ~CWindowMaskClrMask();
268         static int calculate_w(MWindow *mwindow);
269         int handle_event();
270         MWindow *mwindow;
271         CWindowMaskGUI *gui;
272 };
273
274 class CWindowMaskButton : public BC_CheckBox
275 {
276 public:
277         CWindowMaskButton(MWindow *mwindow, CWindowMaskGUI *gui,
278                          int x, int y, int no, int v);
279         ~CWindowMaskButton();
280
281         int handle_event();
282         MWindow *mwindow;
283         CWindowMaskGUI *gui;
284         int no;
285 };
286
287 class CWindowMaskThumbler : public BC_Tumbler
288 {
289 public:
290         CWindowMaskThumbler(MWindow *mwindow, CWindowMaskGUI *gui,
291                         int x, int y);
292         ~CWindowMaskThumbler();
293         int handle_up_event();
294         int handle_down_event();
295         int do_event(int dir);
296
297         MWindow *mwindow;
298         CWindowMaskGUI *gui;
299 };
300
301 class CWindowMaskEnable : public BC_CheckBox
302 {
303 public:
304         CWindowMaskEnable(MWindow *mwindow, CWindowMaskGUI *gui,
305                          int x, int y, int no, int v);
306         ~CWindowMaskEnable();
307
308         int handle_event();
309         MWindow *mwindow;
310         CWindowMaskGUI *gui;
311         int no;
312 };
313
314 class CWindowMaskFade : public BC_TumbleTextBox
315 {
316 public:
317         CWindowMaskFade(MWindow *mwindow, CWindowMaskGUI *gui,
318                         int x, int y);
319         ~CWindowMaskFade();
320         int update(float v);
321         int update_value(float v);
322         int handle_event();
323         MWindow *mwindow;
324         CWindowMaskGUI *gui;
325 };
326
327 class CWindowMaskFadeSlider : public BC_ISlider
328 {
329 public:
330         CWindowMaskFadeSlider(MWindow *mwindow, CWindowMaskGUI *gui,
331                 int x, int y, int w);
332         ~CWindowMaskFadeSlider();
333         int handle_event();
334         int update(int64_t v);
335         char *get_caption() { return 0; }
336         MWindow *mwindow;
337         CWindowMaskGUI *gui;
338         int stick;
339         float last_v;
340         Timer *timer;
341 };
342
343 class CWindowMaskGangFader : public BC_Toggle
344 {
345 public:
346         CWindowMaskGangFader(MWindow *mwindow, CWindowMaskGUI *gui,
347                         int x, int y);
348         ~CWindowMaskGangFader();
349         int handle_event();
350         MWindow *mwindow;
351         CWindowMaskGUI *gui;
352 };
353
354 class CWindowMaskGangFocus : public BC_Toggle
355 {
356 public:
357         CWindowMaskGangFocus(MWindow *mwindow, CWindowMaskGUI *gui,
358                         int x, int y);
359         ~CWindowMaskGangFocus();
360         int handle_event();
361         MWindow *mwindow;
362         CWindowMaskGUI *gui;
363 };
364
365 class CWindowMaskGangPoint : public BC_Toggle
366 {
367 public:
368         CWindowMaskGangPoint(MWindow *mwindow, CWindowMaskGUI *gui,
369                         int x, int y);
370         ~CWindowMaskGangPoint();
371         int handle_event();
372         MWindow *mwindow;
373         CWindowMaskGUI *gui;
374 };
375
376 class CWindowMaskSmoothButton : public BC_Button
377 {
378 public:
379         CWindowMaskSmoothButton(MWindow *mwindow, CWindowMaskGUI *gui,
380                 const char *tip, int type, int on, int x, int y, const char *images);
381         int handle_event();
382         MWindow *mwindow;
383         CWindowMaskGUI *gui;
384         int type, on;
385 };
386
387 class CWindowMaskAffectedPoint : public BC_TumbleTextBox
388 {
389 public:
390         CWindowMaskAffectedPoint(MWindow *mwindow, CWindowMaskGUI *gui,
391                         int x, int y);
392         ~CWindowMaskAffectedPoint();
393         int handle_event();
394         MWindow *mwindow;
395         CWindowMaskGUI *gui;
396 };
397
398 class CWindowMaskFocus : public BC_CheckBox
399 {
400 public:
401         CWindowMaskFocus(MWindow *mwindow, CWindowMaskGUI *gui,
402                         int x, int y);
403         ~CWindowMaskFocus();
404         int handle_event();
405         MWindow *mwindow;
406         CWindowMaskGUI *gui;
407         static int calculate_w(CWindowMaskGUI *gui);
408 };
409
410 class CWindowMaskScaleXY : public BC_Toggle
411 {
412 public:
413         CWindowMaskScaleXY(MWindow *mwindow, CWindowMaskGUI *gui,
414                         int x, int y, VFrame **data, int v,
415                         int id, const char *tip);
416         ~CWindowMaskScaleXY();
417         int handle_event();
418         MWindow *mwindow;
419         CWindowMaskGUI *gui;
420         int id;
421 };
422
423 class CWindowMaskHelp : public BC_CheckBox
424 {
425 public:
426         CWindowMaskHelp(MWindow *mwindow, CWindowMaskGUI *gui,
427                         int x, int y);
428         ~CWindowMaskHelp();
429         int handle_event();
430         MWindow *mwindow;
431         CWindowMaskGUI *gui;
432 };
433
434 class CWindowMaskDrawMarkers : public BC_CheckBox
435 {
436 public:
437         CWindowMaskDrawMarkers(MWindow *mwindow, CWindowMaskGUI *gui,
438                         int x, int y);
439         ~CWindowMaskDrawMarkers();
440         int handle_event();
441         MWindow *mwindow;
442         CWindowMaskGUI *gui;
443 };
444
445 class CWindowMaskDrawBoundary : public BC_CheckBox
446 {
447 public:
448         CWindowMaskDrawBoundary(MWindow *mwindow, CWindowMaskGUI *gui,
449                         int x, int y);
450         ~CWindowMaskDrawBoundary();
451         int handle_event();
452         MWindow *mwindow;
453         CWindowMaskGUI *gui;
454 };
455
456 class CWindowMaskDelPoint : public BC_GenericButton
457 {
458 public:
459         CWindowMaskDelPoint(MWindow *mwindow, CWindowMaskGUI *gui,
460                         int x, int y);
461         int handle_event();
462         MWindow *mwindow;
463         CWindowMaskGUI *gui;
464 };
465
466 class CWindowMaskFeather : public BC_TumbleTextBox
467 {
468 public:
469         CWindowMaskFeather(MWindow *mwindow, CWindowMaskGUI *gui,
470                         int x, int y);
471         ~CWindowMaskFeather();
472         int update(float v);
473         int update_value(float v);
474         int handle_event();
475         MWindow *mwindow;
476         CWindowMaskGUI *gui;
477 };
478
479 class CWindowMaskFeatherSlider : public BC_FSlider
480 {
481 public:
482         CWindowMaskFeatherSlider(MWindow *mwindow, CWindowMaskGUI *gui,
483                 int x, int y, int w, float v);
484         ~CWindowMaskFeatherSlider();
485         int handle_event();
486         int update(float v);
487         int update(int r, float v, float mn, float mx);
488         char *get_caption() { return 0; }
489         MWindow *mwindow;
490         CWindowMaskGUI *gui;
491         int stick;
492         float last_v;
493         float max;
494         Timer *timer;
495 };
496
497 class CWindowMaskGangFeather : public BC_Toggle
498 {
499 public:
500         CWindowMaskGangFeather(MWindow *mwindow, CWindowMaskGUI *gui,
501                         int x, int y);
502         ~CWindowMaskGangFeather();
503         int handle_event();
504         MWindow *mwindow;
505         CWindowMaskGUI *gui;
506 };
507
508 class CWindowMaskBeforePlugins : public BC_CheckBox
509 {
510 public:
511         CWindowMaskBeforePlugins(CWindowMaskGUI *gui,
512                         int x, int y);
513         int handle_event();
514         CWindowMaskGUI *gui;
515 };
516
517 class CWindowMaskLoadList : public BC_ListBox
518 {
519 public:
520         CWindowMaskLoadList(MWindow *mwindow, CWindowMaskGUI *gui);
521         ~CWindowMaskLoadList();
522         void create_objects();
523         int handle_event();
524
525         MWindow *mwindow;
526         CWindowMaskGUI *gui;
527         CWindowMaskItems shape_items;
528 };
529
530 class CWindowMaskLoad : public BC_Button
531 {
532 public:
533         CWindowMaskLoad(MWindow *mwindow, CWindowMaskGUI *gui,
534                         int x, int y, int w);
535         int handle_event();
536
537         MWindow *mwindow;
538         CWindowMaskGUI *gui;
539 };
540
541 class CWindowMaskSave : public BC_Button
542 {
543 public:
544         CWindowMaskSave(MWindow *mwindow, CWindowMaskGUI *gui,
545                         int x, int y, int w);
546         ~CWindowMaskSave();
547         int handle_event();
548
549         MWindow *mwindow;
550         CWindowMaskGUI *gui;
551         CWindowMaskPresetDialog *preset_dialog;
552 };
553
554 class CWindowMaskPresetDialog : public BC_DialogThread
555 {
556 public:
557         CWindowMaskPresetDialog(MWindow *mwindow, CWindowMaskGUI *gui);
558         ~CWindowMaskPresetDialog();
559         void handle_close_event(int result);
560         void handle_done_event(int result);
561         BC_Window* new_gui();
562         void start_dialog(int sx, int sy, MaskAuto *keyframe);
563
564         MWindow *mwindow;
565         CWindowMaskGUI *gui;
566         CWindowMaskPresetGUI *pgui;
567         int sx, sy;
568         MaskAuto *keyframe;
569 };
570
571 class CWindowMaskPresetGUI : public BC_Window
572 {
573 public:
574         CWindowMaskPresetGUI(CWindowMaskPresetDialog *preset_dialog,
575                         int x, int y, const char *title);
576         void create_objects();
577
578         CWindowMaskPresetDialog *preset_dialog;
579         CWindowMaskPresetText *preset_text;
580 };
581
582 class CWindowMaskPresetText : public BC_PopupTextBox
583 {
584 public:
585         CWindowMaskPresetText(CWindowMaskPresetGUI *pgui,
586                 int x, int y, int w, int h, const char *text);
587         int handle_event();
588         void update_items();
589
590         CWindowMaskPresetGUI *pgui;
591         CWindowMaskItems mask_items;
592 };
593
594 class CWindowMaskDelete : public BC_Button
595 {
596 public:
597         CWindowMaskDelete(MWindow *mwindow, CWindowMaskGUI *gui,
598                         int x, int y, int w);
599         int handle_event();
600
601         MWindow *mwindow;
602         CWindowMaskGUI *gui;
603 };
604
605 class CWindowMaskCenter : public BC_Button
606 {
607 public:
608         CWindowMaskCenter(MWindow *mwindow, CWindowMaskGUI *gui,
609                         int x, int y, int w);
610         int handle_event();
611
612         MWindow *mwindow;
613         CWindowMaskGUI *gui;
614 };
615
616 class CWindowMaskNormal : public BC_Button
617 {
618 public:
619         CWindowMaskNormal(MWindow *mwindow, CWindowMaskGUI *gui,
620                         int x, int y, int w);
621         int handle_event();
622
623         MWindow *mwindow;
624         CWindowMaskGUI *gui;
625 };
626
627 class CWindowMaskShape : public BC_Button
628 {
629 public:
630         CWindowMaskShape(MWindow *mwindow, CWindowMaskGUI *gui,
631                 const char *images, int shape, int x, int y, const char *tip);
632         ~CWindowMaskShape();
633         void builtin_shape(int i, SubMask *sub_mask);
634         int handle_event();
635
636         MWindow *mwindow;
637         CWindowMaskGUI *gui;
638         int shape;
639         CWindowMaskItems shape_items;
640 };
641
642 class CWindowDisableOpenGLMasking : public BC_CheckBox
643 {
644 public:
645         CWindowDisableOpenGLMasking(CWindowMaskGUI *gui,
646                         int x, int y);
647         int handle_event();
648         CWindowMaskGUI *gui;
649 };
650
651 class CWindowMaskGUI : public CWindowToolGUI
652 {
653 public:
654         CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread);
655         ~CWindowMaskGUI();
656         void create_objects();
657         void update();
658         int close_event();
659         void done_event();
660         void handle_event();
661         void set_focused(int v, float cx, float cy);
662         void update_buttons(MaskAuto *keyframe, int k);
663         void get_keyframe(Track* &track, MaskAutos* &autos, MaskAuto* &keyframe,
664                 SubMask* &mask, MaskPoint* &point, int create_it);
665         void load_masks(ArrayList<SubMask *> &masks);
666         void save_masks(ArrayList<SubMask *> &masks);
667         int smooth_mask(int typ, int on);
668         int save_mask(const char *nm);
669         int del_mask(const char *nm);
670         int center_mask();
671         int normal_mask();
672
673         CWindowMaskOnTrack *mask_on_track;
674         CWindowMaskTrackTumbler *mask_track_tumbler;
675         CWindowMaskName *mask_name;
676         CWindowMaskButton *mask_buttons[SUBMASKS];
677         CWindowMaskThumbler *mask_thumbler;
678         BC_Title *mask_blabels[SUBMASKS];
679         CWindowMaskEnable *mask_enables[SUBMASKS];
680         CWindowMaskSoloTrack *mask_solo_track;
681         CWindowMaskDelMask *mask_del;
682         CWindowMaskUnclear *mask_unclr;
683         CWindowMaskClrMask *mask_clr;
684         CWindowMaskShape *mask_shape_sqr;
685         CWindowMaskShape *mask_shape_crc;
686         CWindowMaskShape *mask_shape_tri;
687         CWindowMaskShape *mask_shape_ovl;
688         CWindowMaskLoadList *mask_load_list;
689         CWindowMaskLoad *mask_load;
690         CWindowMaskSave *mask_save;
691         CWindowMaskDelete *mask_delete;
692         CWindowMaskPresetDialog *preset_dialog;
693         CWindowMaskCenter *mask_center;
694         CWindowMaskNormal *mask_normal;
695         CWindowMaskFade *fade;
696         CWindowMaskFadeSlider *fade_slider;
697         CWindowMaskGangFader *gang_fader;
698         CWindowMaskAffectedPoint *active_point;
699         CWindowMaskDelPoint *del_point;
700         CWindowMaskGangPoint *gang_point;
701         CWindowMaskSmoothButton *mask_pnt_linear, *mask_pnt_smooth;
702         CWindowMaskSmoothButton *mask_crv_linear, *mask_crv_smooth;
703         CWindowMaskSmoothButton *mask_all_linear, *mask_all_smooth;
704         CWindowCoord *x, *y;
705         CWindowMaskScaleXY *mask_scale_x, *mask_scale_y, *mask_scale_xy;
706         int scale_mode;
707         CWindowMaskFocus *focus;
708         int focused;
709         CWindowMaskGangFocus *gang_focus;
710         CWindowMaskHelp *help;
711         int helped, help_y, help_h;
712         CWindowMaskDrawMarkers *draw_markers;
713         int markers;
714         CWindowMaskDrawBoundary *draw_boundary;
715         int boundary;
716         CWindowCoord *focus_x, *focus_y;
717         CWindowMaskFeather *feather;
718         CWindowMaskFeatherSlider *feather_slider;
719         CWindowMaskGangFeather *gang_feather;
720         CWindowMaskBeforePlugins *apply_before_plugins;
721         CWindowDisableOpenGLMasking *disable_opengl_masking;
722 };
723
724
725 class CWindowEyedropGUI : public CWindowToolGUI
726 {
727 public:
728         CWindowEyedropGUI(MWindow *mwindow, CWindowTool *thread);
729         ~CWindowEyedropGUI();
730
731         void handle_event();
732         void create_objects();
733         void update();
734
735         BC_Title *current;
736         CWindowCoord *radius;
737         CWindowEyedropCheckBox *use_max;
738         BC_Title *red, *green, *blue, *y, *u, *v;
739         BC_Title *rgb_hex, *yuv_hex;
740         BC_SubWindow *sample;
741 };
742
743
744 class CWindowEyedropCheckBox : public BC_CheckBox
745 {
746 public:
747         CWindowEyedropCheckBox(MWindow *mwindow, 
748                 CWindowEyedropGUI *gui,
749                 int x, 
750                 int y);
751
752         int handle_event();
753         MWindow *mwindow;
754         CWindowEyedropGUI *gui;
755 };
756
757
758
759 class CWindowCameraGUI : public CWindowToolGUI
760 {
761 public:
762         CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread);
763         ~CWindowCameraGUI();
764         void handle_event();
765         void create_objects();
766         void update();
767
768         CWindowCoord *x, *y, *z;
769         CWindowCameraAddKeyframe *add_keyframe;
770         CWindowCameraReset *reset;
771         CWindowCurveToggle *t_smooth, *t_linear;
772 };
773
774 class CWindowCameraLeft : public BC_Button
775 {
776 public:
777         CWindowCameraLeft(MWindow *mwindow, CWindowCameraGUI *gui,
778                         int x, int y);
779         int handle_event();
780         MWindow *mwindow;
781         CWindowCameraGUI *gui;
782 };
783
784 class CWindowCameraCenter : public BC_Button
785 {
786 public:
787         CWindowCameraCenter(MWindow *mwindow, CWindowCameraGUI *gui,
788                         int x, int y);
789         int handle_event();
790         MWindow *mwindow;
791         CWindowCameraGUI *gui;
792 };
793
794 class CWindowCameraRight : public BC_Button
795 {
796 public:
797         CWindowCameraRight(MWindow *mwindow, CWindowCameraGUI *gui,
798                         int x, int y);
799         int handle_event();
800         MWindow *mwindow;
801         CWindowCameraGUI *gui;
802 };
803
804 class CWindowCameraTop : public BC_Button
805 {
806 public:
807         CWindowCameraTop(MWindow *mwindow, CWindowCameraGUI *gui,
808                         int x, int y);
809         int handle_event();
810         MWindow *mwindow;
811         CWindowCameraGUI *gui;
812 };
813
814 class CWindowCameraMiddle : public BC_Button
815 {
816 public:
817         CWindowCameraMiddle(MWindow *mwindow, CWindowCameraGUI *gui,
818                         int x, int y);
819         int handle_event();
820         MWindow *mwindow;
821         CWindowCameraGUI *gui;
822 };
823
824 class CWindowCameraBottom : public BC_Button
825 {
826 public:
827         CWindowCameraBottom(MWindow *mwindow, CWindowCameraGUI *gui,
828                         int x, int y);
829         int handle_event();
830         MWindow *mwindow;
831         CWindowCameraGUI *gui;
832 };
833
834 class CWindowCameraAddKeyframe : public BC_Button
835 {
836 public:
837         CWindowCameraAddKeyframe(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
838         int handle_event();
839
840         MWindow *mwindow;
841         CWindowToolGUI *gui;
842 };
843
844 class CWindowCameraReset : public BC_Button
845 {
846 public:
847         CWindowCameraReset(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
848         int handle_event();
849
850         MWindow *mwindow;
851         CWindowToolGUI *gui;
852 };
853
854
855 class CWindowProjectorGUI : public CWindowToolGUI
856 {
857 public:
858         CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread);
859         ~CWindowProjectorGUI();
860         void handle_event();
861         void create_objects();
862         void update();
863
864         CWindowCoord *x, *y, *z;
865         CWindowProjectorAddKeyframe *add_keyframe;
866         CWindowProjectorReset *reset;
867         CWindowCurveToggle *t_smooth, *t_linear;
868 };
869
870 class CWindowProjectorLeft : public BC_Button
871 {
872 public:
873         CWindowProjectorLeft(MWindow *mwindow, CWindowProjectorGUI *gui,
874                         int x, int y);
875         int handle_event();
876         MWindow *mwindow;
877         CWindowProjectorGUI *gui;
878 };
879
880 class CWindowProjectorCenter : public BC_Button
881 {
882 public:
883         CWindowProjectorCenter(MWindow *mwindow, CWindowProjectorGUI *gui,
884                         int x, int y);
885         int handle_event();
886         MWindow *mwindow;
887         CWindowProjectorGUI *gui;
888 };
889
890 class CWindowProjectorRight : public BC_Button
891 {
892 public:
893         CWindowProjectorRight(MWindow *mwindow, CWindowProjectorGUI *gui,
894                         int x, int y);
895         int handle_event();
896         MWindow *mwindow;
897         CWindowProjectorGUI *gui;
898 };
899
900 class CWindowProjectorTop : public BC_Button
901 {
902 public:
903         CWindowProjectorTop(MWindow *mwindow, CWindowProjectorGUI *gui,
904                         int x, int y);
905         int handle_event();
906         MWindow *mwindow;
907         CWindowProjectorGUI *gui;
908 };
909
910 class CWindowProjectorMiddle : public BC_Button
911 {
912 public:
913         CWindowProjectorMiddle(MWindow *mwindow, CWindowProjectorGUI *gui,
914                         int x, int y);
915         int handle_event();
916         MWindow *mwindow;
917         CWindowProjectorGUI *gui;
918 };
919
920 class CWindowProjectorBottom : public BC_Button
921 {
922 public:
923         CWindowProjectorBottom(MWindow *mwindow, CWindowProjectorGUI *gui,
924                         int x, int y);
925         int handle_event();
926         MWindow *mwindow;
927         CWindowProjectorGUI *gui;
928 };
929
930 class CWindowProjectorAddKeyframe : public BC_Button
931 {
932 public:
933         CWindowProjectorAddKeyframe(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
934         int handle_event();
935
936         MWindow *mwindow;
937         CWindowToolGUI *gui;
938 };
939
940 class CWindowProjectorReset : public BC_Button
941 {
942 public:
943         CWindowProjectorReset(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
944         int handle_event();
945
946         MWindow *mwindow;
947         CWindowToolGUI *gui;
948 };
949
950
951
952
953 class CWindowRulerGUI : public CWindowToolGUI
954 {
955 public:
956         CWindowRulerGUI(MWindow *mwindow, CWindowTool *thread);
957         ~CWindowRulerGUI();
958         void create_objects();
959         void update();
960 // Update the gui
961         void handle_event();
962
963         BC_TextBox *current;
964         BC_TextBox *point1;
965         BC_TextBox *point2;
966         BC_TextBox *deltas;
967         BC_TextBox *distance;
968         BC_TextBox *angle;
969 };
970
971
972 #endif