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