4 * Copyright (C) 1997-2014 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
25 #include "awindowgui.inc"
26 #include "batchrender.inc"
28 #include "cwindowgui.inc"
30 #include "keyframegui.inc"
31 #include "levelwindowgui.inc"
32 #include "mbuttons.inc"
33 #include "mwindow.inc"
34 #include "mwindowgui.inc"
36 #include "overlayframe.inc"
37 #include "patchbay.inc"
38 #include "preferencesthread.inc"
39 //#include "presetsgui.inc"
40 #include "recordgui.inc"
41 #include "recordmonitor.inc"
42 #include "resourcepixmap.inc"
43 #include "timebar.inc"
44 #include "trackcanvas.inc"
45 #include "setformat.inc"
46 #include "statusbar.inc"
48 #include "vwindowgui.inc"
49 #include "zoombar.inc"
53 // Theme uses static png resources at startup.
54 // The reason is GUI elements must be constructed at startup from multiple
59 class Theme : public BC_Theme
66 virtual void initialize();
67 virtual void get_mwindow_sizes(MWindowGUI *gui,
70 virtual void get_pane_sizes(MWindowGUI *gui,
81 virtual void get_vwindow_sizes(VWindowGUI *gui);
82 virtual void get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls);
83 virtual void get_awindow_sizes(AWindowGUI *gui);
84 virtual void get_rmonitor_sizes(int do_audio,
90 virtual void get_recordgui_sizes(RecordGUI *gui,
93 virtual void get_batchrender_sizes(BatchRenderGUI *gui,
96 virtual void get_plugindialog_sizes();
97 // virtual void get_presetdialog_sizes(PresetsWindow *gui);
98 virtual void get_keyframedialog_sizes(KeyFrameWindow *gui);
99 virtual void get_menueffect_sizes(int use_list);
100 virtual void draw_rwindow_bg(RecordGUI *gui);
101 virtual void draw_rmonitor_bg(RecordMonitorGUI *gui);
102 virtual void draw_awindow_bg(AWindowGUI *gui);
103 virtual void draw_cwindow_bg(CWindowGUI *gui);
104 virtual void draw_lwindow_bg(LevelWindowGUI *gui);
105 virtual void draw_mwindow_bg(MWindowGUI *gui);
106 virtual void draw_vwindow_bg(VWindowGUI *gui);
107 virtual void draw_resource_bg(TrackCanvas *canvas,
108 ResourcePixmap *pixmap,
117 virtual void get_preferences_sizes();
118 virtual void draw_preferences_bg(PreferencesWindow *gui);
119 virtual void get_new_sizes(NewWindow *gui);
120 virtual void draw_new_bg(NewWindow *gui);
121 virtual void draw_setformat_bg(SetFormatWindow *window);
123 virtual void build_menus();
124 // unsigned char* get_image(char *title);
127 ArrayList<BC_ListBoxItem*> aspect_ratios;
128 ArrayList<BC_ListBoxItem*> frame_rates;
129 ArrayList<BC_ListBoxItem*> frame_sizes;
130 ArrayList<BC_ListBoxItem*> sample_rates;
131 ArrayList<BC_ListBoxItem*> zoom_values;
132 const char *theme_title;
134 // Tools for building widgets
135 void overlay(VFrame *dst, VFrame *src, int in_x1 = -1, int in_x2 = -1);
136 void build_transport(char *title,
137 unsigned char *png_overlay,
140 void build_patches(VFrame** &data,
141 unsigned char *png_overlay,
144 void build_button(VFrame** &data,
145 unsigned char *png_overlay,
149 void build_button(VFrame** &data,
150 unsigned char *png_overlay,
155 void build_toggle(VFrame** &data,
156 unsigned char *png_overlay,
159 VFrame *checked_vframe,
161 VFrame *checkedhi_vframe);
163 // colors for the main message text
164 int message_normal, message_error;
168 int abinbuttons_x, abinbuttons_y;
169 int abuttons_x, abuttons_y;
170 int adivider_x, adivider_y, adivider_w, adivider_h;
171 int afolders_x, afolders_y, afolders_w, afolders_h;
172 int alist_x, alist_y, alist_w, alist_h;
176 int cauto_x, cauto_y, cauto_w, cauto_h;
177 int ccanvas_x, ccanvas_y, ccanvas_w, ccanvas_h;
178 int ccomposite_x, ccomposite_y, ccomposite_w, ccomposite_h;
179 int cstatus_x, cstatus_y;
180 int cdest_x, cdest_y;
181 int cedit_x, cedit_y;
182 int channel_position_color;
183 int cmeter_x, cmeter_y, cmeter_h;
184 int cslider_x, cslider_y, cslider_w;
185 int ctime_x, ctime_y;
186 int ctimebar_x, ctimebar_y, ctimebar_w, ctimebar_h;
187 int timebar_cursor_color;
188 int ctransport_x, ctransport_y;
189 int czoom_x, czoom_y, czoom_w;
193 int mbuttons_x, mbuttons_y, mbuttons_w, mbuttons_h;
194 // pixels between end transport button and arrow button
195 int mtransport_margin;
196 // dimensions containing all panes
197 int mcanvas_x, mcanvas_y, mcanvas_w, mcanvas_h;
198 int mclock_x, mclock_y, mclock_w, mclock_h;
199 int mhscroll_x, mhscroll_y, mhscroll_w;
200 int mvscroll_x, mvscroll_y, mvscroll_h;
203 int mstatus_x, mstatus_y, mstatus_w, mstatus_h;
204 int mstatus_message_x, mstatus_message_y;
205 int mstatus_progress_x, mstatus_progress_y, mstatus_progress_w;
206 int mstatus_cancel_x, mstatus_cancel_y;
207 int mtimebar_x, mtimebar_y, mtimebar_w, mtimebar_h;
208 int mzoom_x, mzoom_y, mzoom_w, mzoom_h;
209 int new_audio_x, new_audio_y;
210 int new_ok_x, new_ok_y;
211 int new_video_x, new_video_y;
215 // Division lines for track panes
222 int preferencescategory_x, preferencescategory_y;
223 // Overlap between category buttons
224 int preferences_category_overlap;
225 int preferencestitle_x, preferencestitle_y;
226 int preferencesoptions_x, preferencesoptions_y;
227 int patchbay_x, patchbay_y, patchbay_w, patchbay_h;
228 // pixels between toggles and buttons in edit panel
230 // Distance to left and right of automation point for control points
233 int plugindialog_new_x, plugindialog_new_y, plugindialog_new_w, plugindialog_new_h;
234 int plugindialog_shared_x, plugindialog_shared_y, plugindialog_shared_w, plugindialog_shared_h;
235 int plugindialog_module_x, plugindialog_module_y, plugindialog_module_w, plugindialog_module_h;
236 int plugindialog_newattach_x, plugindialog_newattach_y;
237 int plugindialog_sharedattach_x, plugindialog_sharedattach_y;
238 int plugindialog_moduleattach_x, plugindialog_moduleattach_y;
240 int keyframe_list_x, keyframe_list_y, keyframe_list_w, keyframe_list_h;
241 int keyframe_text_x, keyframe_text_y, keyframe_text_w, keyframe_text_h;
242 int keyframe_value_x, keyframe_value_y, keyframe_value_w, keyframe_value_h;
243 int keyframe_all_x, keyframe_all_y;
245 int menueffect_list_x, menueffect_list_y, menueffect_list_w, menueffect_list_h;
246 int menueffect_file_x, menueffect_file_y;
247 int menueffect_tools_x, menueffect_tools_y;
250 int recordgui_batches_w, recordgui_batches_h;
251 int recordgui_batches_x, recordgui_batches_y;
252 int recordgui_batch_x, recordgui_batch_y, recordgui_batchcaption_x;
253 int recordgui_options_x, recordgui_options_y;
254 int recordgui_controls_x, recordgui_controls_y;
255 int recordgui_loadmode_x, recordgui_loadmode_y;
256 int recordgui_status_x, recordgui_status_y, recordgui_status_x2;
257 int recordgui_transport_x, recordgui_transport_y;
258 int recordgui_fixed_color, recordgui_variable_color;
259 int rmonitor_canvas_w, rmonitor_canvas_h;
260 int rmonitor_canvas_x, rmonitor_canvas_y;
261 int rmonitor_channel_x, rmonitor_channel_y;
262 int rmonitor_interlace_x, rmonitor_interlace_y;
263 int rmonitor_meter_w, rmonitor_meter_h;
264 int rmonitor_meter_x, rmonitor_meter_y;
265 int rmonitor_source_x, rmonitor_source_y;
266 int rmonitor_tx_x, rmonitor_tx_y;
268 int batchrender_x1, batchrender_x2, batchrender_x3;
270 int setformat_x1, setformat_x2, setformat_x3, setformat_x4;
271 int setformat_y1, setformat_y2, setformat_y3;
272 int setformat_w, setformat_h, setformat_margin;
273 int setformat_channels_x, setformat_channels_y, setformat_channels_w, setformat_channels_h;
275 int title_font, title_color;
277 int vcanvas_x, vcanvas_y, vcanvas_w, vcanvas_h;
278 int vedit_x, vedit_y;
279 int vmeter_x, vmeter_y, vmeter_h;
280 int vslider_x, vslider_y, vslider_w;
281 int vsource_x, vsource_y;
282 int vtimebar_x, vtimebar_y, vtimebar_w, vtimebar_h;
283 int vtime_x, vtime_y, vtime_w;
285 int vtransport_x, vtransport_y;
286 int vzoom_x, vzoom_y;
294 VFrame **appendasset_data;
295 VFrame **append_data;
296 VFrame **asset_append_data;
297 VFrame **asset_disk_data;
298 VFrame **asset_index_data;
299 VFrame **asset_info_data;
300 VFrame **asset_project_data;
301 VFrame **browse_data;
302 VFrame **calibrate_data;
303 VFrame *camerakeyframe_data;
304 VFrame **cancel_data;
306 VFrame *channel_bg_data;
307 VFrame *channel_position_data;
308 VFrame **delete_all_indexes_data;
309 VFrame **deletebin_data;
310 VFrame **delete_data;
311 VFrame **deletedisk_data;
312 VFrame **deleteproject_data;
313 VFrame **detach_data;
314 VFrame **dntriangle_data;
317 VFrame **edithandlein_data;
318 VFrame **edithandleout_data;
319 VFrame **extract_data;
320 VFrame **ffmpeg_toggle;
321 VFrame **infoasset_data;
323 VFrame **insert_data;
324 VFrame *keyframe_data;
325 VFrame **label_toggle;
327 VFrame *maskkeyframe_data;
328 VFrame *modekeyframe_data;
329 VFrame **movedn_data;
330 VFrame **moveup_data;
331 VFrame **newbin_data;
333 VFrame **options_data;
335 VFrame **over_button;
336 VFrame **overwrite_data;
337 VFrame *pankeyframe_data;
338 VFrame **pasteasset_data;
339 VFrame **paused_data;
340 VFrame **picture_data;
341 VFrame **presentation_data;
342 VFrame **presentation_loop;
343 VFrame **presentation_stop;
344 VFrame *projectorkeyframe_data;
345 VFrame **redrawindex_data;
346 VFrame **renamebin_data;
348 VFrame **reverse_data;
349 VFrame **rewind_data;
350 VFrame **select_data;
352 VFrame **splice_data;
353 VFrame **start_over_data;
354 VFrame **statusbar_cancel_data;
355 VFrame *timebar_view_data;
356 VFrame **transition_data;
357 VFrame **uptriangle_data;
358 VFrame **viewasset_data;
359 VFrame *vtimebar_bg_data;
363 // Compressed images are loaded in here.
365 char *contents_buffer;
366 ArrayList<char*> contents;
367 ArrayList<int> offsets;
368 char path[BCTEXTLEN];