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