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