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