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