prevent popup deactivation while button_down
[goodguy/history.git] / cinelerra-5.0 / cinelerra / editpanel.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 EDITPANEL_H
23 #define EDITPANEL_H
24
25 #include "guicast.h"
26 #include "meterpanel.inc"
27 #include "mwindow.inc"
28
29 class EditPanel;
30
31
32 class EditInPoint : public BC_Button
33 {
34 public:
35         EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
36         ~EditInPoint();
37         int handle_event();
38         int keypress_event();
39         MWindow *mwindow;
40         EditPanel *panel;
41 };
42
43 class EditOutPoint : public BC_Button
44 {
45 public:
46         EditOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
47         ~EditOutPoint();
48         int handle_event();
49         int keypress_event();
50         MWindow *mwindow;
51         EditPanel *panel;
52 };
53
54 class EditDelInPoint : public BC_Button
55 {
56 public:
57         EditDelInPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
58         ~EditDelInPoint();
59         int handle_event();
60         int keypress_event();
61         MWindow *mwindow;
62         EditPanel *panel;
63 };
64
65 class EditDelOutPoint : public BC_Button
66 {
67 public:
68         EditDelOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
69         ~EditDelOutPoint();
70         int handle_event();
71         int keypress_event();
72         MWindow *mwindow;
73         EditPanel *panel;
74 };
75
76 class EditSplice : public BC_Button
77 {
78 public:
79         EditSplice(MWindow *mwindow, EditPanel *panel, int x, int y);
80         ~EditSplice();
81         int handle_event();
82         int keypress_event();
83         MWindow *mwindow;
84         EditPanel *panel;
85 };
86
87 class EditOverwrite : public BC_Button
88 {
89 public:
90         EditOverwrite(MWindow *mwindow, EditPanel *panel, int x, int y);
91         ~EditOverwrite();
92         int handle_event();
93         int keypress_event();
94         MWindow *mwindow;
95         EditPanel *panel;
96 };
97
98 class EditLift : public BC_Button
99 {
100 public:
101         EditLift(MWindow *mwindow, EditPanel *panel, int x, int y);
102         ~EditLift();
103         int handle_event();
104         MWindow *mwindow;
105         EditPanel *panel;
106 };
107
108 class EditExtract : public BC_Button
109 {
110 public:
111         EditExtract(MWindow *mwindow, EditPanel *panel, int x, int y);
112         ~EditExtract();
113         int handle_event();
114         MWindow *mwindow;
115         EditPanel *panel;
116 };
117
118 class EditToClip : public BC_Button
119 {
120 public:
121         EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y);
122         ~EditToClip();
123         int handle_event();
124         int keypress_event();
125         MWindow *mwindow;
126         EditPanel *panel;
127 };
128
129 class EditCut : public BC_Button
130 {
131 public:
132         EditCut(MWindow *mwindow, EditPanel *panel, int x, int y);
133         ~EditCut();
134
135         int keypress_event();
136         int handle_event();
137
138         MWindow *mwindow;
139         EditPanel *panel;
140 };
141
142 class EditCommercial : public BC_Button
143 {
144 public:
145         EditCommercial(MWindow *mwindow, EditPanel *panel, int x, int y);
146         ~EditCommercial();
147
148         int keypress_event();
149         int handle_event();
150
151         MWindow *mwindow;
152         EditPanel *panel;
153 };
154
155 class EditCopy : public BC_Button
156 {
157 public:
158         EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y);
159         ~EditCopy();
160
161         int keypress_event();
162         int handle_event();
163
164         MWindow *mwindow;
165         EditPanel *panel;
166 };
167
168 class EditAppend : public BC_Button
169 {
170 public:
171         EditAppend(MWindow *mwindow, EditPanel *panel, int x, int y);
172         ~EditAppend();
173
174         int handle_event();
175
176         MWindow *mwindow;
177         EditPanel *panel;
178 };
179
180 class EditInsert : public BC_Button
181 {
182 public:
183         EditInsert(MWindow *mwindow, EditPanel *panel, int x, int y);
184         ~EditInsert();
185
186         int handle_event();
187
188         MWindow *mwindow;
189         EditPanel *panel;
190 };
191
192 class EditPaste : public BC_Button
193 {
194 public:
195         EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y);
196         ~EditPaste();
197
198         int keypress_event();
199         int handle_event();
200
201         MWindow *mwindow;
202         EditPanel *panel;
203 };
204
205 class EditTransition : public BC_Button
206 {
207 public:
208         EditTransition(MWindow *mwindow, EditPanel *panel, int x, int y);
209         ~EditTransition();
210         int handle_event();
211         MWindow *mwindow;
212         EditPanel *panel;
213 };
214
215 class EditPresentation : public BC_Button
216 {
217 public:
218         EditPresentation(MWindow *mwindow, EditPanel *panel, int x, int y);
219         ~EditPresentation();
220         int handle_event();
221         MWindow *mwindow;
222         EditPanel *panel;
223 };
224
225 class EditUndo : public BC_Button
226 {
227 public:
228         EditUndo(MWindow *mwindow, EditPanel *panel, int x, int y);
229         ~EditUndo();
230         int keypress_event();
231         int handle_event();
232         MWindow *mwindow;
233         EditPanel *panel;
234 };
235
236 class EditRedo : public BC_Button
237 {
238 public:
239         EditRedo(MWindow *mwindow, EditPanel *panel, int x, int y);
240         ~EditRedo();
241         int keypress_event();
242         int handle_event();
243         MWindow *mwindow;
244         EditPanel *panel;
245 };
246
247 class EditLabelbutton : public BC_Button
248 {
249 public:
250         EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y);
251         ~EditLabelbutton();
252         int keypress_event();
253         int handle_event();
254         MWindow *mwindow;
255         EditPanel *panel;
256 };
257
258 class EditFit : public BC_Button
259 {
260 public:
261         EditFit(MWindow *mwindow, EditPanel *panel, int x, int y);
262         ~EditFit();
263         int keypress_event();
264         int handle_event();
265         MWindow *mwindow;
266         EditPanel *panel;
267 };
268
269 class EditFitAutos : public BC_Button
270 {
271 public:
272         EditFitAutos(MWindow *mwindow, EditPanel *panel, int x, int y);
273         ~EditFitAutos();
274         int keypress_event();
275         int handle_event();
276         MWindow *mwindow;
277         EditPanel *panel;
278 };
279
280
281 class EditPrevLabel : public BC_Button
282 {
283 public:
284         EditPrevLabel(MWindow *mwindow, 
285                 EditPanel *panel, 
286                 int x, 
287                 int y,
288                 int is_mwindow);
289         ~EditPrevLabel();
290
291         int keypress_event();
292         int handle_event();
293
294         MWindow *mwindow;
295         EditPanel *panel;
296         int is_mwindow;
297 };
298
299 class EditNextLabel : public BC_Button
300 {
301 public:
302         EditNextLabel(MWindow *mwindow, 
303                 EditPanel *panel, 
304                 int x, 
305                 int y,
306                 int is_mwindow);
307         ~EditNextLabel();
308
309         int keypress_event();
310         int handle_event();
311
312         MWindow *mwindow;
313         EditPanel *panel;
314         int is_mwindow;
315 };
316
317 class EditPrevEdit : public BC_Button
318 {
319 public:
320         EditPrevEdit(MWindow *mwindow, 
321                 EditPanel *panel, 
322                 int x, 
323                 int y,
324                 int is_mwindow);
325         ~EditPrevEdit();
326
327         int keypress_event();
328         int handle_event();
329
330         MWindow *mwindow;
331         EditPanel *panel;
332         int is_mwindow;
333 };
334
335 class EditNextEdit : public BC_Button
336 {
337 public:
338         EditNextEdit(MWindow *mwindow, 
339                 EditPanel *panel, 
340                 int x, 
341                 int y,
342                 int is_mwindow);
343         ~EditNextEdit();
344
345         int keypress_event();
346         int handle_event();
347
348         MWindow *mwindow;
349         EditPanel *panel;
350         int is_mwindow;
351 };
352
353
354 class ArrowButton : public BC_Toggle
355 {
356 public:
357         ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y);
358         int handle_event();
359         MWindow *mwindow;
360         EditPanel *panel;
361 };
362
363 class IBeamButton : public BC_Toggle
364 {
365 public:
366         IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y);
367         int handle_event();
368         MWindow *mwindow;
369         EditPanel *panel;
370 };
371
372 class KeyFrameButton : public BC_Toggle
373 {
374 public:
375         KeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y);
376         int handle_event();
377         MWindow *mwindow;
378         EditPanel *panel;
379 };
380
381
382 class EditPanel
383 {
384 public:
385         EditPanel(MWindow *mwindow, 
386                 BC_WindowBase *subwindow,
387                 int x, 
388                 int y, 
389                 int editing_mode,   // From edl.inc
390                 int use_editing_mode,
391                 int use_keyframe, 
392                 int use_splice,   // Extra buttons
393                 int use_overwrite,
394                 int use_lift,
395                 int use_extract,
396                 int use_copy,  // Use copy when in EDITING_ARROW
397                 int use_paste, 
398                 int use_undo,
399                 int use_fit, 
400                 int use_labels,
401                 int use_toclip,
402                 int use_meters,
403                 int is_mwindow,
404                 int use_cut,
405                 int use_commerical);
406         ~EditPanel();
407
408         void set_meters(MeterPanel *meter_panel);
409         static int calculate_w(MWindow *mwindow, int use_keyframe, int total_buttons);
410         static int calculate_h(MWindow *mwindow);
411         void update();
412         void delete_buttons();
413         void create_buttons();
414         void reposition_buttons(int x, int y);
415         void create_objects();
416         int get_w();
417         virtual void copy_selection();
418         virtual void splice_selection();
419         virtual void overwrite_selection();
420         virtual void set_inpoint();
421         virtual void set_outpoint();
422         virtual void clear_inpoint();
423         virtual void clear_outpoint();
424         virtual void to_clip();
425         virtual void toggle_label();
426         virtual void prev_label();
427         virtual void next_label();
428         virtual void prev_edit();
429         virtual void next_edit();
430
431         MWindow *mwindow;
432         BC_WindowBase *subwindow;
433         MeterPanel *meter_panel;
434
435         int use_editing_mode;
436         int use_keyframe;
437         int editing_mode;
438         int use_splice;
439         int use_overwrite;
440         int use_lift;
441         int use_extract;
442         int use_paste;
443         int use_undo;
444         int use_fit;
445         int use_copy;
446         int use_labels;
447         int use_toclip;
448         int use_meters;
449         int x, y, x1, y1;
450         int is_mwindow;
451         int use_cut;
452         int use_commercial;
453
454         EditFit *fit;
455         EditFitAutos *fit_autos;
456         EditInPoint *inpoint;
457         EditOutPoint *outpoint;
458 //      EditDelInPoint *delinpoint;
459 //      EditDelOutPoint *deloutpoint;
460         EditSplice *splice;
461         EditOverwrite *overwrite;
462         EditLift *lift;
463         EditExtract *extract;
464         EditToClip *clip;
465         EditCut *cut;
466         EditCommercial *commercial;
467         EditCopy *copy;
468         EditPaste *paste;
469         EditLabelbutton *labelbutton;
470         EditPrevLabel *prevlabel;
471         EditNextLabel *nextlabel;
472         EditPrevEdit *prevedit;
473         EditNextEdit *nextedit;
474         EditUndo *undo;
475         EditRedo *redo;
476         MeterShow *meters;
477         ArrowButton *arrow;
478         IBeamButton *ibeam;
479         KeyFrameButton *keyframe;
480 };
481
482 #endif