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;
82 class TitleWindow : public PluginClientWindow
85 TitleWindow(TitleMain *client);
88 void create_objects();
89 int resize_event(int w, int h);
90 int grab_event(XEvent *event);
92 void update_justification();
96 int insert_ibeam(const char *txt, int adv);
100 BC_Title *font_title;
102 TitleFontTumble *font_tumbler;
111 BC_Title *dropshadow_title;
112 TitleDropShadow *dropshadow;
113 BC_Title *outline_title;
114 TitleOutline *outline;
115 BC_Title *stroker_title;
116 TitleStroker *stroker;
117 BC_Title *style_title;
121 TitleCurPopup *cur_popup;
122 TitleFontsPopup *fonts_popup;
123 TitleColorPopup *color_popup;
125 int color_x, color_y;
126 int outline_color_x, outline_color_y;
127 int drag_dx, drag_dy, dragging;
130 BC_Title *size_title;
132 TitleSizeTumble *size_tumbler;
133 BC_Title *pitch_title;
135 BC_Title *encoding_title;
136 TitleEncoding *encoding;
137 TitleColorButton *color_button;
138 TitleColorThread *color_thread;
139 TitleOutlineColorButton *outline_color_button;
140 TitleColorThread *outline_color_thread;
141 BC_Title *motion_title;
143 TitleLinePitch *line_pitch;
145 BC_Title *fadein_title;
147 BC_Title *fadeout_title;
149 BC_Title *text_title;
151 BC_Title *justify_title;
158 BC_Title *speed_title;
160 TitleTimecode *timecode;
161 TitleTimecodeFormat *timecode_format;
162 TitleBackground *background;
163 TitleBackgroundPath *background_path;
164 BrowseButton *background_browse;
165 TitleLoopPlayback *loop_playback;
168 ArrayList<BC_ListBoxItem*> sizes;
169 ArrayList<BC_ListBoxItem*> encodings;
170 ArrayList<BC_ListBoxItem*> paths;
171 ArrayList<BC_ListBoxItem*> fonts;
175 class TitleFontTumble : public BC_Tumbler
178 TitleFontTumble(TitleMain *client, TitleWindow *window, int x, int y);
180 int handle_up_event();
181 int handle_down_event();
188 class TitleSizeTumble : public BC_Tumbler
191 TitleSizeTumble(TitleMain *client, TitleWindow *window, int x, int y);
193 int handle_up_event();
194 int handle_down_event();
202 class TitleItalic : public BC_CheckBox
205 TitleItalic(TitleMain *client, TitleWindow *window, int x, int y);
210 class TitleBold : public BC_CheckBox
213 TitleBold(TitleMain *client, TitleWindow *window, int x, int y);
218 class TitleDrag : public BC_CheckBox
221 TitleDrag(TitleMain *client, TitleWindow *window, int x, int y);
228 class TitleSize : public BC_PopupTextBox
231 TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text);
234 void update(int size);
239 class TitlePitch : public BC_TumbleTextBox
242 TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value);
251 class TitleEncoding : public BC_PopupTextBox
254 TitleEncoding(TitleMain *client, TitleWindow *window, int x, int y, char *text);
261 class TitleColorButton : public BC_GenericButton
264 TitleColorButton(TitleMain *client, TitleWindow *window, int x, int y);
269 class TitleOutlineColorButton : public BC_GenericButton
272 TitleOutlineColorButton(TitleMain *client, TitleWindow *window, int x, int y);
278 class TitleMotion : public BC_PopupTextBox
281 TitleMotion(TitleMain *client, TitleWindow *window, int x, int y);
286 class TitleLoop : public BC_CheckBox
289 TitleLoop(TitleMain *client, int x, int y);
294 class TitleLinePitch : public BC_CheckBox
297 TitleLinePitch(TitleMain *client, int x, int y);
303 class TitleTimecode : public BC_CheckBox
306 TitleTimecode(TitleMain *client, int x, int y);
311 class TitleTimecodeFormat : public BC_PopupMenu
314 TitleTimecodeFormat(TitleMain *client, int x, int y, const char *text);
315 void create_objects();
316 int update(int timecode_format);
321 class TitleFade : public BC_TextBox
324 TitleFade(TitleMain *client, TitleWindow *window, double *value, int x, int y);
330 class TitleFont : public BC_PopupTextBox
333 TitleFont(TitleMain *client, TitleWindow *window, int x, int y);
338 class TitleText : public BC_ScrollTextBox
341 TitleText(TitleMain *client,
348 int button_press_event();
352 class TitleX : public BC_TumbleTextBox
355 TitleX(TitleMain *client, TitleWindow *window, int x, int y);
360 class TitleY : public BC_TumbleTextBox
363 TitleY(TitleMain *client, TitleWindow *window, int x, int y);
368 class TitleW : public BC_TumbleTextBox
371 TitleW(TitleMain *client, TitleWindow *window, int x, int y);
376 class TitleH : public BC_TumbleTextBox
379 TitleH(TitleMain *client, TitleWindow *window, int x, int y);
385 class TitleDropShadow : public BC_TumbleTextBox
388 TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y);
394 class TitleOutline : public BC_TumbleTextBox
397 TitleOutline(TitleMain *client, TitleWindow *window, int x, int y);
403 class TitleStroker : public BC_TumbleTextBox
406 TitleStroker(TitleMain *client, TitleWindow *window, int x, int y);
412 class TitleSpeed : public BC_TumbleTextBox
415 TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y);
420 class TitleLeft : public BC_Radial
423 TitleLeft(TitleMain *client, TitleWindow *window, int x, int y);
428 class TitleCenter : public BC_Radial
431 TitleCenter(TitleMain *client, TitleWindow *window, int x, int y);
436 class TitleRight : public BC_Radial
439 TitleRight(TitleMain *client, TitleWindow *window, int x, int y);
445 class TitleTop : public BC_Radial
448 TitleTop(TitleMain *client, TitleWindow *window, int x, int y);
453 class TitleMid : public BC_Radial
456 TitleMid(TitleMain *client, TitleWindow *window, int x, int y);
461 class TitleBottom : public BC_Radial
464 TitleBottom(TitleMain *client, TitleWindow *window, int x, int y);
469 class TitleColorThread : public ColorThread
472 TitleColorThread(TitleMain *client, TitleWindow *window, int is_outline);
473 virtual int handle_new_color(int output, int alpha);
478 class TitleBackground : public BC_CheckBox
481 TitleBackground(TitleMain *client, TitleWindow *window, int x, int y);
486 class TitleBackgroundPath : public BC_TextBox
489 TitleBackgroundPath(TitleMain *client, TitleWindow *window, int x, int y);
494 class TitleLoopPlayback : public BC_CheckBox
497 TitleLoopPlayback(TitleMain *client, int x, int y);
504 class TitleCurPopup : public BC_PopupMenu
507 TitleCurPopup(TitleMain *client, TitleWindow *window);
510 void create_objects();
516 class TitleCurItem : public BC_MenuItem
519 TitleCurItem(TitleCurPopup *popup, const char *text);
522 TitleCurPopup *popup;
525 class TitleCurSubMenu : public BC_SubMenu
528 TitleCurSubMenu(TitleCurItem *cur_item);
531 TitleCurItem *cur_item;
534 class TitleCurSubMenuItem : public BC_MenuItem
537 TitleCurSubMenuItem(TitleCurSubMenu *submenu, const char *text);
538 ~TitleCurSubMenuItem();
541 TitleCurSubMenu *submenu;
544 class TitleFontsPopup : public BC_ListBox
547 TitleFontsPopup(TitleMain *client, TitleWindow *window);
555 class TitleColorPopup : public ColorThread
558 TitleColorPopup(TitleMain *client, TitleWindow *window);
560 int handle_new_color(int output, int alpha);
561 void handle_done_event(int result);