Credit Andrew - rest of fix for Arch (and termux) which includes thirdparty/Makefile
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / transitionpopup.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 TRANSITIONPOPUP_H
23 #define TRANSITIONPOPUP_H
24
25 #include "bcdialog.h"
26 #include "guicast.h"
27 #include "mwindowgui.inc"
28 #include "plugin.inc"
29 #include "transition.inc"
30 #include "transitionpopup.inc"
31
32 class TransitionUnitsItem : public BC_MenuItem
33 {
34 public:
35         TransitionUnitsItem(TransitionUnitsPopup *popup, const char *text, int id);
36         ~TransitionUnitsItem();
37
38         int handle_event();
39
40         TransitionUnitsPopup *popup;
41         int id;
42 };
43
44 class TransitionUnitsPopup : public BC_PopupMenu
45 {
46 public:
47         TransitionUnitsPopup(TransitionLengthDialog *gui, int x, int y);
48         ~TransitionUnitsPopup();
49
50         void create_objects();
51
52         TransitionLengthDialog *gui;
53         int units;
54 };
55
56
57 class TransitionLengthThread : public BC_DialogThread
58 {
59 public:
60         TransitionLengthThread(MWindow *mwindow);
61         ~TransitionLengthThread();
62
63         void start(Transition *transition,
64                 double length);
65         BC_Window* new_gui();
66         void handle_close_event(int result);
67         int update(double length);
68
69         MWindow *mwindow;
70
71         Transition *transition;
72         double orig_length;
73         double new_length;
74 };
75
76 class TransitionLengthDialog : public BC_Window
77 {
78 public:
79         TransitionLengthDialog(MWindow *mwindow,
80                 TransitionLengthThread *thread,
81                 int x,
82                 int y);
83         ~TransitionLengthDialog();
84
85         void create_objects();
86         int close_event();
87         void update_text(double length);
88
89         MWindow *mwindow;
90         TransitionLengthThread *thread;
91         TransitionUnitsPopup *units_popup;
92         TransitionLengthText *text;
93         double length;
94 };
95
96 class TransitionLengthText : public BC_TumbleTextBox
97 {
98 public:
99         TransitionLengthText(MWindow *mwindow,
100                 TransitionLengthDialog *gui,
101                 int x,
102                 int y);
103         int handle_event();
104         int handle_up_down(int dir);
105         int handle_up_event();
106         int handle_down_event();
107
108         MWindow *mwindow;
109         TransitionLengthDialog *gui;
110 };
111
112
113 class TransitionPopup : public BC_PopupMenu
114 {
115 public:
116         TransitionPopup(MWindow *mwindow, MWindowGUI *gui);
117         ~TransitionPopup();
118
119         void create_objects();
120         int update(Transition *transition);
121
122 // Acquired through the update command as the plugin currently being operated on
123 // Can't be dereferenced.
124         Transition *transition;
125
126 // Set when the user clicks a transition.
127         MWindow *mwindow;
128         MWindowGUI *gui;
129
130 // Needed for loading updates
131         TransitionPopupOn *on;
132         TransitionPopupShow *show;
133         TransitionPopupAttach *attach;
134         TransitionPopupDetach *detach;
135         TransitionPopupLength *length_item;
136         TransitionLengthThread *length_thread;
137 };
138
139
140 class TransitionPopupAttach : public BC_MenuItem
141 {
142 public:
143         TransitionPopupAttach(MWindow *mwindow, TransitionPopup *popup);
144         ~TransitionPopupAttach();
145
146         int handle_event();
147         MWindow *mwindow;
148         TransitionPopup *popup;
149 };
150
151 class TransitionPopupDetach : public BC_MenuItem
152 {
153 public:
154         TransitionPopupDetach(MWindow *mwindow, TransitionPopup *popup);
155         ~TransitionPopupDetach();
156
157         int handle_event();
158         MWindow *mwindow;
159         TransitionPopup *popup;
160 };
161
162 class TransitionPopupShow : public BC_MenuItem
163 {
164 public:
165         TransitionPopupShow(MWindow *mwindow, TransitionPopup *popup);
166         ~TransitionPopupShow();
167
168         int handle_event();
169         MWindow *mwindow;
170         TransitionPopup *popup;
171 };
172
173 class TransitionPopupOn : public BC_MenuItem
174 {
175 public:
176         TransitionPopupOn(MWindow *mwindow, TransitionPopup *popup);
177         ~TransitionPopupOn();
178
179         int handle_event();
180         MWindow *mwindow;
181         TransitionPopup *popup;
182 };
183
184 class TransitionPopupLength : public BC_MenuItem
185 {
186 public:
187         TransitionPopupLength(MWindow *mwindow, TransitionPopup *popup);
188         ~TransitionPopupLength();
189
190         int handle_event();
191         MWindow *mwindow;
192         TransitionPopup *popup;
193 };
194
195 #endif