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