4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
31 #include "colorpicker.h"
38 class TitleFontTumble;
39 class TitleSizeTumble;
46 class TitleColorButton;
47 class TitleOutlineColorButton;
48 class TitleDropShadow;
63 class TitleRight;class TitleTop;
66 class TitleColorThread;
69 class TitleTimecodeFormat;
72 class TitleBackground;
73 class TitleBackgroundPath;
74 class TitleLoopPlayback;
77 class TitleCurSubMenu;
78 class TitleCurSubMenuItem;
79 class TitleFontsPopup;
80 class TitleColorPopup;
83 class TitleWindow : public PluginClientWindow
86 TitleWindow(TitleMain *client);
89 void create_objects();
90 int resize_event(int w, int h);
91 int grab_event(XEvent *event);
93 void update_justification();
98 void check_style(const char *font_name, int update);
99 int insert_ibeam(const char *txt, int ofs=0);
100 void done_event(int result);
101 void send_configure_change();
102 int check_configure_change(int ret);
106 BC_Title *font_title;
108 TitleFontTumble *font_tumbler;
117 BC_Title *dropshadow_title;
118 TitleDropShadow *dropshadow;
119 BC_Title *outline_title;
120 TitleOutline *outline;
121 BC_Title *stroker_title;
122 TitleStroker *stroker;
123 BC_Title *style_title;
127 TitleCurPopup *cur_popup;
128 TitleFontsPopup *fonts_popup;
129 TitleColorPopup *color_popup;
130 TitlePngPopup *png_popup;
132 int color_x, color_y;
133 int outline_color_x, outline_color_y;
134 int drag_dx, drag_dy, dragging;
135 int cur_ibeam, pending_config;
137 BC_Title *size_title;
139 TitleSizeTumble *size_tumbler;
140 BC_Title *pitch_title;
142 BC_Title *encoding_title;
143 TitleEncoding *encoding;
144 TitleColorButton *color_button;
145 TitleColorThread *color_thread;
146 TitleOutlineColorButton *outline_color_button;
147 TitleColorThread *outline_color_thread;
148 BC_Title *motion_title;
150 TitleLinePitch *line_pitch;
152 BC_Title *fadein_title;
154 BC_Title *fadeout_title;
156 BC_Title *text_title;
158 TitleTextChars *text_chars;
159 TitleTextBfrSz *text_bfrsz;
160 BC_Title *justify_title;
167 BC_Title *speed_title;
169 TitleTimecode *timecode;
170 TitleTimecodeFormat *timecode_format;
171 TitleBackground *background;
172 TitleBackgroundPath *background_path;
173 BrowseButton *background_browse;
174 TitleLoopPlayback *loop_playback;
177 ArrayList<BC_ListBoxItem*> sizes;
178 ArrayList<BC_ListBoxItem*> encodings;
179 ArrayList<BC_ListBoxItem*> paths;
180 ArrayList<BC_ListBoxItem*> fonts;
184 class TitleFontTumble : public BC_Tumbler
187 TitleFontTumble(TitleMain *client, TitleWindow *window, int x, int y);
189 int handle_up_event();
190 int handle_down_event();
197 class TitleSizeTumble : public BC_Tumbler
200 TitleSizeTumble(TitleMain *client, TitleWindow *window, int x, int y);
202 int handle_up_event();
203 int handle_down_event();
211 class TitleItalic : public BC_CheckBox
214 TitleItalic(TitleMain *client, TitleWindow *window, int x, int y);
219 class TitleBold : public BC_CheckBox
222 TitleBold(TitleMain *client, TitleWindow *window, int x, int y);
227 class TitleDrag : public BC_CheckBox
230 TitleDrag(TitleMain *client, TitleWindow *window, int x, int y);
237 class TitleSize : public BC_PopupTextBox
240 TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text);
243 void update(int size);
248 class TitlePitch : public BC_TumbleTextBox
251 TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value);
260 class TitleEncoding : public BC_PopupTextBox
263 TitleEncoding(TitleMain *client, TitleWindow *window, int x, int y, char *text);
270 class TitleColorButton : public BC_GenericButton
273 TitleColorButton(TitleMain *client, TitleWindow *window, int x, int y);
278 class TitleOutlineColorButton : public BC_GenericButton
281 TitleOutlineColorButton(TitleMain *client, TitleWindow *window, int x, int y);
287 class TitleMotion : public BC_PopupTextBox
290 TitleMotion(TitleMain *client, TitleWindow *window, int x, int y);
295 class TitleLoop : public BC_CheckBox
298 TitleLoop(TitleMain *client, TitleWindow *window, int x, int y);
303 class TitleLinePitch : public BC_CheckBox
306 TitleLinePitch(TitleMain *client, TitleWindow *window, int x, int y);
312 class TitleTimecode : public BC_CheckBox
315 TitleTimecode(TitleMain *client, TitleWindow *window, int x, int y);
321 class TitleTimecodeFormat : public BC_PopupMenu
324 TitleTimecodeFormat(TitleMain *client, TitleWindow *window, int x, int y, const char *text);
325 void create_objects();
326 int update(int timecode_format);
332 class TitleFade : public BC_TextBox
335 TitleFade(TitleMain *client, TitleWindow *window, double *value, int x, int y);
341 class TitleFont : public BC_PopupTextBox
344 TitleFont(TitleMain *client, TitleWindow *window, int x, int y);
349 class TitleText : public BC_ScrollTextBox
352 TitleText(TitleMain *client,
359 int button_press_event();
363 class TitleTextChars : public BC_Title
367 TitleTextChars(int x, int y, int w);
370 class TitleTextBfrSz : public BC_Title
374 TitleTextBfrSz(int x, int y, int w);
378 class TitleX : public BC_TumbleTextBox
381 TitleX(TitleMain *client, TitleWindow *window, int x, int y);
386 class TitleY : public BC_TumbleTextBox
389 TitleY(TitleMain *client, TitleWindow *window, int x, int y);
394 class TitleW : public BC_TumbleTextBox
397 TitleW(TitleMain *client, TitleWindow *window, int x, int y);
402 class TitleH : public BC_TumbleTextBox
405 TitleH(TitleMain *client, TitleWindow *window, int x, int y);
411 class TitleDropShadow : public BC_TumbleTextBox
414 TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y);
420 class TitleOutline : public BC_TumbleTextBox
423 TitleOutline(TitleMain *client, TitleWindow *window, int x, int y);
429 class TitleStroker : public BC_TumbleTextBox
432 TitleStroker(TitleMain *client, TitleWindow *window, int x, int y);
438 class TitleSpeed : public BC_TumbleTextBox
441 TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y);
447 class TitleLeft : public BC_Radial
450 TitleLeft(TitleMain *client, TitleWindow *window, int x, int y);
455 class TitleCenter : public BC_Radial
458 TitleCenter(TitleMain *client, TitleWindow *window, int x, int y);
463 class TitleRight : public BC_Radial
466 TitleRight(TitleMain *client, TitleWindow *window, int x, int y);
472 class TitleTop : public BC_Radial
475 TitleTop(TitleMain *client, TitleWindow *window, int x, int y);
480 class TitleMid : public BC_Radial
483 TitleMid(TitleMain *client, TitleWindow *window, int x, int y);
488 class TitleBottom : public BC_Radial
491 TitleBottom(TitleMain *client, TitleWindow *window, int x, int y);
496 class TitleColorThread : public ColorPicker
499 TitleColorThread(TitleMain *client, TitleWindow *window, int is_outline);
500 virtual int handle_new_color(int output, int alpha);
505 class TitleBackground : public BC_CheckBox
508 TitleBackground(TitleMain *client, TitleWindow *window, int x, int y);
513 class TitleBackgroundPath : public BC_TextBox
516 TitleBackgroundPath(TitleMain *client, TitleWindow *window, int x, int y);
521 class TitleLoopPlayback : public BC_CheckBox
524 TitleLoopPlayback(TitleMain *client, TitleWindow *window, int x, int y);
531 class TitleCurPopup : public BC_PopupMenu
534 TitleCurPopup(TitleMain *client, TitleWindow *window);
537 void create_objects();
543 class TitleCurItem : public BC_MenuItem
546 TitleCurItem(TitleCurPopup *popup, const char *text);
549 TitleCurPopup *popup;
552 enum { POPUP_OFFSET=-1, POPUP_NONE=0, POPUP_FONT, POPUP_COLOR, POPUP_PNG, };
554 class TitleCurSubMenu : public BC_SubMenu
557 TitleCurSubMenu(TitleCurItem *cur_item);
559 void add_subitemx(int popup_type, va_list ap, const char *fmt);
560 void add_subitem(int popup_type, const char *fmt,...) { va_list ap;
561 va_start(ap, fmt); add_subitemx(popup_type, ap, fmt); va_end(ap);
563 void add_subitem(const char *fmt,...) { va_list ap;
564 va_start(ap, fmt); add_subitemx(POPUP_NONE, ap, fmt); va_end(ap);
566 TitleCurItem *cur_item;
569 class TitleCurSubMenuItem : public BC_MenuItem
572 TitleCurSubMenuItem(TitleCurSubMenu *submenu, const char *text, int popup_type);
573 ~TitleCurSubMenuItem();
576 TitleCurSubMenu *submenu;
580 class TitleFontsPopup : public BC_ListBox
583 TitleFontsPopup(TitleMain *client, TitleWindow *window);
585 int keypress_event();
587 int show_tooltip(const char *text, int x,int y, int w,int h) {
588 return gui_tooltip(text);
595 class TitleColorPopup : public ColorPicker
598 TitleColorPopup(TitleMain *client, TitleWindow *window);
600 int handle_new_color(int output, int alpha);
601 void handle_done_event(int result);
609 class TitlePngPopup : public BC_DialogThread
612 TitlePngPopup(TitleMain *client, TitleWindow *window);
615 void handle_done_event(int result);
616 BC_Window* new_gui();