dd9e9c51ac863c23743d22da2a010b99d0553529
[goodguy/history.git] / cinelerra-5.1 / plugins / titler / titlerwindow.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 "titler.h"
35
36
37
38
39
40 class TitleFontTumble;
41 class TitleSizeTumble;
42 class TitleItalic;
43 class TitleBold;
44 class TitleDrag;
45 class TitleSize;
46 class TitlePitch;
47 class TitleEncoding;
48 class TitleColorButton;
49 class TitleOutlineColorButton;
50 class TitleDropShadow;
51 class TitleMotion;
52 class TitleLoop;
53 class TitleLinePitch;
54 class TitleFade;
55 class TitleFont;
56 class TitleText;
57 class TitleX;
58 class TitleY;
59 class TitleW;
60 class TitleH;
61 class TitleLeft;
62 class TitleCenter;
63 class TitleRight;class TitleTop;
64 class TitleMid;
65 class TitleBottom;
66 class TitleColorThread;
67 class TitleSpeed;
68 class TitleTimecode;
69 class TitleTimecodeFormat;
70 class TitleOutline;
71 class TitleStroker;
72 class TitleBackground;
73 class TitleBackgroundPath;
74 class TitleLoopPlayback;
75 class TitleCurPopup;
76 class TitleCurItem;
77 class TitleCurSubMenu;
78 class TitleCurSubMenuItem;
79 class TitleFontsPopup;
80
81 class TitleWindow : public PluginClientWindow
82 {
83 public:
84         TitleWindow(TitleMain *client);
85         ~TitleWindow();
86
87         void create_objects();
88         int resize_event(int w, int h);
89         int grab_event(XEvent *event);
90         void update_color();
91         void update_justification();
92         void update();
93         void previous_font();
94         void next_font();
95         int insert_ibeam(const char *txt, int adv);
96
97         TitleMain *client;
98
99         BC_Title *font_title;
100         TitleFont *font;
101         TitleFontTumble *font_tumbler;
102         BC_Title *x_title;
103         TitleX *title_x;
104         BC_Title *y_title;
105         TitleY *title_y;
106         BC_Title *w_title;
107         TitleW *title_w;
108         BC_Title *h_title;
109         TitleH *title_h;
110         BC_Title *dropshadow_title;
111         TitleDropShadow *dropshadow;
112         BC_Title *outline_title;
113         TitleOutline *outline;
114         BC_Title *stroker_title;
115         TitleStroker *stroker;
116         BC_Title *style_title;
117         TitleItalic *italic;
118         TitleBold *bold;
119         TitleDrag *drag;
120         TitleCurPopup *cur_popup;
121         TitleFontsPopup *fonts_popup;
122
123         int color_x, color_y;
124         int outline_color_x, outline_color_y;
125         int drag_dx, drag_dy, dragging;
126         int cur_ibeam;
127
128         BC_Title *size_title;
129         TitleSize *size;
130         TitleSizeTumble *size_tumbler;
131         BC_Title *pitch_title;
132         TitlePitch *pitch;
133         BC_Title *encoding_title;
134         TitleEncoding *encoding;
135         TitleColorButton *color_button;
136         TitleColorThread *color_thread;
137         TitleOutlineColorButton *outline_color_button;
138         TitleColorThread *outline_color_thread;
139         BC_Title *motion_title;
140         TitleMotion *motion;
141         TitleLinePitch *line_pitch;
142         TitleLoop *loop;
143         BC_Title *fadein_title;
144         TitleFade *fade_in;
145         BC_Title *fadeout_title;
146         TitleFade *fade_out;
147         BC_Title *text_title;
148         TitleText *text;
149         BC_Title *justify_title;
150         TitleLeft *left;
151         TitleCenter *center;
152         TitleRight *right;
153         TitleTop *top;
154         TitleMid *mid;
155         TitleBottom *bottom;
156         BC_Title *speed_title;
157         TitleSpeed *speed;
158         TitleTimecode *timecode;
159         TitleTimecodeFormat *timecode_format;
160         TitleBackground *background;
161         TitleBackgroundPath *background_path;
162         TitleLoopPlayback *loop_playback;
163
164 // Color preview
165         ArrayList<BC_ListBoxItem*> sizes;
166         ArrayList<BC_ListBoxItem*> encodings;
167         ArrayList<BC_ListBoxItem*> paths;
168         ArrayList<BC_ListBoxItem*> fonts;
169 };
170
171
172 class TitleFontTumble : public BC_Tumbler
173 {
174 public:
175         TitleFontTumble(TitleMain *client, TitleWindow *window, int x, int y);
176
177         int handle_up_event();
178         int handle_down_event();
179
180         TitleMain *client;
181         TitleWindow *window;
182 };
183
184
185 class TitleSizeTumble : public BC_Tumbler
186 {
187 public:
188         TitleSizeTumble(TitleMain *client, TitleWindow *window, int x, int y);
189
190         int handle_up_event();
191         int handle_down_event();
192
193         TitleMain *client;
194         TitleWindow *window;
195 };
196
197
198
199 class TitleItalic : public BC_CheckBox
200 {
201 public:
202         TitleItalic(TitleMain *client, TitleWindow *window, int x, int y);
203         int handle_event();
204         TitleMain *client;
205         TitleWindow *window;
206 };
207 class TitleBold : public BC_CheckBox
208 {
209 public:
210         TitleBold(TitleMain *client, TitleWindow *window, int x, int y);
211         int handle_event();
212         TitleMain *client;
213         TitleWindow *window;
214 };
215 class TitleDrag : public BC_CheckBox
216 {
217 public:
218         TitleDrag(TitleMain *client, TitleWindow *window, int x, int y);
219         int handle_event();
220         TitleMain *client;
221         TitleWindow *window;
222 };
223
224
225 class TitleSize : public BC_PopupTextBox
226 {
227 public:
228         TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text);
229         ~TitleSize();
230         int handle_event();
231         void update(int size);
232         TitleMain *client;
233         TitleWindow *window;
234 };
235
236 class TitlePitch : public BC_TumbleTextBox
237 {
238 public:
239         TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value);
240         ~TitlePitch();
241         int handle_event();
242
243         int *value;
244         TitleMain *client;
245         TitleWindow *window;
246 };
247
248 class TitleEncoding : public BC_PopupTextBox
249 {
250 public:
251         TitleEncoding(TitleMain *client, TitleWindow *window, int x, int y, char *text);
252         ~TitleEncoding();
253         int handle_event();
254         TitleMain *client;
255         TitleWindow *window;
256 };
257
258 class TitleColorButton : public BC_GenericButton
259 {
260 public:
261         TitleColorButton(TitleMain *client, TitleWindow *window, int x, int y);
262         int handle_event();
263         TitleMain *client;
264         TitleWindow *window;
265 };
266 class TitleOutlineColorButton : public BC_GenericButton
267 {
268 public:
269         TitleOutlineColorButton(TitleMain *client, TitleWindow *window, int x, int y);
270         int handle_event();
271         TitleMain *client;
272         TitleWindow *window;
273 };
274
275 class TitleMotion : public BC_PopupTextBox
276 {
277 public:
278         TitleMotion(TitleMain *client, TitleWindow *window, int x, int y);
279         int handle_event();
280         TitleMain *client;
281         TitleWindow *window;
282 };
283 class TitleLoop : public BC_CheckBox
284 {
285 public:
286         TitleLoop(TitleMain *client, int x, int y);
287         int handle_event();
288         TitleMain *client;
289         TitleWindow *window;
290 };
291 class TitleLinePitch : public BC_CheckBox
292 {
293 public:
294         TitleLinePitch(TitleMain *client, int x, int y);
295         int handle_event();
296         TitleMain *client;
297         TitleWindow *window;
298 };
299
300 class TitleTimecode : public BC_CheckBox
301 {
302 public:
303         TitleTimecode(TitleMain *client, int x, int y);
304         int handle_event();
305         TitleMain *client;
306 };
307
308 class TitleTimecodeFormat : public BC_PopupMenu
309 {
310 public:
311         TitleTimecodeFormat(TitleMain *client, int x, int y, const char *text);
312         void create_objects();
313         int update(int timecode_format);
314         int handle_event();
315         TitleMain *client;
316 };
317
318 class TitleFade : public BC_TextBox
319 {
320 public:
321         TitleFade(TitleMain *client, TitleWindow *window, double *value, int x, int y);
322         int handle_event();
323         TitleMain *client;
324         TitleWindow *window;
325         double *value;
326 };
327 class TitleFont : public BC_PopupTextBox
328 {
329 public:
330         TitleFont(TitleMain *client, TitleWindow *window, int x, int y);
331         int handle_event();
332         TitleMain *client;
333         TitleWindow *window;
334 };
335 class TitleText : public BC_ScrollTextBox
336 {
337 public:
338         TitleText(TitleMain *client,
339                 TitleWindow *window,
340                 int x,
341                 int y,
342                 int w,
343                 int h);
344         int handle_event();
345         int button_press_event();
346         TitleMain *client;
347         TitleWindow *window;
348 };
349 class TitleX : public BC_TumbleTextBox
350 {
351 public:
352         TitleX(TitleMain *client, TitleWindow *window, int x, int y);
353         int handle_event();
354         TitleMain *client;
355         TitleWindow *window;
356 };
357 class TitleY : public BC_TumbleTextBox
358 {
359 public:
360         TitleY(TitleMain *client, TitleWindow *window, int x, int y);
361         int handle_event();
362         TitleMain *client;
363         TitleWindow *window;
364 };
365 class TitleW : public BC_TumbleTextBox
366 {
367 public:
368         TitleW(TitleMain *client, TitleWindow *window, int x, int y);
369         int handle_event();
370         TitleMain *client;
371         TitleWindow *window;
372 };
373 class TitleH : public BC_TumbleTextBox
374 {
375 public:
376         TitleH(TitleMain *client, TitleWindow *window, int x, int y);
377         int handle_event();
378         TitleMain *client;
379         TitleWindow *window;
380 };
381
382 class TitleDropShadow : public BC_TumbleTextBox
383 {
384 public:
385         TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y);
386         int handle_event();
387         TitleMain *client;
388         TitleWindow *window;
389 };
390
391 class TitleOutline : public BC_TumbleTextBox
392 {
393 public:
394         TitleOutline(TitleMain *client, TitleWindow *window, int x, int y);
395         int handle_event();
396         TitleMain *client;
397         TitleWindow *window;
398 };
399
400 class TitleStroker : public BC_TumbleTextBox
401 {
402 public:
403         TitleStroker(TitleMain *client, TitleWindow *window, int x, int y);
404         int handle_event();
405         TitleMain *client;
406         TitleWindow *window;
407 };
408
409 class TitleSpeed : public BC_TumbleTextBox
410 {
411 public:
412         TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y);
413         int handle_event();
414         TitleMain *client;
415 };
416
417 class TitleLeft : public BC_Radial
418 {
419 public:
420         TitleLeft(TitleMain *client, TitleWindow *window, int x, int y);
421         int handle_event();
422         TitleMain *client;
423         TitleWindow *window;
424 };
425 class TitleCenter : public BC_Radial
426 {
427 public:
428         TitleCenter(TitleMain *client, TitleWindow *window, int x, int y);
429         int handle_event();
430         TitleMain *client;
431         TitleWindow *window;
432 };
433 class TitleRight : public BC_Radial
434 {
435 public:
436         TitleRight(TitleMain *client, TitleWindow *window, int x, int y);
437         int handle_event();
438         TitleMain *client;
439         TitleWindow *window;
440 };
441
442 class TitleTop : public BC_Radial
443 {
444 public:
445         TitleTop(TitleMain *client, TitleWindow *window, int x, int y);
446         int handle_event();
447         TitleMain *client;
448         TitleWindow *window;
449 };
450 class TitleMid : public BC_Radial
451 {
452 public:
453         TitleMid(TitleMain *client, TitleWindow *window, int x, int y);
454         int handle_event();
455         TitleMain *client;
456         TitleWindow *window;
457 };
458 class TitleBottom : public BC_Radial
459 {
460 public:
461         TitleBottom(TitleMain *client, TitleWindow *window, int x, int y);
462         int handle_event();
463         TitleMain *client;
464         TitleWindow *window;
465 };
466 class TitleColorThread : public ColorThread
467 {
468 public:
469         TitleColorThread(TitleMain *client, TitleWindow *window, int is_outline);
470         virtual int handle_new_color(int output, int alpha);
471         TitleMain *client;
472         TitleWindow *window;
473         int is_outline;
474 };
475 class TitleBackground : public BC_CheckBox
476 {
477 public:
478         TitleBackground(TitleMain *client, TitleWindow *window, int x, int y);
479         int handle_event();
480         TitleMain *client;
481         TitleWindow *window;
482 };
483 class TitleBackgroundPath : public BC_TextBox
484 {
485 public:
486         TitleBackgroundPath(TitleMain *client, TitleWindow *window, int x, int y);
487         int handle_event();
488         TitleMain *client;
489         TitleWindow *window;
490 };
491 class TitleLoopPlayback : public BC_CheckBox
492 {
493 public:
494         TitleLoopPlayback(TitleMain *client, int x, int y);
495         int handle_event();
496         TitleMain *client;
497         TitleWindow *window;
498 };
499
500
501 class TitleCurPopup : public BC_PopupMenu
502 {
503 public:
504         TitleCurPopup(TitleMain *client, TitleWindow *window);
505
506         int handle_event();
507         void create_objects();
508
509         TitleMain *client;
510         TitleWindow *window;
511 };
512
513 class TitleCurItem : public BC_MenuItem
514 {
515 public:
516         TitleCurItem(TitleCurPopup *popup, const char *text);
517
518         int handle_event();
519         TitleCurPopup *popup;
520 };
521
522 class TitleCurSubMenu : public BC_SubMenu
523 {
524 public:
525         TitleCurSubMenu(TitleCurItem *cur_item);
526         ~TitleCurSubMenu();
527
528         TitleCurItem *cur_item;
529 };
530
531 class TitleCurSubMenuItem : public BC_MenuItem
532 {
533 public:
534         TitleCurSubMenuItem(TitleCurSubMenu *submenu, const char *text);
535         ~TitleCurSubMenuItem();
536         int handle_event();
537
538         TitleCurSubMenu *submenu;
539 };
540
541 class TitleFontsPopup : public BC_ListBox
542 {
543 public:
544         TitleFontsPopup(TitleMain *client, TitleWindow *window);
545         ~TitleFontsPopup();
546         int handle_event();
547
548         TitleMain *client;
549         TitleWindow *window;
550 };
551
552 #endif