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"
32 #include "dragcheckbox.h"
39 class TitleFontTumble;
40 class TitleSizeTumble;
48 class TitleColorButton;
49 class TitleOutlineColorButton;
50 class TitleDropShadow;
64 class TitleRight;class TitleTop;
67 class TitleColorThread;
70 class TitleTimecodeFormat;
73 class TitleBackground;
74 class TitleBackgroundPath;
75 class TitleLoopPlayback;
78 class TitleCurSubMenu;
79 class TitleCurSubMenuItem;
80 class TitleFontsPopup;
81 class TitleColorPopup;
84 class TitleWindow : public PluginClientWindow
87 TitleWindow(TitleMain *client);
90 void create_objects();
91 int resize_event(int w, int h);
94 void update_justification();
99 void check_style(const char *font_name, int update);
100 int insert_ibeam(const char *txt, int ofs=0);
101 void done_event(int result);
102 void send_configure_change();
103 int check_configure_change(int ret);
107 BC_Title *font_title;
109 TitleFontTumble *font_tumbler;
118 BC_Title *dropshadow_title;
119 TitleDropShadow *dropshadow;
120 BC_Title *outline_title;
121 TitleOutline *outline;
122 BC_Title *stroker_title;
123 TitleStroker *stroker;
124 BC_Title *style_title;
129 TitleCurPopup *cur_popup;
130 TitleFontsPopup *fonts_popup;
131 TitleColorPopup *color_popup;
132 TitlePngPopup *png_popup;
134 int color_x, color_y;
135 int outline_color_x, outline_color_y;
136 int drag_dx, drag_dy, dragging;
137 int cur_ibeam, pending_config;
139 BC_Title *size_title;
141 TitleSizeTumble *size_tumbler;
142 BC_Title *pitch_title;
144 BC_Title *encoding_title;
145 TitleEncoding *encoding;
146 TitleColorButton *color_button;
147 TitleColorThread *color_thread;
148 TitleOutlineColorButton *outline_color_button;
149 TitleColorThread *outline_color_thread;
150 BC_Title *motion_title;
152 TitleLinePitch *line_pitch;
154 BC_Title *fadein_title;
156 BC_Title *fadeout_title;
158 BC_Title *text_title;
160 TitleTextChars *text_chars;
161 BC_Title *justify_title;
168 BC_Title *speed_title;
170 TitleTimecode *timecode;
171 TitleTimecodeFormat *timecode_format;
172 TitleBackground *background;
173 TitleBackgroundPath *background_path;
174 BrowseButton *background_browse;
175 TitleLoopPlayback *loop_playback;
178 ArrayList<BC_ListBoxItem*> sizes;
179 ArrayList<BC_ListBoxItem*> encodings;
180 ArrayList<BC_ListBoxItem*> paths;
181 ArrayList<BC_ListBoxItem*> fonts;
185 class TitleFontTumble : public BC_Tumbler
188 TitleFontTumble(TitleMain *client, TitleWindow *window, int x, int y);
190 int handle_up_event();
191 int handle_down_event();
198 class TitleSizeTumble : public BC_Tumbler
201 TitleSizeTumble(TitleMain *client, TitleWindow *window, int x, int y);
203 int handle_up_event();
204 int handle_down_event();
211 class TitleAlias : public BC_CheckBox
214 TitleAlias(TitleMain *client, TitleWindow *window, int x, int y);
219 class TitleItalic : public BC_CheckBox
222 TitleItalic(TitleMain *client, TitleWindow *window, int x, int y);
227 class TitleBold : public BC_CheckBox
230 TitleBold(TitleMain *client, TitleWindow *window, int x, int y);
235 class TitleDrag : public DragCheckBox
238 TitleDrag(TitleMain *client, TitleWindow *window, int x, int y);
241 Track *get_drag_track();
242 int64_t get_drag_position();
249 class TitleSize : public BC_PopupTextBox
252 TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text);
255 void update(int size);
260 class TitlePitch : public BC_TumbleTextBox
263 TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value);
272 class TitleEncoding : public BC_PopupTextBox
275 TitleEncoding(TitleMain *client, TitleWindow *window, int x, int y, char *text);
282 class TitleColorButton : public BC_GenericButton
285 TitleColorButton(TitleMain *client, TitleWindow *window, int x, int y);
290 class TitleOutlineColorButton : public BC_GenericButton
293 TitleOutlineColorButton(TitleMain *client, TitleWindow *window, int x, int y);
299 class TitleMotion : public BC_PopupTextBox
302 TitleMotion(TitleMain *client, TitleWindow *window, int x, int y);
307 class TitleLoop : public BC_CheckBox
310 TitleLoop(TitleMain *client, TitleWindow *window, int x, int y);
315 class TitleLinePitch : public BC_CheckBox
318 TitleLinePitch(TitleMain *client, TitleWindow *window, int x, int y);
324 class TitleTimecode : public BC_CheckBox
327 TitleTimecode(TitleMain *client, TitleWindow *window, int x, int y);
333 class TitleTimecodeFormat : public BC_PopupMenu
336 TitleTimecodeFormat(TitleMain *client, TitleWindow *window, int x, int y, const char *text);
337 void create_objects();
338 int update(int timecode_format);
344 class TitleFade : public BC_TextBox
347 TitleFade(TitleMain *client, TitleWindow *window, double *value, int x, int y);
353 class TitleFont : public BC_PopupTextBox
356 TitleFont(TitleMain *client, TitleWindow *window, int x, int y);
361 class TitleText : public BC_ScrollTextBox
364 TitleText(TitleMain *client,
371 int button_press_event();
375 class TitleTextChars : public BC_Title
379 TitleTextChars(int x, int y, int w);
383 class TitleX : public BC_TumbleTextBox
386 TitleX(TitleMain *client, TitleWindow *window, int x, int y);
391 class TitleY : public BC_TumbleTextBox
394 TitleY(TitleMain *client, TitleWindow *window, int x, int y);
399 class TitleW : public BC_TumbleTextBox
402 TitleW(TitleMain *client, TitleWindow *window, int x, int y);
407 class TitleH : public BC_TumbleTextBox
410 TitleH(TitleMain *client, TitleWindow *window, int x, int y);
416 class TitleDropShadow : public BC_TumbleTextBox
419 TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y);
425 class TitleOutline : public BC_TumbleTextBox
428 TitleOutline(TitleMain *client, TitleWindow *window, int x, int y);
434 class TitleStroker : public BC_TumbleTextBox
437 TitleStroker(TitleMain *client, TitleWindow *window, int x, int y);
443 class TitleSpeed : public BC_TumbleTextBox
446 TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y);
452 class TitleLeft : public BC_Radial
455 TitleLeft(TitleMain *client, TitleWindow *window, int x, int y);
460 class TitleCenter : public BC_Radial
463 TitleCenter(TitleMain *client, TitleWindow *window, int x, int y);
468 class TitleRight : public BC_Radial
471 TitleRight(TitleMain *client, TitleWindow *window, int x, int y);
477 class TitleTop : public BC_Radial
480 TitleTop(TitleMain *client, TitleWindow *window, int x, int y);
485 class TitleMid : public BC_Radial
488 TitleMid(TitleMain *client, TitleWindow *window, int x, int y);
493 class TitleBottom : public BC_Radial
496 TitleBottom(TitleMain *client, TitleWindow *window, int x, int y);
501 class TitleColorThread : public ColorPicker
504 TitleColorThread(TitleMain *client, TitleWindow *window, int is_outline);
505 virtual int handle_new_color(int output, int alpha);
506 void handle_done_event(int result);
511 class TitleBackground : public BC_CheckBox
514 TitleBackground(TitleMain *client, TitleWindow *window, int x, int y);
519 class TitleBackgroundPath : public BC_TextBox
522 TitleBackgroundPath(TitleMain *client, TitleWindow *window, int x, int y);
527 class TitleLoopPlayback : public BC_CheckBox
530 TitleLoopPlayback(TitleMain *client, TitleWindow *window, int x, int y);
537 class TitleCurPopup : public BC_PopupMenu
540 TitleCurPopup(TitleMain *client, TitleWindow *window);
543 void create_objects();
549 class TitleCurItem : public BC_MenuItem
552 TitleCurItem(TitleCurPopup *popup, const char *text);
555 TitleCurPopup *popup;
558 enum { POPUP_OFFSET=-1, POPUP_NONE=0, POPUP_FONT, POPUP_COLOR, POPUP_PNG, };
560 class TitleCurSubMenu : public BC_SubMenu
563 TitleCurSubMenu(TitleCurItem *cur_item);
565 void add_subitemx(int popup_type, va_list ap, const char *fmt);
566 void add_subitem(int popup_type, const char *fmt,...) { va_list ap;
567 va_start(ap, fmt); add_subitemx(popup_type, ap, fmt); va_end(ap);
569 void add_subitem(const char *fmt,...) { va_list ap;
570 va_start(ap, fmt); add_subitemx(POPUP_NONE, ap, fmt); va_end(ap);
572 TitleCurItem *cur_item;
575 class TitleCurSubMenuItem : public BC_MenuItem
578 TitleCurSubMenuItem(TitleCurSubMenu *submenu, const char *text, int popup_type);
579 ~TitleCurSubMenuItem();
582 TitleCurSubMenu *submenu;
586 class TitleFontsPopup : public BC_ListBox
589 TitleFontsPopup(TitleMain *client, TitleWindow *window);
591 int keypress_event();
593 int show_tooltip(const char *text, int x,int y, int w,int h) {
594 return gui_tooltip(text);
601 class TitleColorPopup : public ColorPicker
604 TitleColorPopup(TitleMain *client, TitleWindow *window);
606 int handle_new_color(int output, int alpha);
607 void handle_done_event(int result);
615 class TitlePngPopup : public BC_DialogThread
618 TitlePngPopup(TitleMain *client, TitleWindow *window);
621 void handle_done_event(int result);
622 BC_Window* new_gui();