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