r665: Merged the official release 2.0.
[cinelerra_cv.git] / plugins / defaulttheme / defaulttheme.C
blobd6170e07e3520a4ef418fb9f5f59d9787c9d24a4
1 #include "bcsignals.h"
2 #include "clip.h"
3 #include "cwindowgui.h"
4 #include "defaulttheme.h"
5 #include "edl.h"
6 #include "edlsession.h"
7 #include "mainmenu.h"
8 #include "mainsession.h"
9 #include "mbuttons.h"
10 #include "meterpanel.h"
11 #include "mwindow.h"
12 #include "mwindowgui.h"
13 #include "new.h"
14 #include "patchbay.h"
15 #include "preferencesthread.h"
16 #include "recordgui.h"
17 #include "recordmonitor.h"
18 #include "setformat.h"
19 #include "statusbar.h"
20 #include "timebar.h"
21 #include "trackcanvas.h"
22 #include "vframe.h"
23 #include "vwindowgui.h"
24 #include "zoombar.h"
29 PluginClient* new_plugin(PluginServer *server)
31         return new BlondThemeMain(server);
40 BlondThemeMain::BlondThemeMain(PluginServer *server)
41  : PluginTClient(server)
45 BlondThemeMain::~BlondThemeMain()
49 char* BlondThemeMain::plugin_title()
51         return "Blond";
54 Theme* BlondThemeMain::new_theme()
56         theme = new BlondTheme;
57         extern unsigned char _binary_defaulttheme_data_start[];
58         theme->set_data(_binary_defaulttheme_data_start);
59         return theme;
69 BlondTheme::BlondTheme()
70  : Theme()
74 BlondTheme::~BlondTheme()
78 void BlondTheme::initialize()
80         BC_Resources *resources = BC_WindowBase::get_resources();
81         resources->generic_button_images = new_image_set(3, 
82                         "generic_up.png", 
83                         "generic_hi.png", 
84                         "generic_dn.png");
85         resources->horizontal_slider_data = new_image_set(6,
86                         "hslider_fg_up.png",
87                         "hslider_fg_hi.png",
88                         "hslider_fg_dn.png",
89                         "hslider_bg_up.png",
90                         "hslider_bg_hi.png",
91                         "hslider_bg_dn.png");
92         resources->vertical_slider_data = new_image_set(6,
93                         "vertical_slider_fg_up.png",
94                         "vertical_slider_fg_hi.png",
95                         "vertical_slider_fg_dn.png",
96                         "vertical_slider_bg_up.png",
97                         "vertical_slider_bg_hi.png",
98                         "vertical_slider_bg_dn.png");
99         resources->progress_images = new_image_set(2,
100                         "progress_bg.png",
101                         "progress_hi.png");
102         resources->tumble_data = new_image_set(4,
103                 "tumble_up.png",
104                 "tumble_hi.png",
105                 "tumble_botdn.png",
106                 "tumble_topdn.png");
107         resources->listbox_button = new_image_set(4,
108                 "listbox_button_up.png",
109                 "listbox_button_hi.png",
110                 "listbox_button_dn.png",
111                 "listbox_button_disabled.png");
112         resources->listbox_column = new_image_set(3,
113                 "listbox_column_up.png",
114                 "listbox_column_hi.png",
115                 "listbox_column_dn.png");
116         resources->listbox_expand = new_image_set(5,
117                 "listbox_expandup.png",
118                 "listbox_expanduphi.png",
119                 "listbox_expandchecked.png",
120                 "listbox_expanddn.png",
121                 "listbox_expandcheckedhi.png");
122         resources->listbox_up = new_image("listbox_up.png");
123         resources->listbox_dn = new_image("listbox_dn.png");
124         resources->pan_data = new_image_set(7,
125                         "pan_up.png", 
126                         "pan_hi.png", 
127                         "pan_popup.png", 
128                         "pan_channel.png", 
129                         "pan_stick.png", 
130                         "pan_channel_small.png", 
131                         "pan_stick_small.png");
132         resources->pan_text_color = WHITE;
134         resources->pot_images = new_image_set(3,
135                 "pot_up.png",
136                 "pot_hi.png",
137                 "pot_dn.png");
139         resources->checkbox_images = new_image_set(5,
140                 "checkbox_up.png",
141                 "checkbox_uphi.png",
142                 "checkbox_checked.png",
143                 "checkbox_down.png",
144                 "checkbox_checkedhi.png");
146         resources->radial_images = new_image_set(5,
147                 "radial_up.png",
148                 "radial_uphi.png",
149                 "radial_checked.png",
150                 "radial_down.png",
151                 "radial_checkedhi.png");
153         resources->xmeter_images = new_image_set(6, 
154                 "xmeter_normal.png",
155                 "xmeter_green.png",
156                 "xmeter_red.png",
157                 "xmeter_yellow.png",
158                 "xmeter_white.png",
159                 "xmeter_over.png");
160         resources->ymeter_images = new_image_set(6, 
161                 "ymeter_normal.png",
162                 "ymeter_green.png",
163                 "ymeter_red.png",
164                 "ymeter_yellow.png",
165                 "ymeter_white.png",
166                 "ymeter_over.png");
168         resources->hscroll_data = new_image_set(10,
169                         "hscroll_center_up.png",
170                         "hscroll_center_hi.png",
171                         "hscroll_center_dn.png",
172                         "hscroll_bg.png",
173                         "hscroll_back_up.png",
174                         "hscroll_back_hi.png",
175                         "hscroll_back_dn.png",
176                         "hscroll_fwd_up.png",
177                         "hscroll_fwd_hi.png",
178                         "hscroll_fwd_dn.png");
180         resources->vscroll_data = new_image_set(10,
181                         "vscroll_center_up.png",
182                         "vscroll_center_hi.png",
183                         "vscroll_center_dn.png",
184                         "vscroll_bg.png",
185                         "vscroll_back_up.png",
186                         "vscroll_back_hi.png",
187                         "vscroll_back_dn.png",
188                         "vscroll_fwd_up.png",
189                         "vscroll_fwd_hi.png",
190                         "vscroll_fwd_dn.png");
192         resources->ok_images = new_button("ok.png", 
193                         "generic_up.png",
194                         "generic_hi.png",
195                         "generic_dn.png");
197         resources->cancel_images = new_button("cancel.png", 
198                         "generic_up.png",
199                         "generic_hi.png",
200                         "generic_dn.png");
203 // Record windows
204         rgui_batch = new_image("recordgui_batch.png");
205         rgui_controls = new_image("recordgui_controls.png");
206         rgui_list = new_image("recordgui_list.png");
207         rmonitor_panel = new_image("recordmonitor_panel.png");
208         rmonitor_meters = new_image("recordmonitor_meters.png");
211 // MWindow
212         mbutton_left = new_image("mbutton_left.png");
213         mbutton_right = new_image("mbutton_right.png");
214         new_image("timebar_bg", "timebar_bg.png");
215         new_image("timebar_brender", "timebar_brender.png");
216         new_image("clock_bg", "mclock.png");
217         new_image("patchbay_bg", "patchbay_bg.png");
218         tracks_bg = new_image("tracks_bg.png");
219         zoombar_left = new_image("zoombar_left.png");
220         zoombar_right = new_image("zoombar_right.png");
221         statusbar_left = new_image("statusbar_left.png");
222         statusbar_right = new_image("statusbar_right.png");
224 // CWindow
225         cpanel_bg = new_image("cpanel_bg.png");
226         cbuttons_left = new_image("cbuttons_left.png");
227         cbuttons_right = new_image("cbuttons_right.png");
228         cmeter_bg = new_image("cmeter_bg.png");
230 // VWindow
231         vbuttons_left = new_image("vbuttons_left.png");
232         vbuttons_right = new_image("vbuttons_right.png");
233         vmeter_bg = new_image("vmeter_bg.png");
235         preferences_bg = new_image("preferences_bg.png");
238         new_bg = new_image("new_bg.png");
239         setformat_bg = new_image("setformat_bg2.png");
242         timebar_view_data = new_image("timebar_view.png");
244         setformat_w = 600;
245         setformat_h = 560;
246         setformat_x1 = 15;
247         setformat_x2 = 100;
249         setformat_x3 = 315;
250         setformat_x4 = 425;
251         setformat_y1 = 20;
252         setformat_y2 = 85;
253         setformat_y3 = 125;
254         setformat_margin = 30;
255         setformat_channels_x = 25;
256         setformat_channels_y = 242;
257         setformat_channels_w = 250;
258         setformat_channels_h = 250;
260         loadfile_pad = 70;
261         browse_pad = 20;
269         build_icons();
270         build_bg_data();
272         new_image_set("drawpatch_data", 5, "drawpatch_up.png", "drawpatch_hi.png", "drawpatch_checked.png", "drawpatch_dn.png", "drawpatch_checkedhi.png");
273         new_image_set("expandpatch_data", 5, "expandpatch_up.png", "expandpatch_hi.png", "expandpatch_checked.png", "expandpatch_dn.png", "expandpatch_checkedhi.png");
274         new_image_set("gangpatch_data", 5, "gangpatch_up.png", "gangpatch_hi.png", "gangpatch_checked.png", "gangpatch_dn.png", "gangpatch_checkedhi.png");
275         new_image_set("mutepatch_data", 5, "mutepatch_up.png", "mutepatch_hi.png", "mutepatch_checked.png", "mutepatch_dn.png", "mutepatch_checkedhi.png");
276         new_image_set("playpatch_data", 5, "playpatch_up.png", "playpatch_hi.png", "playpatch_checked.png", "playpatch_dn.png", "playpatch_checkedhi.png");
277         new_image_set("recordpatch_data", 5, "recordpatch_up.png", "recordpatch_hi.png", "recordpatch_checked.png", "recordpatch_dn.png", "recordpatch_checkedhi.png");
280         build_overlays();
284         out_point = new_image_set(5,
285                 "out_up.png", 
286                 "out_hi.png", 
287                 "out_checked.png", 
288                 "out_dn.png", 
289                 "out_checkedhi.png");
290         in_point = new_image_set(5,
291                 "in_up.png", 
292                 "in_hi.png", 
293                 "in_checked.png", 
294                 "in_dn.png", 
295                 "in_checkedhi.png");
297         label_toggle = new_image_set(5,
298                 "labeltoggle_up.png", 
299                 "labeltoggle_uphi.png", 
300                 "label_checked.png", 
301                 "labeltoggle_dn.png", 
302                 "label_checkedhi.png");
305         statusbar_cancel_data = new_image_set(3,
306                 "statusbar_cancel_up.png",
307                 "statusbar_cancel_hi.png",
308                 "statusbar_cancel_dn.png");
311         VFrame *editpanel_up = new_image("editpanel_up.png");
312         VFrame *editpanel_hi = new_image("editpanel_hi.png");
313         VFrame *editpanel_dn = new_image("editpanel_dn.png");
314         VFrame *editpanel_checked = new_image("editpanel_checked.png");
315         VFrame *editpanel_checkedhi = new_image("editpanel_checkedhi.png");
317         bottom_justify = new_button("bottom_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
318         center_justify = new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
319         channel_data = new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn);
320         new_button("copy.png", editpanel_up, editpanel_hi, editpanel_dn, "copy");
321         new_button("cut.png", editpanel_up, editpanel_hi, editpanel_dn, "cut");
322         new_button("fit.png", editpanel_up, editpanel_hi, editpanel_dn, "fit");
323         new_button("fitautos.png", editpanel_up, editpanel_hi, editpanel_dn, "fitautos");
324         new_button("inpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "inbutton");
325         new_button("label.png", editpanel_up, editpanel_hi, editpanel_dn, "labelbutton");
326         left_justify = new_button("left_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
327         magnify_button_data = new_button("magnify.png", editpanel_up, editpanel_hi, editpanel_dn);
328         middle_justify = new_button("middle_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
329         new_button("nextlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "nextlabel");
330         new_button("outpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "outbutton");
331         over_button = new_button("over.png", editpanel_up, editpanel_hi, editpanel_dn);
332         overwrite_data = new_button("overwrite.png", editpanel_up, editpanel_hi, editpanel_dn);
333         new_button("paste.png", editpanel_up, editpanel_hi, editpanel_dn, "paste");
334         new_button("prevlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "prevlabel");
335         new_button("redo.png", editpanel_up, editpanel_hi, editpanel_dn, "redo");
336         right_justify = new_button("right_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
337         splice_data = new_button("splice.png", editpanel_up, editpanel_hi, editpanel_dn);
338         new_button("toclip.png", editpanel_up, editpanel_hi, editpanel_dn, "toclip");
339         top_justify = new_button("top_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
340         new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
341         wrench_data = new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn);
343 // CWindow icons
344         new_image("cwindow_inactive", "cwindow_inactive.png");
345         new_image("cwindow_active", "cwindow_active.png");
348         new_image_set("batch_render_start",
349                 3,
350                 "batchstart_up.png",
351                 "batchstart_hi.png",
352                 "batchstart_dn.png");
353         new_image_set("batch_render_stop",
354                 3,
355                 "batchstop_up.png",
356                 "batchstop_hi.png",
357                 "batchstop_dn.png");
358         new_image_set("batch_render_cancel",
359                 3,
360                 "batchcancel_up.png",
361                 "batchcancel_hi.png",
362                 "batchcancel_dn.png");
364         new_toggle("arrow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "arrow");
365         new_toggle("autokeyframe.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "autokeyframe");
366         camera_data = new_toggle("camera.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
367         crop_data = new_toggle("crop.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
368         new_toggle("ibeam.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "ibeam");
369         magnify_data = new_toggle("magnify.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
370         mask_data = new_toggle("mask.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
371         proj_data = new_toggle("projector.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
372         protect_data = new_toggle("protect.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
373         show_meters = new_toggle("show_meters.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
374         titlesafe_data = new_toggle("titlesafe.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
375         tool_data = new_toggle("toolwindow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
376         new_toggle("eyedrop.png", 
377                 editpanel_up, 
378                 editpanel_hi, 
379                 editpanel_checked, 
380                 editpanel_dn, 
381                 editpanel_checkedhi, 
382                 "cwindow_eyedrop");
387         static VFrame **transport_bg = new_image_set(3,
388                 "transportup.png", 
389                 "transporthi.png", 
390                 "transportdn.png");
391         build_transport("end", get_image_data("end.png"), transport_bg, 2);
392         build_transport("fastfwd", get_image_data("fastfwd.png"), transport_bg, 1);
393         build_transport("fastrev", get_image_data("fastrev.png"), transport_bg, 1);
394         build_transport("play", get_image_data("play.png"), transport_bg, 1);
395         build_transport("framefwd", get_image_data("framefwd.png"), transport_bg, 1);
396         build_transport("framerev", get_image_data("framerev.png"), transport_bg, 1);
397         build_transport("pause", get_image_data("pause.png"), transport_bg, 1);
398         build_transport("record", get_image_data("record.png"), transport_bg, 1);
399         build_transport("singleframe", get_image_data("singleframe.png"), transport_bg, 1);
400         build_transport("reverse", get_image_data("reverse.png"), transport_bg, 1);
401         build_transport("rewind", get_image_data("rewind.png"), transport_bg, 0);
402         build_transport("stop", get_image_data("stop.png"), transport_bg, 1);
403         build_transport("stoprec", get_image_data("stoprec.png"), transport_bg, 2);
404         flush_images();
406         title_font = MEDIUMFONT_3D;
407         title_color = WHITE;
408         recordgui_fixed_color = YELLOW;
409         recordgui_variable_color = RED;
410         resources->medium_font = N_("-*-helvetica-bold-r-normal-*-14-*");
412         channel_position_color = MEYELLOW;
413         resources->meter_title_w = 25;
415         // (asset) edit info text color
416         edit_font_color = YELLOW;
418         //bgcolor
419         resources->bg_color = BLOND;
421         //checkbox
422         resources->checkbox_images = new_image_set(5,
423                 "checkbox_up.png", 
424                 "checkbox_uphi.png", 
425                 "checkbox_checked.png", 
426                 "checkbox_down.png", 
427                 "checkbox_checkedhi.png");
429         //radiobox
430         resources->radial_images = new_image_set(5,
431                 "radial_up.png", 
432                 "radial_uphi.png", 
433                 "radial_checked.png", 
434                 "radial_down.png", 
435                 "radial_checkedhi.png");
436         
437         //labels
438         resources->label_images = new_image_set(5,
439                 "radial_up.png", 
440                 "radial_uphi.png", 
441                 "radial_checked.png", 
442                 "radial_down.png", 
443                 "radial_checkedhi.png");
445         //filebox
446         resources->filebox_text_images = new_image_set(3,
447                 "file_text_up.png", 
448                 "file_text_uphi.png", 
449                 "file_text_dn.png");
450         resources->filebox_icons_images = new_image_set(3,
451                 "file_icons_up.png", 
452                 "file_icons_uphi.png", 
453                 "file_icons_dn.png");
454         resources->filebox_updir_images = new_image_set(3,
455                 "file_updir_up.png", 
456                 "file_updir_uphi.png", 
457                 "file_updir_dn.png");
458         resources->filebox_newfolder_images = new_image_set(3,
459                 "file_newfolder_up.png", 
460                 "file_newfolder_uphi.png", 
461                 "file_newfolder_dn.png");
463         resources->type_to_icon = new_image_set(5,
464                 "file_folder.png",
465                 "file_unknown.png",
466                 "file_film.png",
467                 "file_sound.png",
468                 "file_column.png");
470         //listbox
471         resources->listbox_bg = new_image("list_bg.png");
476 #define CWINDOW_METER_MARGIN 5
477 #define VWINDOW_METER_MARGIN 5
479 void BlondTheme::get_mwindow_sizes(MWindowGUI *gui, int w, int h)
481         mbuttons_x = 0;
482         mbuttons_y = gui->mainmenu->get_h();
483         mbuttons_w = w;
484         mbuttons_h = mbutton_left->get_h();
485         mclock_x = 10;
486         mclock_y = mbuttons_y + mbuttons_h + CWINDOW_METER_MARGIN;
487         mclock_w = get_image("clock_bg")->get_w() - 40;
488         mclock_h = get_image("clock_bg")->get_h();
489         mtimebar_x = get_image("patchbay_bg")->get_w();
490         mtimebar_y = mbuttons_y + mbuttons_h;
491         mtimebar_w = w - mtimebar_x;
492         mtimebar_h = get_image("timebar_bg")->get_h();
493         mstatus_x = 0;
494         mstatus_y = h - statusbar_left->get_h();
495         mstatus_w = w;
496         mstatus_h = statusbar_left->get_h();
497         mstatus_message_x = 10;
498         mstatus_message_y = 5;
499         mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 240;
500         mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h();
501         mstatus_progress_w = 230;
502         mstatus_cancel_x = mstatus_w - statusbar_cancel_data[0]->get_w();
503         mstatus_cancel_y = mstatus_h - statusbar_cancel_data[0]->get_h();
504         mzoom_x = 0;
505         mzoom_y = mstatus_y - zoombar_left->get_h();
506         mzoom_h = zoombar_left->get_h();
507         mzoom_w = w;
508         patchbay_x = 0;
509         patchbay_y = mtimebar_y + mtimebar_h;
510         patchbay_w = get_image("patchbay_bg")->get_w();
511         patchbay_h = mzoom_y - patchbay_y;
512         mcanvas_x = patchbay_x + patchbay_w;
513         mcanvas_y = mtimebar_y + mtimebar_h;
514         mcanvas_w = w - patchbay_w - BC_ScrollBar::get_span(SCROLL_VERT);
515         mcanvas_h = patchbay_h;
516         mhscroll_x = 0;
517         mhscroll_y = mcanvas_y + mcanvas_h;
518         mhscroll_w = w - BC_ScrollBar::get_span(SCROLL_VERT) - patchbay_w;
519         mvscroll_x = mcanvas_x + mcanvas_w;
520         mvscroll_y = mcanvas_y;
521         mvscroll_h = mcanvas_h;
524 void BlondTheme::get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls)
526         if(cwindow_controls)
527         {
528                 ccomposite_x = 0;
529                 ccomposite_y = 5;
530                 ccomposite_w = cpanel_bg->get_w();
531                 ccomposite_h = mwindow->session->cwindow_h - cbuttons_left->get_h();
532                 cslider_x = 5;
533                 cslider_y = ccomposite_h + 23;
534                 cedit_x = 10;
535                 cedit_y = cslider_y + 17;
536                 ctransport_x = 10;
537                 ctransport_y = mwindow->session->cwindow_h - get_image_set("autokeyframe")[0]->get_h();
538                 ccanvas_x = ccomposite_x + ccomposite_w;
539                 ccanvas_y = 0;
540                 ccanvas_h = ccomposite_h;
541                 cstatus_x = 525;
542                 cstatus_y = mwindow->session->cwindow_h - 40;
543                 if(mwindow->edl->session->cwindow_meter)
544                 {
545                         cmeter_x = mwindow->session->cwindow_w - MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, 
546                                 mwindow->edl->session->cwindow_meter);
547                         ccanvas_w = cmeter_x - ccanvas_x - 5;
548                 }
549                 else
550                 {
551                         cmeter_x = mwindow->session->cwindow_w;
552                         ccanvas_w = cmeter_x - ccanvas_x;
553                 }
554         }
555         else
556         {
557                 ccomposite_x = -cpanel_bg->get_w();
558                 ccomposite_y = 0;
559                 ccomposite_w = cpanel_bg->get_w();
560                 ccomposite_h = mwindow->session->cwindow_h - cbuttons_left->get_h();
562                 cslider_x = 5;
563                 cslider_y = mwindow->session->cwindow_h;
564                 cedit_x = 10;
565                 cedit_y = cslider_y + 17;
566                 ctransport_x = 10;
567                 ctransport_y = cedit_y + 40;
568                 ccanvas_x = 0;
569                 ccanvas_y = 0;
570                 ccanvas_w = mwindow->session->cwindow_w;
571                 ccanvas_h = mwindow->session->cwindow_h;
572                 cmeter_x = mwindow->session->cwindow_w;
573                 cstatus_x = mwindow->session->cwindow_w;
574                 cstatus_y = mwindow->session->cwindow_h;
575         }
578         czoom_x = ctransport_x + PlayTransport::get_transport_width(mwindow) + 20;
579         czoom_y = ctransport_y + 5;
582         cmeter_y = 5;
583         cmeter_h = mwindow->session->cwindow_h - cmeter_y;
585         cslider_w = ccanvas_x + ccanvas_w - cslider_x;
586         ctimebar_x = ccanvas_x;
587         ctimebar_y = ccanvas_y + ccanvas_h;
588         ctimebar_w = ccanvas_w;
589         ctimebar_h = 16;
592 // Not used
593         ctime_x = ctransport_x + PlayTransport::get_transport_width(mwindow);
594         ctime_y = ctransport_y;
595         cdest_x = czoom_x;
596         cdest_y = czoom_y + 30;
601 void BlondTheme::get_recordgui_sizes(RecordGUI *gui, int w, int h)
603         recordgui_status_x = 10;
604         recordgui_status_y = 10;
605         recordgui_status_x2 = 160;
606         recordgui_batch_x = 310;
607         recordgui_batch_y = 10;
608         recordgui_batchcaption_x = recordgui_batch_x + 110;
611         recordgui_transport_x = recordgui_batch_x;
612         recordgui_transport_y = recordgui_batch_y + 150;
614         recordgui_buttons_x = recordgui_batch_x - 50;
615         recordgui_buttons_y = recordgui_transport_y + 40;
616         recordgui_options_x = recordgui_buttons_x;
617         recordgui_options_y = recordgui_buttons_y + 35;
619         recordgui_batches_x = 10;
620         recordgui_batches_y = 270;
621         recordgui_batches_w = w - 20;
622         recordgui_batches_h = h - recordgui_batches_y - 70;
623         recordgui_loadmode_x = w / 2 - loadmode_w / 2;
624         recordgui_loadmode_y = h - 60;
626         recordgui_controls_x = 10;
627         recordgui_controls_y = h - 40;
632 void BlondTheme::get_vwindow_sizes(VWindowGUI *gui)
634         vmeter_y = 5;
635         vmeter_h = mwindow->session->vwindow_h - cmeter_y;
636         vcanvas_x = 0;
637         vcanvas_y = 0;
638         vcanvas_h = mwindow->session->vwindow_h - vbuttons_left->get_h();
640         if(mwindow->edl->session->vwindow_meter)
641         {
642                 vmeter_x = mwindow->session->vwindow_w - 
643                         VWINDOW_METER_MARGIN - 
644                         MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, 
645                         mwindow->edl->session->vwindow_meter);
646                 vcanvas_w = vmeter_x - vcanvas_x - VWINDOW_METER_MARGIN;
647         }
648         else
649         {
650                 vmeter_x = mwindow->session->vwindow_w;
651                 vcanvas_w = mwindow->session->vwindow_w;
652         }
654         vtimebar_x = vcanvas_x;
655         vtimebar_y = vcanvas_y + vcanvas_h;
656         vtimebar_w = vcanvas_w;
657         vtimebar_h = 16;
659         vslider_x = 10;
660         vslider_y = vtimebar_y + 25;
661         vslider_w = vtimebar_w - vslider_x;
662         vedit_x = 10;
663         vedit_y = vslider_y + 17;
664         vtransport_x = 10;
665         vtransport_y = mwindow->session->vwindow_h - get_image_set("autokeyframe")[0]->get_h();
666         vtime_x = 370;
667         vtime_y = vedit_y + 10;
668         vtime_w = 150;
673         vzoom_x = vtime_x + 150;
674         vzoom_y = vtime_y;
675         vsource_x = vtime_x + 50;
676         vsource_y = vtransport_y + 5;
683 void BlondTheme::build_icons()
685         mwindow_icon = new VFrame(get_image_data("heroine_icon.png"));
686         vwindow_icon = new VFrame(get_image_data("heroine_icon.png"));
687         cwindow_icon = new VFrame(get_image_data("heroine_icon.png"));
688         awindow_icon = new VFrame(get_image_data("heroine_icon.png"));
689         record_icon = new VFrame(get_image_data("heroine_icon.png"));
690         clip_icon = new VFrame(get_image_data("clip_icon.png"));
695 void BlondTheme::build_bg_data()
697 // Audio settings
698         channel_bg_data = new VFrame(get_image_data("channel_bg.png"));
699         channel_position_data = new VFrame(get_image_data("channel_position.png"));
701 // Track bitmaps
702         new_image("resource1024", "resource1024.png");
703         new_image("resource512", "resource512.png");
704         new_image("resource256", "resource256.png");
705         new_image("resource128", "resource128.png");
706         new_image("resource64", "resource64.png");
707         new_image("resource32", "resource32.png");
708         plugin_bg_data = new VFrame(get_image_data("plugin_bg.png"));
709         title_bg_data = new VFrame(get_image_data("title_bg.png"));
710         vtimebar_bg_data = new VFrame(get_image_data("vwindow_timebar.png"));
714 void BlondTheme::build_patches()
716         static VFrame *default_drawpatch_data[] = { new VFrame(get_image_data("drawpatch_up.png")), new VFrame(get_image_data("drawpatch_hi.png")), new VFrame(get_image_data("drawpatch_checked.png")), new VFrame(get_image_data("drawpatch_dn.png")), new VFrame(get_image_data("drawpatch_checkedhi.png")) };
717         static VFrame *default_expandpatch_data[] = { new VFrame(get_image_data("expandpatch_up.png")), new VFrame(get_image_data("expandpatch_hi.png")), new VFrame(get_image_data("expandpatch_checked.png")), new VFrame(get_image_data("expandpatch_dn.png")), new VFrame(get_image_data("expandpatch_checkedhi.png")) };
718         static VFrame *default_gangpatch_data[] = { new VFrame(get_image_data("gangpatch_up.png")), new VFrame(get_image_data("gangpatch_hi.png")), new VFrame(get_image_data("gangpatch_checked.png")), new VFrame(get_image_data("gangpatch_dn.png")), new VFrame(get_image_data("gangpatch_checkedhi.png")) };
719         static VFrame *default_mutepatch_data[] = { new VFrame(get_image_data("mutepatch_up.png")), new VFrame(get_image_data("mutepatch_hi.png")), new VFrame(get_image_data("mutepatch_checked.png")), new VFrame(get_image_data("mutepatch_dn.png")), new VFrame(get_image_data("mutepatch_checkedhi.png")) };
720         static VFrame *default_patchbay_bg = new VFrame(get_image_data("patchbay_bg.png"));
721         static VFrame *default_playpatch_data[] = { new VFrame(get_image_data("playpatch_up.png")), new VFrame(get_image_data("playpatch_hi.png")), new VFrame(get_image_data("playpatch_checked.png")), new VFrame(get_image_data("playpatch_dn.png")), new VFrame(get_image_data("playpatch_checkedhi.png")) };
722         static VFrame *default_recordpatch_data[] = { new VFrame(get_image_data("recordpatch_up.png")), new VFrame(get_image_data("recordpatch_hi.png")), new VFrame(get_image_data("recordpatch_checked.png")), new VFrame(get_image_data("recordpatch_dn.png")), new VFrame(get_image_data("recordpatch_checkedhi.png")) };
725         drawpatch_data = default_drawpatch_data;
726         expandpatch_data = default_expandpatch_data;
727         gangpatch_data = default_gangpatch_data;
728         mutepatch_data = default_mutepatch_data;
729         patchbay_bg = default_patchbay_bg;
730         playpatch_data = default_playpatch_data;
731         recordpatch_data = default_recordpatch_data;
734 void BlondTheme::build_overlays()
736         keyframe_data = new VFrame(get_image_data("keyframe3.png"));
737         camerakeyframe_data = new VFrame(get_image_data("camerakeyframe.png"));
738         maskkeyframe_data = new VFrame(get_image_data("maskkeyframe.png"));
739         modekeyframe_data = new VFrame(get_image_data("modekeyframe.png"));
740         pankeyframe_data = new VFrame(get_image_data("pankeyframe.png"));
741         projectorkeyframe_data = new VFrame(get_image_data("projectorkeyframe.png"));
752 void BlondTheme::draw_rwindow_bg(RecordGUI *gui)
754         int y;
755         int margin = 50;
756         int margin2 = 80;
757         gui->draw_9segment(recordgui_batch_x - margin,
758                 0,
759                 mwindow->session->rwindow_w - recordgui_status_x + margin,
760                 recordgui_buttons_y,
761                 rgui_batch);
762         gui->draw_3segmenth(recordgui_options_x - margin2,
763                 recordgui_buttons_y - 5,
764                 mwindow->session->rwindow_w - recordgui_options_x + margin2,
765                 rgui_controls);
766         y = recordgui_buttons_y - 5 + rgui_controls->get_h();
767         gui->draw_9segment(0,
768                 y,
769                 mwindow->session->rwindow_w,
770                 mwindow->session->rwindow_h - y,
771                 rgui_list);
774 void BlondTheme::draw_rmonitor_bg(RecordMonitorGUI *gui)
776         int margin = 45;
777         int panel_w = 300;
778         int x = rmonitor_meter_x - margin;
779         int w = mwindow->session->rmonitor_w - x;
780         if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w();
781         gui->clear_box(0, 
782                 0, 
783                 mwindow->session->rmonitor_w, 
784                 mwindow->session->rmonitor_h);
785         gui->draw_9segment(x,
786                 0,
787                 w,
788                 mwindow->session->rmonitor_h,
789                 rmonitor_meters);
797 void BlondTheme::draw_mwindow_bg(MWindowGUI *gui)
799 // Button bar
800         gui->draw_3segmenth(mbuttons_x, 
801                 mbuttons_y, 
802                 750, 
803                 mbutton_left);
804         gui->draw_3segmenth(mbuttons_x + 750, 
805                 mbuttons_y, 
806                 mbuttons_w - 500, 
807                 mbutton_right);
809 // Clock
810         gui->draw_3segmenth(0, 
811                 mbuttons_y + mbutton_left->get_h(),
812                 get_image("patchbay_bg")->get_w(), 
813                 get_image("clock_bg"));
815 // Patchbay
816         gui->draw_3segmentv(patchbay_x, 
817                 patchbay_y, 
818                 patchbay_h + 20, 
819                 get_image("patchbay_bg"));
821 // Track canvas
822         gui->draw_9segment(mcanvas_x, 
823                 mcanvas_y, 
824                 mcanvas_w, 
825                 patchbay_h + 20, 
826                 tracks_bg);
828 // Timebar
829         gui->draw_3segmenth(mtimebar_x, 
830                 mtimebar_y, 
831                 mtimebar_w, 
832                 get_image("timebar_bg"));
834 // Zoombar
835         int zoombar_center = 710;
836         gui->draw_3segmenth(mzoom_x, 
837                 mzoom_y,
838                 zoombar_center, 
839                 zoombar_left);
840         if(mzoom_w > zoombar_center)
841                 gui->draw_3segmenth(mzoom_x + zoombar_center, 
842                         mzoom_y, 
843                         mzoom_w - zoombar_center, 
844                         zoombar_right);
846 // Status
847         gui->draw_3segmenth(mstatus_x, 
848                 mstatus_y,
849                 zoombar_center, 
850                 statusbar_left);
852         if(mstatus_w > zoombar_center)
853                 gui->draw_3segmenth(mstatus_x + zoombar_center, 
854                         mstatus_y,
855                         mstatus_w - zoombar_center, 
856                         statusbar_right);
859 void BlondTheme::draw_cwindow_bg(CWindowGUI *gui)
861         const int button_division = 530;
862         gui->draw_3segmentv(0, 0, ccomposite_h, cpanel_bg);
863         gui->draw_3segmenth(0, ccomposite_h, button_division, cbuttons_left);
864         if(mwindow->edl->session->cwindow_meter)
865         {
866                 gui->draw_3segmenth(button_division, 
867                         ccomposite_h, 
868                         cmeter_x - CWINDOW_METER_MARGIN - button_division, 
869                         cbuttons_right);
870                 gui->draw_9segment(cmeter_x - CWINDOW_METER_MARGIN, 
871                         0, 
872                         mwindow->session->cwindow_w - cmeter_x + CWINDOW_METER_MARGIN, 
873                         mwindow->session->cwindow_h, 
874                         cmeter_bg);
875         }
876         else
877         {
878                 gui->draw_3segmenth(button_division, 
879                         ccomposite_h, 
880                         cmeter_x - CWINDOW_METER_MARGIN - button_division + 100, 
881                         cbuttons_right);
882         }
885 void BlondTheme::draw_vwindow_bg(VWindowGUI *gui)
887         const int button_division = 400;
888         gui->draw_3segmenth(0, vcanvas_h, button_division, vbuttons_left);
889         if(mwindow->edl->session->vwindow_meter)
890         {
891                 gui->draw_3segmenth(button_division, 
892                         vcanvas_h, 
893                         vmeter_x - VWINDOW_METER_MARGIN - button_division, 
894                         vbuttons_right);
895                 gui->draw_9segment(vmeter_x - VWINDOW_METER_MARGIN,
896                         0,
897                         mwindow->session->vwindow_w - vmeter_x + VWINDOW_METER_MARGIN, 
898                         mwindow->session->vwindow_h, 
899                         vmeter_bg);
900         }
901         else
902         {
903                 gui->draw_3segmenth(button_division, 
904                         vcanvas_h, 
905                         vmeter_x - VWINDOW_METER_MARGIN - button_division + 100, 
906                         vbuttons_right);
907         }
910 void BlondTheme::get_preferences_sizes()
915 void BlondTheme::draw_preferences_bg(PreferencesWindow *gui)
917         gui->draw_9segment(0, 0, gui->get_w(), gui->get_h() - 40, preferences_bg);
920 void BlondTheme::get_new_sizes(NewWindow *gui)
924 void BlondTheme::draw_new_bg(NewWindow *gui)
926         gui->draw_vframe(new_bg, 0, 0);
929 void BlondTheme::draw_setformat_bg(SetFormatWindow *gui)
931         gui->draw_vframe(setformat_bg, 0, 0);