initial commit
[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
313         statusbar_cancel_data = new_image_set(3,
314                 "statusbar_cancel_up.png",
315                 "statusbar_cancel_hi.png",
316                 "statusbar_cancel_dn.png");
317
318
319         VFrame *editpanel_up = new_image("editpanel_up.png");
320         VFrame *editpanel_hi = new_image("editpanel_hi.png");
321         VFrame *editpanel_dn = new_image("editpanel_dn.png");
322         VFrame *editpanel_checked = new_image("editpanel_checked.png");
323         VFrame *editpanel_checkedhi = new_image("editpanel_checkedhi.png");
324
325         bottom_justify = new_button("bottom_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
326         center_justify = new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
327         channel_data = new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn);
328         new_button("copy.png", editpanel_up, editpanel_hi, editpanel_dn, "copy");
329         new_button("cut.png", editpanel_up, editpanel_hi, editpanel_dn, "cut");
330         new_button("fit.png", editpanel_up, editpanel_hi, editpanel_dn, "fit");
331         new_button("fitautos.png", editpanel_up, editpanel_hi, editpanel_dn, "fitautos");
332         new_button("inpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "inbutton");
333         new_button("label.png", editpanel_up, editpanel_hi, editpanel_dn, "labelbutton");
334         left_justify = new_button("left_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
335         magnify_button_data = new_button("magnify.png", editpanel_up, editpanel_hi, editpanel_dn);
336         middle_justify = new_button("middle_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
337         new_button("nextlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "nextlabel");
338         new_button("outpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "outbutton");
339         over_button = new_button("over.png", editpanel_up, editpanel_hi, editpanel_dn);
340         overwrite_data = new_button("overwrite.png", editpanel_up, editpanel_hi, editpanel_dn);
341         new_button("paste.png", editpanel_up, editpanel_hi, editpanel_dn, "paste");
342         new_button("prevlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "prevlabel");
343         new_button("redo.png", editpanel_up, editpanel_hi, editpanel_dn, "redo");
344         right_justify = new_button("right_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
345         splice_data = new_button("splice.png", editpanel_up, editpanel_hi, editpanel_dn);
346         new_button("toclip.png", editpanel_up, editpanel_hi, editpanel_dn, "toclip");
347         top_justify = new_button("top_justify.png", editpanel_up, editpanel_hi, editpanel_dn);
348         new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
349         wrench_data = new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn);
350
351 // CWindow icons
352         new_image("cwindow_inactive", "cwindow_inactive.png");
353         new_image("cwindow_active", "cwindow_active.png");
354
355
356         new_image_set("batch_render_start",
357                 3,
358                 "batchstart_up.png",
359                 "batchstart_hi.png",
360                 "batchstart_dn.png");
361         new_image_set("batch_render_stop",
362                 3,
363                 "batchstop_up.png",
364                 "batchstop_hi.png",
365                 "batchstop_dn.png");
366         new_image_set("batch_render_cancel",
367                 3,
368                 "batchcancel_up.png",
369                 "batchcancel_hi.png",
370                 "batchcancel_dn.png");
371
372         new_toggle("arrow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "arrow");
373         new_toggle("autokeyframe.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "autokeyframe");
374         camera_data = new_toggle("camera.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
375         crop_data = new_toggle("crop.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
376         new_toggle("ibeam.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "ibeam");
377         magnify_data = new_toggle("magnify.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
378         mask_data = new_toggle("mask.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
379         proj_data = new_toggle("projector.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
380         protect_data = new_toggle("protect.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
381         show_meters = new_toggle("show_meters.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
382         titlesafe_data = new_toggle("titlesafe.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
383         tool_data = new_toggle("toolwindow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
384         new_toggle("eyedrop.png", 
385                 editpanel_up, 
386                 editpanel_hi, 
387                 editpanel_checked, 
388                 editpanel_dn, 
389                 editpanel_checkedhi, 
390                 "cwindow_eyedrop");
391
392
393
394
395         static VFrame **transport_bg = new_image_set(3,
396                 "transportup.png", 
397                 "transporthi.png", 
398                 "transportdn.png");
399         build_transport("end", get_image_data("end.png"), transport_bg, 2);
400         build_transport("fastfwd", get_image_data("fastfwd.png"), transport_bg, 1);
401         build_transport("fastrev", get_image_data("fastrev.png"), transport_bg, 1);
402         build_transport("play", get_image_data("play.png"), transport_bg, 1);
403         build_transport("framefwd", get_image_data("framefwd.png"), transport_bg, 1);
404         build_transport("framerev", get_image_data("framerev.png"), transport_bg, 1);
405         build_transport("pause", get_image_data("pause.png"), transport_bg, 1);
406         build_transport("record", get_image_data("record.png"), transport_bg, 1);
407         build_transport("singleframe", get_image_data("singleframe.png"), transport_bg, 1);
408         build_transport("reverse", get_image_data("reverse.png"), transport_bg, 1);
409         build_transport("rewind", get_image_data("rewind.png"), transport_bg, 0);
410         build_transport("stop", get_image_data("stop.png"), transport_bg, 1);
411         build_transport("stoprec", get_image_data("stoprec.png"), transport_bg, 2);
412         flush_images();
413
414         title_font = MEDIUMFONT_3D;
415         title_color = WHITE;
416         recordgui_fixed_color = YELLOW;
417         recordgui_variable_color = RED;
418
419         channel_position_color = MEYELLOW;
420         resources->meter_title_w = 25;
421 }
422
423 #define CWINDOW_METER_MARGIN 5
424 #define VWINDOW_METER_MARGIN 5
425
426 void DefaultTheme::get_mwindow_sizes(MWindowGUI *gui, int w, int h)
427 {
428         mbuttons_x = 0;
429         mbuttons_y = gui->mainmenu->get_h();
430         mbuttons_w = w;
431         mbuttons_h = mbutton_left->get_h();
432         mclock_x = 10;
433         mclock_y = mbuttons_y + mbuttons_h + CWINDOW_METER_MARGIN;
434         mclock_w = get_image("clock_bg")->get_w() - 40;
435         mclock_h = get_image("clock_bg")->get_h();
436         mtimebar_x = get_image("patchbay_bg")->get_w();
437         mtimebar_y = mbuttons_y + mbuttons_h;
438         mtimebar_w = w - mtimebar_x;
439         mtimebar_h = get_image("timebar_bg")->get_h();
440         mstatus_x = 0;
441         mstatus_y = h - statusbar_left->get_h();
442         mstatus_w = w;
443         mstatus_h = statusbar_left->get_h();
444         mstatus_message_x = 10;
445         mstatus_message_y = 5;
446         mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 240;
447         mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h();
448         mstatus_progress_w = 230;
449         mstatus_cancel_x = mstatus_w - statusbar_cancel_data[0]->get_w();
450         mstatus_cancel_y = mstatus_h - statusbar_cancel_data[0]->get_h();
451         mzoom_x = 0;
452         mzoom_y = mstatus_y - zoombar_left->get_h();
453         mzoom_h = zoombar_left->get_h();
454         mzoom_w = w;
455         patchbay_x = 0;
456         patchbay_y = mtimebar_y + mtimebar_h;
457         patchbay_w = get_image("patchbay_bg")->get_w();
458         patchbay_h = mzoom_y - patchbay_y;
459         mcanvas_x = patchbay_x + patchbay_w;
460         mcanvas_y = mtimebar_y + mtimebar_h;
461         mcanvas_w = w - patchbay_w - BC_ScrollBar::get_span(SCROLL_VERT);
462         mcanvas_h = patchbay_h;
463         mhscroll_x = 0;
464         mhscroll_y = mcanvas_y + mcanvas_h;
465         mhscroll_w = w - BC_ScrollBar::get_span(SCROLL_VERT) - patchbay_w;
466         mvscroll_x = mcanvas_x + mcanvas_w;
467         mvscroll_y = mcanvas_y;
468         mvscroll_h = mcanvas_h;
469 }
470
471 void DefaultTheme::get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls)
472 {
473         if(cwindow_controls)
474         {
475                 ccomposite_x = 0;
476                 ccomposite_y = 5;
477                 ccomposite_w = cpanel_bg->get_w();
478                 ccomposite_h = mwindow->session->cwindow_h - cbuttons_left->get_h();
479                 cedit_x = 10;
480                 cedit_y = ccomposite_h + 17;
481                 ctransport_x = 10;
482                 ctransport_y = mwindow->session->cwindow_h - get_image_set("autokeyframe")[0]->get_h();
483                 ccanvas_x = ccomposite_x + ccomposite_w;
484                 ccanvas_y = 0;
485                 ccanvas_h = ccomposite_h;
486                 cstatus_x = 525;
487                 cstatus_y = mwindow->session->cwindow_h - 40;
488                 if(mwindow->edl->session->cwindow_meter)
489                 {
490                         cmeter_x = mwindow->session->cwindow_w - MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, 
491                                 mwindow->edl->session->cwindow_meter);
492                         ccanvas_w = cmeter_x - ccanvas_x - 5;
493                 }
494                 else
495                 {
496                         cmeter_x = mwindow->session->cwindow_w;
497                         ccanvas_w = cmeter_x - ccanvas_x;
498                 }
499         }
500         else
501         {
502                 ccomposite_x = -cpanel_bg->get_w();
503                 ccomposite_y = 0;
504                 ccomposite_w = cpanel_bg->get_w();
505                 ccomposite_h = mwindow->session->cwindow_h - cbuttons_left->get_h();
506
507                 cedit_x = 10;
508                 cedit_y = mwindow->session->cwindow_h + 17;
509                 ctransport_x = 10;
510                 ctransport_y = cedit_y + 40;
511                 ccanvas_x = 0;
512                 ccanvas_y = 0;
513                 ccanvas_w = mwindow->session->cwindow_w;
514                 ccanvas_h = mwindow->session->cwindow_h;
515                 cmeter_x = mwindow->session->cwindow_w;
516                 cstatus_x = mwindow->session->cwindow_w;
517                 cstatus_y = mwindow->session->cwindow_h;
518         }
519
520
521         czoom_x = ctransport_x + PlayTransport::get_transport_width(mwindow) + 20;
522         czoom_y = ctransport_y + 5;
523
524
525         cmeter_y = 5;
526         cmeter_h = mwindow->session->cwindow_h - cmeter_y;
527
528         ctimebar_x = ccanvas_x;
529         ctimebar_y = ccanvas_y + ccanvas_h;
530         ctimebar_w = ccanvas_w;
531         ctimebar_h = 16;
532
533
534 // Not used
535         ctime_x = ctransport_x + PlayTransport::get_transport_width(mwindow);
536         ctime_y = ctransport_y;
537         cdest_x = czoom_x;
538         cdest_y = czoom_y + 30;
539 }
540
541
542
543 void DefaultTheme::get_recordgui_sizes(RecordGUI *gui, int w, int h)
544 {
545         recordgui_status_x = 10;
546         recordgui_status_y = 10;
547         recordgui_status_x2 = 160;
548         recordgui_batch_x = 310;
549         recordgui_batch_y = 10;
550         recordgui_batchcaption_x = recordgui_batch_x + 110;
551
552
553         recordgui_transport_x = recordgui_batch_x;
554         recordgui_transport_y = recordgui_batch_y + 150;
555
556         recordgui_buttons_x = recordgui_batch_x - 50;
557         recordgui_buttons_y = recordgui_transport_y + 40;
558         recordgui_options_x = recordgui_buttons_x;
559         recordgui_options_y = recordgui_buttons_y + 35;
560
561         recordgui_batches_x = 10;
562         recordgui_batches_y = 270;
563         recordgui_batches_w = w - 20;
564         recordgui_batches_h = h - recordgui_batches_y - 70;
565         recordgui_loadmode_x = w / 2 - loadmode_w / 2;
566         recordgui_loadmode_y = h - 60;
567
568         recordgui_controls_x = 10;
569         recordgui_controls_y = h - 40;
570 }
571
572
573
574 void DefaultTheme::get_vwindow_sizes(VWindowGUI *gui)
575 {
576         vmeter_y = 5;
577         vmeter_h = mwindow->session->vwindow_h - cmeter_y;
578         vcanvas_x = 0;
579         vcanvas_y = 0;
580         vcanvas_h = mwindow->session->vwindow_h - vbuttons_left->get_h();
581
582         if(mwindow->edl->session->vwindow_meter)
583         {
584                 vmeter_x = mwindow->session->vwindow_w - 
585                         VWINDOW_METER_MARGIN - 
586                         MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, 
587                         mwindow->edl->session->vwindow_meter);
588                 vcanvas_w = vmeter_x - vcanvas_x - VWINDOW_METER_MARGIN;
589         }
590         else
591         {
592                 vmeter_x = mwindow->session->vwindow_w;
593                 vcanvas_w = mwindow->session->vwindow_w;
594         }
595
596         vtimebar_x = vcanvas_x;
597         vtimebar_y = vcanvas_y + vcanvas_h;
598         vtimebar_w = vcanvas_w;
599         vtimebar_h = 16;
600
601         vslider_x = 10;
602         vslider_y = vtimebar_y + 25;
603         vslider_w = vtimebar_w - vslider_x;
604         vedit_x = 10;
605         vedit_y = vslider_y + 17;
606         vtransport_x = 10;
607         vtransport_y = mwindow->session->vwindow_h - get_image_set("autokeyframe")[0]->get_h();
608         vtime_x = 370;
609         vtime_y = vedit_y + 10;
610         vtime_w = 150;
611
612
613
614
615         vzoom_x = vtime_x + 150;
616         vzoom_y = vtime_y;
617         vsource_x = vtime_x + 50;
618         vsource_y = vtransport_y + 5;
619 }
620
621
622
623
624
625 void DefaultTheme::build_icons()
626 {
627         mwindow_icon = new VFrame(get_image_data("heroine_icon.png"));
628         vwindow_icon = new VFrame(get_image_data("heroine_icon.png"));
629         cwindow_icon = new VFrame(get_image_data("heroine_icon.png"));
630         awindow_icon = new VFrame(get_image_data("heroine_icon.png"));
631         record_icon = new VFrame(get_image_data("heroine_icon.png"));
632         clip_icon = new VFrame(get_image_data("clip_icon.png"));
633 }
634
635
636
637 void DefaultTheme::build_bg_data()
638 {
639 // Audio settings
640         channel_bg_data = new VFrame(get_image_data("channel_bg.png"));
641         channel_position_data = new VFrame(get_image_data("channel_position.png"));
642
643 // Track bitmaps
644         new_image("resource1024", "resource1024.png");
645         new_image("resource512", "resource512.png");
646         new_image("resource256", "resource256.png");
647         new_image("resource128", "resource128.png");
648         new_image("resource64", "resource64.png");
649         new_image("resource32", "resource32.png");
650         plugin_bg_data = new VFrame(get_image_data("plugin_bg.png"));
651         title_bg_data = new VFrame(get_image_data("title_bg.png"));
652         vtimebar_bg_data = new VFrame(get_image_data("vwindow_timebar.png"));
653 }
654
655
656
657 void DefaultTheme::build_overlays()
658 {
659         keyframe_data = new VFrame(get_image_data("keyframe3.png"));
660         camerakeyframe_data = new VFrame(get_image_data("camerakeyframe.png"));
661         maskkeyframe_data = new VFrame(get_image_data("maskkeyframe.png"));
662         modekeyframe_data = new VFrame(get_image_data("modekeyframe.png"));
663         pankeyframe_data = new VFrame(get_image_data("pankeyframe.png"));
664         projectorkeyframe_data = new VFrame(get_image_data("projectorkeyframe.png"));
665 }
666
667
668
669
670
671
672
673
674
675 void DefaultTheme::draw_rwindow_bg(RecordGUI *gui)
676 {
677         int y;
678         int margin = 50;
679         int margin2 = 80;
680         gui->draw_9segment(recordgui_batch_x - margin,
681                 0,
682                 mwindow->session->rwindow_w - recordgui_status_x + margin,
683                 recordgui_buttons_y,
684                 rgui_batch);
685         gui->draw_3segmenth(recordgui_options_x - margin2,
686                 recordgui_buttons_y - 5,
687                 mwindow->session->rwindow_w - recordgui_options_x + margin2,
688                 rgui_controls);
689         y = recordgui_buttons_y - 5 + rgui_controls->get_h();
690         gui->draw_9segment(0,
691                 y,
692                 mwindow->session->rwindow_w,
693                 mwindow->session->rwindow_h - y,
694                 rgui_list);
695 }
696
697 void DefaultTheme::draw_rmonitor_bg(RecordMonitorGUI *gui)
698 {
699         int margin = 45;
700         int panel_w = 300;
701         int x = rmonitor_meter_x - margin;
702         int w = mwindow->session->rmonitor_w - x;
703         if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w();
704         gui->clear_box(0, 
705                 0, 
706                 mwindow->session->rmonitor_w, 
707                 mwindow->session->rmonitor_h);
708         gui->draw_9segment(x,
709                 0,
710                 w,
711                 mwindow->session->rmonitor_h,
712                 rmonitor_meters);
713 }
714
715
716
717
718
719
720 void DefaultTheme::draw_mwindow_bg(MWindowGUI *gui)
721 {
722 // Button bar
723         gui->draw_3segmenth(mbuttons_x, 
724                 mbuttons_y, 
725                 750, 
726                 mbutton_left);
727         gui->draw_3segmenth(mbuttons_x + 750, 
728                 mbuttons_y, 
729                 mbuttons_w - 500, 
730                 mbutton_right);
731
732 // Clock
733         gui->draw_3segmenth(0, 
734                 mbuttons_y + mbutton_left->get_h(),
735                 get_image("patchbay_bg")->get_w(), 
736                 get_image("clock_bg"));
737
738 // Patchbay
739         gui->draw_3segmentv(patchbay_x, 
740                 patchbay_y, 
741                 patchbay_h + 20, 
742                 get_image("patchbay_bg"));
743
744 // Track canvas
745         gui->draw_9segment(mcanvas_x, 
746                 mcanvas_y, 
747                 mcanvas_w, 
748                 patchbay_h + 20, 
749                 tracks_bg);
750
751 // Timebar
752         gui->draw_3segmenth(mtimebar_x, 
753                 mtimebar_y, 
754                 mtimebar_w, 
755                 get_image("timebar_bg"));
756
757 // Zoombar
758         int zoombar_center = 710;
759         gui->draw_3segmenth(mzoom_x, 
760                 mzoom_y,
761                 zoombar_center, 
762                 zoombar_left);
763         if(mzoom_w > zoombar_center)
764                 gui->draw_3segmenth(mzoom_x + zoombar_center, 
765                         mzoom_y, 
766                         mzoom_w - zoombar_center, 
767                         zoombar_right);
768
769 // Status
770         gui->draw_3segmenth(mstatus_x, 
771                 mstatus_y,
772                 zoombar_center, 
773                 statusbar_left);
774
775         if(mstatus_w > zoombar_center)
776                 gui->draw_3segmenth(mstatus_x + zoombar_center, 
777                         mstatus_y,
778                         mstatus_w - zoombar_center, 
779                         statusbar_right);
780 }
781
782 void DefaultTheme::draw_cwindow_bg(CWindowGUI *gui)
783 {
784         const int button_division = 530;
785         gui->draw_3segmentv(0, 0, ccomposite_h, cpanel_bg);
786         gui->draw_3segmenth(0, ccomposite_h, button_division, cbuttons_left);
787         if(mwindow->edl->session->cwindow_meter)
788         {
789                 gui->draw_3segmenth(button_division, 
790                         ccomposite_h, 
791                         cmeter_x - CWINDOW_METER_MARGIN - button_division, 
792                         cbuttons_right);
793                 gui->draw_9segment(cmeter_x - CWINDOW_METER_MARGIN, 
794                         0, 
795                         mwindow->session->cwindow_w - cmeter_x + CWINDOW_METER_MARGIN, 
796                         mwindow->session->cwindow_h, 
797                         cmeter_bg);
798         }
799         else
800         {
801                 gui->draw_3segmenth(button_division, 
802                         ccomposite_h, 
803                         cmeter_x - CWINDOW_METER_MARGIN - button_division + 100, 
804                         cbuttons_right);
805         }
806 }
807
808 void DefaultTheme::draw_vwindow_bg(VWindowGUI *gui)
809 {
810         const int button_division = 400;
811         gui->draw_3segmenth(0, vcanvas_h, button_division, vbuttons_left);
812         if(mwindow->edl->session->vwindow_meter)
813         {
814                 gui->draw_3segmenth(button_division, 
815                         vcanvas_h, 
816                         vmeter_x - VWINDOW_METER_MARGIN - button_division, 
817                         vbuttons_right);
818                 gui->draw_9segment(vmeter_x - VWINDOW_METER_MARGIN,
819                         0,
820                         mwindow->session->vwindow_w - vmeter_x + VWINDOW_METER_MARGIN, 
821                         mwindow->session->vwindow_h, 
822                         vmeter_bg);
823         }
824         else
825         {
826                 gui->draw_3segmenth(button_division, 
827                         vcanvas_h, 
828                         vmeter_x - VWINDOW_METER_MARGIN - button_division + 100, 
829                         vbuttons_right);
830         }
831 }
832
833 void DefaultTheme::get_preferences_sizes()
834 {
835 }
836
837
838 void DefaultTheme::draw_preferences_bg(PreferencesWindow *gui)
839 {
840         gui->draw_9segment(0, 0, gui->get_w(), gui->get_h() - 40, preferences_bg);
841 }
842
843 void DefaultTheme::get_new_sizes(NewWindow *gui)
844 {
845 }
846
847 void DefaultTheme::draw_new_bg(NewWindow *gui)
848 {
849         gui->draw_vframe(new_bg, 0, 0);
850 }
851
852 void DefaultTheme::draw_setformat_bg(SetFormatWindow *gui)
853 {
854         gui->draw_vframe(setformat_bg, 0, 0);
855 }
856
857
858
859
860
861