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;
65 class TitleRight;class TitleTop;
68 class TitleColorThread;
71 class TitleTimecodeFormat;
74 class TitleBackground;
75 class TitleBackgroundPath;
76 class TitleLoopPlayback;
79 class TitleCurSubMenu;
80 class TitleCurSubMenuItem;
81 class TitleFontsPopup;
82 class TitleColorPopup;
85 class TitleWindow : public PluginClientWindow
88 TitleWindow(TitleMain *client);
91 void create_objects();
92 int resize_event(int w, int h);
95 void update_justification();
100 void check_style(const char *font_name, int update);
101 int insert_ibeam(const char *txt, int ofs=0);
102 void done_event(int result);
103 void send_configure_change();
104 int check_configure_change(int ret);
108 BC_Title *font_title;
110 TitleFontTumble *font_tumbler;
119 BC_Title *dropshadow_title;
120 TitleDropShadow *dropshadow;
121 BC_Title *outline_title;
122 TitleOutline *outline;
123 BC_Title *stroker_title;
124 TitleStroker *stroker;
125 BC_Title *style_title;
130 TitleCurPopup *cur_popup;
131 TitleFontsPopup *fonts_popup;
132 TitleColorPopup *color_popup;
133 TitlePngPopup *png_popup;
135 int color_x, color_y;
136 int outline_color_x, outline_color_y;
137 int drag_dx, drag_dy, dragging;
138 int cur_ibeam, pending_config;
140 BC_Title *size_title;
142 TitleSizeTumble *size_tumbler;
143 BC_Title *pitch_title;
145 BC_Title *encoding_title;
146 TitleEncoding *encoding;
147 TitleColorButton *color_button;
148 TitleColorThread *color_thread;
149 TitleOutlineColorButton *outline_color_button;
150 TitleColorThread *outline_color_thread;
151 BC_Title *motion_title;
153 TitleLinePitch *line_pitch;
155 BC_Title *fadein_title;
157 BC_Title *fadeout_title;
159 BC_Title *text_title;
161 TitleTextChars *text_chars;
162 TitleTextBfrSz *text_bfrsz;
163 BC_Title *justify_title;
170 BC_Title *speed_title;
172 TitleTimecode *timecode;
173 TitleTimecodeFormat *timecode_format;
174 TitleBackground *background;
175 TitleBackgroundPath *background_path;
176 BrowseButton *background_browse;
177 TitleLoopPlayback *loop_playback;
180 ArrayList<BC_ListBoxItem*> sizes;
181 ArrayList<BC_ListBoxItem*> encodings;
182 ArrayList<BC_ListBoxItem*> paths;
183 ArrayList<BC_ListBoxItem*> fonts;
187 class TitleFontTumble : public BC_Tumbler
190 TitleFontTumble(TitleMain *client, TitleWindow *window, int x, int y);
192 int handle_up_event();
193 int handle_down_event();
200 class TitleSizeTumble : public BC_Tumbler
203 TitleSizeTumble(TitleMain *client, TitleWindow *window, int x, int y);
205 int handle_up_event();
206 int handle_down_event();
213 class TitleAlias : public BC_CheckBox
216 TitleAlias(TitleMain *client, TitleWindow *window, int x, int y);
221 class TitleItalic : public BC_CheckBox
224 TitleItalic(TitleMain *client, TitleWindow *window, int x, int y);
229 class TitleBold : public BC_CheckBox
232 TitleBold(TitleMain *client, TitleWindow *window, int x, int y);
237 class TitleDrag : public DragCheckBox
240 TitleDrag(TitleMain *client, TitleWindow *window, int x, int y);
243 Track *get_drag_track();
244 int64_t get_drag_position();
251 class TitleSize : public BC_PopupTextBox
254 TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text);
257 void update(int size);
262 class TitlePitch : public BC_TumbleTextBox
265 TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value);
274 class TitleEncoding : public BC_PopupTextBox
277 TitleEncoding(TitleMain *client, TitleWindow *window, int x, int y, char *text);
284 class TitleColorButton : public BC_GenericButton
287 TitleColorButton(TitleMain *client, TitleWindow *window, int x, int y);
292 class TitleOutlineColorButton : public BC_GenericButton
295 TitleOutlineColorButton(TitleMain *client, TitleWindow *window, int x, int y);
301 class TitleMotion : public BC_PopupTextBox
304 TitleMotion(TitleMain *client, TitleWindow *window, int x, int y);
309 class TitleLoop : public BC_CheckBox
312 TitleLoop(TitleMain *client, TitleWindow *window, int x, int y);
317 class TitleLinePitch : public BC_CheckBox
320 TitleLinePitch(TitleMain *client, TitleWindow *window, int x, int y);
326 class TitleTimecode : public BC_CheckBox
329 TitleTimecode(TitleMain *client, TitleWindow *window, int x, int y);
335 class TitleTimecodeFormat : public BC_PopupMenu
338 TitleTimecodeFormat(TitleMain *client, TitleWindow *window, int x, int y, const char *text);
339 void create_objects();
340 int update(int timecode_format);
346 class TitleFade : public BC_TextBox
349 TitleFade(TitleMain *client, TitleWindow *window, double *value, int x, int y);
355 class TitleFont : public BC_PopupTextBox
358 TitleFont(TitleMain *client, TitleWindow *window, int x, int y);
363 class TitleText : public BC_ScrollTextBox
366 TitleText(TitleMain *client,
373 int button_press_event();
377 class TitleTextChars : public BC_Title
381 TitleTextChars(int x, int y, int w);
384 class TitleTextBfrSz : public BC_Title
388 TitleTextBfrSz(int x, int y, int w);
392 class TitleX : public BC_TumbleTextBox
395 TitleX(TitleMain *client, TitleWindow *window, int x, int y);
400 class TitleY : public BC_TumbleTextBox
403 TitleY(TitleMain *client, TitleWindow *window, int x, int y);
408 class TitleW : public BC_TumbleTextBox
411 TitleW(TitleMain *client, TitleWindow *window, int x, int y);
416 class TitleH : public BC_TumbleTextBox
419 TitleH(TitleMain *client, TitleWindow *window, int x, int y);
425 class TitleDropShadow : public BC_TumbleTextBox
428 TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y);
434 class TitleOutline : public BC_TumbleTextBox
437 TitleOutline(TitleMain *client, TitleWindow *window, int x, int y);
443 class TitleStroker : public BC_TumbleTextBox
446 TitleStroker(TitleMain *client, TitleWindow *window, int x, int y);
452 class TitleSpeed : public BC_TumbleTextBox
455 TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y);
461 class TitleLeft : public BC_Radial
464 TitleLeft(TitleMain *client, TitleWindow *window, int x, int y);
469 class TitleCenter : public BC_Radial
472 TitleCenter(TitleMain *client, TitleWindow *window, int x, int y);
477 class TitleRight : public BC_Radial
480 TitleRight(TitleMain *client, TitleWindow *window, int x, int y);
486 class TitleTop : public BC_Radial
489 TitleTop(TitleMain *client, TitleWindow *window, int x, int y);
494 class TitleMid : public BC_Radial
497 TitleMid(TitleMain *client, TitleWindow *window, int x, int y);
502 class TitleBottom : public BC_Radial
505 TitleBottom(TitleMain *client, TitleWindow *window, int x, int y);
510 class TitleColorThread : public ColorPicker
513 TitleColorThread(TitleMain *client, TitleWindow *window, int is_outline);
514 virtual int handle_new_color(int output, int alpha);
519 class TitleBackground : public BC_CheckBox
522 TitleBackground(TitleMain *client, TitleWindow *window, int x, int y);
527 class TitleBackgroundPath : public BC_TextBox
530 TitleBackgroundPath(TitleMain *client, TitleWindow *window, int x, int y);
535 class TitleLoopPlayback : public BC_CheckBox
538 TitleLoopPlayback(TitleMain *client, TitleWindow *window, int x, int y);
545 class TitleCurPopup : public BC_PopupMenu
548 TitleCurPopup(TitleMain *client, TitleWindow *window);
551 void create_objects();
557 class TitleCurItem : public BC_MenuItem
560 TitleCurItem(TitleCurPopup *popup, const char *text);
563 TitleCurPopup *popup;
566 enum { POPUP_OFFSET=-1, POPUP_NONE=0, POPUP_FONT, POPUP_COLOR, POPUP_PNG, };
568 class TitleCurSubMenu : public BC_SubMenu
571 TitleCurSubMenu(TitleCurItem *cur_item);
573 void add_subitemx(int popup_type, va_list ap, const char *fmt);
574 void add_subitem(int popup_type, const char *fmt,...) { va_list ap;
575 va_start(ap, fmt); add_subitemx(popup_type, ap, fmt); va_end(ap);
577 void add_subitem(const char *fmt,...) { va_list ap;
578 va_start(ap, fmt); add_subitemx(POPUP_NONE, ap, fmt); va_end(ap);
580 TitleCurItem *cur_item;
583 class TitleCurSubMenuItem : public BC_MenuItem
586 TitleCurSubMenuItem(TitleCurSubMenu *submenu, const char *text, int popup_type);
587 ~TitleCurSubMenuItem();
590 TitleCurSubMenu *submenu;
594 class TitleFontsPopup : public BC_ListBox
597 TitleFontsPopup(TitleMain *client, TitleWindow *window);
599 int keypress_event();
601 int show_tooltip(const char *text, int x,int y, int w,int h) {
602 return gui_tooltip(text);
609 class TitleColorPopup : public ColorPicker
612 TitleColorPopup(TitleMain *client, TitleWindow *window);
614 int handle_new_color(int output, int alpha);
615 void handle_done_event(int result);
623 class TitlePngPopup : public BC_DialogThread
626 TitlePngPopup(TitleMain *client, TitleWindow *window);
629 void handle_done_event(int result);
630 BC_Window* new_gui();