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"
38 class TitleFontTumble;
39 class TitleSizeTumble;
46 class TitleColorButton;
47 class TitleOutlineColorButton;
48 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();
98 void check_style(const char *font_name, int update);
99 int insert_ibeam(const char *txt, int ofs=0);
100 void done_event(int result);
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;
125 TitleCurPopup *cur_popup;
126 TitleFontsPopup *fonts_popup;
127 TitleColorPopup *color_popup;
128 TitlePngPopup *png_popup;
130 int color_x, color_y;
131 int outline_color_x, outline_color_y;
132 int drag_dx, drag_dy, dragging;
135 BC_Title *size_title;
137 TitleSizeTumble *size_tumbler;
138 BC_Title *pitch_title;
140 BC_Title *encoding_title;
141 TitleEncoding *encoding;
142 TitleColorButton *color_button;
143 TitleColorThread *color_thread;
144 TitleOutlineColorButton *outline_color_button;
145 TitleColorThread *outline_color_thread;
146 BC_Title *motion_title;
148 TitleLinePitch *line_pitch;
150 BC_Title *fadein_title;
152 BC_Title *fadeout_title;
154 BC_Title *text_title;
156 TitleTextChars *text_chars;
157 TitleTextBfrSz *text_bfrsz;
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();
209 class TitleItalic : public BC_CheckBox
212 TitleItalic(TitleMain *client, TitleWindow *window, int x, int y);
217 class TitleBold : public BC_CheckBox
220 TitleBold(TitleMain *client, TitleWindow *window, int x, int y);
225 class TitleDrag : public BC_CheckBox
228 TitleDrag(TitleMain *client, TitleWindow *window, int x, int y);
235 class TitleSize : public BC_PopupTextBox
238 TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text);
241 void update(int size);
246 class TitlePitch : public BC_TumbleTextBox
249 TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value);
258 class TitleEncoding : public BC_PopupTextBox
261 TitleEncoding(TitleMain *client, TitleWindow *window, int x, int y, char *text);
268 class TitleColorButton : public BC_GenericButton
271 TitleColorButton(TitleMain *client, TitleWindow *window, int x, int y);
276 class TitleOutlineColorButton : public BC_GenericButton
279 TitleOutlineColorButton(TitleMain *client, TitleWindow *window, int x, int y);
285 class TitleMotion : public BC_PopupTextBox
288 TitleMotion(TitleMain *client, TitleWindow *window, int x, int y);
293 class TitleLoop : public BC_CheckBox
296 TitleLoop(TitleMain *client, int x, int y);
301 class TitleLinePitch : public BC_CheckBox
304 TitleLinePitch(TitleMain *client, int x, int y);
310 class TitleTimecode : public BC_CheckBox
313 TitleTimecode(TitleMain *client, int x, int y);
318 class TitleTimecodeFormat : public BC_PopupMenu
321 TitleTimecodeFormat(TitleMain *client, int x, int y, const char *text);
322 void create_objects();
323 int update(int timecode_format);
328 class TitleFade : public BC_TextBox
331 TitleFade(TitleMain *client, TitleWindow *window, double *value, int x, int y);
337 class TitleFont : public BC_PopupTextBox
340 TitleFont(TitleMain *client, TitleWindow *window, int x, int y);
345 class TitleText : public BC_ScrollTextBox
348 TitleText(TitleMain *client,
355 int button_press_event();
359 class TitleTextChars : public BC_Title
363 TitleTextChars(int x, int y, int w);
366 class TitleTextBfrSz : public BC_Title
370 TitleTextBfrSz(int x, int y, int w);
374 class TitleX : public BC_TumbleTextBox
377 TitleX(TitleMain *client, TitleWindow *window, int x, int y);
382 class TitleY : public BC_TumbleTextBox
385 TitleY(TitleMain *client, TitleWindow *window, int x, int y);
390 class TitleW : public BC_TumbleTextBox
393 TitleW(TitleMain *client, TitleWindow *window, int x, int y);
398 class TitleH : public BC_TumbleTextBox
401 TitleH(TitleMain *client, TitleWindow *window, int x, int y);
407 class TitleDropShadow : public BC_TumbleTextBox
410 TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y);
416 class TitleOutline : public BC_TumbleTextBox
419 TitleOutline(TitleMain *client, TitleWindow *window, int x, int y);
425 class TitleStroker : public BC_TumbleTextBox
428 TitleStroker(TitleMain *client, TitleWindow *window, int x, int y);
434 class TitleSpeed : public BC_TumbleTextBox
437 TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y);
442 class TitleLeft : public BC_Radial
445 TitleLeft(TitleMain *client, TitleWindow *window, int x, int y);
450 class TitleCenter : public BC_Radial
453 TitleCenter(TitleMain *client, TitleWindow *window, int x, int y);
458 class TitleRight : public BC_Radial
461 TitleRight(TitleMain *client, TitleWindow *window, int x, int y);
467 class TitleTop : public BC_Radial
470 TitleTop(TitleMain *client, TitleWindow *window, int x, int y);
475 class TitleMid : public BC_Radial
478 TitleMid(TitleMain *client, TitleWindow *window, int x, int y);
483 class TitleBottom : public BC_Radial
486 TitleBottom(TitleMain *client, TitleWindow *window, int x, int y);
491 class TitleColorThread : public ColorPicker
494 TitleColorThread(TitleMain *client, TitleWindow *window, int is_outline);
495 virtual int handle_new_color(int output, int alpha);
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, 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();