prevent popup deactivation while button_down
[goodguy/history.git] / cinelerra-5.0 / cinelerra / keyframegui.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 KEYFRAMEGUI_H
23 #define KEYFRAMEGUI_H
24
25
26 #include "bcdialog.h"
27 #include "guicast.h"
28 #include "presets.inc"
29
30 class KeyFrameWindow;
31
32
33
34
35 #define KEYFRAME_COLUMNS 2
36 // Enable editing of detailed keyframe parameters.
37 #define EDIT_KEYFRAME
38
39 class KeyFrameThread : public BC_DialogThread
40 {
41 public:
42         KeyFrameThread(MWindow *mwindow);
43         ~KeyFrameThread();
44
45
46         BC_Window* new_gui();
47         void start_window(Plugin *plugin, KeyFrame *keyframe);
48         void handle_done_event(int result);
49         void handle_close_event(int result);
50         void update_values();
51         void save_value(char *value);
52         void save_preset(const char *title);
53         void delete_preset(const char *title);
54         void apply_preset(const char *title);
55         void apply_value();
56         void calculate_preset_list();
57         void update_gui(int update_value_text = 1);
58
59         ArrayList<BC_ListBoxItem*> *keyframe_data;
60         Plugin *plugin;
61         KeyFrame *keyframe;
62         MWindow *mwindow;
63         char window_title[BCTEXTLEN];
64         char plugin_title[BCTEXTLEN];
65         char *column_titles[KEYFRAME_COLUMNS];
66         int column_width[KEYFRAME_COLUMNS];
67         ArrayList<BC_ListBoxItem*> *presets_data;
68         PresetsDB *presets_db;
69 };
70
71 #ifdef EDIT_KEYFRAME
72
73
74 class KeyFrameList : public BC_ListBox
75 {
76 public:
77         KeyFrameList(KeyFrameThread *thread,
78                 KeyFrameWindow *window,
79                 int x,
80                 int y,
81                 int w, 
82                 int h);
83         int selection_changed();
84         int handle_event();
85         int column_resize_event();
86         KeyFrameThread *thread;
87         KeyFrameWindow *window;
88 };
89 #endif
90
91 class KeyFramePresetsList : public BC_ListBox
92 {
93 public:
94         KeyFramePresetsList(KeyFrameThread *thread,
95                 KeyFrameWindow *window,
96                 int x,
97                 int y,
98                 int w, 
99                 int h);
100         int selection_changed();
101         int handle_event();
102         KeyFrameThread *thread;
103         KeyFrameWindow *window;
104 };
105
106 class KeyFramePresetsText : public BC_TextBox
107 {
108 public:
109         KeyFramePresetsText(KeyFrameThread *thread,
110                 KeyFrameWindow *window,
111                 int x,
112                 int y,
113                 int w);
114         int handle_event();
115         KeyFrameThread *thread;
116         KeyFrameWindow *window;
117 };
118
119
120 class KeyFramePresetsDelete : public BC_GenericButton
121 {
122 public:
123         KeyFramePresetsDelete(KeyFrameThread *thread,
124                 KeyFrameWindow *window,
125                 int x,
126                 int y);
127         int handle_event();
128         KeyFrameThread *thread;
129         KeyFrameWindow *window;
130 };
131
132 class KeyFramePresetsSave : public BC_GenericButton
133 {
134 public:
135         KeyFramePresetsSave(KeyFrameThread *thread,
136                 KeyFrameWindow *window,
137                 int x,
138                 int y);
139         int handle_event();
140         KeyFrameThread *thread;
141         KeyFrameWindow *window;
142 };
143
144 class KeyFramePresetsApply : public BC_GenericButton
145 {
146 public:
147         KeyFramePresetsApply(KeyFrameThread *thread,
148                 KeyFrameWindow *window,
149                 int x,
150                 int y);
151         int handle_event();
152         KeyFrameThread *thread;
153         KeyFrameWindow *window;
154 };
155
156 /*
157  * class KeyFrameText : public BC_TextBox
158  * {
159  * public:
160  *      KeyFrameText(KeyFrameThread *thread,
161  *              KeyFrameWindow *window,
162  *              int x,
163  *              int y,
164  *              int w);
165  *      int handle_event();
166  *      KeyFrameThread *thread;
167  *      KeyFrameWindow *window;
168  * };
169  */
170
171 #ifdef EDIT_KEYFRAME
172
173
174 class KeyFrameValue : public BC_TextBox
175 {
176 public:
177         KeyFrameValue(KeyFrameThread *thread,
178                 KeyFrameWindow *window,
179                 int x,
180                 int y,
181                 int w);
182         int handle_event();
183         KeyFrameThread *thread;
184         KeyFrameWindow *window;
185 };
186
187 class KeyFrameAll : public BC_CheckBox
188 {
189 public:
190         KeyFrameAll(KeyFrameThread *thread,
191                 KeyFrameWindow *window,
192                 int x,
193                 int y);
194         int handle_event();
195         KeyFrameThread *thread;
196         KeyFrameWindow *window;
197 };
198
199 #endif
200
201
202 class KeyFramePresetsOK : public BC_OKButton
203 {
204 public:
205         KeyFramePresetsOK(KeyFrameThread *thread,
206                 KeyFrameWindow *window);
207         int keypress_event();
208         KeyFrameThread *thread;
209         KeyFrameWindow *window;
210 };
211
212
213
214 class KeyFrameWindow : public BC_Window
215 {
216 public:
217         KeyFrameWindow(MWindow *mwindow,
218                 KeyFrameThread *thread,
219                 int x,
220                 int y,
221                 char *title);
222         void create_objects();
223         int resize_event(int w, int h);
224
225 #ifdef EDIT_KEYFRAME
226
227 // List of parameters, values, & whether the parameter is defined by the current keyframe.
228         KeyFrameList *keyframe_list;
229 // The text area of the plugin
230 //      KeyFrameText *keyframe_text;
231 // Value text of the current parameter
232         KeyFrameValue *value_text;
233         KeyFrameAll *all_toggle;
234 #endif
235         
236         KeyFramePresetsList *preset_list;
237         KeyFramePresetsText *preset_text;
238         KeyFramePresetsDelete *delete_preset;
239         KeyFramePresetsSave *save_preset;
240         KeyFramePresetsApply *apply_preset;
241
242 #ifdef EDIT_KEYFRAME
243
244         BC_Title *title1;
245 //      BC_Title *title2;
246         BC_Title *title3;
247 #endif
248
249         BC_Title *title4;
250         BC_Title *title5;
251
252         MWindow *mwindow;
253         KeyFrameThread *thread;
254 };
255
256
257
258
259 #endif
260
261
262
263
264