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
29 #include "colorpicker.h"
30 #include "dragcheckbox.h"
37 class TitleFontTumble;
38 class TitleSizeTumble;
46 class TitleResetButton;
47 class TitleColorButton;
48 class TitleOutlineColorButton;
49 class TitleDropShadow;
63 class TitleRight;class TitleTop;
68 class TitleTimecodeFormat;
71 class TitleBackground;
72 class TitleBackgroundPath;
73 class TitleLoopPlayback;
76 class TitleCurSubMenu;
77 class TitleCurSubMenuItem;
78 class TitleFontsPopup;
79 class TitleColorPopup;
82 class TitleWindow : public PluginClientWindow
85 TitleWindow(TitleMain *client);
88 void create_objects();
89 int resize_event(int w, int h);
92 void update_justification();
97 void check_style(const char *font_name, int update);
98 int insert_ibeam(const char *txt, int ofs=0);
99 void done_event(int result);
100 void send_configure_change();
101 int check_configure_change(int ret);
105 BC_Title *font_title;
107 TitleFontTumble *font_tumbler;
116 BC_Title *dropshadow_title;
117 TitleDropShadow *dropshadow;
118 BC_Title *outline_title;
119 TitleOutline *outline;
120 BC_Title *stroker_title;
121 TitleStroker *stroker;
122 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 TitleResetButton *reset_button;
145 BC_Title *color_button_title;
146 TitleColorButton *color_button;
147 BC_Title *outline_button_title;
148 TitleOutlineColorButton *outline_button;
149 BC_Title *motion_title;
151 TitleLinePitch *line_pitch;
153 BC_Title *fadein_title;
155 BC_Title *fadeout_title;
157 BC_Title *text_title;
159 TitleTextChars *text_chars;
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 TitleResetButton : public BC_GenericButton
187 TitleResetButton(TitleMain *client, TitleWindow *window, int x, int y);
197 class TitleFontTumble : public BC_Tumbler
200 TitleFontTumble(TitleMain *client, TitleWindow *window, int x, int y);
202 int handle_up_event();
203 int handle_down_event();
210 class TitleSizeTumble : public BC_Tumbler
213 TitleSizeTumble(TitleMain *client, TitleWindow *window, int x, int y);
215 int handle_up_event();
216 int handle_down_event();
223 class TitleAlias : public BC_CheckBox
226 TitleAlias(TitleMain *client, TitleWindow *window, int x, int y);
231 class TitleItalic : public BC_CheckBox
234 TitleItalic(TitleMain *client, TitleWindow *window, int x, int y);
239 class TitleBold : public BC_CheckBox
242 TitleBold(TitleMain *client, TitleWindow *window, int x, int y);
247 class TitleDrag : public DragCheckBox
250 TitleDrag(TitleMain *client, TitleWindow *window, int x, int y);
253 Track *get_drag_track();
254 int64_t get_drag_position();
261 class TitleSize : public BC_PopupTextBox
264 TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text);
267 void update(int size);
272 class TitlePitch : public BC_TumbleTextBox
275 TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value);
284 class TitleEncoding : public BC_PopupTextBox
287 TitleEncoding(TitleMain *client, TitleWindow *window, int x, int y, char *text);
294 class TitleColorButton : public ColorCircleButton
297 TitleColorButton(TitleMain *client, TitleWindow *window, int x, int y);
298 int handle_new_color(int output, int alpha);
299 void handle_done_event(int result);
303 class TitleOutlineColorButton : public ColorCircleButton
306 TitleOutlineColorButton(TitleMain *client, TitleWindow *window, int x, int y);
307 int handle_new_color(int output, int alpha);
308 void handle_done_event(int result);
313 class TitleMotion : public BC_PopupTextBox
316 TitleMotion(TitleMain *client, TitleWindow *window, int x, int y);
321 class TitleLoop : public BC_CheckBox
324 TitleLoop(TitleMain *client, TitleWindow *window, int x, int y);
329 class TitleLinePitch : public BC_CheckBox
332 TitleLinePitch(TitleMain *client, TitleWindow *window, int x, int y);
338 class TitleTimecode : public BC_CheckBox
341 TitleTimecode(TitleMain *client, TitleWindow *window, int x, int y);
347 class TitleTimecodeFormat : public BC_PopupMenu
350 TitleTimecodeFormat(TitleMain *client, TitleWindow *window,
351 int x, int y, int tw, const char *text);
352 void create_objects();
353 int update(int timecode_format);
359 class TitleFade : public BC_TextBox
362 TitleFade(TitleMain *client, TitleWindow *window, double *value, int x, int y);
368 class TitleFont : public BC_PopupTextBox
371 TitleFont(TitleMain *client, TitleWindow *window, int x, int y);
376 class TitleText : public BC_ScrollTextBox
379 TitleText(TitleMain *client,
386 int button_press_event();
390 class TitleTextChars : public BC_Title
394 TitleTextChars(int x, int y, int w);
398 class TitleX : public BC_TumbleTextBox
401 TitleX(TitleMain *client, TitleWindow *window, int x, int y);
406 class TitleY : public BC_TumbleTextBox
409 TitleY(TitleMain *client, TitleWindow *window, int x, int y);
414 class TitleW : public BC_TumbleTextBox
417 TitleW(TitleMain *client, TitleWindow *window, int x, int y);
422 class TitleH : public BC_TumbleTextBox
425 TitleH(TitleMain *client, TitleWindow *window, int x, int y);
431 class TitleDropShadow : public BC_TumbleTextBox
434 TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y);
440 class TitleOutline : public BC_TumbleTextBox
443 TitleOutline(TitleMain *client, TitleWindow *window, int x, int y);
449 class TitleStroker : public BC_TumbleTextBox
452 TitleStroker(TitleMain *client, TitleWindow *window, int x, int y);
458 class TitleSpeed : public BC_TumbleTextBox
461 TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y);
467 class TitleLeft : public BC_Radial
470 TitleLeft(TitleMain *client, TitleWindow *window, int x, int y);
475 class TitleCenter : public BC_Radial
478 TitleCenter(TitleMain *client, TitleWindow *window, int x, int y);
483 class TitleRight : public BC_Radial
486 TitleRight(TitleMain *client, TitleWindow *window, int x, int y);
492 class TitleTop : public BC_Radial
495 TitleTop(TitleMain *client, TitleWindow *window, int x, int y);
500 class TitleMid : public BC_Radial
503 TitleMid(TitleMain *client, TitleWindow *window, int x, int y);
508 class TitleBottom : public BC_Radial
511 TitleBottom(TitleMain *client, TitleWindow *window, int x, int y);
516 class TitleBackground : public BC_CheckBox
519 TitleBackground(TitleMain *client, TitleWindow *window, int x, int y);
524 class TitleBackgroundPath : public BC_TextBox
527 TitleBackgroundPath(TitleMain *client, TitleWindow *window, int x, int y);
532 class TitleLoopPlayback : public BC_CheckBox
535 TitleLoopPlayback(TitleMain *client, TitleWindow *window, int x, int y);
542 class TitleCurPopup : public BC_PopupMenu
545 TitleCurPopup(TitleMain *client, TitleWindow *window);
548 void create_objects();
554 class TitleCurItem : public BC_MenuItem
557 TitleCurItem(TitleCurPopup *popup, const char *text);
560 TitleCurPopup *popup;
563 enum { POPUP_OFFSET=-1, POPUP_NONE=0, POPUP_FONT, POPUP_COLOR, POPUP_PNG, };
565 class TitleCurSubMenu : public BC_SubMenu
568 TitleCurSubMenu(TitleCurItem *cur_item);
570 void add_subitemx(int popup_type, va_list ap, const char *fmt);
571 void add_subitem(int popup_type, const char *fmt,...) { va_list ap;
572 va_start(ap, fmt); add_subitemx(popup_type, ap, fmt); va_end(ap);
574 void add_subitem(const char *fmt,...) { va_list ap;
575 va_start(ap, fmt); add_subitemx(POPUP_NONE, ap, fmt); va_end(ap);
577 TitleCurItem *cur_item;
580 class TitleCurSubMenuItem : public BC_MenuItem
583 TitleCurSubMenuItem(TitleCurSubMenu *submenu, const char *text, int popup_type);
584 ~TitleCurSubMenuItem();
587 TitleCurSubMenu *submenu;
591 class TitleFontsPopup : public BC_ListBox
594 TitleFontsPopup(TitleMain *client, TitleWindow *window);
596 int keypress_event();
598 int show_tooltip(const char *text, int x,int y, int w,int h) {
599 return gui_tooltip(text);
606 class TitleColorPopup : public ColorPicker
609 TitleColorPopup(TitleMain *client, TitleWindow *window);
611 int handle_new_color(int output, int alpha);
612 void handle_done_event(int result);
620 class TitlePngPopup : public BC_DialogThread
623 TitlePngPopup(TitleMain *client, TitleWindow *window);
626 void handle_done_event(int result);
627 BC_Window* new_gui();