Add back 2 patches for histogram and overlayframe that are working correctly and...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / theme_neophyte / neophyte.C
1 /*
2  *
3  * CINELERRA
4  * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
5  * by Paolo Rampino <info at tuttoainternet dot it>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  *
21  */
22
23 #include "bcsignals.h"
24 #include "clip.h"
25 #include "cwindowgui.h"
26 #include "neophyte.h"
27 #include "edl.h"
28 #include "edlsession.h"
29 #include "mainmenu.h"
30 #include "mainsession.h"
31 #include "mbuttons.h"
32 #include "meterpanel.h"
33 #include "mwindow.h"
34 #include "mwindowgui.h"
35 #include "new.h"
36 #include "patchbay.h"
37 #include "preferencesthread.h"
38 #include "recordgui.h"
39 #include "recordmonitor.h"
40 #include "setformat.h"
41 #include "statusbar.h"
42 #include "timebar.h"
43 #include "trackcanvas.h"
44 #include "vframe.h"
45 #include "vwindowgui.h"
46
47 #define ALARM 0xff00ff             // not yet defined, to search for the element
48 #define CreamyWhite 0xe6e4dd       // creamy white 10% black
49 #define CreamyWhiteBright 0xfffdee // creamy white without black
50 #define BlackNineTwo 0x141414      // 92% black
51 #define BlackSevenTwo 0x474747     // 72% black
52 #define BlackEightFive 0x262626    // 85% black
53 #define BlackFive 0xf2f2f2         //  5% black
54 #define BabyBlue 0x5f8dd3
55 #define BabyBlueDark 0x162d50      // baby-blue -3 (inkscape), e.g. dialog Subtitle
56 // traffic lights, light green: 0x27ae60/0x37c871 - just on the buttons.
57 #define ComicYellow 0xffcc00       // heads up!
58 #define DarkRed 0xaa0000           // locked or not switched on. 
59 #define LockedRed 0x400000
60
61 PluginClient* new_plugin(PluginServer *server)
62 {
63         return new NEOPHYTETHEMEMain(server);
64 }
65
66 NEOPHYTETHEMEMain::NEOPHYTETHEMEMain(PluginServer *server)
67         : PluginTClient(server)
68 {
69 }
70
71 NEOPHYTETHEMEMain::~NEOPHYTETHEMEMain()
72 {
73 }
74
75 const char* NEOPHYTETHEMEMain::plugin_title() { return N_("Neophyte"); }
76
77 Theme* NEOPHYTETHEMEMain::new_theme()
78 {
79         theme = new NEOPHYTETHEME;
80         extern unsigned char _binary_theme_neophyte_data_start[];
81         theme->set_data(_binary_theme_neophyte_data_start);
82         return theme;
83 }
84
85 NEOPHYTETHEME::NEOPHYTETHEME()
86         : Theme()
87 {
88 }
89
90 NEOPHYTETHEME::~NEOPHYTETHEME()
91 {
92         delete camerakeyframe_data;
93         delete channel_position_data;
94         delete keyframe_data;
95         delete maskkeyframe_data;
96         delete modekeyframe_data;
97         delete hardedge_data;
98         delete pankeyframe_data;
99         delete projectorkeyframe_data;
100 }
101
102 void NEOPHYTETHEME::initialize()
103 {
104         //printf("Neophyte::initialize 1\n");
105         BC_Resources *resources = BC_WindowBase::get_resources();
106
107         /* Something own, fitting to the theme and independent of
108            the integrated splash screen/about */
109         // Preferences: About (logo)
110         delete about_bg;
111         about_bg = new VFramePng(get_image_data("about_bg.png"));
112         
113         /* Replacement for the heroine icon. Everyone has his 
114            own ideas about this, especially in connection with the 
115            new desktops[tm]. It would be better to solve this globally,
116            irrespective of the theme currently in use. */
117         // /home/olaf/src/cinelerra-gg/cin5/cinelerra-5.1/cinelerra/theme.C-237
118         new_image_set_images("mwindow_icon", 1, new VFramePng(get_image_data("cin_icon_mwin.png")));
119         new_image_set_images("vwindow_icon", 1, new VFramePng(get_image_data("cin_icon_vwin.png")));
120         new_image_set_images("cwindow_icon", 1, new VFramePng(get_image_data("cin_icon_cwin.png")));
121         new_image_set_images("awindow_icon", 1, new VFramePng(get_image_data("cin_icon_awin.png")));
122         new_image_set_images("record_icon",  1, new VFramePng(get_image_data("cin_icon_rec.png")));
123         // Windows without an icon: Camera, Overlays, etc.
124         
125         resources->text_default = CreamyWhite;     // general text color
126         resources->text_background = BlackNineTwo;
127         resources->text_background_disarmed = LockedRed; // arm track locked (!)
128         resources->text_border2 = BlackNineTwo;    // l,t outside
129         resources->text_border1 = BLACK;           // l,t inside
130         resources->text_border3 = BlackSevenTwo;   // r,d inside
131         resources->text_border4 = BlackNineTwo;    // r,d outside
132         resources->text_border2_hi = ComicYellow;  // highlighting on mouseover
133         resources->text_border3_hi = ComicYellow;
134         resources->text_inactive_highlight = BabyBlueDark; /* e.g. Subtitle (double click
135                                                                                                                   on inactive text, choose next or 
136                                                                                                                   prev and be amazed). */
137         resources->text_highlight = BabyBlue;
138   
139         resources->bg_color = BlackEightFive;
140         resources->border_light2 = resources->bg_color;
141         resources->border_shadow2 = resources->bg_color;
142
143         resources->default_text_color = CreamyWhite; // Timeline, dialogs and much more. 
144         resources->menu_title_text = WHITE;          // high contrast
145         resources->popup_title_text = WHITE;
146         resources->menu_item_text = WHITE; 
147
148         resources->menu_highlighted_fontcolor = CreamyWhiteBright;
149         /* This indent is too global and the fullness ultimately depends
150          * on the text. (Pref. top right, engl.: ~17) */
151         resources->generic_button_margin = xS(20);     // [15]
152         resources->pot_needle_color = CreamyWhite; // [resources->text_default] – marginal
153         resources->pot_offset = 1;                 // only the needle
154         resources->progress_text = resources->text_default;
155         resources->meter_font_color = resources->default_text_color;
156
157         // the following four are overwritten by graphics
158         resources->menu_light = BlackEightFive;  
159         resources->menu_down = ALARM;
160         resources->menu_up = ALARM;
161         resources->menu_shadow = ALARM;
162
163         resources->menu_highlighted = BabyBlue;
164         resources->popupmenu_margin = xS(15);       // indent, moves the button text to the right
165         resources->popupmenu_triangle_margin = xS(15);
166
167         resources->listbox_title_color = CreamyWhiteBright; // columns header
168         resources->listbox_title_margin = xS(15);               // [20] indent
169         resources->listbox_title_hotspot = xS(15);              // [20]
170
171         resources->listbox_border2 = BlackNineTwo; // as text_border
172         resources->listbox_border1 = BLACK;
173         resources->listbox_border3 = BlackSevenTwo;
174         resources->listbox_border4 = BlackNineTwo;
175         // ../../guicast/bcresources.C:684, highlighting on mouseover
176         resources->listbox_border2_hi = BabyBlue;
177         resources->listbox_border3_hi = BabyBlue;
178
179         resources->listbox_highlighted = BabyBlue;  // recources, loadfiles
180         resources->listbox_inactive = BlackNineTwo; //       background
181         resources->listbox_bg = 0;                  // s.a. ../theme_blond_cv/blondcvtheme.C:249
182         resources->listbox_text = CreamyWhite;
183         resources->listbox_selected = 0x3d5477;     // approximately matches column_hi
184   
185         resources->filebox_margin = yS(130); // [130]
186         resources->file_color = WHITE;
187         resources->directory_color = BabyBlue;
188
189         // Footage in the timeline
190         title_font = MEDIUMFONT;
191         title_color = WHITE;
192
193         /* Because the colors of the text in the list are fixed.
194            So it is at least uniform. */
195         recordgui_fixed_color = YELLOW;
196         recordgui_variable_color = RED;
197               
198         channel_position_color = ComicYellow; // Set Format, speaker numbers 
199         resources->meter_title_w = xS(28);
200
201         // (asset) edit info text color
202         edit_font_color = ComicYellow; // ? ../../cinelerra/theme.h:282
203         assetedit_color = CreamyWhiteBright; // variable attributes
204
205         // flash_color = ALARM;          // ../../cinelerra/recordgui.C:135
206         timebar_cursor_color = WHITE; // ../../cinelerra/theme.C:73
207     
208         // tooltip ../../guicast/bcresources.C:786
209         resources->tooltip_bg_color = CreamyWhiteBright;
210         // resources->tooltip_fg_color = ALARM; // undefined.
211         resources->tooltip_delay = 1500; // [1000]
212   
213         /* Waveform of audio tracks.
214            Instead of squeaky [GREEN]. This three are soft, warm and matte:
215            848661 beige, 6d876f green, 665f8a purple */
216         audio_color = 0x6d876f;
217
218         /* Resources: the text overlay location display. Affects 
219            a) Preferences, Performace: BR "Video" (text).
220            b) Render. */
221         resources->audiovideo_color = CreamyWhite; // BlackNineTwo;
222
223         /* ../../guicast/bcresources.C:781 ff.
224            Delays must all be different for repeaters */
225         resources->blink_rate = 750; // [250] - we're not on the run.
226
227         // ../../cinelerra/theme.C:87
228         clock_fg_color = ComicYellow;
229         // clock_bg_color = ALARM; // see vclock
230
231         // The line between the in and out markings
232         inout_highlight_color=BabyBlue;
233
234         new_toggle(
235                 "loadmode_new.png",
236                 "loadmode_up.png",
237                 "loadmode_hi.png",
238                 "loadmode_checked.png",
239                 "loadmode_dn.png",
240                 "loadmode_checkedhi.png",
241                 "loadmode_new");
242         new_toggle(
243                 "loadmode_none.png",
244                 "loadmode_up.png",
245                 "loadmode_hi.png",
246                 "loadmode_checked.png",
247                 "loadmode_dn.png",
248                 "loadmode_checkedhi.png",
249                 "loadmode_none");
250         new_toggle(
251                 "loadmode_newcat.png",
252                 "loadmode_up.png",
253                 "loadmode_hi.png",
254                 "loadmode_checked.png",
255                 "loadmode_dn.png",
256                 "loadmode_checkedhi.png",
257                 "loadmode_newcat");
258         new_toggle(
259                 "loadmode_cat.png",
260                 "loadmode_up.png",
261                 "loadmode_hi.png",
262                 "loadmode_checked.png",
263                 "loadmode_dn.png",
264                 "loadmode_checkedhi.png",
265                 "loadmode_cat");
266         new_toggle(
267                 "loadmode_newtracks.png",
268                 "loadmode_up.png",
269                 "loadmode_hi.png",
270                 "loadmode_checked.png",
271                 "loadmode_dn.png",
272                 "loadmode_checkedhi.png",
273                 "loadmode_newtracks");
274         new_toggle(
275                 "loadmode_paste.png",
276                 "loadmode_up.png",
277                 "loadmode_hi.png",
278                 "loadmode_checked.png",
279                 "loadmode_dn.png",
280                 "loadmode_checkedhi.png",
281                 "loadmode_paste");
282         new_toggle(
283                 "loadmode_resource.png",
284                 "loadmode_up.png",
285                 "loadmode_hi.png",
286                 "loadmode_checked.png",
287                 "loadmode_dn.png",
288                 "loadmode_checkedhi.png",
289                 "loadmode_resource");
290
291         new_toggle(
292                 "loadmode_edl_clip.png",
293                 "loadmode_up.png",
294                 "loadmode_hi.png",
295                 "loadmode_checked.png",
296                 "loadmode_dn.png",
297                 "loadmode_checkedhi.png",
298                 "loadmode_edl_clip");
299         new_toggle(
300                 "loadmode_edl_nested.png",
301                 "loadmode_up.png",
302                 "loadmode_hi.png",
303                 "loadmode_checked.png",
304                 "loadmode_dn.png",
305                 "loadmode_checkedhi.png",
306                 "loadmode_edl_nested");
307         new_toggle(
308                 "loadmode_edl_fileref.png",
309                 "loadmode_up.png",
310                 "loadmode_hi.png",
311                 "loadmode_checked.png",
312                 "loadmode_dn.png",
313                 "loadmode_checkedhi.png",
314                 "loadmode_edl_fileref");
315
316         resources->filebox_icons_images = new_button(
317                 "icons.png",
318                 "fileboxbutton_up.png",
319                 "fileboxbutton_hi.png",
320                 "fileboxbutton_dn.png",
321                 "filebox_icons");
322         resources->filebox_text_images = new_button(
323                 "text.png",
324                 "fileboxbutton_up.png",
325                 "fileboxbutton_hi.png",
326                 "fileboxbutton_dn.png",
327                 "filebox_text");
328         resources->filebox_newfolder_images = new_button(
329                 "folder.png",
330                 "fileboxbutton_up.png",
331                 "fileboxbutton_hi.png",
332                 "fileboxbutton_dn.png",
333                 "filebox_newfolder");
334         resources->filebox_rename_images = new_button(
335                 "rename.png",
336                 "fileboxbutton_up.png",
337                 "fileboxbutton_hi.png",
338                 "fileboxbutton_dn.png",
339                 "filebox_rename");
340         resources->filebox_updir_images = new_button(
341                 "updir.png",
342                 "fileboxbutton_up.png",
343                 "fileboxbutton_hi.png",
344                 "fileboxbutton_dn.png",
345                 "filebox_updir");
346         resources->filebox_delete_images = new_button(
347                 "delete.png",
348                 "fileboxbutton_up.png",
349                 "fileboxbutton_hi.png",
350                 "fileboxbutton_dn.png",
351                 "filebox_delete");
352         resources->filebox_reload_images = new_button(
353                 "reload.png",
354                 "fileboxbutton_up.png",
355                 "fileboxbutton_hi.png",
356                 "fileboxbutton_dn.png",
357                 "filebox_reload");
358         resources->filebox_descend_images = new_button(
359                 "openfolder.png",
360                 "filebox_bigbutton_up.png",
361                 "filebox_bigbutton_hi.png",
362                 "filebox_bigbutton_dn.png",
363                 "filebox_descend");
364         resources->usethis_button_images = resources->ok_images = new_button(
365                 "ok.png",
366                 "filebox_bigbutton_up.png",
367                 "filebox_bigbutton_hi.png",
368                 "filebox_bigbutton_dn.png",
369                 "ok_button");
370         new_button(
371                 "ok.png",
372                 "new_bigbutton_up.png",
373                 "new_bigbutton_hi.png",
374                 "new_bigbutton_dn.png",
375                 "new_ok_images");
376         new_button(
377                 "reset.png",
378                 "reset_up.png",
379                 "reset_hi.png",
380                 "reset_dn.png",
381                 "reset_button");
382         new_button(
383                 "unclear.png",
384                 "unclear_up.png",
385                 "unclear_hi.png",
386                 "unclear_dn.png",
387                 "unclear_button");
388         new_button("keyframe.png",
389                 "keyframe_up.png",
390                 "keyframe_hi.png",
391                 "keyframe_dn.png",
392                 "keyframe_button");
393
394         resources->cancel_images = new_button(
395                 "cancel.png",
396                 "filebox_bigbutton_up.png",
397                 "filebox_bigbutton_hi.png",
398                 "filebox_bigbutton_dn.png",
399                 "cancel_button");
400         new_button(
401                 "cancel.png",
402                 "new_bigbutton_up.png",
403                 "new_bigbutton_hi.png",
404                 "new_bigbutton_dn.png",
405                 "new_cancel_images");
406
407         new_button("mask_pnt_linear.png",
408                 "mask_button_up.png",
409                 "mask_button_hi.png",
410                 "mask_button_dn.png",
411                 "mask_pnt_linear_images");
412         new_button("mask_crv_linear.png",
413                 "mask_button_up.png",
414                 "mask_button_hi.png",
415                 "mask_button_dn.png",
416                 "mask_crv_linear_images");
417         new_button("mask_all_linear.png",
418                 "mask_button_up.png",
419                 "mask_button_hi.png",
420                 "mask_button_dn.png",
421                 "mask_all_linear_images");
422
423         new_button("mask_pnt_smooth.png",
424                 "mask_button_up.png",
425                 "mask_button_hi.png",
426                 "mask_button_dn.png",
427                 "mask_pnt_smooth_images");
428         new_button("mask_crv_smooth.png",
429                 "mask_button_up.png",
430                 "mask_button_hi.png",
431                 "mask_button_dn.png",
432                 "mask_crv_smooth_images");
433         new_button("mask_all_smooth.png",
434                 "mask_button_up.png",
435                 "mask_button_hi.png",
436                 "mask_button_dn.png",
437                 "mask_all_smooth_images");
438
439         new_button("mask_prst_sqr.png",
440                 "mask_button_up.png",
441                 "mask_button_hi.png",
442                 "mask_button_dn.png",
443                 "mask_prst_sqr_images");
444         new_button("mask_prst_crc.png",
445                 "mask_button_up.png",
446                 "mask_button_hi.png",
447                 "mask_button_dn.png",
448                 "mask_prst_crc_images");
449         new_button("mask_prst_tri.png",
450                 "mask_button_up.png",
451                 "mask_button_hi.png",
452                 "mask_button_dn.png",
453                 "mask_prst_tri_images");
454         new_button("mask_prst_ovl.png",
455                 "mask_button_up.png",
456                 "mask_button_hi.png",
457                 "mask_button_dn.png",
458                 "mask_prst_ovl_images");
459
460         new_button("mask_prst_load.png",
461                 "mask_button_up.png",
462                 "mask_button_hi.png",
463                 "mask_button_dn.png",
464                 "mask_prst_load_images");
465         new_button("mask_prst_save.png",
466                 "mask_button_up.png",
467                 "mask_button_hi.png",
468                 "mask_button_dn.png",
469                 "mask_prst_save_images");
470         new_button("mask_prst_trsh.png",
471                 "mask_button_up.png",
472                 "mask_button_hi.png",
473                 "mask_button_dn.png",
474                 "mask_prst_trsh_images");
475
476         new_button("mask_pstn_cen.png",
477                 "mask_button_up.png",
478                 "mask_button_hi.png",
479                 "mask_button_dn.png",
480                 "mask_pstn_cen_images");
481         new_button("mask_pstn_nrm.png",
482                 "mask_button_up.png",
483                 "mask_button_hi.png",
484                 "mask_button_dn.png",
485                 "mask_pstn_nrm_images");
486
487         // Clock - is not used (AFAIK). See also clock color.
488         // resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
489         //      "0.png", "1.png", "2.png", "3.png", "4.png", "5.png", "6.png", "7.png",
490         //      "8.png", "9.png", "colon.png", "period.png", "a.png", "b.png", "c.png",
491         //      "d.png", "e.png", "f.png", "space.png", "dash.png");
492
493         resources->bar_data = new_image("bar", "bar.png");
494         resources->check = new_image("check", "check.png");
495
496         resources->min_menu_w = xS(96);
497         resources->menu_popup_bg = new_image("menu_popup_bg.png");
498         resources->menu_item_bg = new_image_set(
499                 3,
500                 "menuitem_up.png",
501                 "menuitem_hi.png",
502                 "menuitem_dn.png");
503         resources->menu_bar_bg = new_image("menubar_bg.png");
504         resources->menu_title_bg = new_image_set
505                 (3,
506                  "menubar_up.png",
507                  "menubar_hi.png",
508                  "menubar_dn.png");
509         resources->popupmenu_images = 0;
510         // new_image_set(3,
511         // "menupopup_up.png",
512         // "menupopup_hi.png",
513         // "menupopup_dn.png");
514         resources->toggle_highlight_bg = new_image(
515                 "toggle_highlight_bg",
516                 "text_highlight.png");
517         resources->generic_button_images = new_image_set(
518                 3,
519                 "generic_up.png",
520                 "generic_hi.png",
521                 "generic_dn.png");
522         resources->horizontal_slider_data = new_image_set(
523                 6,
524                 "hslider_fg_up.png",
525                 "hslider_fg_hi.png",
526                 "hslider_fg_dn.png",
527                 "hslider_bg_up.png",
528                 "hslider_bg_hi.png",
529                 "hslider_bg_dn.png");
530         resources->vertical_slider_data = new_image_set(
531                 6,
532                 "hslider_fg_up.png",
533                 "hslider_fg_hi.png",
534                 "hslider_fg_dn.png",
535                 "hslider_bg_up.png",
536                 "hslider_bg_hi.png",
537                 "hslider_bg_dn.png");
538   
539         for( int i=0; i<6; ++i )
540                 resources->vertical_slider_data[i]->rotate90();
541
542         resources->progress_images = new_image_set(
543                 2,
544                 "progress_bg.png",
545                 "progress_hi.png");
546         resources->tumble_data = new_image_set(
547                 4,
548                 "tumble_up.png",
549                 "tumble_hi.png",
550                 "tumble_bottom.png",
551                 "tumble_top.png");
552         new_image_set("tumblepatch_data", 4,
553                 "tumblepatch_up.png",
554                 "tumblepatch_hi.png",
555                 "tumblepatch_bottom.png",
556                 "tumblepatch_top.png");
557         resources->listbox_button = new_button4(
558                 "listbox_button.png",
559                 "editpanel_up.png",
560                 "editpanel_hi.png",
561                 "editpanel_dn.png",
562                 "editpanel_hi.png",
563                 "listbox_button");
564         // Dialog "Load files…" switch SI/IEC
565         resources->filebox_szfmt_images = new_image_set(
566                 12,
567                 "file_size_zero_up.png",
568                 "file_size_zero_hi.png",
569                 "file_size_zero_dn.png",
570                 "file_size_lwrb_up.png",
571                 "file_size_lwrb_hi.png",
572                 "file_size_lwrb_dn.png",
573                 "file_size_capb_up.png",
574                 "file_size_capb_hi.png",
575                 "file_size_capb_dn.png",
576                 "file_size_semi_up.png",
577                 "file_size_semi_hi.png",
578                 "file_size_semi_dn.png");
579         resources->listbox_column = new_image_set(
580                 3,
581                 "column_up.png",
582                 "column_hi.png",
583                 "column_dn.png");
584         resources->listbox_up = new_image("listbox_up.png");
585         resources->listbox_dn = new_image("listbox_dn.png");
586         resources->pan_data = new_image_set(
587                 7,
588                 "pan_up.png",
589                 "pan_hi.png",
590                 "pan_popup.png",
591                 "pan_channel.png",
592                 "pan_stick.png",
593                 "pan_channel_small.png",
594                 "pan_stick_small.png");
595         resources->pan_text_color = CreamyWhiteBright;
596         resources->pot_images = new_image_set(
597                 3,
598                 "pot_up.png",
599                 "pot_hi.png",
600                 "pot_dn.png");
601         resources->checkbox_images = new_image_set(
602                 5,
603                 "checkbox_up.png",
604                 "checkbox_hi.png",
605                 "checkbox_checked.png",
606                 "checkbox_dn.png",
607                 "checkbox_checkedhi.png");
608         resources->radial_images = new_image_set(
609                 5,
610                 "radial_up.png",
611                 "radial_hi.png",
612                 "radial_checked.png",
613                 "radial_dn.png",
614                 "radial_checkedhi.png");
615         resources->xmeter_images = new_image_set(
616                 7,
617                 "xmeter_normal.png",
618                 "xmeter_green.png",
619                 "xmeter_red.png",
620                 "xmeter_yellow.png",
621                 "xmeter_white.png",
622                 "xmeter_over.png",
623                 "downmix51_2.png");
624         resources->ymeter_images = new_image_set(
625                 7,
626                 "ymeter_normal.png",
627                 "ymeter_green.png",
628                 "ymeter_red.png",
629                 "ymeter_yellow.png",
630                 "ymeter_white.png",
631                 "ymeter_over.png",
632                 "downmix51_2.png");
633         resources->hscroll_data = new_image_set(
634                 10,
635                 "hscroll_handle_up.png",
636                 "hscroll_handle_hi.png",
637                 "hscroll_handle_dn.png",
638                 "hscroll_handle_bg.png",
639                 "hscroll_left_up.png",
640                 "hscroll_left_hi.png",
641                 "hscroll_left_dn.png",
642                 "hscroll_right_up.png",
643                 "hscroll_right_hi.png",
644                 "hscroll_right_dn.png");
645         resources->vscroll_data = new_image_set(
646                 10,
647                 "vscroll_handle_up.png",
648                 "vscroll_handle_hi.png",
649                 "vscroll_handle_dn.png",
650                 "vscroll_handle_bg.png",
651                 "vscroll_left_up.png",
652                 "vscroll_left_hi.png",
653                 "vscroll_left_dn.png",
654                 "vscroll_right_up.png",
655                 "vscroll_right_hi.png",
656                 "vscroll_right_dn.png");
657         resources->scroll_minhandle = 20;
658     
659         new_button(
660                 "prevtip.png", "tipbutton_up.png",
661                 "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip");
662         new_button(
663                 "nexttip.png", "tipbutton_up.png",
664                 "tipbutton_hi.png", "tipbutton_dn.png", "next_tip");
665         new_button(
666                 "closetip.png", "tipbutton_up.png",
667                 "tipbutton_hi.png", "tipbutton_dn.png", "close_tip");
668         new_button(
669                 "swap_extents.png", "editpanel_up.png",
670                 "editpanel_hi.png", "editpanel_dn.png", "swap_extents");
671
672         // Record windows
673         preferences_category_overlap = 0;
674         preferencescategory_x = 0;
675         preferencescategory_y = yS(5);
676         preferencestitle_x = xS(5);
677         preferencestitle_y = yS(10);
678         preferencesoptions_x = xS(5);
679         preferencesoptions_y = 0;
680
681         // MWindow
682         message_normal = resources->text_default;
683
684         mtransport_margin = xS(10);
685         toggle_margin = xS(10);
686
687         new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png",
688                            "pane");
689         new_image_set("xpane", 3,
690                                   "xpane_up.png",
691                                   "xpane_hi.png",
692                                   "xpane_dn.png");
693         new_image_set("ypane", 3,
694                                   "ypane_up.png",
695                                   "ypane_hi.png",
696                                   "ypane_dn.png");
697
698         new_image("mbutton_bg", "mbutton_bg.png");
699         new_image("timebar_bg", "timebar_bg_flat.png");
700         new_image("timebar_brender", "timebar_brender.png");
701         new_image("clock_bg", "mclock_flat.png");
702         new_image("patchbay_bg", "patchbay_bg.png");
703         new_image("statusbar", "statusbar.png");
704         // new_image("mscroll_filler", "mscroll_filler.png");
705
706         new_image_set("zoombar_menu", 3,
707                                   "zoompopup_up.png",
708                                   "zoompopup_hi.png",
709                                   "zoompopup_dn.png");
710         new_image_set("zoombar_tumbler", 4,
711                                   "zoomtumble_up.png",
712                                   "zoomtumble_hi.png",
713                                   "zoomtumble_bottom.png",
714                                   "zoomtumble_top.png");
715
716         new_image_set("mode_popup", 3,
717                                   "mode_up.png", "mode_hi.png", "mode_dn.png");
718         new_image("mode_add", "mode_add.png");
719         new_image("mode_divide", "mode_divide.png");
720         new_image("mode_multiply", "mode_multiply.png");
721         new_image("mode_normal", "mode_normal.png");
722         new_image("mode_replace", "mode_replace.png");
723         new_image("mode_subtract", "mode_subtract.png");
724         new_image("mode_max", "mode_max.png");
725
726         new_image_set("plugin_on", 5,
727                                   "plugin_on.png",
728                                   "plugin_onhi.png",
729                                   "plugin_onselect.png",
730                                   "plugin_ondn.png",
731                                   "plugin_onselecthi.png");
732         new_image_set("plugin_show", 5,
733                                   "plugin_show.png",
734                                   "plugin_showhi.png",
735                                   "plugin_showselect.png",
736                                   "plugin_showdn.png",
737                                   "plugin_showselecthi.png");
738         
739         // Mixer
740         new_image_set("mixpatch_data", 5,
741                                   "mixpatch_up.png",
742                                   "mixpatch_hi.png",
743                                   "mixpatch_checked.png",
744                                   "mixpatch_dn.png",
745                                   "mixpatch_checkedhi.png");
746         
747         // CWindow
748         new_image("cpanel_bg", "cpanel_bg.png");
749         new_image("cbuttons_left", "cbuttons_left.png");
750         new_image("cbuttons_right", "cbuttons_right.png");
751         new_image("cmeter_bg", "cmeter_bg.png");
752         new_image("cwindow_focus", "cwindow_focus.png");
753         
754         // VWindow
755         /* The red position indicator is currently only 5 px high.
756            The backgrounds were made according to this. */
757         new_image("vbuttons_left", "vbuttons_left.png");
758         new_image("vbuttons_right", "vbuttons_right.png"); // unset = cbuttons_right
759         new_image("vclock", "vclock.png");
760         //new_image("vmeter_bg", ".png"); // ! 
761   
762         new_image("preferences_bg", "preferences_bg.png");
763
764         new_image("new_bg", "new_bg.png");
765         new_image("setformat_bg", "setformat_bg.png");
766
767         timebar_view_data = new_image("timebar_view.png");
768
769         setformat_w = get_image("setformat_bg")->get_w();
770         setformat_h = get_image("setformat_bg")->get_h();
771         setformat_x1 = xS(15);
772         setformat_x2 = xS(110);
773         setformat_x3 = xS(315);
774         setformat_x4 = xS(425);
775         setformat_y1 = yS(20);
776         setformat_y2 = yS(85);
777         setformat_y3 = yS(125);
778         setformat_margin = xS(30);
779         setformat_channels_x = xS(25);
780         setformat_channels_y = yS(242);
781         setformat_channels_w = xS(250);
782         setformat_channels_h = yS(250);
783
784         loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + yS(10);
785         browse_pad = yS(20);
786
787         new_toggle("playpatch.png",
788                            "playpatch_up.png",
789                            "playpatch_hi.png",
790                            "playpatch_checked.png",
791                            "playpatch_dn.png",
792                            "playpatch_checkedhi.png",
793                            "playpatch_data");
794         new_toggle("recordpatch.png",
795                            "recordpatch_up.png",
796                            "recordpatch_hi.png",
797                            "recordpatch_checked.png",
798                            "recordpatch_dn.png",
799                            "recordpatch_checkedhi.png",
800                            "recordpatch_data");
801         new_toggle("gangpatch.png",
802                            "patch_up.png",
803                            "patch_hi.png",
804                            "patch_checked.png",
805                            "patch_dn.png",
806                            "patch_checkedhi.png",
807                            "gangpatch_data");
808         new_toggle("drawpatch.png",
809                            "patch_up.png",
810                            "patch_hi.png",
811                            "patch_checked.png",
812                            "patch_dn.png",
813                            "patch_checkedhi.png",
814                            "drawpatch_data");
815
816         new_image_set("mutepatch_data",
817                                   5,
818                                   "mutepatch_up.png",
819                                   "mutepatch_hi.png",
820                                   "mutepatch_checked.png",
821                                   "mutepatch_dn.png",
822                                   "mutepatch_checkedhi.png");
823         new_image_set("expandpatch_data",
824                                   5,
825                                   "expandpatch_up.png",
826                                   "expandpatch_hi.png",
827                                   "expandpatch_checked.png",
828                                   "expandpatch_dn.png",
829                                   "expandpatch_checkedhi.png");
830
831         build_bg_data();
832         build_overlays();
833
834         out_point = new_image_set(
835                 5,
836                 "out_up.png",
837                 "out_hi.png",
838                 "out_checked.png",
839                 "out_dn.png",
840                 "out_checkedhi.png");
841         in_point = new_image_set(
842                 5,
843                 "in_up.png",
844                 "in_hi.png",
845                 "in_checked.png",
846                 "in_dn.png",
847                 "in_checkedhi.png");
848         label_toggle = new_image_set(
849                 5,
850                 "labeltoggle_up.png",
851                 "labeltoggle_uphi.png",
852                 "label_checked.png",
853                 "labeltoggle_dn.png",
854                 "label_checkedhi.png");
855         ffmpeg_toggle = new_image_set(
856                 5,
857                 "ff_up.png",
858                 "ff_hi.png",
859                 "ff_checked.png",
860                 "ff_down.png",
861                 "ff_checkedhi.png");
862         proxy_p_toggle = new_image_set(
863                 5,
864                 "proxy_p_up.png",
865                 "proxy_p_hi.png",
866                 "proxy_p_chkd.png",
867                 "proxy_p_down.png",
868                 "proxy_p_chkdhi.png");
869         proxy_s_toggle = new_image_set( // proxy use ffmpeg scaler
870                 5,
871                 "proxy_s_up.png",
872                 "proxy_s_hi.png",
873                 "proxy_s_chkd.png",
874                 "proxy_s_down.png",
875                 "proxy_s_chkdhi.png");
876         mask_mode_toggle = new_image_set(5,
877                 "mask_mode_up.png",
878                 "mask_mode_hi.png",
879                 "mask_mode_chkd.png",
880                 "mask_mode_down.png",
881                 "mask_mode_chkdhi.png");
882         shbtn_data = new_image_set(
883                 3,
884                 "shbtn_up.png",
885                 "shbtn_hi.png",
886                 "shbtn_dn.png");
887         new_image_set(
888                 "preset_edit",
889                 3,
890                 "preset_edit0.png",
891                 "preset_edit1.png",
892                 "preset_edit2.png");
893         new_image_set(
894                 "histogram_carrot",
895                 5,
896                 "histogram_carrot_up.png",
897                 "histogram_carrot_hi.png",
898                 "histogram_carrot_checked.png",
899                 "histogram_carrot_dn.png",
900                 "histogram_carrot_checkedhi.png");
901         statusbar_cancel_data = new_image_set(
902                 3,
903                 "statusbar_cancel_up.png",
904                 "statusbar_cancel_hi.png",
905                 "statusbar_cancel_dn.png");
906
907         VFrame *editpanel_up = new_image("editpanel_up.png");
908         VFrame *editpanel_hi = new_image("editpanel_hi.png");
909         VFrame *editpanel_dn = new_image("editpanel_dn.png");
910         VFrame *editpanel_checked = new_image("editpanel_checked.png");
911         VFrame *editpanel_checkedhi = new_image("editpanel_checkedhi.png");
912
913         new_image("panel_divider", "panel_divider.png");
914         new_button("bottom_justify.png",
915                            editpanel_up, editpanel_hi, editpanel_dn,
916                            "bottom_justify");
917         new_button("center_justify.png",
918                            editpanel_up, editpanel_hi, editpanel_dn,
919                            "center_justify");
920         new_button("channel.png",
921                            editpanel_up, editpanel_hi, editpanel_dn,
922                            "channel");
923         new_button("lok.png", // popup slider
924                            editpanel_up, editpanel_hi, editpanel_dn,
925                            "lok");
926         new_toggle("histogram_toggle.png",
927                            editpanel_up,
928                            editpanel_hi,
929                            editpanel_checked,
930                            editpanel_dn,
931                            editpanel_checkedhi,
932                            "histogram_toggle");
933         new_toggle("histogram_rgb.png",
934                            editpanel_up,
935                            editpanel_hi,
936                            editpanel_checked,
937                            editpanel_dn,
938                            editpanel_checkedhi,
939                            "histogram_rgb_toggle");
940         new_toggle("waveform.png",
941                            editpanel_up,
942                            editpanel_hi,
943                            editpanel_checked,
944                            editpanel_dn,
945                            editpanel_checkedhi,
946                            "waveform_toggle");
947         new_toggle("waveform_rgb.png",
948                            editpanel_up,
949                            editpanel_hi,
950                            editpanel_checked,
951                            editpanel_dn,
952                            editpanel_checkedhi,
953                            "waveform_rgb_toggle");
954         new_toggle("scope.png",
955                            editpanel_up,
956                            editpanel_hi,
957                            editpanel_checked,
958                            editpanel_dn,
959                            editpanel_checkedhi,
960                            "scope_toggle");
961
962         new_button("picture.png",
963                            editpanel_up, editpanel_hi, editpanel_dn,
964                            "picture");
965         new_button("histogram_img.png",
966                            editpanel_up, editpanel_hi, editpanel_dn,
967                            "histogram_img");
968         new_button("copy.png",
969                            editpanel_up, editpanel_hi, editpanel_dn,
970                            "copy");
971         new_button("commercial.png",
972                            editpanel_up, editpanel_hi, editpanel_dn,
973                            "commercial"); // cdb
974         new_button("cut.png",
975                            editpanel_up, editpanel_hi, editpanel_dn,
976                            "cut");
977         new_button("fit.png",
978                            editpanel_up, editpanel_hi, editpanel_dn,
979                            "fit");
980         new_button("fitautos.png",
981                            editpanel_up, editpanel_hi, editpanel_dn,
982                            "fitautos");
983         new_button("inpoint.png",
984                            editpanel_up, editpanel_hi, editpanel_dn,
985                            "inbutton");
986         new_button("label.png",
987                            editpanel_up, editpanel_hi, editpanel_dn,
988                            "labelbutton");
989         new_button("left_justify.png",
990                            editpanel_up, editpanel_hi, editpanel_dn,
991                            "left_justify");
992         new_button("magnify.png",
993                            editpanel_up, editpanel_hi, editpanel_dn,
994                            "magnify_button");
995         new_button("middle_justify.png",
996                            editpanel_up, editpanel_hi, editpanel_dn,
997                            "middle_justify");
998         new_button("nextlabel.png",
999                            editpanel_up, editpanel_hi, editpanel_dn,
1000                            "nextlabel");
1001         new_button("prevlabel.png",
1002                            editpanel_up, editpanel_hi, editpanel_dn,
1003                            "prevlabel");
1004         new_button("nextedit.png",
1005                            editpanel_up, editpanel_hi, editpanel_dn,
1006                            "nextedit");
1007         new_button("prevedit.png",
1008                            editpanel_up, editpanel_hi, editpanel_dn,
1009                            "prevedit");
1010         new_button("outpoint.png",
1011                            editpanel_up, editpanel_hi, editpanel_dn,
1012                            "outbutton");
1013         over_button = new_button("over.png",
1014                                                          editpanel_up, editpanel_hi, editpanel_dn,
1015                                                          "overbutton");
1016         overwrite_data = new_button("overwrite.png",
1017                                                                 editpanel_up, editpanel_hi, editpanel_dn,
1018                                                                 "overwritebutton");
1019         new_button("paste.png",
1020                            editpanel_up, editpanel_hi, editpanel_dn,
1021                            "paste");
1022         new_button("redo.png",
1023                            editpanel_up, editpanel_hi, editpanel_dn,
1024                            "redo");
1025         new_button("right_justify.png",
1026                            editpanel_up, editpanel_hi, editpanel_dn,
1027                            "right_justify");
1028         splice_data = new_button("splice.png",
1029                                                          editpanel_up, editpanel_hi, editpanel_dn,
1030                                                          "splicebutton");
1031         new_button("toclip.png",
1032                            editpanel_up, editpanel_hi, editpanel_dn,
1033                            "toclip");
1034         new_button("goto.png",
1035                            editpanel_up, editpanel_hi, editpanel_dn,
1036                            "goto");
1037         new_button("top_justify.png",
1038                            editpanel_up, editpanel_hi, editpanel_dn,
1039                            "top_justify");
1040         new_button("undo.png",
1041                            editpanel_up, editpanel_hi, editpanel_dn,
1042                            "undo");
1043         new_button("wrench.png",
1044                            editpanel_up, editpanel_hi, editpanel_dn,
1045                            "wrench");
1046
1047         VFrame *transport_up = new_image("transportup.png");
1048         VFrame *transport_hi = new_image("transporthi.png");
1049         VFrame *transport_dn = new_image("transportdn.png");
1050
1051         new_button("end.png",
1052                            transport_up, transport_hi, transport_dn,
1053                            "end");
1054         new_button("fastfwd.png",
1055                            transport_up, transport_hi, transport_dn,
1056                            "fastfwd");
1057         new_button("fastrev.png",
1058                            transport_up, transport_hi, transport_dn,
1059                            "fastrev");
1060         new_button("play.png",
1061                            transport_up, transport_hi, transport_dn,
1062                            "play");
1063         new_button("framefwd.png",
1064                            transport_up, transport_hi, transport_dn,
1065                            "framefwd");
1066         new_button("framerev.png",
1067                            transport_up, transport_hi, transport_dn,
1068                            "framerev");
1069         new_button("pause.png",
1070                            transport_up, transport_hi, transport_dn,
1071                            "pause");
1072         new_button("record.png",
1073                            transport_up, transport_hi, transport_dn,
1074                            "record");
1075         new_button("singleframe.png",
1076                            transport_up, transport_hi, transport_dn,
1077                            "recframe");
1078         new_button("reverse.png",
1079                            transport_up, transport_hi, transport_dn,
1080                            "reverse");
1081         new_button("rewind.png",
1082                            transport_up, transport_hi, transport_dn,
1083                            "rewind");
1084         new_button("stop.png",
1085                            transport_up, transport_hi, transport_dn,
1086                            "stop");
1087         new_button("stop.png",
1088                            transport_up, transport_hi, transport_dn,
1089                            "stoprec");
1090
1091         // CWindow icons (led)
1092         new_image("cwindow_inactive", "cwindow_inactive.png");
1093         new_image("cwindow_active", "cwindow_active.png");
1094
1095         new_image_set("category_button",
1096                                   3,
1097                                   "preferencesbutton_dn.png",
1098                                   "preferencesbutton_dnhi.png",
1099                                   "preferencesbutton_dnlo.png");
1100         new_image_set("category_button_checked",
1101                                   3,
1102                                   "preferencesbutton_up.png",
1103                                   "preferencesbutton_uphi.png",
1104                                   "preferencesbutton_dnlo.png");
1105         new_image_set("color3way_point",
1106                                   3,
1107                                   "color3way_up.png",
1108                                   "color3way_hi.png",
1109                                   "color3way_dn.png");
1110
1111         new_toggle("arrow.png",
1112                            editpanel_up, editpanel_hi, editpanel_checked,
1113                            editpanel_dn, editpanel_checkedhi,
1114                            "arrow");
1115         new_toggle("autokeyframe.png",
1116                            transport_up, editpanel_hi, editpanel_checked,
1117                            editpanel_dn, editpanel_checkedhi,
1118                            "autokeyframe");
1119         new_toggle("spankeyframe.png",
1120                            transport_up, editpanel_hi, editpanel_checked,
1121                            editpanel_dn, editpanel_checkedhi,
1122                            "spankeyframe");
1123         new_toggle("ibeam.png",
1124                            editpanel_up, editpanel_hi, editpanel_checked,
1125                            editpanel_dn, editpanel_checkedhi,
1126                            "ibeam");
1127         new_toggle("show_meters.png",
1128                            editpanel_up, editpanel_hi, editpanel_checked,
1129                            editpanel_dn, editpanel_checkedhi,
1130                            "meters");
1131         new_toggle("blank30x30.png",
1132                            new_image("locklabels_locked.png"),
1133                            new_image("locklabels_lockedhi.png"),
1134                            new_image("locklabels_unlocked.png"),
1135                            new_image("locklabels_dn.png"), // can't have seperate down for each!!??
1136                            new_image("locklabels_unlockedhi.png"),
1137                            "locklabels");
1138
1139         VFrame *cpanel_up = new_image("cpanel_up.png");
1140         VFrame *cpanel_hi = new_image("cpanel_hi.png");
1141         VFrame *cpanel_dn = new_image("cpanel_dn.png");
1142         VFrame *cpanel_checked = new_image("cpanel_checked.png");
1143         VFrame *cpanel_checkedhi = new_image("cpanel_checkedhi.png");
1144
1145         new_toggle("camera.png",
1146                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1147                            "camera");
1148         new_toggle("crop.png",
1149                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1150                            "crop");
1151         new_toggle("eyedrop.png",
1152                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1153                            "eyedrop");
1154         new_toggle("magnify.png",
1155                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1156                            "magnify");
1157         new_toggle("mask.png",
1158                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1159                            "mask");
1160         new_toggle("ruler.png",
1161                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1162                            "ruler");
1163         new_toggle("projector.png",
1164                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1165                            "projector");
1166         new_toggle("protect.png",
1167                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1168                            "protect");
1169         new_toggle("titlesafe.png",
1170                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1171                            "titlesafe");
1172         new_toggle("toolwindow.png",
1173                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1174                            "tool");
1175         // toggle for tangent mode (compositor/tool window)
1176         new_toggle("tan_smooth.png",
1177                            editpanel_up, editpanel_hi, editpanel_checked,
1178                            editpanel_dn, editpanel_checkedhi,
1179                            "tan_smooth");
1180         new_toggle("tan_linear.png",
1181                            editpanel_up, editpanel_hi, editpanel_checked,
1182                            editpanel_dn, editpanel_checkedhi,
1183                            "tan_linear");
1184
1185         new_toggle("mask_scale_x.png",   "mask_scale_up.png",    "mask_scale_uphi.png",
1186                 "mask_scale_chkd.png",  "mask_scale_xdown.png",  "mask_scale_chkdhi.png",
1187                 "mask_scale_x");
1188         new_toggle("mask_scale_y.png",   "mask_scale_up.png",    "mask_scale_uphi.png",
1189                 "mask_scale_chkd.png",  "mask_scale_ydown.png",  "mask_scale_chkdhi.png",
1190                 "mask_scale_y");
1191         new_toggle("mask_scale_xy.png",  "mask_scale_up.png",   "mask_scale_uphi.png",
1192                 "mask_scale_chkd.png", "mask_scale_xydown.png", "mask_scale_chkdhi.png",
1193                 "mask_scale_xy");
1194
1195         flush_images();
1196 }
1197
1198 // Re-align the Clock. theme.c:931 
1199 void NEOPHYTETHEME::get_vwindow_sizes(VWindowGUI *gui)
1200 {
1201         int edit_w = EditPanel::calculate_w(mwindow, 0, 12);
1202         int transport_w = PlayTransport::get_transport_width(mwindow) + toggle_margin;
1203         vtimebar_h = yS(16);       // The height of the position indicator
1204         int division_w = xS(30);
1205         
1206         /* For the deco, [150]-10. The remaining space should theoretically
1207            suffice for 999,999:59:59.960 hours. Total size: 140 x 26, where
1208            a height of 24 or 22 px would be nicer. */
1209         vtime_w = xS(140);
1210         
1211         /* Indent, flat. Larger indentation also puts
1212            the 35% view into the compact view. */
1213         int vtime_border = xS(15);
1214   
1215         vmeter_y = widget_border;
1216         vmeter_h = mwindow->session->vwindow_h - cmeter_y - widget_border;
1217
1218         int buttons_h;
1219         if (mwindow->edl->session->vwindow_meter) {
1220                 vmeter_x = mwindow->session->vwindow_w -
1221                         MeterPanel::get_meters_width(this,
1222                                                                                  mwindow->edl->session->audio_channels,
1223                                                                                  mwindow->edl->session->vwindow_meter);
1224         } else {
1225                 vmeter_x = mwindow->session->vwindow_w + widget_border;
1226         }
1227
1228         vcanvas_x = 0;
1229         vcanvas_y = 0;
1230         vcanvas_w = vmeter_x - vcanvas_x - widget_border;
1231
1232         if (edit_w +
1233                 widget_border * 2 +
1234                 transport_w + widget_border +
1235                 vtime_w + division_w +
1236                 vtime_border > vmeter_x) {
1237                 buttons_h = get_image("vbuttons_left")->get_h();
1238                 vedit_x = widget_border;
1239                 vedit_y = mwindow->session->vwindow_h -
1240                         buttons_h +
1241                         vtimebar_h +
1242                         widget_border;
1243
1244                 vtransport_x = widget_border;
1245                 vtransport_y = mwindow->session->vwindow_h -
1246                         get_image_set("autokeyframe")[0]->get_h() -
1247                         widget_border;
1248
1249                 vdivision_x = xS(280);      // field width, compact
1250                 vtime_x = vedit_x + xS(38); // concentric
1251                 vtime_y = vedit_y + yS(24); // vertical alignment
1252         } else {
1253                 buttons_h = vtimebar_h +
1254                         widget_border +
1255                         EditPanel::calculate_h(mwindow) +
1256                         widget_border;
1257                 vtransport_x = widget_border;
1258                 vtransport_y = mwindow->session->vwindow_h -
1259                         buttons_h +
1260                         vtimebar_h +
1261                         widget_border;
1262
1263                 vedit_x = vtransport_x + transport_w + widget_border;
1264                 vedit_y = vtransport_y;
1265
1266                 vdivision_x = vedit_x + edit_w + division_w;
1267                 vtime_x = vdivision_x + vtime_border;
1268                 // vertical height concentric at button height
1269                 vtime_y = vedit_y + widget_border - yS(7);
1270         }
1271
1272         // vtimebar_x = vcanvas_x;
1273         // vtimebar_y = vcanvas_y + vcanvas_h;
1274         // vtimebar_w = vcanvas_w;
1275
1276         vcanvas_h = mwindow->session->vwindow_h - buttons_h;
1277         vtimebar_x = 0;
1278         vtimebar_y = vcanvas_y + vcanvas_h;
1279         vtimebar_w = vmeter_x - widget_border;
1280 }
1281
1282 void NEOPHYTETHEME::build_bg_data()
1283 {
1284         // Audio settings
1285         channel_position_data = new VFramePng(get_image_data("channel_position.png"));
1286         // Track bitmaps
1287         new_image1("resource1024", "resource1024.png");
1288         new_image1("resource512", "resource512.png");
1289         new_image1("resource256", "resource256.png");
1290         new_image1("resource128", "resource128.png");
1291         new_image1("resource64", "resource64.png");
1292         new_image1("resource32", "resource32.png");
1293         new_image("plugin_bg_data", "plugin_bg.png");
1294         new_image("title_bg_data", "title_bg.png");
1295         new_image("vtimebar_bg_data", "vwindow_timebar.png");
1296 }
1297
1298 void NEOPHYTETHEME::build_overlays()
1299 {
1300         keyframe_data = new VFramePng(get_image_data("keyframe3.png"));
1301         camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
1302         maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
1303         modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
1304         hardedge_data = new VFramePng(get_image_data("hardedge.png"));
1305         pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
1306         projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
1307 }
1308
1309 void NEOPHYTETHEME::draw_rwindow_bg(RecordGUI *gui)
1310 {
1311         // int y;
1312         // int margin = xS(50);
1313         // int margin2 = xS(80);
1314         // gui->draw_9segment(recordgui_batch_x - margin, 0,
1315         //      mwindow->session->rwindow_w - recordgui_status_x + margin,
1316         //      recordgui_buttons_y,
1317         //      rgui_batch);
1318         // gui->draw_3segmenth(recordgui_options_x - margin2,
1319         //      recordgui_buttons_y - yS(5),
1320         //      mwindow->session->rwindow_w - recordgui_options_x + margin2,
1321         //      rgui_controls);
1322         // y = recordgui_buttons_y - yS(5) + rgui_controls->get_h();
1323         // gui->draw_9segment(0, y,
1324         //      mwindow->session->rwindow_w,
1325         //      mwindow->session->rwindow_h - y,
1326         //      rgui_list);
1327 }
1328
1329 void NEOPHYTETHEME::draw_rmonitor_bg(RecordMonitorGUI *gui)
1330 {
1331         // int margin = xS(45);
1332         // int panel_w = xS(300);
1333         // int x = rmonitor_meter_x - margin;
1334         // int w = mwindow->session->rmonitor_w - x;
1335         // if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w();
1336         // gui->clear_box(0, 0,
1337         //      mwindow->session->rmonitor_w,
1338         //      mwindow->session->rmonitor_h);
1339         // gui->draw_9segment(x, 0,
1340         //      w,
1341         //      mwindow->session->rmonitor_h,
1342         //      rmonitor_meters);
1343 }
1344
1345 void NEOPHYTETHEME::draw_mwindow_bg(MWindowGUI *gui)
1346 {
1347         // Button bar
1348         gui->draw_3segmenth(mbuttons_x, mbuttons_y - 1,
1349                                                 gui->menu_w(), get_image("mbutton_bg"));
1350
1351         int pdw = get_image("panel_divider")->get_w();
1352         int x = mbuttons_x;
1353         x += 9 * get_image("play")->get_w();
1354         x += mtransport_margin;                                     // the control buttons
1355
1356         gui->draw_vframe(get_image("panel_divider"),
1357                                          x - toggle_margin / 2 - pdw / 2 + 2,
1358                                          mbuttons_y - 1);
1359         x += 2 * get_image("arrow")->get_w() + toggle_margin;       // the mode buttons
1360
1361         gui->draw_vframe(get_image("panel_divider"),
1362                                          x - toggle_margin / 2 - pdw / 2 + 2,
1363                                          mbuttons_y - 1);
1364
1365         x += 3 * get_image("autokeyframe")->get_w() + toggle_margin; // the state toggle buttons
1366         gui->draw_vframe(get_image("panel_divider"),
1367                                          x - toggle_margin / 2 - pdw / 2 + 2,
1368                                          mbuttons_y - 1);
1369         // Clock
1370         gui->draw_3segmenth(0,
1371                                                 mbuttons_y - 1 + get_image("mbutton_bg")->get_h(),
1372                                                 get_image("patchbay_bg")->get_w(),
1373                                                 get_image("clock_bg"));
1374         // Patchbay
1375         gui->draw_3segmentv(patchbay_x,
1376                                                 patchbay_y,
1377                                                 patchbay_h,
1378                                                 get_image("patchbay_bg"));
1379         // Track canvas
1380         gui->set_color(BLACK);
1381         gui->draw_box(mcanvas_x + get_image("patchbay_bg")->get_w(),
1382                                   mcanvas_y + mtimebar_h,
1383                                   mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT),
1384                                   mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ) - mtimebar_h);
1385         // Timebar
1386         gui->draw_3segmenth(mtimebar_x, mtimebar_y,
1387                 mtimebar_w, get_image("timebar_bg"));
1388         // Zoombar
1389         gui->set_color(BlackNineTwo);
1390         gui->draw_box(mzoom_x, mzoom_y,
1391                 mwindow->session->mwindow_w, yS(25));
1392         // Scrollbar filler
1393         // gui->draw_vframe(get_image("mscroll_filler"),
1394         //                  mcanvas_x + mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT),
1395         //                  mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ));
1396
1397         // Status
1398         gui->draw_3segmenth(mzoom_x, mzoom_y,
1399                 mzoom_w, get_image("statusbar"));
1400 }
1401
1402 void NEOPHYTETHEME::draw_cwindow_bg(CWindowGUI *gui)
1403 {
1404         gui->draw_3segmentv(0, 0, ccomposite_h, get_image("cpanel_bg"));
1405
1406         gui->draw_3segmenth(0, ccomposite_h, cstatus_x, get_image("cbuttons_left"));
1407
1408         if(mwindow->edl->session->cwindow_meter)
1409         {
1410                 gui->draw_3segmenth(cstatus_x,
1411                                                         ccomposite_h,
1412                                                         cmeter_x - widget_border - cstatus_x,
1413                                                         get_image("cbuttons_right"));
1414                 gui->draw_9segment(cmeter_x - widget_border,
1415                                                    0,
1416                                                    mwindow->session->cwindow_w - cmeter_x + widget_border,
1417                                                    mwindow->session->cwindow_h,
1418                                                    get_image("cmeter_bg"));
1419         } else {
1420                 gui->draw_3segmenth(cstatus_x, ccomposite_h,
1421                         cmeter_x - widget_border - cstatus_x + xS(100),
1422                         get_image("cbuttons_right"));
1423         }
1424 }
1425
1426 void NEOPHYTETHEME::draw_vwindow_bg(VWindowGUI *gui)
1427 {
1428         gui->draw_3segmenth(0, vcanvas_h,
1429                 vdivision_x, get_image("vbuttons_left"));
1430         if(mwindow->edl->session->vwindow_meter)
1431         {
1432                 gui->draw_3segmenth(vdivision_x, vcanvas_h,
1433                         vmeter_x - widget_border - vdivision_x, get_image("vbuttons_right"));
1434                 gui->draw_9segment(vmeter_x - widget_border, 0,
1435                            mwindow->session->vwindow_w - vmeter_x + widget_border,
1436                            mwindow->session->vwindow_h, get_image("cmeter_bg"));
1437         } else {
1438                 gui->draw_3segmenth(vdivision_x, vcanvas_h,
1439                         vmeter_x - widget_border - vdivision_x + xS(100),
1440                         get_image("vbuttons_right"));
1441         }
1442
1443         // Clock deco
1444         gui->draw_3segmenth(
1445                 vtime_x - xS(5),  // -left, +right
1446                 vtime_y + 0,      // -up, +down. Careful, move some of the buttons as well.
1447                 vtime_w + xS(10), // protruded l/r x*2
1448                 get_image("vclock"));
1449
1450 }
1451
1452 void NEOPHYTETHEME::draw_preferences_bg(PreferencesWindow *gui)
1453 {
1454         gui->draw_vframe(get_image("preferences_bg"), 0, 0);
1455 }
1456
1457 void NEOPHYTETHEME::draw_new_bg(NewWindow *gui)
1458 {
1459         gui->draw_vframe(get_image("new_bg"), 0, 0);
1460 }
1461
1462 void NEOPHYTETHEME::draw_setformat_bg(SetFormatWindow *gui)
1463 {
1464         gui->draw_vframe(get_image("setformat_bg"), 0, 0);
1465 }