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"
40 class TitleFontTumble;
41 class TitleSizeTumble;
48 class TitleColorButton;
49 class TitleOutlineColorButton;
50 class TitleDropShadow;
63 class TitleRight;class TitleTop;
66 class TitleColorThread;
69 class TitleTimecodeFormat;
72 class TitleBackground;
73 class TitleBackgroundPath;
74 class TitleLoopPlayback;
77 class TitleCurSubMenu;
78 class TitleCurSubMenuItem;
79 class TitleFontsPopup;
80 class TitleColorPopup;
83 class TitleWindow : public PluginClientWindow
86 TitleWindow(TitleMain *client);
89 void create_objects();
90 int resize_event(int w, int h);
91 int grab_event(XEvent *event);
93 void update_justification();
97 void check_style(const char *font_name);
98 int insert_ibeam(const char *txt, int adv);
99 void done_event(int result);
103 BC_Title *font_title;
105 TitleFontTumble *font_tumbler;
114 BC_Title *dropshadow_title;
115 TitleDropShadow *dropshadow;
116 BC_Title *outline_title;
117 TitleOutline *outline;
118 BC_Title *stroker_title;
119 TitleStroker *stroker;
120 BC_Title *style_title;
124 TitleCurPopup *cur_popup;
125 TitleFontsPopup *fonts_popup;
126 TitleColorPopup *color_popup;
127 TitlePngPopup *png_popup;
129 int color_x, color_y;
130 int outline_color_x, outline_color_y;
131 int drag_dx, drag_dy, dragging;
134 BC_Title *size_title;
136 TitleSizeTumble *size_tumbler;
137 BC_Title *pitch_title;
139 BC_Title *encoding_title;
140 TitleEncoding *encoding;
141 TitleColorButton *color_button;
142 TitleColorThread *color_thread;
143 TitleOutlineColorButton *outline_color_button;
144 TitleColorThread *outline_color_thread;
145 BC_Title *motion_title;
147 TitleLinePitch *line_pitch;
149 BC_Title *fadein_title;
151 BC_Title *fadeout_title;
153 BC_Title *text_title;
155 BC_Title *justify_title;
162 BC_Title *speed_title;
164 TitleTimecode *timecode;
165 TitleTimecodeFormat *timecode_format;
166 TitleBackground *background;
167 TitleBackgroundPath *background_path;
168 BrowseButton *background_browse;
169 TitleLoopPlayback *loop_playback;
172 ArrayList<BC_ListBoxItem*> sizes;
173 ArrayList<BC_ListBoxItem*> encodings;
174 ArrayList<BC_ListBoxItem*> paths;
175 ArrayList<BC_ListBoxItem*> fonts;
179 class TitleFontTumble : public BC_Tumbler
182 TitleFontTumble(TitleMain *client, TitleWindow *window, int x, int y);
184 int handle_up_event();
185 int handle_down_event();
192 class TitleSizeTumble : public BC_Tumbler
195 TitleSizeTumble(TitleMain *client, TitleWindow *window, int x, int y);
197 int handle_up_event();
198 int handle_down_event();
206 class TitleItalic : public BC_CheckBox
209 TitleItalic(TitleMain *client, TitleWindow *window, int x, int y);
214 class TitleBold : public BC_CheckBox
217 TitleBold(TitleMain *client, TitleWindow *window, int x, int y);
222 class TitleDrag : public BC_CheckBox
225 TitleDrag(TitleMain *client, TitleWindow *window, int x, int y);
232 class TitleSize : public BC_PopupTextBox
235 TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text);
238 void update(int size);
243 class TitlePitch : public BC_TumbleTextBox
246 TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value);
255 class TitleEncoding : public BC_PopupTextBox
258 TitleEncoding(TitleMain *client, TitleWindow *window, int x, int y, char *text);
265 class TitleColorButton : public BC_GenericButton
268 TitleColorButton(TitleMain *client, TitleWindow *window, int x, int y);
273 class TitleOutlineColorButton : public BC_GenericButton
276 TitleOutlineColorButton(TitleMain *client, TitleWindow *window, int x, int y);
282 class TitleMotion : public BC_PopupTextBox
285 TitleMotion(TitleMain *client, TitleWindow *window, int x, int y);
290 class TitleLoop : public BC_CheckBox
293 TitleLoop(TitleMain *client, int x, int y);
298 class TitleLinePitch : public BC_CheckBox
301 TitleLinePitch(TitleMain *client, int x, int y);
307 class TitleTimecode : public BC_CheckBox
310 TitleTimecode(TitleMain *client, int x, int y);
315 class TitleTimecodeFormat : public BC_PopupMenu
318 TitleTimecodeFormat(TitleMain *client, int x, int y, const char *text);
319 void create_objects();
320 int update(int timecode_format);
325 class TitleFade : public BC_TextBox
328 TitleFade(TitleMain *client, TitleWindow *window, double *value, int x, int y);
334 class TitleFont : public BC_PopupTextBox
337 TitleFont(TitleMain *client, TitleWindow *window, int x, int y);
342 class TitleText : public BC_ScrollTextBox
345 TitleText(TitleMain *client,
352 int button_press_event();
356 class TitleX : public BC_TumbleTextBox
359 TitleX(TitleMain *client, TitleWindow *window, int x, int y);
364 class TitleY : public BC_TumbleTextBox
367 TitleY(TitleMain *client, TitleWindow *window, int x, int y);
372 class TitleW : public BC_TumbleTextBox
375 TitleW(TitleMain *client, TitleWindow *window, int x, int y);
380 class TitleH : public BC_TumbleTextBox
383 TitleH(TitleMain *client, TitleWindow *window, int x, int y);
389 class TitleDropShadow : public BC_TumbleTextBox
392 TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y);
398 class TitleOutline : public BC_TumbleTextBox
401 TitleOutline(TitleMain *client, TitleWindow *window, int x, int y);
407 class TitleStroker : public BC_TumbleTextBox
410 TitleStroker(TitleMain *client, TitleWindow *window, int x, int y);
416 class TitleSpeed : public BC_TumbleTextBox
419 TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y);
424 class TitleLeft : public BC_Radial
427 TitleLeft(TitleMain *client, TitleWindow *window, int x, int y);
432 class TitleCenter : public BC_Radial
435 TitleCenter(TitleMain *client, TitleWindow *window, int x, int y);
440 class TitleRight : public BC_Radial
443 TitleRight(TitleMain *client, TitleWindow *window, int x, int y);
449 class TitleTop : public BC_Radial
452 TitleTop(TitleMain *client, TitleWindow *window, int x, int y);
457 class TitleMid : public BC_Radial
460 TitleMid(TitleMain *client, TitleWindow *window, int x, int y);
465 class TitleBottom : public BC_Radial
468 TitleBottom(TitleMain *client, TitleWindow *window, int x, int y);
473 class TitleColorThread : public ColorThread
476 TitleColorThread(TitleMain *client, TitleWindow *window, int is_outline);
477 virtual int handle_new_color(int output, int alpha);
482 class TitleBackground : public BC_CheckBox
485 TitleBackground(TitleMain *client, TitleWindow *window, int x, int y);
490 class TitleBackgroundPath : public BC_TextBox
493 TitleBackgroundPath(TitleMain *client, TitleWindow *window, int x, int y);
498 class TitleLoopPlayback : public BC_CheckBox
501 TitleLoopPlayback(TitleMain *client, int x, int y);
508 class TitleCurPopup : public BC_PopupMenu
511 TitleCurPopup(TitleMain *client, TitleWindow *window);
514 void create_objects();
520 class TitleCurItem : public BC_MenuItem
523 TitleCurItem(TitleCurPopup *popup, const char *text);
526 TitleCurPopup *popup;
529 class TitleCurSubMenu : public BC_SubMenu
532 TitleCurSubMenu(TitleCurItem *cur_item);
535 TitleCurItem *cur_item;
538 class TitleCurSubMenuItem : public BC_MenuItem
541 TitleCurSubMenuItem(TitleCurSubMenu *submenu, const char *text);
542 ~TitleCurSubMenuItem();
545 TitleCurSubMenu *submenu;
548 class TitleFontsPopup : public BC_ListBox
551 TitleFontsPopup(TitleMain *client, TitleWindow *window);
553 int keypress_event();
555 int show_tooltip(const char *text, int x,int y, int w,int h) {
556 return gui_tooltip(text);
563 class TitleColorPopup : public ColorThread
566 TitleColorPopup(TitleMain *client, TitleWindow *window);
568 int handle_new_color(int output, int alpha);
569 void handle_done_event(int result);
577 class TitlePngPopup : public BC_DialogThread
580 TitlePngPopup(TitleMain *client, TitleWindow *window);
583 void handle_done_event(int result);
584 BC_Window* new_gui();