version update
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / theme_blond / blondtheme.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
5  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6  * by Paolo Rampino <akir4d at gmail dot com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  *
22  */
23
24 #include "bcsignals.h"
25 #include "clip.h"
26 #include "cwindowgui.h"
27 #include "blondtheme.h"
28 #include "edl.h"
29 #include "edlsession.h"
30 #include "mainmenu.h"
31 #include "mainsession.h"
32 #include "mbuttons.h"
33 #include "meterpanel.h"
34 #include "mwindow.h"
35 #include "mwindowgui.h"
36 #include "new.h"
37 #include "patchbay.h"
38 #include "preferencesthread.h"
39 #include "recordgui.h"
40 #include "recordmonitor.h"
41 #include "setformat.h"
42 #include "statusbar.h"
43 #include "timebar.h"
44 #include "trackcanvas.h"
45 #include "vframe.h"
46 #include "vwindowgui.h"
47
48
49
50
51 PluginClient* new_plugin(PluginServer *server)
52 {
53         return new BlondThemeMain(server);
54 }
55
56 BlondThemeMain::BlondThemeMain(PluginServer *server)
57  : PluginTClient(server)
58 {
59 }
60
61 BlondThemeMain::~BlondThemeMain()
62 {
63 }
64
65 const char* BlondThemeMain::plugin_title() { return N_("Blond"); }
66
67 Theme* BlondThemeMain::new_theme()
68 {
69         theme = new BlondTheme;
70         extern unsigned char _binary_theme_blond_data_start[];
71         theme->set_data(_binary_theme_blond_data_start);
72         return theme;
73 }
74
75 BlondTheme::BlondTheme()
76  : Theme()
77 {
78 }
79
80 BlondTheme::~BlondTheme()
81 {
82         delete camerakeyframe_data;
83         delete channel_position_data;
84         delete keyframe_data;
85         delete maskkeyframe_data;
86         delete modekeyframe_data;
87         delete hardedge_data;
88         delete pankeyframe_data;
89         delete projectorkeyframe_data;
90 }
91
92 void BlondTheme::initialize()
93 {
94         BC_Resources *resources = BC_WindowBase::get_resources();
95
96
97         resources->text_default = 0x000000;
98         resources->text_background = 0xcecea2;
99         resources->text_background_disarmed = 0xefeddb;
100         resources->text_border1 = 0x202020;
101         resources->text_border2 = 0xcecea2;
102         resources->text_border3 = 0xcecea2;
103         resources->text_border4 = 0x969696;
104         resources->text_inactive_highlight = 0x707070;
105
106         resources->bg_color = 0xc8c696;
107         resources->border_light2 = resources->bg_color;
108         resources->border_shadow2 = resources->bg_color;
109         resources->default_text_color = 0x000000;
110         resources->menu_title_text = 0x000000;
111         resources->popup_title_text = 0x000000;
112         resources->menu_item_text = 0x000000;
113         resources->menu_highlighted_fontcolor = WHITE;
114         resources->generic_button_margin = xS(30);
115         resources->pot_needle_color = resources->text_default;
116         resources->pot_offset = 1;
117         resources->progress_text = resources->text_default;
118         resources->meter_font_color = resources->default_text_color;
119
120         resources->menu_light = 0xababab;
121         resources->menu_highlighted = 0x6f6f6f;
122         resources->menu_down = 0x4b4b4b;
123         resources->menu_up = 0x4b4b4b;
124         resources->menu_shadow = 0x202020;
125         resources->popupmenu_margin = xS(15);
126         resources->popupmenu_triangle_margin = xS(15);
127
128         resources->listbox_title_color = 0x000000;
129
130         resources->listbox_title_margin = xS(20);
131         resources->listbox_title_hotspot = xS(20);
132         resources->listbox_border1 = 0x1a1a1a;
133         resources->listbox_border2 = 0xcecea2;
134         resources->listbox_border3 = 0xcecea2;
135         resources->listbox_border4 = 0x646464;
136         resources->listbox_highlighted = 0x505050;
137         resources->listbox_inactive = 0xcecea2;
138         resources->listbox_bg = 0;
139         resources->listbox_text = 0x000000;
140
141         resources->filebox_margin = yS(130);
142         resources->file_color = 0x000000;
143         resources->directory_color = 0xa0a0ff;
144
145
146         new_toggle("loadmode_new.png",
147                 "loadmode_up.png",
148                 "loadmode_hi.png",
149                 "loadmode_checked.png",
150                 "loadmode_dn.png",
151                 "loadmode_checkedhi.png",
152                 "loadmode_new");
153         new_toggle("loadmode_none.png",
154                 "loadmode_up.png",
155                 "loadmode_hi.png",
156                 "loadmode_checked.png",
157                 "loadmode_dn.png",
158                 "loadmode_checkedhi.png",
159                 "loadmode_none");
160         new_toggle("loadmode_newcat.png",
161                 "loadmode_up.png",
162                 "loadmode_hi.png",
163                 "loadmode_checked.png",
164                 "loadmode_dn.png",
165                 "loadmode_checkedhi.png",
166                 "loadmode_newcat");
167         new_toggle("loadmode_cat.png",
168                 "loadmode_up.png",
169                 "loadmode_hi.png",
170                 "loadmode_checked.png",
171                 "loadmode_dn.png",
172                 "loadmode_checkedhi.png",
173                 "loadmode_cat");
174         new_toggle("loadmode_newtracks.png",
175                 "loadmode_up.png",
176                 "loadmode_hi.png",
177                 "loadmode_checked.png",
178                 "loadmode_dn.png",
179                 "loadmode_checkedhi.png",
180                 "loadmode_newtracks");
181         new_toggle("loadmode_paste.png",
182                 "loadmode_up.png",
183                 "loadmode_hi.png",
184                 "loadmode_checked.png",
185                 "loadmode_dn.png",
186                 "loadmode_checkedhi.png",
187                 "loadmode_paste");
188         new_toggle("loadmode_resource.png",
189                 "loadmode_up.png",
190                 "loadmode_hi.png",
191                 "loadmode_checked.png",
192                 "loadmode_dn.png",
193                 "loadmode_checkedhi.png",
194                 "loadmode_resource");
195         new_toggle("loadmode_nested.png",
196                 "loadmode_up.png",
197                 "loadmode_hi.png",
198                 "loadmode_checked.png",
199                 "loadmode_dn.png",
200                 "loadmode_checkedhi.png",
201                 "loadmode_nested");
202
203
204         resources->filebox_icons_images = new_button("icons.png",
205                 "fileboxbutton_up.png",
206                 "fileboxbutton_hi.png",
207                 "fileboxbutton_dn.png",
208                 "filebox_icons");
209
210         resources->filebox_text_images = new_button("text.png",
211                 "fileboxbutton_up.png",
212                 "fileboxbutton_hi.png",
213                 "fileboxbutton_dn.png",
214                 "filebox_text");
215
216         resources->filebox_newfolder_images = new_button("folder.png",
217                 "fileboxbutton_up.png",
218                 "fileboxbutton_hi.png",
219                 "fileboxbutton_dn.png",
220                 "filebox_newfolder");
221
222         resources->filebox_rename_images = new_button("rename.png",
223                 "fileboxbutton_up.png",
224                 "fileboxbutton_hi.png",
225                 "fileboxbutton_dn.png",
226                 "filebox_rename");
227
228         resources->filebox_updir_images = new_button("updir.png",
229                 "fileboxbutton_up.png",
230                 "fileboxbutton_hi.png",
231                 "fileboxbutton_dn.png",
232                 "filebox_updir");
233
234         resources->filebox_delete_images = new_button("delete.png",
235                 "fileboxbutton_up.png",
236                 "fileboxbutton_hi.png",
237                 "fileboxbutton_dn.png",
238                 "filebox_delete");
239
240         resources->filebox_reload_images = new_button("reload.png",
241                 "fileboxbutton_up.png",
242                 "fileboxbutton_hi.png",
243                 "fileboxbutton_dn.png",
244                 "filebox_reload");
245
246
247         resources->filebox_descend_images = new_button("openfolder.png",
248                 "filebox_bigbutton_up.png",
249                 "filebox_bigbutton_hi.png",
250                 "filebox_bigbutton_dn.png",
251                 "filebox_descend");
252
253         resources->usethis_button_images =
254                 resources->ok_images = new_button("ok.png",
255                 "filebox_bigbutton_up.png",
256                 "filebox_bigbutton_hi.png",
257                 "filebox_bigbutton_dn.png",
258                 "ok_button");
259
260         new_button("ok.png",
261                 "new_bigbutton_up.png",
262                 "new_bigbutton_hi.png",
263                 "new_bigbutton_dn.png",
264                 "new_ok_images");
265
266         new_button("reset.png",
267                 "reset_up.png",
268                 "reset_hi.png",
269                 "reset_dn.png",
270                 "reset_button");
271
272         new_button("unclear.png",
273                 "unclear_up.png",
274                 "unclear_hi.png",
275                 "unclear_dn.png",
276                 "unclear_button");
277
278         new_button("keyframe.png",
279                 "keyframe_up.png",
280                 "keyframe_hi.png",
281                 "keyframe_dn.png",
282                 "keyframe_button");
283
284         resources->cancel_images = new_button("cancel.png",
285                 "filebox_bigbutton_up.png",
286                 "filebox_bigbutton_hi.png",
287                 "filebox_bigbutton_dn.png",
288                 "cancel_button");
289
290         new_button("cancel.png",
291                 "new_bigbutton_up.png",
292                 "new_bigbutton_hi.png",
293                 "new_bigbutton_dn.png",
294                 "new_cancel_images");
295
296         new_button("mask_pnt_linear.png",
297                 "mask_button_up.png",
298                 "mask_button_hi.png",
299                 "mask_button_dn.png",
300                 "mask_pnt_linear_images");
301         new_button("mask_crv_linear.png",
302                 "mask_button_up.png",
303                 "mask_button_hi.png",
304                 "mask_button_dn.png",
305                 "mask_crv_linear_images");
306         new_button("mask_all_linear.png",
307                 "mask_button_up.png",
308                 "mask_button_hi.png",
309                 "mask_button_dn.png",
310                 "mask_all_linear_images");
311
312         new_button("mask_pnt_smooth.png",
313                 "mask_button_up.png",
314                 "mask_button_hi.png",
315                 "mask_button_dn.png",
316                 "mask_pnt_smooth_images");
317         new_button("mask_crv_smooth.png",
318                 "mask_button_up.png",
319                 "mask_button_hi.png",
320                 "mask_button_dn.png",
321                 "mask_crv_smooth_images");
322         new_button("mask_all_smooth.png",
323                 "mask_button_up.png",
324                 "mask_button_hi.png",
325                 "mask_button_dn.png",
326                 "mask_all_smooth_images");
327
328         new_button("mask_prst_sqr.png",
329                 "mask_button_up.png",
330                 "mask_button_hi.png",
331                 "mask_button_dn.png",
332                 "mask_prst_sqr_images");
333         new_button("mask_prst_crc.png",
334                 "mask_button_up.png",
335                 "mask_button_hi.png",
336                 "mask_button_dn.png",
337                 "mask_prst_crc_images");
338         new_button("mask_prst_tri.png",
339                 "mask_button_up.png",
340                 "mask_button_hi.png",
341                 "mask_button_dn.png",
342                 "mask_prst_tri_images");
343         new_button("mask_prst_ovl.png",
344                 "mask_button_up.png",
345                 "mask_button_hi.png",
346                 "mask_button_dn.png",
347                 "mask_prst_ovl_images");
348
349         new_button("mask_prst_load.png",
350                 "mask_button_up.png",
351                 "mask_button_hi.png",
352                 "mask_button_dn.png",
353                 "mask_prst_load_images");
354         new_button("mask_prst_save.png",
355                 "mask_button_up.png",
356                 "mask_button_hi.png",
357                 "mask_button_dn.png",
358                 "mask_prst_save_images");
359         new_button("mask_prst_trsh.png",
360                 "mask_button_up.png",
361                 "mask_button_hi.png",
362                 "mask_button_dn.png",
363                 "mask_prst_trsh_images");
364
365         new_button("mask_pstn_cen.png",
366                 "mask_button_up.png",
367                 "mask_button_hi.png",
368                 "mask_button_dn.png",
369                 "mask_pstn_cen_images");
370         new_button("mask_pstn_nrm.png",
371                 "mask_button_up.png",
372                 "mask_button_hi.png",
373                 "mask_button_dn.png",
374                 "mask_pstn_nrm_images");
375
376         resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
377                 "0.png", "1.png", "2.png", "3.png", "4.png", "5.png", "6.png", "7.png",
378                 "8.png", "9.png", "colon.png", "period.png", "a.png", "b.png", "c.png",
379                 "d.png", "e.png", "f.png", "space.png", "dash.png");
380
381         resources->bar_data = new_image("bar", "bar.png");
382         resources->check = new_image("check", "check.png");
383
384         resources->min_menu_w = xS(96);
385         resources->menu_popup_bg = new_image("menu_popup_bg.png");
386         resources->menu_item_bg = new_image_set(3,
387                 "menuitem_up.png",
388                 "menuitem_hi.png",
389                 "menuitem_dn.png");
390         resources->menu_bar_bg = new_image("menubar_bg.png");
391         resources->menu_title_bg = new_image_set(3,
392                 "menubar_up.png",
393                 "menubar_hi.png",
394                 "menubar_dn.png");
395
396
397         resources->popupmenu_images = 0;
398 //              new_image_set(3,
399 //              "menupopup_up.png",
400 //              "menupopup_hi.png",
401 //              "menupopup_dn.png");
402
403         resources->toggle_highlight_bg = new_image("toggle_highlight_bg",
404                 "text_highlight.png");
405
406         resources->generic_button_images = new_image_set(3,
407                         "generic_up.png",
408                         "generic_hi.png",
409                         "generic_dn.png");
410         resources->horizontal_slider_data = new_image_set(6,
411                         "hslider_fg_up.png",
412                         "hslider_fg_hi.png",
413                         "hslider_fg_dn.png",
414                         "hslider_bg_up.png",
415                         "hslider_bg_hi.png",
416                         "hslider_bg_dn.png");
417         resources->vertical_slider_data = new_image_set(6,
418                         "hslider_fg_up.png",
419                         "hslider_fg_hi.png",
420                         "hslider_fg_dn.png",
421                         "hslider_bg_up.png",
422                         "hslider_bg_hi.png",
423                         "hslider_bg_dn.png");
424         for( int i=0; i<6; ++i )
425                 resources->vertical_slider_data[i]->rotate90();
426
427         resources->progress_images = new_image_set(2,
428                         "progress_bg.png",
429                         "progress_hi.png");
430         resources->tumble_data = new_image_set(4,
431                 "tumble_up.png",
432                 "tumble_hi.png",
433                 "tumble_bottom.png",
434                 "tumble_top.png");
435         resources->listbox_button = new_button4("listbox_button.png",
436                 "editpanel_up.png",
437                 "editpanel_hi.png",
438                 "editpanel_dn.png",
439                 "editpanel_hi.png",
440                 "listbox_button");
441         resources->listbox_column = new_image_set(3,
442                 "column_up.png",
443                 "column_hi.png",
444                 "column_dn.png");
445         resources->listbox_up = new_image("listbox_up.png");
446         resources->listbox_dn = new_image("listbox_dn.png");
447         resources->pan_data = new_image_set(7,
448                         "pan_up.png",
449                         "pan_hi.png",
450                         "pan_popup.png",
451                         "pan_channel.png",
452                         "pan_stick.png",
453                         "pan_channel_small.png",
454                         "pan_stick_small.png");
455         resources->pan_text_color = WHITE;
456
457         resources->pot_images = new_image_set(3,
458                 "pot_up.png",
459                 "pot_hi.png",
460                 "pot_dn.png");
461
462         resources->checkbox_images = new_image_set(5,
463                 "checkbox_up.png",
464                 "checkbox_hi.png",
465                 "checkbox_checked.png",
466                 "checkbox_dn.png",
467                 "checkbox_checkedhi.png");
468
469         resources->radial_images = new_image_set(5,
470                 "radial_up.png",
471                 "radial_hi.png",
472                 "radial_checked.png",
473                 "radial_dn.png",
474                 "radial_checkedhi.png");
475
476         resources->xmeter_images = new_image_set(7,
477                 "xmeter_normal.png",
478                 "xmeter_green.png",
479                 "xmeter_red.png",
480                 "xmeter_yellow.png",
481                 "xmeter_white.png",
482                 "xmeter_over.png",
483                 "downmix51_2.png");
484         resources->ymeter_images = new_image_set(7,
485                 "ymeter_normal.png",
486                 "ymeter_green.png",
487                 "ymeter_red.png",
488                 "ymeter_yellow.png",
489                 "ymeter_white.png",
490                 "ymeter_over.png",
491                 "downmix51_2.png");
492
493         resources->hscroll_data = new_image_set(10,
494                         "hscroll_handle_up.png",
495                         "hscroll_handle_hi.png",
496                         "hscroll_handle_dn.png",
497                         "hscroll_handle_bg.png",
498                         "hscroll_left_up.png",
499                         "hscroll_left_hi.png",
500                         "hscroll_left_dn.png",
501                         "hscroll_right_up.png",
502                         "hscroll_right_hi.png",
503                         "hscroll_right_dn.png");
504
505         resources->vscroll_data = new_image_set(10,
506                         "vscroll_handle_up.png",
507                         "vscroll_handle_hi.png",
508                         "vscroll_handle_dn.png",
509                         "vscroll_handle_bg.png",
510                         "vscroll_left_up.png",
511                         "vscroll_left_hi.png",
512                         "vscroll_left_dn.png",
513                         "vscroll_right_up.png",
514                         "vscroll_right_hi.png",
515                         "vscroll_right_dn.png");
516         resources->scroll_minhandle = xS(20);
517
518
519         new_button("prevtip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip");
520         new_button("nexttip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "next_tip");
521         new_button("closetip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "close_tip");
522         new_button("swap_extents.png",
523                 "editpanel_up.png",
524                 "editpanel_hi.png",
525                 "editpanel_dn.png",
526                 "swap_extents");
527
528
529 // Record windows
530
531
532         preferences_category_overlap = 0;
533         preferencescategory_x = 0;
534         preferencescategory_y = yS(5);
535         preferencestitle_x = xS(5);
536         preferencestitle_y = yS(10);
537         preferencesoptions_x = xS(5);
538         preferencesoptions_y = 0;
539
540 // MWindow
541         message_normal = resources->text_default;
542         audio_color = GREEN;
543         mtransport_margin = xS(10);
544         toggle_margin = xS(10);
545
546         new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png", "pane");
547         new_image_set("xpane", 3, "xpane_up.png", "xpane_hi.png", "xpane_dn.png");
548         new_image_set("ypane", 3, "ypane_up.png", "ypane_hi.png", "ypane_dn.png");
549
550         new_image("mbutton_bg", "mbutton_bg.png");
551         new_image("timebar_bg", "timebar_bg_flat.png");
552         new_image("timebar_brender", "timebar_brender.png");
553         new_image("clock_bg", "mclock_flat.png");
554         new_image("patchbay_bg", "patchbay_bg.png");
555         new_image("statusbar", "statusbar.png");
556 //      new_image("mscroll_filler", "mscroll_filler.png");
557
558         new_image_set("zoombar_menu", 3, "zoompopup_up.png", "zoompopup_hi.png", "zoompopup_dn.png");
559         new_image_set("zoombar_tumbler", 4, "zoomtumble_up.png", "zoomtumble_hi.png", "zoomtumble_bottom.png", "zoomtumble_top.png");
560
561         new_image_set("mode_popup", 3, "mode_up.png", "mode_hi.png", "mode_dn.png");
562         new_image("mode_add", "mode_add.png");
563         new_image("mode_divide", "mode_divide.png");
564         new_image("mode_multiply", "mode_multiply.png");
565         new_image("mode_normal", "mode_normal.png");
566         new_image("mode_replace", "mode_replace.png");
567         new_image("mode_subtract", "mode_subtract.png");
568         new_image("mode_max", "mode_max.png");
569
570         new_image_set("plugin_on", 5, "plugin_on.png", "plugin_onhi.png", "plugin_onselect.png", "plugin_ondn.png", "plugin_onselecthi.png");
571         new_image_set("plugin_show", 5, "plugin_show.png", "plugin_showhi.png", "plugin_showselect.png", "plugin_showdn.png", "plugin_showselecthi.png");
572
573 // CWindow
574         new_image("cpanel_bg", "cpanel_bg.png");
575         new_image("cbuttons_left", "cbuttons_left.png");
576         new_image("cbuttons_right", "cbuttons_right.png");
577         new_image("cmeter_bg", "cmeter_bg.png");
578         new_image("cwindow_focus", "cwindow_focus.png");
579
580 // VWindow
581         new_image("vbuttons_left", "vbuttons_left.png");
582         new_image("vclock", "vclock.png");
583
584         new_image("preferences_bg", "preferences_bg.png");
585
586
587         new_image("new_bg", "new_bg.png");
588         new_image("setformat_bg", "setformat_bg.png");
589
590
591         timebar_view_data = new_image("timebar_view.png");
592
593         setformat_w = get_image("setformat_bg")->get_w();
594         setformat_h = get_image("setformat_bg")->get_h();
595         setformat_x1 = xS(15);
596         setformat_x2 = xS(110);
597
598         setformat_x3 = xS(315);
599         setformat_x4 = xS(425);
600         setformat_y1 = xS(20);
601         setformat_y2 = xS(85);
602         setformat_y3 = xS(125);
603         setformat_margin = xS(30);
604         setformat_channels_x = xS(25);
605         setformat_channels_y = yS(242);
606         setformat_channels_w = xS(250);
607         setformat_channels_h = yS(250);
608
609         loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + yS(10);
610         browse_pad = yS(20);
611
612
613         new_toggle("playpatch.png",
614                 "playpatch_up.png",
615                 "playpatch_hi.png",
616                 "playpatch_checked.png",
617                 "playpatch_dn.png",
618                 "playpatch_checkedhi.png",
619                 "playpatch_data");
620
621         new_toggle("recordpatch.png",
622                 "recordpatch_up.png",
623                 "recordpatch_hi.png",
624                 "recordpatch_checked.png",
625                 "recordpatch_dn.png",
626                 "recordpatch_checkedhi.png",
627                 "recordpatch_data");
628
629         new_toggle("gangpatch.png",
630                 "patch_up.png",
631                 "patch_hi.png",
632                 "patch_checked.png",
633                 "patch_dn.png",
634                 "patch_checkedhi.png",
635                 "gangpatch_data");
636
637         new_toggle("drawpatch.png",
638                 "patch_up.png",
639                 "patch_hi.png",
640                 "patch_checked.png",
641                 "patch_dn.png",
642                 "patch_checkedhi.png",
643                 "drawpatch_data");
644
645
646         new_image_set("mutepatch_data",
647                 5,
648                 "mutepatch_up.png",
649                 "mutepatch_hi.png",
650                 "mutepatch_checked.png",
651                 "mutepatch_dn.png",
652                 "mutepatch_checkedhi.png");
653
654         new_image_set("expandpatch_data",
655                 5,
656                 "expandpatch_up.png",
657                 "expandpatch_hi.png",
658                 "expandpatch_checked.png",
659                 "expandpatch_dn.png",
660                 "expandpatch_checkedhi.png");
661
662         build_bg_data();
663         build_overlays();
664
665
666
667
668         out_point = new_image_set(5,
669                 "out_up.png",
670                 "out_hi.png",
671                 "out_checked.png",
672                 "out_dn.png",
673                 "out_checkedhi.png");
674         in_point = new_image_set(5,
675                 "in_up.png",
676                 "in_hi.png",
677                 "in_checked.png",
678                 "in_dn.png",
679                 "in_checkedhi.png");
680
681         label_toggle = new_image_set(5,
682                 "labeltoggle_up.png",
683                 "labeltoggle_uphi.png",
684                 "label_checked.png",
685                 "labeltoggle_dn.png",
686                 "label_checkedhi.png");
687
688         ffmpeg_toggle = new_image_set(5,
689                 "ff_up.png",
690                 "ff_hi.png",
691                 "ff_checked.png",
692                 "ff_down.png",
693                 "ff_checkedhi.png");
694
695         proxy_p_toggle = new_image_set(5,
696                 "proxy_p_up.png",
697                 "proxy_p_hi.png",
698                 "proxy_p_chkd.png",
699                 "proxy_p_down.png",
700                 "proxy_p_chkdhi.png");
701
702         proxy_s_toggle = new_image_set(5,
703                 "proxy_s_up.png",
704                 "proxy_s_hi.png",
705                 "proxy_s_chkd.png",
706                 "proxy_s_down.png",
707                 "proxy_s_chkdhi.png");
708
709         mask_mode_toggle = new_image_set(5,
710                 "mask_mode_up.png",
711                 "mask_mode_hi.png",
712                 "mask_mode_chkd.png",
713                 "mask_mode_down.png",
714                 "mask_mode_chkdhi.png");
715
716         shbtn_data = new_image_set(3,
717                 "shbtn_up.png",
718                 "shbtn_hi.png",
719                 "shbtn_dn.png");
720
721         new_image_set("preset_edit",
722                 3,
723                 "preset_edit0.png",
724                 "preset_edit1.png",
725                 "preset_edit2.png");
726
727         new_image_set("histogram_carrot",
728                 5,
729                 "histogram_carrot_up.png",
730                 "histogram_carrot_hi.png",
731                 "histogram_carrot_checked.png",
732                 "histogram_carrot_dn.png",
733                 "histogram_carrot_checkedhi.png");
734
735
736         statusbar_cancel_data = new_image_set(3,
737                 "statusbar_cancel_up.png",
738                 "statusbar_cancel_hi.png",
739                 "statusbar_cancel_dn.png");
740
741
742         VFrame *editpanel_up = new_image("editpanel_up.png");
743         VFrame *editpanel_hi = new_image("editpanel_hi.png");
744         VFrame *editpanel_dn = new_image("editpanel_dn.png");
745         VFrame *editpanel_checked = new_image("editpanel_checked.png");
746         VFrame *editpanel_checkedhi = new_image("editpanel_checkedhi.png");
747
748         new_image("panel_divider", "panel_divider.png");
749         new_button("bottom_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "bottom_justify");
750         new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify");
751         new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel");
752         new_button("lok.png", editpanel_up, editpanel_hi, editpanel_dn, "lok");
753
754         new_toggle("histogram_toggle.png",
755                 editpanel_up,
756                 editpanel_hi,
757                 editpanel_checked,
758                 editpanel_dn,
759                 editpanel_checkedhi,
760                 "histogram_toggle");
761         new_toggle("histogram_rgb.png",
762                 editpanel_up,
763                 editpanel_hi,
764                 editpanel_checked,
765                 editpanel_dn,
766                 editpanel_checkedhi,
767                 "histogram_rgb_toggle");
768         new_toggle("waveform.png",
769                 editpanel_up,
770                 editpanel_hi,
771                 editpanel_checked,
772                 editpanel_dn,
773                 editpanel_checkedhi,
774                 "waveform_toggle");
775         new_toggle("waveform_rgb.png",
776                 editpanel_up,
777                 editpanel_hi,
778                 editpanel_checked,
779                 editpanel_dn,
780                 editpanel_checkedhi,
781                 "waveform_rgb_toggle");
782         new_toggle("scope.png",
783                 editpanel_up,
784                 editpanel_hi,
785                 editpanel_checked,
786                 editpanel_dn,
787                 editpanel_checkedhi,
788                 "scope_toggle");
789
790         new_button("picture.png", editpanel_up, editpanel_hi, editpanel_dn, "picture");
791         new_button("histogram_img.png", editpanel_up, editpanel_hi, editpanel_dn, "histogram_img");
792
793
794         new_button("copy.png", editpanel_up, editpanel_hi, editpanel_dn, "copy");
795         new_button("commercial.png", editpanel_up, editpanel_hi, editpanel_dn, "commercial");
796         new_button("cut.png", editpanel_up, editpanel_hi, editpanel_dn, "cut");
797         new_button("fit.png", editpanel_up, editpanel_hi, editpanel_dn, "fit");
798         new_button("fitautos.png", editpanel_up, editpanel_hi, editpanel_dn, "fitautos");
799         new_button("inpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "inbutton");
800         new_button("label.png", editpanel_up, editpanel_hi, editpanel_dn, "labelbutton");
801         new_button("left_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "left_justify");
802         new_button("magnify.png", editpanel_up, editpanel_hi, editpanel_dn, "magnify_button");
803         new_button("middle_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "middle_justify");
804         new_button("nextlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "nextlabel");
805         new_button("prevlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "prevlabel");
806         new_button("nextedit.png", editpanel_up, editpanel_hi, editpanel_dn, "nextedit");
807         new_button("prevedit.png", editpanel_up, editpanel_hi, editpanel_dn, "prevedit");
808         new_button("outpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "outbutton");
809         over_button = new_button("over.png", editpanel_up, editpanel_hi, editpanel_dn, "overbutton");
810         overwrite_data = new_button("overwrite.png", editpanel_up, editpanel_hi, editpanel_dn, "overwritebutton");
811         new_button("paste.png", editpanel_up, editpanel_hi, editpanel_dn, "paste");
812         new_button("redo.png", editpanel_up, editpanel_hi, editpanel_dn, "redo");
813         new_button("right_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "right_justify");
814         splice_data = new_button("splice.png", editpanel_up, editpanel_hi, editpanel_dn, "slicebutton");
815         new_button("toclip.png", editpanel_up, editpanel_hi, editpanel_dn, "toclip");
816         new_button("goto.png", editpanel_up, editpanel_hi, editpanel_dn, "goto");
817         new_button("top_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "top_justify");
818         new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
819         new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
820
821
822         VFrame *transport_up = new_image("transportup.png");
823         VFrame *transport_hi = new_image("transporthi.png");
824         VFrame *transport_dn = new_image("transportdn.png");
825
826         new_button("end.png", transport_up, transport_hi, transport_dn, "end");
827         new_button("fastfwd.png", transport_up, transport_hi, transport_dn, "fastfwd");
828         new_button("fastrev.png", transport_up, transport_hi, transport_dn, "fastrev");
829         new_button("play.png", transport_up, transport_hi, transport_dn, "play");
830         new_button("framefwd.png", transport_up, transport_hi, transport_dn, "framefwd");
831         new_button("framerev.png", transport_up, transport_hi, transport_dn, "framerev");
832         new_button("pause.png", transport_up, transport_hi, transport_dn, "pause");
833         new_button("record.png", transport_up, transport_hi, transport_dn, "record");
834         new_button("singleframe.png", transport_up, transport_hi, transport_dn, "recframe");
835         new_button("reverse.png", transport_up, transport_hi, transport_dn, "reverse");
836         new_button("rewind.png", transport_up, transport_hi, transport_dn, "rewind");
837         new_button("stop.png", transport_up, transport_hi, transport_dn, "stop");
838         new_button("stop.png", transport_up, transport_hi, transport_dn, "stoprec");
839
840
841
842 // CWindow icons
843         new_image("cwindow_inactive", "cwindow_inactive.png");
844         new_image("cwindow_active", "cwindow_active.png");
845
846
847
848         new_image_set("category_button",
849                 3,
850                 "preferencesbutton_dn.png",
851                 "preferencesbutton_dnhi.png",
852                 "preferencesbutton_dnlo.png");
853
854         new_image_set("category_button_checked",
855                 3,
856                 "preferencesbutton_up.png",
857                 "preferencesbutton_uphi.png",
858                 "preferencesbutton_dnlo.png");
859
860
861
862
863
864         new_image_set("color3way_point",
865                 3,
866                 "color3way_up.png",
867                 "color3way_hi.png",
868                 "color3way_dn.png");
869
870         new_toggle("arrow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "arrow");
871         new_toggle("autokeyframe.png", transport_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "autokeyframe");
872         new_toggle("spankeyframe.png", transport_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "spankeyframe");
873         new_toggle("ibeam.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "ibeam");
874         new_toggle("show_meters.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "meters");
875         new_toggle("blank30x30.png",
876                    new_image("locklabels_locked.png"),
877                    new_image("locklabels_lockedhi.png"),
878                    new_image("locklabels_unlocked.png"),
879                    new_image("locklabels_dn.png"), // can't have seperate down for each!!??
880                    new_image("locklabels_unlockedhi.png"),
881                    "locklabels");
882
883         VFrame *cpanel_up = new_image("cpanel_up.png");
884         VFrame *cpanel_hi = new_image("cpanel_hi.png");
885         VFrame *cpanel_dn = new_image("cpanel_dn.png");
886         VFrame *cpanel_checked = new_image("cpanel_checked.png");
887         VFrame *cpanel_checkedhi = new_image("cpanel_checkedhi.png");
888
889
890         new_toggle("camera.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "camera");
891         new_toggle("crop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "crop");
892         new_toggle("eyedrop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "eyedrop");
893         new_toggle("magnify.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "magnify");
894         new_toggle("mask.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "mask");
895         new_toggle("ruler.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "ruler");
896         new_toggle("projector.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "projector");
897         new_toggle("protect.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "protect");
898         new_toggle("titlesafe.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "titlesafe");
899         new_toggle("toolwindow.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "tool");
900
901         // toggle for tangent mode (compositor/tool window)
902         new_toggle("tan_smooth.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_smooth");
903         new_toggle("tan_linear.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_linear");
904
905         new_toggle("mask_scale_x.png",   "mask_scale_up.png",    "mask_scale_uphi.png",
906                 "mask_scale_chkd.png",  "mask_scale_xdown.png",  "mask_scale_chkdhi.png",
907                 "mask_scale_x");
908         new_toggle("mask_scale_y.png",   "mask_scale_up.png",    "mask_scale_uphi.png",
909                 "mask_scale_chkd.png",  "mask_scale_ydown.png",  "mask_scale_chkdhi.png",
910                 "mask_scale_y");
911         new_toggle("mask_scale_xy.png",  "mask_scale_up.png",   "mask_scale_uphi.png",
912                 "mask_scale_chkd.png", "mask_scale_xydown.png", "mask_scale_chkdhi.png",
913                 "mask_scale_xy");
914
915         flush_images();
916
917         title_font = MEDIUMFONT_3D;
918         title_color = 0x000000;
919         recordgui_fixed_color = YELLOW;
920         recordgui_variable_color = RED;
921
922         channel_position_color = MEYELLOW;
923         resources->meter_title_w = xS(25);
924
925         // (asset) edit info text color
926         edit_font_color = YELLOW;
927 }
928
929 #define VWINDOW_METER_MARGIN xS(5)
930
931
932 void BlondTheme::build_bg_data()
933 {
934 // Audio settings
935         channel_position_data = new VFramePng(get_image_data("channel_position.png"));
936
937 // Track bitmaps
938         new_image1("resource1024", "resource1024.png");
939         new_image1("resource512", "resource512.png");
940         new_image1("resource256", "resource256.png");
941         new_image1("resource128", "resource128.png");
942         new_image1("resource64", "resource64.png");
943         new_image1("resource32", "resource32.png");
944         new_image("plugin_bg_data", "plugin_bg.png");
945         new_image("title_bg_data", "title_bg.png");
946         new_image("vtimebar_bg_data", "vwindow_timebar.png");
947 }
948
949
950 void BlondTheme::build_overlays()
951 {
952         keyframe_data = new VFramePng(get_image_data("keyframe3.png"));
953         camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
954         maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
955         modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
956         hardedge_data = new VFramePng(get_image_data("hardedge.png"));
957         pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
958         projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
959 }
960
961 void BlondTheme::draw_rwindow_bg(RecordGUI *gui)
962 {
963 //      int y;
964 //      int margin = xS(50);
965 //      int margin2 = xS(80);
966 //      gui->draw_9segment(recordgui_batch_x - margin,
967 //              0,
968 //              mwindow->session->rwindow_w - recordgui_status_x + margin,
969 //              recordgui_buttons_y,
970 //              rgui_batch);
971 //      gui->draw_3segmenth(recordgui_options_x - margin2,
972 //              recordgui_buttons_y - yS(5),
973 //              mwindow->session->rwindow_w - recordgui_options_x + margin2,
974 //              rgui_controls);
975 //      y = recordgui_buttons_y - yS(5) + rgui_controls->get_h();
976 //      gui->draw_9segment(0,
977 //              y,
978 //              mwindow->session->rwindow_w,
979 //              mwindow->session->rwindow_h - y,
980 //              rgui_list);
981 }
982
983 void BlondTheme::draw_rmonitor_bg(RecordMonitorGUI *gui)
984 {
985 //      int margin = xS(45);
986 //      int panel_w = xS(300);
987 //      int x = rmonitor_meter_x - margin;
988 //      int w = mwindow->session->rmonitor_w - x;
989 //      if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w();
990 //      gui->clear_box(0, 0,
991 //              mwindow->session->rmonitor_w,
992 //              mwindow->session->rmonitor_h);
993 //      gui->draw_9segment(x, 0,
994 //              w,
995 //              mwindow->session->rmonitor_h,
996 //              rmonitor_meters);
997 }
998
999
1000 void BlondTheme::draw_mwindow_bg(MWindowGUI *gui)
1001 {
1002 // Button bar
1003         gui->draw_3segmenth(mbuttons_x, mbuttons_y - 1,
1004                 gui->menu_w(), get_image("mbutton_bg"));
1005
1006         int pdw = get_image("panel_divider")->get_w();
1007         int x = mbuttons_x;
1008         x += 9 * get_image("play")->get_w();
1009         x += mtransport_margin;                                       // the control buttons
1010
1011         int xs2 = xS(2);
1012         gui->draw_vframe(get_image("panel_divider"),
1013                 x - toggle_margin / 2 - pdw / 2 + xs2,
1014                 mbuttons_y - 1);
1015         x += 2 * get_image("arrow")->get_w() + toggle_margin;           // the mode buttons
1016
1017         gui->draw_vframe(get_image("panel_divider"),
1018                 x - toggle_margin / 2 - pdw / 2 + xs2,
1019                 mbuttons_y - 1);
1020
1021         x += 3 * get_image("autokeyframe")->get_w() + toggle_margin;    // the state toggle buttons
1022         gui->draw_vframe(get_image("panel_divider"),
1023                 x - toggle_margin / 2 - pdw / 2 + xs2,
1024                 mbuttons_y - 1);
1025
1026 // Clock
1027         gui->draw_3segmenth(0,
1028                 mbuttons_y - 1 + get_image("mbutton_bg")->get_h(),
1029                 get_image("patchbay_bg")->get_w(),
1030                 get_image("clock_bg"));
1031
1032 // Patchbay
1033         gui->draw_3segmentv(patchbay_x, patchbay_y,
1034                 patchbay_h, get_image("patchbay_bg"));
1035
1036 // Track canvas
1037         gui->set_color(BLACK);
1038         gui->draw_box(mcanvas_x + get_image("patchbay_bg")->get_w(),
1039                 mcanvas_y + mtimebar_h,
1040                 mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT),
1041                 mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ) - mtimebar_h);
1042
1043 // Timebar
1044         gui->draw_3segmenth(mtimebar_x, mtimebar_y,
1045                 mtimebar_w, get_image("timebar_bg"));
1046
1047 // Zoombar
1048         gui->set_color(0xcecea2);
1049         gui->draw_box(mzoom_x, mzoom_y,
1050                 mwindow->session->mwindow_w, yS(25));
1051
1052 // Scrollbar filler
1053 //      gui->draw_vframe(get_image("mscroll_filler"),
1054 //              mcanvas_x + mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT),
1055 //              mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ));
1056
1057 // Status
1058         gui->draw_3segmenth(mzoom_x,
1059                 mzoom_y,
1060                 mzoom_w,
1061                 get_image("statusbar"));
1062 }
1063
1064 void BlondTheme::draw_cwindow_bg(CWindowGUI *gui)
1065 {
1066         gui->draw_3segmentv(0, 0, ccomposite_h, get_image("cpanel_bg"));
1067
1068         gui->draw_3segmenth(0, ccomposite_h, cstatus_x, get_image("cbuttons_left"));
1069
1070         if(mwindow->edl->session->cwindow_meter)
1071         {
1072                 gui->draw_3segmenth(cstatus_x,
1073                         ccomposite_h,
1074                         cmeter_x - widget_border - cstatus_x,
1075                         get_image("cbuttons_right"));
1076                 gui->draw_9segment(cmeter_x - widget_border,
1077                         0,
1078                         mwindow->session->cwindow_w - cmeter_x + widget_border,
1079                         mwindow->session->cwindow_h,
1080                         get_image("cmeter_bg"));
1081         }
1082         else
1083         {
1084                 gui->draw_3segmenth(cstatus_x,
1085                         ccomposite_h,
1086                         cmeter_x - widget_border - cstatus_x + xS(100),
1087                         get_image("cbuttons_right"));
1088         }
1089 }
1090
1091 void BlondTheme::draw_vwindow_bg(VWindowGUI *gui)
1092 {
1093         gui->draw_3segmenth(0, vcanvas_h,
1094                 vdivision_x,
1095                 get_image("vbuttons_left"));
1096         if(mwindow->edl->session->vwindow_meter)
1097         {
1098                 gui->draw_3segmenth(vdivision_x, vcanvas_h,
1099                         vmeter_x - widget_border - vdivision_x,
1100                         get_image("cbuttons_right"));
1101                 gui->draw_9segment(vmeter_x - widget_border, 0,
1102                         mwindow->session->vwindow_w - vmeter_x + widget_border,
1103                         mwindow->session->vwindow_h,
1104                         get_image("cmeter_bg"));
1105         }
1106         else
1107         {
1108                 gui->draw_3segmenth(vdivision_x, vcanvas_h,
1109                         vmeter_x - widget_border - vdivision_x + xS(100),
1110                         get_image("cbuttons_right"));
1111         }
1112
1113 // Clock border
1114         gui->draw_3segmenth(vtime_x - xS(20), vtime_y - 1,
1115                 vtime_w + xS(40), get_image("vclock"));
1116 }
1117
1118 void BlondTheme::draw_preferences_bg(PreferencesWindow *gui)
1119 {
1120         gui->draw_vframe(get_image("preferences_bg"), 0, 0);
1121 }
1122
1123 void BlondTheme::draw_new_bg(NewWindow *gui)
1124 {
1125         gui->draw_vframe(get_image("new_bg"), 0, 0);
1126 }
1127
1128 void BlondTheme::draw_setformat_bg(SetFormatWindow *gui)
1129 {
1130         gui->draw_vframe(get_image("setformat_bg"), 0, 0);
1131 }
1132
1133