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 TitleColorButton;
47 class TitleOutlineColorButton;
48 class TitleDropShadow;
62 class TitleRight;class TitleTop;
67 class TitleTimecodeFormat;
70 class TitleBackground;
71 class TitleBackgroundPath;
72 class TitleLoopPlayback;
75 class TitleCurSubMenu;
76 class TitleCurSubMenuItem;
77 class TitleFontsPopup;
78 class TitleColorPopup;
81 class TitleWindow : public PluginClientWindow
84 TitleWindow(TitleMain *client);
87 void create_objects();
88 int resize_event(int w, int h);
91 void update_justification();
96 void check_style(const char *font_name, int update);
97 int insert_ibeam(const char *txt, int ofs=0);
98 void done_event(int result);
99 void send_configure_change();
100 int check_configure_change(int ret);
104 BC_Title *font_title;
106 TitleFontTumble *font_tumbler;
115 BC_Title *dropshadow_title;
116 TitleDropShadow *dropshadow;
117 BC_Title *outline_title;
118 TitleOutline *outline;
119 BC_Title *stroker_title;
120 TitleStroker *stroker;
121 BC_Title *style_title;
126 TitleCurPopup *cur_popup;
127 TitleFontsPopup *fonts_popup;
128 TitleColorPopup *color_popup;
129 TitlePngPopup *png_popup;
131 int color_x, color_y;
132 int outline_color_x, outline_color_y;
133 int drag_dx, drag_dy, dragging;
134 int cur_ibeam, pending_config;
136 BC_Title *size_title;
138 TitleSizeTumble *size_tumbler;
139 BC_Title *pitch_title;
141 BC_Title *encoding_title;
142 TitleEncoding *encoding;
143 BC_Title *color_button_title;
144 TitleColorButton *color_button;
145 BC_Title *outline_button_title;
146 TitleOutlineColorButton *outline_button;
147 BC_Title *motion_title;
149 TitleLinePitch *line_pitch;
151 BC_Title *fadein_title;
153 BC_Title *fadeout_title;
155 BC_Title *text_title;
157 TitleTextChars *text_chars;
158 BC_Title *justify_title;
165 BC_Title *speed_title;
167 TitleTimecode *timecode;
168 TitleTimecodeFormat *timecode_format;
169 TitleBackground *background;
170 TitleBackgroundPath *background_path;
171 BrowseButton *background_browse;
172 TitleLoopPlayback *loop_playback;
175 ArrayList<BC_ListBoxItem*> sizes;
176 ArrayList<BC_ListBoxItem*> encodings;
177 ArrayList<BC_ListBoxItem*> paths;
178 ArrayList<BC_ListBoxItem*> fonts;
182 class TitleFontTumble : public BC_Tumbler
185 TitleFontTumble(TitleMain *client, TitleWindow *window, int x, int y);
187 int handle_up_event();
188 int handle_down_event();
195 class TitleSizeTumble : public BC_Tumbler
198 TitleSizeTumble(TitleMain *client, TitleWindow *window, int x, int y);
200 int handle_up_event();
201 int handle_down_event();
208 class TitleAlias : public BC_CheckBox
211 TitleAlias(TitleMain *client, TitleWindow *window, int x, int y);
216 class TitleItalic : public BC_CheckBox
219 TitleItalic(TitleMain *client, TitleWindow *window, int x, int y);
224 class TitleBold : public BC_CheckBox
227 TitleBold(TitleMain *client, TitleWindow *window, int x, int y);
232 class TitleDrag : public DragCheckBox
235 TitleDrag(TitleMain *client, TitleWindow *window, int x, int y);
238 Track *get_drag_track();
239 int64_t get_drag_position();
246 class TitleSize : public BC_PopupTextBox
249 TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text);
252 void update(int size);
257 class TitlePitch : public BC_TumbleTextBox
260 TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value);
269 class TitleEncoding : public BC_PopupTextBox
272 TitleEncoding(TitleMain *client, TitleWindow *window, int x, int y, char *text);
279 class TitleColorButton : public ColorCircleButton
282 TitleColorButton(TitleMain *client, TitleWindow *window, int x, int y);
283 int handle_new_color(int output, int alpha);
284 void handle_done_event(int result);
288 class TitleOutlineColorButton : public ColorCircleButton
291 TitleOutlineColorButton(TitleMain *client, TitleWindow *window, int x, int y);
292 int handle_new_color(int output, int alpha);
293 void handle_done_event(int result);
298 class TitleMotion : public BC_PopupTextBox
301 TitleMotion(TitleMain *client, TitleWindow *window, int x, int y);
306 class TitleLoop : public BC_CheckBox
309 TitleLoop(TitleMain *client, TitleWindow *window, int x, int y);
314 class TitleLinePitch : public BC_CheckBox
317 TitleLinePitch(TitleMain *client, TitleWindow *window, int x, int y);
323 class TitleTimecode : public BC_CheckBox
326 TitleTimecode(TitleMain *client, TitleWindow *window, int x, int y);
332 class TitleTimecodeFormat : public BC_PopupMenu
335 TitleTimecodeFormat(TitleMain *client, TitleWindow *window,
336 int x, int y, int tw, 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 TitleBackground : public BC_CheckBox
504 TitleBackground(TitleMain *client, TitleWindow *window, int x, int y);
509 class TitleBackgroundPath : public BC_TextBox
512 TitleBackgroundPath(TitleMain *client, TitleWindow *window, int x, int y);
517 class TitleLoopPlayback : public BC_CheckBox
520 TitleLoopPlayback(TitleMain *client, TitleWindow *window, int x, int y);
527 class TitleCurPopup : public BC_PopupMenu
530 TitleCurPopup(TitleMain *client, TitleWindow *window);
533 void create_objects();
539 class TitleCurItem : public BC_MenuItem
542 TitleCurItem(TitleCurPopup *popup, const char *text);
545 TitleCurPopup *popup;
548 enum { POPUP_OFFSET=-1, POPUP_NONE=0, POPUP_FONT, POPUP_COLOR, POPUP_PNG, };
550 class TitleCurSubMenu : public BC_SubMenu
553 TitleCurSubMenu(TitleCurItem *cur_item);
555 void add_subitemx(int popup_type, va_list ap, const char *fmt);
556 void add_subitem(int popup_type, const char *fmt,...) { va_list ap;
557 va_start(ap, fmt); add_subitemx(popup_type, ap, fmt); va_end(ap);
559 void add_subitem(const char *fmt,...) { va_list ap;
560 va_start(ap, fmt); add_subitemx(POPUP_NONE, ap, fmt); va_end(ap);
562 TitleCurItem *cur_item;
565 class TitleCurSubMenuItem : public BC_MenuItem
568 TitleCurSubMenuItem(TitleCurSubMenu *submenu, const char *text, int popup_type);
569 ~TitleCurSubMenuItem();
572 TitleCurSubMenu *submenu;
576 class TitleFontsPopup : public BC_ListBox
579 TitleFontsPopup(TitleMain *client, TitleWindow *window);
581 int keypress_event();
583 int show_tooltip(const char *text, int x,int y, int w,int h) {
584 return gui_tooltip(text);
591 class TitleColorPopup : public ColorPicker
594 TitleColorPopup(TitleMain *client, TitleWindow *window);
596 int handle_new_color(int output, int alpha);
597 void handle_done_event(int result);
605 class TitlePngPopup : public BC_DialogThread
608 TitlePngPopup(TitleMain *client, TitleWindow *window);
611 void handle_done_event(int result);
612 BC_Window* new_gui();