initial commit
[goodguy/history.git] / cinelerra-5.0 / plugins / titler / titlewindow.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 TITLEWINDOW_H
23 #define TITLEWINDOW_H
24
25 #include "guicast.h"
26
27 class TitleThread;
28 class TitleWindow;
29 class TitleInterlace;
30
31 #include "colorpicker.h"
32 #include "filexml.h"
33 #include "mutex.h"
34 #include "title.h"
35
36
37
38
39
40 class TitleFontTumble;
41 class TitleSizeTumble;
42 class TitleItalic;
43 class TitleBold;
44 class TitleSize;
45 class TitlePitch;
46 class TitleEncoding;
47 class TitleColorButton;
48 class TitleDropShadow;
49 class TitleMotion;
50 class TitleLoop;
51 class TitleLinePitch;
52 class TitleFade;
53 class TitleFont;
54 class TitleText;
55 class TitleX;
56 class TitleY;
57 class TitleLeft;
58 class TitleCenter;
59 class TitleRight;class TitleTop;
60 class TitleMid;
61 class TitleBottom;
62 class TitleColorThread;
63 class TitleSpeed;
64 class TitleTimecode;
65 class TitleTimecodeFormat;
66 class TitleOutline;
67
68 class TitleWindow : public PluginClientWindow
69 {
70 public:
71         TitleWindow(TitleMain *client);
72         ~TitleWindow();
73
74         void create_objects();
75         int resize_event(int w, int h);
76         void update_color();
77         void update_justification();
78         void update();
79         void previous_font();
80         void next_font();
81
82         TitleMain *client;
83
84         BC_Title *font_title;
85         TitleFont *font;
86         TitleFontTumble *font_tumbler;
87         BC_Title *x_title;
88         TitleX *title_x;
89         BC_Title *y_title;
90         TitleY *title_y;
91         BC_Title *dropshadow_title;
92         TitleDropShadow *dropshadow;
93         BC_Title *outline_title;
94         TitleOutline *outline;
95         BC_Title *style_title;
96         TitleItalic *italic;
97         TitleBold *bold;
98
99
100         int color_x, color_y;
101         int outline_color_x, outline_color_y;
102         BC_Title *size_title;
103         TitleSize *size;
104         TitleSizeTumble *size_tumbler;
105         BC_Title *pitch_title;
106         TitlePitch *pitch;
107         BC_Title *encoding_title;
108         TitleEncoding *encoding;
109         TitleColorButton *color_button;
110         TitleColorThread *color_thread;
111         TitleColorButton *outline_color_button;
112         TitleColorThread *outline_color_thread;
113         BC_Title *motion_title;
114         TitleMotion *motion;
115         TitleLinePitch *line_pitch;
116         TitleLoop *loop;
117         BC_Title *fadein_title;
118         TitleFade *fade_in;
119         BC_Title *fadeout_title;
120         TitleFade *fade_out;
121         BC_Title *text_title;
122         TitleText *text;
123         BC_Title *justify_title;
124         TitleLeft *left;
125         TitleCenter *center;
126         TitleRight *right;
127         TitleTop *top;
128         TitleMid *mid;
129         TitleBottom *bottom;
130         BC_Title *speed_title;
131         TitleSpeed *speed;
132         TitleTimecode *timecode;
133         TitleTimecodeFormat *timecode_format;
134
135 // Color preview
136         ArrayList<BC_ListBoxItem*> sizes;
137         ArrayList<BC_ListBoxItem*> encodings;
138         ArrayList<BC_ListBoxItem*> paths;
139         ArrayList<BC_ListBoxItem*> fonts;
140 };
141
142
143 class TitleFontTumble : public BC_Tumbler
144 {
145 public:
146         TitleFontTumble(TitleMain *client, TitleWindow *window, int x, int y);
147
148         int handle_up_event();
149         int handle_down_event();
150
151         TitleMain *client;
152         TitleWindow *window;
153 };
154
155
156 class TitleSizeTumble : public BC_Tumbler
157 {
158 public:
159         TitleSizeTumble(TitleMain *client, TitleWindow *window, int x, int y);
160
161         int handle_up_event();
162         int handle_down_event();
163
164         TitleMain *client;
165         TitleWindow *window;
166 };
167
168
169
170 class TitleItalic : public BC_CheckBox
171 {
172 public:
173         TitleItalic(TitleMain *client, TitleWindow *window, int x, int y);
174         int handle_event();
175         TitleMain *client;
176         TitleWindow *window;
177 };
178 class TitleBold : public BC_CheckBox
179 {
180 public:
181         TitleBold(TitleMain *client, TitleWindow *window, int x, int y);
182         int handle_event();
183         TitleMain *client;
184         TitleWindow *window;
185 };
186
187
188 class TitleSize : public BC_PopupTextBox
189 {
190 public:
191         TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text);
192         ~TitleSize();
193         int handle_event();
194         void update(int size);
195         TitleMain *client;
196         TitleWindow *window;
197 };
198
199 class TitlePitch : public BC_TumbleTextBox
200 {
201 public:
202         TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value);
203         ~TitlePitch();
204         int handle_event();
205
206         int *value;
207         TitleMain *client;
208         TitleWindow *window;
209 };
210
211 class TitleEncoding : public BC_PopupTextBox
212 {
213 public:
214         TitleEncoding(TitleMain *client, TitleWindow *window, int x, int y, char *text);
215         ~TitleEncoding();
216         int handle_event();
217         TitleMain *client;
218         TitleWindow *window;
219 };
220
221 class TitleColorButton : public BC_GenericButton
222 {
223 public:
224         TitleColorButton(TitleMain *client,
225                 TitleWindow *window,
226                 int x,
227                 int y,
228                 int is_outline);
229         int handle_event();
230         TitleMain *client;
231         TitleWindow *window;
232         int is_outline;
233 };
234
235 class TitleMotion : public BC_PopupTextBox
236 {
237 public:
238         TitleMotion(TitleMain *client, TitleWindow *window, int x, int y);
239         int handle_event();
240         TitleMain *client;
241         TitleWindow *window;
242 };
243 class TitleLoop : public BC_CheckBox
244 {
245 public:
246         TitleLoop(TitleMain *client, int x, int y);
247         int handle_event();
248         TitleMain *client;
249         TitleWindow *window;
250 };
251 class TitleLinePitch : public BC_CheckBox
252 {
253 public:
254         TitleLinePitch(TitleMain *client, int x, int y);
255         int handle_event();
256         TitleMain *client;
257         TitleWindow *window;
258 };
259
260 class TitleTimecode : public BC_CheckBox
261 {
262 public:
263         TitleTimecode(TitleMain *client, int x, int y);
264         int handle_event();
265         TitleMain *client;
266 };
267
268 class TitleTimecodeFormat : public BC_PopupMenu
269 {
270 public:
271         TitleTimecodeFormat(TitleMain *client, int x, int y, const char *text);
272         void create_objects();
273         int update(int timecode_format);
274         int handle_event();
275         TitleMain *client;
276 };
277
278 class TitleFade : public BC_TextBox
279 {
280 public:
281         TitleFade(TitleMain *client, TitleWindow *window, double *value, int x, int y);
282         int handle_event();
283         TitleMain *client;
284         TitleWindow *window;
285         double *value;
286 };
287 class TitleFont : public BC_PopupTextBox
288 {
289 public:
290         TitleFont(TitleMain *client, TitleWindow *window, int x, int y);
291         int handle_event();
292         TitleMain *client;
293         TitleWindow *window;
294 };
295 class TitleText : public BC_ScrollTextBox
296 {
297 public:
298         TitleText(TitleMain *client,
299                 TitleWindow *window,
300                 int x,
301                 int y,
302                 int w,
303                 int h);
304         int handle_event();
305         TitleMain *client;
306         TitleWindow *window;
307 };
308 class TitleX : public BC_TumbleTextBox
309 {
310 public:
311         TitleX(TitleMain *client, TitleWindow *window, int x, int y);
312         int handle_event();
313         TitleMain *client;
314         TitleWindow *window;
315 };
316 class TitleY : public BC_TumbleTextBox
317 {
318 public:
319         TitleY(TitleMain *client, TitleWindow *window, int x, int y);
320         int handle_event();
321         TitleMain *client;
322         TitleWindow *window;
323 };
324
325 class TitleStrokeW : public BC_TumbleTextBox
326 {
327 public:
328         TitleStrokeW(TitleMain *client, TitleWindow *window, int x, int y);
329         int handle_event();
330         TitleMain *client;
331         TitleWindow *window;
332 };
333
334 class TitleDropShadow : public BC_TumbleTextBox
335 {
336 public:
337         TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y);
338         int handle_event();
339         TitleMain *client;
340         TitleWindow *window;
341 };
342
343 class TitleOutline : public BC_TumbleTextBox
344 {
345 public:
346         TitleOutline(TitleMain *client, TitleWindow *window, int x, int y);
347         int handle_event();
348         TitleMain *client;
349         TitleWindow *window;
350 };
351
352 class TitleSpeed : public BC_TumbleTextBox
353 {
354 public:
355         TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y);
356         int handle_event();
357         TitleMain *client;
358 };
359
360 class TitleLeft : public BC_Radial
361 {
362 public:
363         TitleLeft(TitleMain *client, TitleWindow *window, int x, int y);
364         int handle_event();
365         TitleMain *client;
366         TitleWindow *window;
367 };
368 class TitleCenter : public BC_Radial
369 {
370 public:
371         TitleCenter(TitleMain *client, TitleWindow *window, int x, int y);
372         int handle_event();
373         TitleMain *client;
374         TitleWindow *window;
375 };
376 class TitleRight : public BC_Radial
377 {
378 public:
379         TitleRight(TitleMain *client, TitleWindow *window, int x, int y);
380         int handle_event();
381         TitleMain *client;
382         TitleWindow *window;
383 };
384
385 class TitleTop : public BC_Radial
386 {
387 public:
388         TitleTop(TitleMain *client, TitleWindow *window, int x, int y);
389         int handle_event();
390         TitleMain *client;
391         TitleWindow *window;
392 };
393 class TitleMid : public BC_Radial
394 {
395 public:
396         TitleMid(TitleMain *client, TitleWindow *window, int x, int y);
397         int handle_event();
398         TitleMain *client;
399         TitleWindow *window;
400 };
401 class TitleBottom : public BC_Radial
402 {
403 public:
404         TitleBottom(TitleMain *client, TitleWindow *window, int x, int y);
405         int handle_event();
406         TitleMain *client;
407         TitleWindow *window;
408 };
409
410 class TitleColorThread : public ColorThread
411 {
412 public:
413         TitleColorThread(TitleMain *client, TitleWindow *window, int is_outline);
414         virtual int handle_new_color(int output, int alpha);
415         TitleMain *client;
416         TitleWindow *window;
417         int is_outline;
418 };
419
420
421 class TitleColorStrokeThread : public ColorThread
422 {
423 public:
424         TitleColorStrokeThread(TitleMain *client, TitleWindow *window);
425         int handle_event(int output);
426         TitleMain *client;
427         TitleWindow *window;
428 };
429
430 #endif