prevent popup deactivation while button_down
[goodguy/history.git] / cinelerra-5.0 / cinelerra / gwindowgui.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 GWINDOWGUI_H
23 #define GWINDOWGUI_H
24
25 #include "automation.inc"
26 #include "guicast.h"
27 #include "mwindow.inc"
28
29 class GWindowToggle;
30
31 #define ASSETS 0
32 #define TITLES 1
33 #define TRANSITIONS 2
34 #define PLUGIN_AUTOS 3
35 #define OTHER_TOGGLES 4
36
37 class GWindowGUI : public BC_Window
38 {
39 public:
40         GWindowGUI(MWindow *mwindow, int w, int h);
41         static void calculate_extents(BC_WindowBase *gui, int *w, int *h);
42         void create_objects();
43         int translation_event();
44         int close_event();
45         int keypress_event();
46         void update_toggles(int use_lock);
47         void update_mwindow();
48         int cursor_motion_event();
49
50         int drag_operation;
51         int new_status;
52
53         MWindow *mwindow;
54         GWindowToggle *other[OTHER_TOGGLES];
55         GWindowToggle *auto_toggle[AUTOMATION_TOTAL];
56 };
57
58 class GWindowToggle : public BC_CheckBox
59 {
60 public:
61         GWindowToggle(MWindow *mwindow, 
62                 GWindowGUI *gui, 
63                 int x, 
64                 int y, 
65                 int subscript,
66                 int other, 
67                 const char *text);
68         int handle_event();
69         void update();
70
71         static int* get_main_value(MWindow *mwindow, int subscript, int other);
72
73         int button_press_event();
74         int button_release_event();
75
76         MWindow *mwindow;
77         GWindowGUI *gui;
78         int subscript;
79         int other;
80 };
81
82 #endif