add scaled icon data
[goodguy/history.git] / cinelerra-5.0 / plugins / defaulttheme / defaulttheme.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 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 #include "bcsignals.h"
23 #include "clip.h"
24 #include "cwindowgui.h"
25 #include "defaulttheme.h"
26 #include "edl.h"
27 #include "edlsession.h"
28 #include "mainmenu.h"
29 #include "mainsession.h"
30 #include "mbuttons.h"
31 #include "meterpanel.h"
32 #include "mwindow.h"
33 #include "mwindowgui.h"
34 #include "new.h"
35 #include "patchbay.h"
36 #include "preferencesthread.h"
37 #include "recordgui.h"
38 #include "recordmonitor.h"
39 #include "setformat.h"
40 #include "statusbar.h"
41 #include "timebar.h"
42 #include "trackcanvas.h"
43 #include "vframe.h"
44 #include "vwindowgui.h"
45 #include "zoombar.h"
46
47
48
49
50 PluginClient* new_plugin(PluginServer *server)
51 {
52         return new DefaultThemeMain(server);
53 }
54
55
56
57
58
59
60
61 DefaultThemeMain::DefaultThemeMain(PluginServer *server)
62  : PluginTClient(server)
63 {
64 }
65
66 DefaultThemeMain::~DefaultThemeMain()
67 {
68 }
69
70 char* DefaultThemeMain::plugin_title()
71 {
72         return _("Blond");
73 }
74
75 Theme* DefaultThemeMain::new_theme()
76 {
77         theme = new DefaultTheme;
78         extern unsigned char _binary_defaulttheme_data_start[];
79         theme->set_data(_binary_defaulttheme_data_start);
80         return theme;
81 }
82
83
84
85
86
87
88
89
90 DefaultTheme::DefaultTheme()
91  : Theme()
92 {
93 }
94
95 DefaultTheme::~DefaultTheme()
96 {
97 }
98
99 void DefaultTheme::initialize()
100 {
101         BC_Resources *resources = BC_WindowBase::get_resources();
102         resources->generic_button_images = new_image_set(3, 
103                         "generic_up.png", 
104                         "generic_hi.png", 
105                         "generic_dn.png");
106         resources->horizontal_slider_data = new_image_set(6,
107                         "hslider_fg_up.png",
108                         "hslider_fg_hi.png",
109                         "hslider_fg_dn.png",
110                         "hslider_bg_up.png",
111                         "hslider_bg_hi.png",
112                         "hslider_bg_dn.png");
113         resources->progress_images = new_image_set(2,
114                         "progress_bg.png",
115                         "progress_hi.png");
116         resources->tumble_data = new_image_set(4,
117                 "tumble_up.png",
118                 "tumble_hi.png",
119                 "tumble_botdn.png",
120                 "tumble_topdn.png");
121         resources->listbox_button = new_image_set(4,
122                 "listbox_button_up.png",
123                 "listbox_button_hi.png",
124                 "listbox_button_dn.png",
125                 "listbox_button_hi.png");
126         resources->listbox_column = new_image_set(3,
127                 "listbox_column_up.png",
128                 "listbox_column_hi.png",
129                 "listbox_column_dn.png");
130         resources->pan_data = new_image_set(7,
131                         "pan_up.png", 
132                         "pan_hi.png", 
133                         "pan_popup.png", 
134                         "pan_channel.png", 
135                         "pan_stick.png", 
136                         "pan_channel_small.png", 
137                         "pan_stick_small.png");
138         resources->pan_text_color = WHITE;
139
140         resources->pot_images = new_image_set(3,
141                 "pot_up.png",
142                 "pot_hi.png",
143                 "pot_dn.png");
144
145         resources->checkbox_images = new_image_set(5,
146                 "checkbox_up.png",
147                 "checkbox_uphi.png",
148                 "checkbox_checked.png",
149                 "checkbox_down.png",
150                 "checkbox_checkedhi.png");
151
152         resources->radial_images = new_image_set(5,
153                 "radial_up.png",
154                 "radial_uphi.png",
155                 "radial_checked.png",
156                 "radial_down.png",
157                 "radial_checkedhi.png");
158
159         resources->xmeter_images = new_image_set(7, 
160                 "xmeter_normal.png",
161                 "xmeter_green.png",
162                 "xmeter_red.png",
163                 "xmeter_yellow.png",
164                 "xmeter_white.png",
165                 "xmeter_over.png",
166                 "downmix51_2.png");
167         resources->ymeter_images = new_image_set(7, 
168                 "ymeter_normal.png",
169                 "ymeter_green.png",
170                 "ymeter_red.png",
171                 "ymeter_yellow.png",
172                 "ymeter_white.png",
173                 "ymeter_over.png",
174                 "downmix51_2.png");
175
176         resources->hscroll_data = new_image_set(10,
177                         "hscroll_center_up.png",
178                         "hscroll_center_hi.png",
179                         "hscroll_center_dn.png",
180                         "hscroll_bg.png",
181                         "hscroll_back_up.png",
182                         "hscroll_back_hi.png",
183                         "hscroll_back_dn.png",
184                         "hscroll_fwd_up.png",
185                         "hscroll_fwd_hi.png",
186                         "hscroll_fwd_dn.png");
187
188         resources->vscroll_data = new_image_set(10,
189                         "vscroll_center_up.png",
190                         "vscroll_center_hi.png",
191                         "vscroll_center_dn.png",
192                         "vscroll_bg.png",
193                         "vscroll_back_up.png",
194                         "vscroll_back_hi.png",
195                         "vscroll_back_dn.png",
196                         "vscroll_fwd_up.png",
197                         "vscroll_fwd_hi.png",
198                         "vscroll_fwd_dn.png");
199
200         resources->ok_images = new_button("ok.png", 
201                         "generic_up.png",
202                         "generic_hi.png",
203                         "generic_dn.png");
204
205         resources->cancel_images = new_button("cancel.png", 
206                         "generic_up.png",
207                         "generic_hi.png",
208                         "generic_dn.png");
209
210
211 // Record windows
212         rgui_batch = new_image("recordgui_batch.png");
213         rgui_controls = new_image("recordgui_controls.png");
214         rgui_list = new_image("recordgui_list.png");
215         rmonitor_panel = new_image("recordmonitor_panel.png");
216         rmonitor_meters = new_image("recordmonitor_meters.png");
217
218
219 // MWindow
220         mbutton_left = new_image("mbutton_left.png");
221         mbutton_right = new_image("mbutton_right.png");
222         new_image("timebar_bg", "timebar_bg.png");
223         new_image("timebar_brender", "timebar_brender.png");
224         new_image("clock_bg", "mclock.png");
225         new_image("patchbay_bg", "patchbay_bg.png");
226         tracks_bg = new_image("tracks_bg.png");
227         zoombar_left = new_image("zoombar_left.png");
228         zoombar_right = new_image("zoombar_right.png");
229         statusbar_left = new_image("statusbar_left.png");
230         statusbar_right = new_image("statusbar_right.png");
231
232 // CWindow
233         cpanel_bg = new_image("cpanel_bg.png");
234         cbuttons_left = new_image("cbuttons_left.png");
235         cbuttons_right = new_image("cbuttons_right.png");
236         cmeter_bg = new_image("cmeter_bg.png");
237
238 // VWindow
239         vbuttons_left = new_image("vbuttons_left.png");
240         vbuttons_right = new_image("vbuttons_right.png");
241         vmeter_bg = new_image("vmeter_bg.png");
242
243         preferences_bg = new_image("preferences_bg.png");
244
245
246         new_bg = new_image("new_bg.png");
247         setformat_bg = new_image("setformat_bg2.png");
248
249
250         timebar_view_data = new_image("timebar_view.png");
251
252         setformat_w = 600;
253         setformat_h = 560;
254         setformat_x1 = 15;
255         setformat_x2 = 100;
256
257         setformat_x3 = 315;
258         setformat_x4 = 415;
259         setformat_y1 = 20;
260         setformat_y2 = 85;
261         setformat_y3 = 125;
262         setformat_margin = 30;
263         setformat_channels_x = 25;
264         setformat_channels_y = 242;
265         setformat_channels_w = 250;
266         setformat_channels_h = 250;
267
268         loadfile_pad = 70;
269         browse_pad = 20;
270
271
272
273
274
275
276
277         build_icons();
278         build_bg_data();
279
280         new_image_set("drawpatch_data", 5, "drawpatch_up.png", "drawpatch_hi.png", "drawpatch_checked.png", "drawpatch_dn.png", "drawpatch_checkedhi.png");
281         new_image_set("expandpatch_data", 5, "expandpatch_up.png", "expandpatch_hi.png", "expandpatch_checked.png", "expandpatch_dn.png", "expandpatch_checkedhi.png");
282         new_image_set("gangpatch_data", 5, "gangpatch_up.png", "gangpatch_hi.png", "gangpatch_checked.png", "gangpatch_dn.png", "gangpatch_checkedhi.png");
283         new_image_set("mutepatch_data", 5, "mutepatch_up.png", "mutepatch_hi.png", "mutepatch_checked.png", "mutepatch_dn.png", "mutepatch_checkedhi.png");
284         new_image_set("playpatch_data", 5, "playpatch_up.png", "playpatch_hi.png", "playpatch_checked.png", "playpatch_dn.png", "playpatch_checkedhi.png");
285         new_image_set("recordpatch_data", 5, "recordpatch_up.png", "recordpatch_hi.png", "recordpatch_checked.png", "recordpatch_dn.png", "recordpatch_checkedhi.png");
286
287
288         build_overlays();
289
290
291
292         out_point = new_image_set(5,
293                 "out_up.png", 
294                 "out_hi.png", 
295                 "out_checked.png", 
296                 "out_dn.png", 
297                 "out_checkedhi.png");
298         in_point = new_image_set(5,
299                 "in_up.png", 
300                 "in_hi.png", 
301                 "in_checked.png", 
302                 "in_dn.png", 
303                 "in_checkedhi.png");
304
305         label_toggle = new_image_set(5,
306                 "labeltoggle_up.png", 
307                 "labeltoggle_uphi.png", 
308                 "label_checked.png", 
309                 "labeltoggle_dn.png", 
310                 "label_checkedhi.png");
311
312         ffmpeg_toggle = new_image_set(5,
313                 "ff_up.png", 
314                 "ff_hi.png", 
315                 "ff_checked.png", 
316                 "ff_down.png", 
317                 "ff_checkedhi.png");
318
319         shbtn_data = new_image_set(3,
320                 "shbtn_up.png",
321                 "shbtn_hi.png",
322                 "shbtn_dn.png");
323
324         statusbar_cancel_data = new_image_set(3,
325                 "statusbar_cancel_up.png",
326                 "statusbar_cancel_hi.png",
327                 "statusbar_cancel_dn.png");
328
329
330         VFrame *editpanel_up = new_image("editpanel_up.png");
331         VFrame *editpanel_hi = new_image("editpanel_hi.png");
332         VFrame *editpanel_dn = new_image("editpanel_dn.png");
333         VFrame *editpanel_checked = new_image("editpanel_checked.png");
334         VFrame *editpanel_checkedhi = new_image("editpanel_checkedhi.png");
335
336         bottom_justify = new_button("bottom_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
337         center_justify = new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
338         channel_data = new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn);
339         new_button("copy.png", editpanel_up, editpanel_hi, editpanel_dn, "copy");
340         new_button("cut.png", editpanel_up, editpanel_hi, editpanel_dn, "cut");
341         new_button("fit.png", editpanel_up, editpanel_hi, editpanel_dn, "fit");
342         new_button("fitautos.png", editpanel_up, editpanel_hi, editpanel_dn, "fitautos");
343         new_button("inpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "inbutton");
344         new_button("label.png", editpanel_up, editpanel_hi, editpanel_dn, "labelbutton");
345         left_justify = new_button("left_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
346         magnify_button_data = new_button("magnify.png", editpanel_up, editpanel_hi, editpanel_dn);
347         middle_justify = new_button("middle_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
348         new_button("nextlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "nextlabel");
349         new_button("outpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "outbutton");
350         over_button = new_button("over.png", editpanel_up, editpanel_hi, editpanel_dn);
351         overwrite_data = new_button("overwrite.png", editpanel_up, editpanel_hi, editpanel_dn);
352         new_button("paste.png", editpanel_up, editpanel_hi, editpanel_dn, "paste");
353         new_button("prevlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "prevlabel");
354         new_button("redo.png", editpanel_up, editpanel_hi, editpanel_dn, "redo");
355         right_justify = new_button("right_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
356         splice_data = new_button("splice.png", editpanel_up, editpanel_hi, editpanel_dn);
357         new_button("toclip.png", editpanel_up, editpanel_hi, editpanel_dn, "toclip");
358         top_justify = new_button("top_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
359         new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
360         wrench_data = new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn);
361
362 // CWindow icons
363         new_image("cwindow_inactive", "cwindow_inactive.png");
364         new_image("cwindow_active", "cwindow_active.png");
365
366
367         new_image_set("batch_render_start",
368                 3,
369                 "batchstart_up.png",
370                 "batchstart_hi.png",
371                 "batchstart_dn.png");
372         new_image_set("batch_render_stop",
373                 3,
374                 "batchstop_up.png",
375                 "batchstop_hi.png",
376                 "batchstop_dn.png");
377         new_image_set("batch_render_cancel",
378                 3,
379                 "batchcancel_up.png",
380                 "batchcancel_hi.png",
381                 "batchcancel_dn.png");
382
383         new_toggle("arrow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "arrow");
384         new_toggle("autokeyframe.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "autokeyframe");
385         camera_data = new_toggle("camera.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
386         crop_data = new_toggle("crop.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
387         new_toggle("ibeam.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "ibeam");
388         magnify_data = new_toggle("magnify.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
389         mask_data = new_toggle("mask.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
390         proj_data = new_toggle("projector.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
391         protect_data = new_toggle("protect.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
392         show_meters = new_toggle("show_meters.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
393         titlesafe_data = new_toggle("titlesafe.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
394         tool_data = new_toggle("toolwindow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
395         new_toggle("eyedrop.png", 
396                 editpanel_up, 
397                 editpanel_hi, 
398                 editpanel_checked, 
399                 editpanel_dn, 
400                 editpanel_checkedhi, 
401                 "cwindow_eyedrop");
402
403
404
405
406         static VFrame **transport_bg = new_image_set(3,
407                 "transportup.png", 
408                 "transporthi.png", 
409                 "transportdn.png");
410         build_transport("end", get_image_data("end.png"), transport_bg, 2);
411         build_transport("fastfwd", get_image_data("fastfwd.png"), transport_bg, 1);
412         build_transport("fastrev", get_image_data("fastrev.png"), transport_bg, 1);
413         build_transport("play", get_image_data("play.png"), transport_bg, 1);
414         build_transport("framefwd", get_image_data("framefwd.png"), transport_bg, 1);
415         build_transport("framerev", get_image_data("framerev.png"), transport_bg, 1);
416         build_transport("pause", get_image_data("pause.png"), transport_bg, 1);
417         build_transport("record", get_image_data("record.png"), transport_bg, 1);
418         build_transport("singleframe", get_image_data("singleframe.png"), transport_bg, 1);
419         build_transport("reverse", get_image_data("reverse.png"), transport_bg, 1);
420         build_transport("rewind", get_image_data("rewind.png"), transport_bg, 0);
421         build_transport("stop", get_image_data("stop.png"), transport_bg, 1);
422         build_transport("stoprec", get_image_data("stoprec.png"), transport_bg, 2);
423         flush_images();
424
425         title_font = MEDIUMFONT_3D;
426         title_color = WHITE;
427         recordgui_fixed_color = YELLOW;
428         recordgui_variable_color = RED;
429
430         channel_position_color = MEYELLOW;
431         resources->meter_title_w = 25;
432 }
433
434 #define CWINDOW_METER_MARGIN 5
435 #define VWINDOW_METER_MARGIN 5
436
437 void DefaultTheme::get_mwindow_sizes(MWindowGUI *gui, int w, int h)
438 {
439         mbuttons_x = 0;
440         mbuttons_y = gui->mainmenu->get_h();
441         mbuttons_w = w;
442         mbuttons_h = mbutton_left->get_h();
443         mclock_x = 10;
444         mclock_y = mbuttons_y + mbuttons_h + CWINDOW_METER_MARGIN;
445         mclock_w = get_image("clock_bg")->get_w() - 40;
446         mclock_h = get_image("clock_bg")->get_h();
447         mtimebar_x = get_image("patchbay_bg")->get_w();
448         mtimebar_y = mbuttons_y + mbuttons_h;
449         mtimebar_w = w - mtimebar_x;
450         mtimebar_h = get_image("timebar_bg")->get_h();
451         mstatus_x = 0;
452         mstatus_y = h - statusbar_left->get_h();
453         mstatus_w = w;
454         mstatus_h = statusbar_left->get_h();
455         mstatus_message_x = 10;
456         mstatus_message_y = 5;
457         mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 240;
458         mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h();
459         mstatus_progress_w = 230;
460         mstatus_cancel_x = mstatus_w - statusbar_cancel_data[0]->get_w();
461         mstatus_cancel_y = mstatus_h - statusbar_cancel_data[0]->get_h();
462         mzoom_x = 0;
463         mzoom_y = mstatus_y - zoombar_left->get_h();
464         mzoom_h = zoombar_left->get_h();
465         mzoom_w = w;
466         patchbay_x = 0;
467         patchbay_y = mtimebar_y + mtimebar_h;
468         patchbay_w = get_image("patchbay_bg")->get_w();
469         patchbay_h = mzoom_y - patchbay_y;
470         mcanvas_x = patchbay_x + patchbay_w;
471         mcanvas_y = mtimebar_y + mtimebar_h;
472         mcanvas_w = w - patchbay_w - BC_ScrollBar::get_span(SCROLL_VERT);
473         mcanvas_h = patchbay_h;
474         mhscroll_x = 0;
475         mhscroll_y = mcanvas_y + mcanvas_h;
476         mhscroll_w = w - BC_ScrollBar::get_span(SCROLL_VERT) - patchbay_w;
477         mvscroll_x = mcanvas_x + mcanvas_w;
478         mvscroll_y = mcanvas_y;
479         mvscroll_h = mcanvas_h;
480 }
481
482 void DefaultTheme::get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls)
483 {
484         if(cwindow_controls)
485         {
486                 ccomposite_x = 0;
487                 ccomposite_y = 5;
488                 ccomposite_w = cpanel_bg->get_w();
489                 ccomposite_h = mwindow->session->cwindow_h - cbuttons_left->get_h();
490                 cedit_x = 10;
491                 cedit_y = ccomposite_h + 17;
492                 ctransport_x = 10;
493                 ctransport_y = mwindow->session->cwindow_h - get_image_set("autokeyframe")[0]->get_h();
494                 ccanvas_x = ccomposite_x + ccomposite_w;
495                 ccanvas_y = 0;
496                 ccanvas_h = ccomposite_h;
497                 cstatus_x = 525;
498                 cstatus_y = mwindow->session->cwindow_h - 40;
499                 if(mwindow->edl->session->cwindow_meter)
500                 {
501                         cmeter_x = mwindow->session->cwindow_w - MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, 
502                                 mwindow->edl->session->cwindow_meter);
503                         ccanvas_w = cmeter_x - ccanvas_x - 5;
504                 }
505                 else
506                 {
507                         cmeter_x = mwindow->session->cwindow_w;
508                         ccanvas_w = cmeter_x - ccanvas_x;
509                 }
510         }
511         else
512         {
513                 ccomposite_x = -cpanel_bg->get_w();
514                 ccomposite_y = 0;
515                 ccomposite_w = cpanel_bg->get_w();
516                 ccomposite_h = mwindow->session->cwindow_h - cbuttons_left->get_h();
517
518                 cedit_x = 10;
519                 cedit_y = mwindow->session->cwindow_h + 17;
520                 ctransport_x = 10;
521                 ctransport_y = cedit_y + 40;
522                 ccanvas_x = 0;
523                 ccanvas_y = 0;
524                 ccanvas_w = mwindow->session->cwindow_w;
525                 ccanvas_h = mwindow->session->cwindow_h;
526                 cmeter_x = mwindow->session->cwindow_w;
527                 cstatus_x = mwindow->session->cwindow_w;
528                 cstatus_y = mwindow->session->cwindow_h;
529         }
530
531
532         czoom_x = ctransport_x + PlayTransport::get_transport_width(mwindow) + 20;
533         czoom_y = ctransport_y + 5;
534
535
536         cmeter_y = 5;
537         cmeter_h = mwindow->session->cwindow_h - cmeter_y;
538
539         ctimebar_x = ccanvas_x;
540         ctimebar_y = ccanvas_y + ccanvas_h;
541         ctimebar_w = ccanvas_w;
542         ctimebar_h = 16;
543
544
545 // Not used
546         ctime_x = ctransport_x + PlayTransport::get_transport_width(mwindow);
547         ctime_y = ctransport_y;
548         cdest_x = czoom_x;
549         cdest_y = czoom_y + 30;
550 }
551
552
553
554 void DefaultTheme::get_recordgui_sizes(RecordGUI *gui, int w, int h)
555 {
556         recordgui_status_x = 10;
557         recordgui_status_y = 10;
558         recordgui_status_x2 = 160;
559         recordgui_batch_x = 310;
560         recordgui_batch_y = 10;
561         recordgui_batchcaption_x = recordgui_batch_x + 110;
562
563
564         recordgui_transport_x = recordgui_batch_x;
565         recordgui_transport_y = recordgui_batch_y + 150;
566
567         recordgui_buttons_x = recordgui_batch_x - 50;
568         recordgui_buttons_y = recordgui_transport_y + 40;
569         recordgui_options_x = recordgui_buttons_x;
570         recordgui_options_y = recordgui_buttons_y + 35;
571
572         recordgui_batches_x = 10;
573         recordgui_batches_y = 270;
574         recordgui_batches_w = w - 20;
575         recordgui_batches_h = h - recordgui_batches_y - 70;
576         recordgui_loadmode_x = w / 2 - loadmode_w / 2;
577         recordgui_loadmode_y = h - 60;
578
579         recordgui_controls_x = 10;
580         recordgui_controls_y = h - 40;
581 }
582
583
584
585 void DefaultTheme::get_vwindow_sizes(VWindowGUI *gui)
586 {
587         vmeter_y = 5;
588         vmeter_h = mwindow->session->vwindow_h - cmeter_y;
589         vcanvas_x = 0;
590         vcanvas_y = 0;
591         vcanvas_h = mwindow->session->vwindow_h - vbuttons_left->get_h();
592
593         if(mwindow->edl->session->vwindow_meter)
594         {
595                 vmeter_x = mwindow->session->vwindow_w - 
596                         VWINDOW_METER_MARGIN - 
597                         MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, 
598                         mwindow->edl->session->vwindow_meter);
599                 vcanvas_w = vmeter_x - vcanvas_x - VWINDOW_METER_MARGIN;
600         }
601         else
602         {
603                 vmeter_x = mwindow->session->vwindow_w;
604                 vcanvas_w = mwindow->session->vwindow_w;
605         }
606
607         vtimebar_x = vcanvas_x;
608         vtimebar_y = vcanvas_y + vcanvas_h;
609         vtimebar_w = vcanvas_w;
610         vtimebar_h = 16;
611
612         vslider_x = 10;
613         vslider_y = vtimebar_y + 25;
614         vslider_w = vtimebar_w - vslider_x;
615         vedit_x = 10;
616         vedit_y = vslider_y + 17;
617         vtransport_x = 10;
618         vtransport_y = mwindow->session->vwindow_h - get_image_set("autokeyframe")[0]->get_h();
619         vtime_x = 370;
620         vtime_y = vedit_y + 10;
621         vtime_w = 150;
622
623
624
625
626         vzoom_x = vtime_x + 150;
627         vzoom_y = vtime_y;
628         vsource_x = vtime_x + 50;
629         vsource_y = vtransport_y + 5;
630 }
631
632
633
634
635
636 void DefaultTheme::build_icons()
637 {
638         mwindow_icon = new VFrame(get_image_data("heroine_icon.png"));
639         vwindow_icon = new VFrame(get_image_data("heroine_icon.png"));
640         cwindow_icon = new VFrame(get_image_data("heroine_icon.png"));
641         awindow_icon = new VFrame(get_image_data("heroine_icon.png"));
642         record_icon = new VFrame(get_image_data("heroine_icon.png"));
643         clip_icon = new VFrame(get_image_data("clip_icon.png"));
644 }
645
646
647
648 void DefaultTheme::build_bg_data()
649 {
650 // Audio settings
651         channel_bg_data = new VFrame(get_image_data("channel_bg.png"));
652         channel_position_data = new VFrame(get_image_data("channel_position.png"));
653
654 // Track bitmaps
655         new_image("resource1024", "resource1024.png");
656         new_image("resource512", "resource512.png");
657         new_image("resource256", "resource256.png");
658         new_image("resource128", "resource128.png");
659         new_image("resource64", "resource64.png");
660         new_image("resource32", "resource32.png");
661         plugin_bg_data = new VFrame(get_image_data("plugin_bg.png"));
662         title_bg_data = new VFrame(get_image_data("title_bg.png"));
663         vtimebar_bg_data = new VFrame(get_image_data("vwindow_timebar.png"));
664 }
665
666
667
668 void DefaultTheme::build_overlays()
669 {
670         keyframe_data = new VFrame(get_image_data("keyframe3.png"));
671         camerakeyframe_data = new VFrame(get_image_data("camerakeyframe.png"));
672         maskkeyframe_data = new VFrame(get_image_data("maskkeyframe.png"));
673         modekeyframe_data = new VFrame(get_image_data("modekeyframe.png"));
674         pankeyframe_data = new VFrame(get_image_data("pankeyframe.png"));
675         projectorkeyframe_data = new VFrame(get_image_data("projectorkeyframe.png"));
676 }
677
678
679
680
681
682
683
684
685
686 void DefaultTheme::draw_rwindow_bg(RecordGUI *gui)
687 {
688         int y;
689         int margin = 50;
690         int margin2 = 80;
691         gui->draw_9segment(recordgui_batch_x - margin,
692                 0,
693                 mwindow->session->rwindow_w - recordgui_status_x + margin,
694                 recordgui_buttons_y,
695                 rgui_batch);
696         gui->draw_3segmenth(recordgui_options_x - margin2,
697                 recordgui_buttons_y - 5,
698                 mwindow->session->rwindow_w - recordgui_options_x + margin2,
699                 rgui_controls);
700         y = recordgui_buttons_y - 5 + rgui_controls->get_h();
701         gui->draw_9segment(0,
702                 y,
703                 mwindow->session->rwindow_w,
704                 mwindow->session->rwindow_h - y,
705                 rgui_list);
706 }
707
708 void DefaultTheme::draw_rmonitor_bg(RecordMonitorGUI *gui)
709 {
710         int margin = 45;
711         int panel_w = 300;
712         int x = rmonitor_meter_x - margin;
713         int w = mwindow->session->rmonitor_w - x;
714         if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w();
715         gui->clear_box(0, 
716                 0, 
717                 mwindow->session->rmonitor_w, 
718                 mwindow->session->rmonitor_h);
719         gui->draw_9segment(x,
720                 0,
721                 w,
722                 mwindow->session->rmonitor_h,
723                 rmonitor_meters);
724 }
725
726
727
728
729
730
731 void DefaultTheme::draw_mwindow_bg(MWindowGUI *gui)
732 {
733 // Button bar
734         gui->draw_3segmenth(mbuttons_x, 
735                 mbuttons_y, 
736                 750, 
737                 mbutton_left);
738         gui->draw_3segmenth(mbuttons_x + 750, 
739                 mbuttons_y, 
740                 mbuttons_w - 500, 
741                 mbutton_right);
742
743 // Clock
744         gui->draw_3segmenth(0, 
745                 mbuttons_y + mbutton_left->get_h(),
746                 get_image("patchbay_bg")->get_w(), 
747                 get_image("clock_bg"));
748
749 // Patchbay
750         gui->draw_3segmentv(patchbay_x, 
751                 patchbay_y, 
752                 patchbay_h + 20, 
753                 get_image("patchbay_bg"));
754
755 // Track canvas
756         gui->draw_9segment(mcanvas_x, 
757                 mcanvas_y, 
758                 mcanvas_w, 
759                 patchbay_h + 20, 
760                 tracks_bg);
761
762 // Timebar
763         gui->draw_3segmenth(mtimebar_x, 
764                 mtimebar_y, 
765                 mtimebar_w, 
766                 get_image("timebar_bg"));
767
768 // Zoombar
769         int zoombar_center = 710;
770         gui->draw_3segmenth(mzoom_x, 
771                 mzoom_y,
772                 zoombar_center, 
773                 zoombar_left);
774         if(mzoom_w > zoombar_center)
775                 gui->draw_3segmenth(mzoom_x + zoombar_center, 
776                         mzoom_y, 
777                         mzoom_w - zoombar_center, 
778                         zoombar_right);
779
780 // Status
781         gui->draw_3segmenth(mstatus_x, 
782                 mstatus_y,
783                 zoombar_center, 
784                 statusbar_left);
785
786         if(mstatus_w > zoombar_center)
787                 gui->draw_3segmenth(mstatus_x + zoombar_center, 
788                         mstatus_y,
789                         mstatus_w - zoombar_center, 
790                         statusbar_right);
791 }
792
793 void DefaultTheme::draw_cwindow_bg(CWindowGUI *gui)
794 {
795         const int button_division = 530;
796         gui->draw_3segmentv(0, 0, ccomposite_h, cpanel_bg);
797         gui->draw_3segmenth(0, ccomposite_h, button_division, cbuttons_left);
798         if(mwindow->edl->session->cwindow_meter)
799         {
800                 gui->draw_3segmenth(button_division, 
801                         ccomposite_h, 
802                         cmeter_x - CWINDOW_METER_MARGIN - button_division, 
803                         cbuttons_right);
804                 gui->draw_9segment(cmeter_x - CWINDOW_METER_MARGIN, 
805                         0, 
806                         mwindow->session->cwindow_w - cmeter_x + CWINDOW_METER_MARGIN, 
807                         mwindow->session->cwindow_h, 
808                         cmeter_bg);
809         }
810         else
811         {
812                 gui->draw_3segmenth(button_division, 
813                         ccomposite_h, 
814                         cmeter_x - CWINDOW_METER_MARGIN - button_division + 100, 
815                         cbuttons_right);
816         }
817 }
818
819 void DefaultTheme::draw_vwindow_bg(VWindowGUI *gui)
820 {
821         const int button_division = 400;
822         gui->draw_3segmenth(0, vcanvas_h, button_division, vbuttons_left);
823         if(mwindow->edl->session->vwindow_meter)
824         {
825                 gui->draw_3segmenth(button_division, 
826                         vcanvas_h, 
827                         vmeter_x - VWINDOW_METER_MARGIN - button_division, 
828                         vbuttons_right);
829                 gui->draw_9segment(vmeter_x - VWINDOW_METER_MARGIN,
830                         0,
831                         mwindow->session->vwindow_w - vmeter_x + VWINDOW_METER_MARGIN, 
832                         mwindow->session->vwindow_h, 
833                         vmeter_bg);
834         }
835         else
836         {
837                 gui->draw_3segmenth(button_division, 
838                         vcanvas_h, 
839                         vmeter_x - VWINDOW_METER_MARGIN - button_division + 100, 
840                         vbuttons_right);
841         }
842 }
843
844 void DefaultTheme::get_preferences_sizes()
845 {
846 }
847
848
849 void DefaultTheme::draw_preferences_bg(PreferencesWindow *gui)
850 {
851         gui->draw_9segment(0, 0, gui->get_w(), gui->get_h() - 40, preferences_bg);
852 }
853
854 void DefaultTheme::get_new_sizes(NewWindow *gui)
855 {
856 }
857
858 void DefaultTheme::draw_new_bg(NewWindow *gui)
859 {
860         gui->draw_vframe(new_bg, 0, 0);
861 }
862
863 void DefaultTheme::draw_setformat_bg(SetFormatWindow *gui)
864 {
865         gui->draw_vframe(setformat_bg, 0, 0);
866 }
867
868
869
870
871
872