b5b2d0599930f9baa2164f118b5470911e9dcf99
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / theme.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef THEME_H
23 #define THEME_H
24
25 #include "awindowgui.inc"
26 #include "batchrender.inc"
27 #include "bctheme.h"
28 #include "compressortools.inc"
29 #include "cwindowgui.inc"
30 #include "edit.inc"
31 #include "guicast.h"
32 #include "keyframegui.inc"
33 #include "levelwindowgui.inc"
34 #include "mbuttons.inc"
35 #include "mwindow.inc"
36 #include "mwindowgui.inc"
37 #include "new.inc"
38 #include "overlayframe.inc"
39 #include "patchbay.inc"
40 #include "preferencesthread.inc"
41 //#include "presetsgui.inc"
42 #include "recordgui.inc"
43 #include "recordmonitor.inc"
44 #include "resourcepixmap.inc"
45 #include "timebar.inc"
46 #include "trackcanvas.inc"
47 #include "setformat.inc"
48 #include "statusbar.inc"
49 #include "vframe.inc"
50 #include "vwindowgui.inc"
51 #include "zoombar.inc"
52
53
54
55 // Theme uses static png resources at startup.
56 // The reason is GUI elements must be constructed at startup from multiple
57 // pngs.
58
59
60
61 class Theme : public BC_Theme
62 {
63 public:
64         Theme();
65         virtual ~Theme();
66
67
68         virtual void initialize();
69         virtual void get_mwindow_sizes(MWindowGUI *gui,
70                 int w,
71                 int h);
72         virtual void get_pane_sizes(MWindowGUI *gui,
73                 int *view_x,
74                 int *view_y,
75                 int *view_w,
76                 int *view_h,
77                 int number,
78                 int x,
79                 int y,
80                 int w,
81                 int h);
82
83         virtual void get_vwindow_sizes(VWindowGUI *gui);
84         virtual void get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls);
85         virtual void get_awindow_sizes(AWindowGUI *gui);
86         virtual void get_rmonitor_sizes(int do_audio,
87                 int do_video,
88                 int do_channel,
89                 int do_interlace,
90                 int do_avc,
91                 int audio_channels);
92         virtual void get_recordgui_sizes(RecordGUI *gui,
93                 int w,
94                 int h);
95         virtual void get_batchrender_sizes(BatchRenderGUI *gui,
96                 int w,
97                 int h);
98         virtual void get_plugindialog_sizes();
99 //      virtual void get_presetdialog_sizes(PresetsWindow *gui);
100         virtual void get_keyframedialog_sizes(KeyFrameWindow *gui);
101         virtual void get_menueffect_sizes(int use_list);
102         virtual void draw_rwindow_bg(RecordGUI *gui);
103         virtual void draw_rmonitor_bg(RecordMonitorGUI *gui);
104         virtual void draw_awindow_bg(AWindowGUI *gui);
105         virtual void draw_cwindow_bg(CWindowGUI *gui);
106         virtual void draw_lwindow_bg(LevelWindowGUI *gui);
107         virtual void draw_mwindow_bg(MWindowGUI *gui);
108         virtual void draw_vwindow_bg(VWindowGUI *gui);
109         virtual void draw_resource_bg(TrackCanvas *canvas, ResourcePixmap *pixmap,
110                         int color, Edit *edit, int edit_x, int edit_w,
111                         int pixmap_x, int x1, int y1, int x2, int y2);
112
113         virtual void get_preferences_sizes();
114         virtual void draw_preferences_bg(PreferencesWindow *gui);
115         virtual void get_new_sizes(NewWindow *gui);
116         virtual void draw_new_bg(NewWindow *gui);
117         virtual void draw_setformat_bg(SetFormatWindow *window);
118
119         virtual void build_menus();
120         virtual int get_color_title_bg();
121 //      unsigned char* get_image(char *title);
122         void flush_images();
123
124         ArrayList<BC_ListBoxItem*> aspect_ratios;
125         ArrayList<BC_ListBoxItem*> frame_rates;
126         ArrayList<BC_ListBoxItem*> frame_sizes;
127         ArrayList<BC_ListBoxItem*> sample_rates;
128         ArrayList<BC_ListBoxItem*> zoom_values;
129         const char *theme_title;
130
131 // Tools for building widgets
132         void overlay(VFrame *dst, VFrame *src, int in_x1 = -1, int in_x2 = -1);
133         void build_transport(char *title,
134                 unsigned char *png_overlay,
135                 VFrame **bg_data,
136                 int region);
137         void build_patches(VFrame** &data,
138                 unsigned char *png_overlay,
139                 VFrame **bg_data,
140                 int region);
141         void build_button(VFrame** &data,
142                 unsigned char *png_overlay,
143                 VFrame *up_vframe,
144                 VFrame *hi_vframe,
145                 VFrame *dn_vframe);
146         void build_button(VFrame** &data,
147                 unsigned char *png_overlay,
148                 VFrame *up_vframe,
149                 VFrame *hi_vframe,
150                 VFrame *dn_vframe,
151                 VFrame *at_vframe);
152         void build_toggle(VFrame** &data,
153                 unsigned char *png_overlay,
154                 VFrame *up_vframe,
155                 VFrame *hi_vframe,
156                 VFrame *checked_vframe,
157                 VFrame *dn_vframe,
158                 VFrame *checkedhi_vframe);
159
160 // colors for the main message text
161         int message_normal, message_error;
162
163
164 // Locations
165         int abinbuttons_x, abinbuttons_y;
166         int abuttons_x, abuttons_y;
167         int adivider_x, adivider_y, adivider_w, adivider_h;
168         int afolders_x, afolders_y, afolders_w, afolders_h;
169         int alist_x, alist_y, alist_w, alist_h;
170         int stack_button_w;
171         int audio_color;
172 // audio zero crossing
173         int zero_crossing_color;
174 // compressor graph line
175         int graph_active_color;
176         int graph_inactive_color;
177 // compressor graph background
178         int graph_grid_color;
179         int graph_bg_color;
180         int graph_border1_color;
181         int graph_border2_color;
182         int assetedit_color;
183         int browse_pad;
184         int cauto_x, cauto_y, cauto_w, cauto_h;
185         int ccanvas_x, ccanvas_y, ccanvas_w, ccanvas_h;
186         int ccomposite_x, ccomposite_y, ccomposite_w, ccomposite_h;
187         int cstatus_x, cstatus_y;
188         int cdest_x, cdest_y;
189         int cedit_x, cedit_y;
190         int channel_position_color;
191         int cmeter_x, cmeter_y, cmeter_h;
192         int cslider_x, cslider_y, cslider_w;
193         int ctime_x, ctime_y;
194         int ctimebar_x, ctimebar_y, ctimebar_w, ctimebar_h;
195         int timebar_cursor_color;
196         int ctransport_x, ctransport_y;
197         int czoom_x, czoom_y, czoom_w;
198         int fade_h;
199         int inout_highlight_color;
200         int loadfile_pad;
201         int loadmode_w;
202         int mbuttons_x, mbuttons_y, mbuttons_w, mbuttons_h;
203 // pixels between end transport button and arrow button
204         int mtransport_margin;
205 // dimensions containing all panes
206         int mcanvas_x, mcanvas_y, mcanvas_w, mcanvas_h;
207         int mclock_x, mclock_y, mclock_w, mclock_h;
208         int mhscroll_x, mhscroll_y, mhscroll_w;
209         int mvscroll_x, mvscroll_y, mvscroll_h;
210         int meter_h;
211         int mode_h;
212         int mstatus_x, mstatus_y, mstatus_w, mstatus_h;
213         int mstatus_message_x, mstatus_message_y;
214         int mstatus_progress_x, mstatus_progress_y, mstatus_progress_w;
215         int mstatus_cancel_x, mstatus_cancel_y;
216         int mtimebar_x, mtimebar_y, mtimebar_w, mtimebar_h;
217         int mzoom_x, mzoom_y, mzoom_w, mzoom_h;
218         int new_audio_x, new_audio_y;
219         int new_ok_x, new_ok_y;
220         int new_video_x, new_video_y;
221         int pan_h;
222         int pan_x;
223         int pane_x;
224 // Division lines for track panes
225         int pane_y;
226         int pane_w;
227         int pane_h;
228         int play_h;
229         int pane_color;
230         int drag_pane_color;
231         int preferencescategory_x, preferencescategory_y;
232 // Overlap between category buttons
233         int preferences_category_overlap;
234         int preferencestitle_x, preferencestitle_y;
235         int preferencesoptions_x, preferencesoptions_y;
236         int patchbay_x, patchbay_y, patchbay_w, patchbay_h;
237 // pixels between toggles and buttons in edit panel
238         int toggle_margin;
239 // Distance to left and right of automation point for control points
240         int control_pixels;
241
242         int plugindialog_new_x, plugindialog_new_y, plugindialog_new_w, plugindialog_new_h;
243         int plugindialog_shared_x, plugindialog_shared_y, plugindialog_shared_w, plugindialog_shared_h;
244         int plugindialog_module_x, plugindialog_module_y, plugindialog_module_w, plugindialog_module_h;
245         int plugindialog_newattach_x, plugindialog_newattach_y;
246         int plugindialog_sharedattach_x, plugindialog_sharedattach_y;
247         int plugindialog_moduleattach_x, plugindialog_moduleattach_y;
248
249         int presets_list_x, presets_list_y, presets_list_w, presets_list_h;
250         int presets_text_x, presets_text_y, presets_text_w;
251         int presets_delete_x, presets_delete_y;
252         int presets_save_x, presets_save_y;
253         int presets_apply_x, presets_apply_y;
254
255         int keyframe_list_x, keyframe_list_y, keyframe_list_w, keyframe_list_h;
256         int keyframe_text_x, keyframe_text_y, keyframe_text_w, keyframe_text_h;
257         int keyframe_value_x, keyframe_value_y, keyframe_value_w, keyframe_value_h;
258         int keyframe_all_x, keyframe_all_y;
259
260         int menueffect_list_x, menueffect_list_y, menueffect_list_w, menueffect_list_h;
261         int menueffect_file_x, menueffect_file_y;
262         int menueffect_tools_x, menueffect_tools_y;
263
264
265         int recordgui_batches_w, recordgui_batches_h;
266         int recordgui_batches_x, recordgui_batches_y;
267         int recordgui_batch_x, recordgui_batch_y, recordgui_batchcaption_x;
268         int recordgui_options_x, recordgui_options_y;
269         int recordgui_controls_x, recordgui_controls_y;
270         int recordgui_loadmode_x, recordgui_loadmode_y;
271         int recordgui_status_x, recordgui_status_y, recordgui_status_x2;
272         int recordgui_transport_x, recordgui_transport_y;
273         int recordgui_fixed_color, recordgui_variable_color;
274         int rmonitor_canvas_w, rmonitor_canvas_h;
275         int rmonitor_canvas_x, rmonitor_canvas_y;
276         int rmonitor_channel_x, rmonitor_channel_y;
277         int rmonitor_interlace_x, rmonitor_interlace_y;
278         int rmonitor_meter_w, rmonitor_meter_h;
279         int rmonitor_meter_x, rmonitor_meter_y;
280         int rmonitor_source_x, rmonitor_source_y;
281         int rmonitor_tx_x, rmonitor_tx_y;
282
283         int batchrender_x1, batchrender_x2, batchrender_x3;
284
285         int setformat_x1, setformat_x2, setformat_x3, setformat_x4;
286         int setformat_y1, setformat_y2, setformat_y3;
287         int setformat_w, setformat_h, setformat_margin;
288         int setformat_channels_x, setformat_channels_y, setformat_channels_w, setformat_channels_h;
289         int title_h;
290         int title_font, title_color;
291         int edit_font_color;
292         int vcanvas_x, vcanvas_y, vcanvas_w, vcanvas_h;
293         int vedit_x, vedit_y;
294         int vmeter_x, vmeter_y, vmeter_h;
295         int vslider_x, vslider_y, vslider_w;
296         int vsource_x, vsource_y;
297         int vtimebar_x, vtimebar_y, vtimebar_w, vtimebar_h;
298         int vtime_x, vtime_y, vtime_w;
299         int vdivision_x;
300         int vtransport_x, vtransport_y;
301         int vzoom_x, vzoom_y;
302         int window_border;
303         int widget_border;
304         int clock_bg_color;
305         int clock_fg_color;
306         int use_commercials;
307
308 // Bitmaps
309         VFrame *about_bg;
310         VFrame **appendasset_data;
311         VFrame **append_data;
312         VFrame **asset_append_data;
313         VFrame **asset_disk_data;
314         VFrame **asset_index_data;
315         VFrame **asset_info_data;
316         VFrame **asset_project_data;
317         VFrame **browse_data;
318         VFrame **calibrate_data;
319         VFrame *camerakeyframe_data;
320         VFrame **cancel_data;
321         VFrame **chain_data;
322         VFrame *channel_bg_data;
323         VFrame *channel_position_data;
324         VFrame **delete_all_indexes_data;
325         VFrame **deletebin_data;
326         VFrame **delete_data;
327         VFrame **deletedisk_data;
328         VFrame **deleteproject_data;
329         VFrame **detach_data;
330         VFrame **dntriangle_data;
331
332         VFrame **edit_data;
333         VFrame **edithandlein_data;
334         VFrame **edithandleout_data;
335         VFrame **extract_data;
336         VFrame **ffmpeg_toggle;
337         VFrame **proxy_p_toggle;
338         VFrame **proxy_s_toggle;
339         VFrame **mask_mode_toggle;
340         VFrame **infoasset_data;
341         VFrame **in_point;
342         VFrame **insert_data;
343         VFrame *keyframe_data;
344         VFrame **label_toggle;
345         VFrame **lift_data;
346         VFrame *maskkeyframe_data;
347         VFrame *modekeyframe_data;
348         VFrame *hardedge_data;
349         VFrame **movedn_data;
350         VFrame **moveup_data;
351         VFrame **newbin_data;
352         VFrame **no_data;
353         VFrame **options_data;
354         VFrame **out_point;
355         VFrame **over_button;
356         VFrame **overwrite_data;
357         VFrame *pankeyframe_data;
358         VFrame **pasteasset_data;
359         VFrame **paused_data;
360         VFrame **picture_data;
361         VFrame **presentation_data;
362         VFrame **presentation_loop;
363         VFrame **presentation_stop;
364         VFrame *projectorkeyframe_data;
365         VFrame **redrawindex_data;
366         VFrame **renamebin_data;
367         VFrame **reset_data;
368         VFrame **reverse_data;
369         VFrame **rewind_data;
370         VFrame **select_data;
371         VFrame **shbtn_data;
372         VFrame **splice_data;
373         VFrame **start_over_data;
374         VFrame **statusbar_cancel_data;
375         VFrame *timebar_view_data;
376         VFrame **transition_data;
377         VFrame **uptriangle_data;
378         VFrame **viewasset_data;
379         VFrame *vtimebar_bg_data;
380
381
382         MWindow *mwindow;
383 // Compressed images are loaded in here.
384         char *data_buffer;
385         char path[BCTEXTLEN];
386         char *last_image;
387         int last_offset;
388 };
389
390 #endif