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, int x, int y, const char *text);
336 void create_objects();
337 int update(int timecode_format);
343 class TitleFade : public BC_TextBox
346 TitleFade(TitleMain *client, TitleWindow *window, double *value, int x, int y);
352 class TitleFont : public BC_PopupTextBox
355 TitleFont(TitleMain *client, TitleWindow *window, int x, int y);
360 class TitleText : public BC_ScrollTextBox
363 TitleText(TitleMain *client,
370 int button_press_event();
374 class TitleTextChars : public BC_Title
378 TitleTextChars(int x, int y, int w);
382 class TitleX : public BC_TumbleTextBox
385 TitleX(TitleMain *client, TitleWindow *window, int x, int y);
390 class TitleY : public BC_TumbleTextBox
393 TitleY(TitleMain *client, TitleWindow *window, int x, int y);
398 class TitleW : public BC_TumbleTextBox
401 TitleW(TitleMain *client, TitleWindow *window, int x, int y);
406 class TitleH : public BC_TumbleTextBox
409 TitleH(TitleMain *client, TitleWindow *window, int x, int y);
415 class TitleDropShadow : public BC_TumbleTextBox
418 TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y);
424 class TitleOutline : public BC_TumbleTextBox
427 TitleOutline(TitleMain *client, TitleWindow *window, int x, int y);
433 class TitleStroker : public BC_TumbleTextBox
436 TitleStroker(TitleMain *client, TitleWindow *window, int x, int y);
442 class TitleSpeed : public BC_TumbleTextBox
445 TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y);
451 class TitleLeft : public BC_Radial
454 TitleLeft(TitleMain *client, TitleWindow *window, int x, int y);
459 class TitleCenter : public BC_Radial
462 TitleCenter(TitleMain *client, TitleWindow *window, int x, int y);
467 class TitleRight : public BC_Radial
470 TitleRight(TitleMain *client, TitleWindow *window, int x, int y);
476 class TitleTop : public BC_Radial
479 TitleTop(TitleMain *client, TitleWindow *window, int x, int y);
484 class TitleMid : public BC_Radial
487 TitleMid(TitleMain *client, TitleWindow *window, int x, int y);
492 class TitleBottom : public BC_Radial
495 TitleBottom(TitleMain *client, TitleWindow *window, int x, int y);
500 class TitleBackground : public BC_CheckBox
503 TitleBackground(TitleMain *client, TitleWindow *window, int x, int y);
508 class TitleBackgroundPath : public BC_TextBox
511 TitleBackgroundPath(TitleMain *client, TitleWindow *window, int x, int y);
516 class TitleLoopPlayback : public BC_CheckBox
519 TitleLoopPlayback(TitleMain *client, TitleWindow *window, int x, int y);
526 class TitleCurPopup : public BC_PopupMenu
529 TitleCurPopup(TitleMain *client, TitleWindow *window);
532 void create_objects();
538 class TitleCurItem : public BC_MenuItem
541 TitleCurItem(TitleCurPopup *popup, const char *text);
544 TitleCurPopup *popup;
547 enum { POPUP_OFFSET=-1, POPUP_NONE=0, POPUP_FONT, POPUP_COLOR, POPUP_PNG, };
549 class TitleCurSubMenu : public BC_SubMenu
552 TitleCurSubMenu(TitleCurItem *cur_item);
554 void add_subitemx(int popup_type, va_list ap, const char *fmt);
555 void add_subitem(int popup_type, const char *fmt,...) { va_list ap;
556 va_start(ap, fmt); add_subitemx(popup_type, ap, fmt); va_end(ap);
558 void add_subitem(const char *fmt,...) { va_list ap;
559 va_start(ap, fmt); add_subitemx(POPUP_NONE, ap, fmt); va_end(ap);
561 TitleCurItem *cur_item;
564 class TitleCurSubMenuItem : public BC_MenuItem
567 TitleCurSubMenuItem(TitleCurSubMenu *submenu, const char *text, int popup_type);
568 ~TitleCurSubMenuItem();
571 TitleCurSubMenu *submenu;
575 class TitleFontsPopup : public BC_ListBox
578 TitleFontsPopup(TitleMain *client, TitleWindow *window);
580 int keypress_event();
582 int show_tooltip(const char *text, int x,int y, int w,int h) {
583 return gui_tooltip(text);
590 class TitleColorPopup : public ColorPicker
593 TitleColorPopup(TitleMain *client, TitleWindow *window);
595 int handle_new_color(int output, int alpha);
596 void handle_done_event(int result);
604 class TitlePngPopup : public BC_DialogThread
607 TitlePngPopup(TitleMain *client, TitleWindow *window);
610 void handle_done_event(int result);
611 BC_Window* new_gui();