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