add edit clear submenu/clear hard_edges, fix tessy gl segv, mask toolgui layout,...
[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 = 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 = 15;       // indent, moves the button text to the right
165         resources->popupmenu_triangle_margin = 15;
166
167         resources->listbox_title_color = CreamyWhiteBright; // columns header
168         resources->listbox_title_margin = 15;               // [20] indent
169         resources->listbox_title_hotspot = 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 = 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 = 25;
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         new_toggle(
291                 "loadmode_nested.png",
292                 "loadmode_up.png",
293                 "loadmode_hi.png",
294                 "loadmode_checked.png",
295                 "loadmode_dn.png",
296                 "loadmode_checkedhi.png",
297                 "loadmode_nested");
298         resources->filebox_icons_images = new_button(
299                 "icons.png",
300                 "fileboxbutton_up.png",
301                 "fileboxbutton_hi.png",
302                 "fileboxbutton_dn.png",
303                 "filebox_icons");
304         resources->filebox_text_images = new_button(
305                 "text.png",
306                 "fileboxbutton_up.png",
307                 "fileboxbutton_hi.png",
308                 "fileboxbutton_dn.png",
309                 "filebox_text");
310         resources->filebox_newfolder_images = new_button(
311                 "folder.png",
312                 "fileboxbutton_up.png",
313                 "fileboxbutton_hi.png",
314                 "fileboxbutton_dn.png",
315                 "filebox_newfolder");
316         resources->filebox_rename_images = new_button(
317                 "rename.png",
318                 "fileboxbutton_up.png",
319                 "fileboxbutton_hi.png",
320                 "fileboxbutton_dn.png",
321                 "filebox_rename");
322         resources->filebox_updir_images = new_button(
323                 "updir.png",
324                 "fileboxbutton_up.png",
325                 "fileboxbutton_hi.png",
326                 "fileboxbutton_dn.png",
327                 "filebox_updir");
328         resources->filebox_delete_images = new_button(
329                 "delete.png",
330                 "fileboxbutton_up.png",
331                 "fileboxbutton_hi.png",
332                 "fileboxbutton_dn.png",
333                 "filebox_delete");
334         resources->filebox_reload_images = new_button(
335                 "reload.png",
336                 "fileboxbutton_up.png",
337                 "fileboxbutton_hi.png",
338                 "fileboxbutton_dn.png",
339                 "filebox_reload");
340         resources->filebox_descend_images = new_button(
341                 "openfolder.png",
342                 "filebox_bigbutton_up.png",
343                 "filebox_bigbutton_hi.png",
344                 "filebox_bigbutton_dn.png",
345                 "filebox_descend");
346         resources->usethis_button_images = resources->ok_images = new_button(
347                 "ok.png",
348                 "filebox_bigbutton_up.png",
349                 "filebox_bigbutton_hi.png",
350                 "filebox_bigbutton_dn.png",
351                 "ok_button");
352         new_button(
353                 "ok.png",
354                 "new_bigbutton_up.png",
355                 "new_bigbutton_hi.png",
356                 "new_bigbutton_dn.png",
357                 "new_ok_images");
358         new_button(
359                 "reset.png",
360                 "reset_up.png",
361                 "reset_dn.png",
362                 "reset_hi.png",
363                 "reset_button");
364         resources->cancel_images = new_button(
365                 "cancel.png",
366                 "filebox_bigbutton_up.png",
367                 "filebox_bigbutton_hi.png",
368                 "filebox_bigbutton_dn.png",
369                 "cancel_button");
370         new_button(
371                 "cancel.png",
372                 "new_bigbutton_up.png",
373                 "new_bigbutton_hi.png",
374                 "new_bigbutton_dn.png",
375                 "new_cancel_images");
376         // Clock - is not used (AFAIK). See also clock color.
377         // resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
378         //      "0.png",
379         //      "1.png",
380         //      "2.png",
381         //      "3.png",
382         //      "4.png",
383         //      "5.png",
384         //      "6.png",
385         //      "7.png",
386         //      "8.png",
387         //      "9.png",
388         //      "colon.png",
389         //      "period.png",
390         //      "a.png",
391         //      "b.png",
392         //      "c.png",
393         //      "d.png",
394         //      "e.png",
395         //      "f.png",
396         //      "space.png",
397         //      "dash.png");
398
399         resources->bar_data = new_image("bar", "bar.png");
400         resources->check = new_image("check", "check.png");
401
402         resources->min_menu_w = 96;
403         resources->menu_popup_bg = new_image("menu_popup_bg.png");
404         resources->menu_item_bg = new_image_set(
405                 3,
406                 "menuitem_up.png",
407                 "menuitem_hi.png",
408                 "menuitem_dn.png");
409         resources->menu_bar_bg = new_image("menubar_bg.png");
410         resources->menu_title_bg = new_image_set
411                 (3,
412                  "menubar_up.png",
413                  "menubar_hi.png",
414                  "menubar_dn.png");
415         resources->popupmenu_images = 0;
416         // new_image_set(3,
417         // "menupopup_up.png",
418         // "menupopup_hi.png",
419         // "menupopup_dn.png");
420         resources->toggle_highlight_bg = new_image(
421                 "toggle_highlight_bg",
422                 "text_highlight.png");
423         resources->generic_button_images = new_image_set(
424                 3,
425                 "generic_up.png",
426                 "generic_hi.png",
427                 "generic_dn.png");
428         resources->horizontal_slider_data = new_image_set(
429                 6,
430                 "hslider_fg_up.png",
431                 "hslider_fg_hi.png",
432                 "hslider_fg_dn.png",
433                 "hslider_bg_up.png",
434                 "hslider_bg_hi.png",
435                 "hslider_bg_dn.png");
436         resources->vertical_slider_data = new_image_set(
437                 6,
438                 "hslider_fg_up.png",
439                 "hslider_fg_hi.png",
440                 "hslider_fg_dn.png",
441                 "hslider_bg_up.png",
442                 "hslider_bg_hi.png",
443                 "hslider_bg_dn.png");
444   
445         for( int i=0; i<6; ++i )
446                 resources->vertical_slider_data[i]->rotate90();
447
448         resources->progress_images = new_image_set(
449                 2,
450                 "progress_bg.png",
451                 "progress_hi.png");
452         resources->tumble_data = new_image_set(
453                 4,
454                 "tumble_up.png",
455                 "tumble_hi.png",
456                 "tumble_bottom.png",
457                 "tumble_top.png");
458         resources->listbox_button = new_button4(
459                 "listbox_button.png",
460                 "editpanel_up.png",
461                 "editpanel_hi.png",
462                 "editpanel_dn.png",
463                 "editpanel_hi.png",
464                 "listbox_button");
465         // Dialog "Load files…" switch SI/IEC
466         resources->filebox_szfmt_images = new_image_set(
467                 12,
468                 "file_size_zero_up.png",
469                 "file_size_zero_hi.png",
470                 "file_size_zero_dn.png",
471                 "file_size_lwrb_up.png",
472                 "file_size_lwrb_hi.png",
473                 "file_size_lwrb_dn.png",
474                 "file_size_capb_up.png",
475                 "file_size_capb_hi.png",
476                 "file_size_capb_dn.png",
477                 "file_size_semi_up.png",
478                 "file_size_semi_hi.png",
479                 "file_size_semi_dn.png");
480         resources->listbox_column = new_image_set(
481                 3,
482                 "column_up.png",
483                 "column_hi.png",
484                 "column_dn.png");
485         resources->listbox_up = new_image("listbox_up.png");
486         resources->listbox_dn = new_image("listbox_dn.png");
487         resources->pan_data = new_image_set(
488                 7,
489                 "pan_up.png",
490                 "pan_hi.png",
491                 "pan_popup.png",
492                 "pan_channel.png",
493                 "pan_stick.png",
494                 "pan_channel_small.png",
495                 "pan_stick_small.png");
496         resources->pan_text_color = CreamyWhiteBright;
497         resources->pot_images = new_image_set(
498                 3,
499                 "pot_up.png",
500                 "pot_hi.png",
501                 "pot_dn.png");
502         resources->checkbox_images = new_image_set(
503                 5,
504                 "checkbox_up.png",
505                 "checkbox_hi.png",
506                 "checkbox_checked.png",
507                 "checkbox_dn.png",
508                 "checkbox_checkedhi.png");
509         resources->radial_images = new_image_set(
510                 5,
511                 "radial_up.png",
512                 "radial_hi.png",
513                 "radial_checked.png",
514                 "radial_dn.png",
515                 "radial_checkedhi.png");
516         resources->xmeter_images = new_image_set(
517                 7,
518                 "xmeter_normal.png",
519                 "xmeter_green.png",
520                 "xmeter_red.png",
521                 "xmeter_yellow.png",
522                 "xmeter_white.png",
523                 "xmeter_over.png",
524                 "downmix51_2.png");
525         resources->ymeter_images = new_image_set(
526                 7,
527                 "ymeter_normal.png",
528                 "ymeter_green.png",
529                 "ymeter_red.png",
530                 "ymeter_yellow.png",
531                 "ymeter_white.png",
532                 "ymeter_over.png",
533                 "downmix51_2.png");
534         resources->hscroll_data = new_image_set(
535                 10,
536                 "hscroll_handle_up.png",
537                 "hscroll_handle_hi.png",
538                 "hscroll_handle_dn.png",
539                 "hscroll_handle_bg.png",
540                 "hscroll_left_up.png",
541                 "hscroll_left_hi.png",
542                 "hscroll_left_dn.png",
543                 "hscroll_right_up.png",
544                 "hscroll_right_hi.png",
545                 "hscroll_right_dn.png");
546         resources->vscroll_data = new_image_set(
547                 10,
548                 "vscroll_handle_up.png",
549                 "vscroll_handle_hi.png",
550                 "vscroll_handle_dn.png",
551                 "vscroll_handle_bg.png",
552                 "vscroll_left_up.png",
553                 "vscroll_left_hi.png",
554                 "vscroll_left_dn.png",
555                 "vscroll_right_up.png",
556                 "vscroll_right_hi.png",
557                 "vscroll_right_dn.png");
558         resources->scroll_minhandle = 20;
559     
560         new_button(
561                 "prevtip.png", "tipbutton_up.png",
562                 "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip");
563         new_button(
564                 "nexttip.png", "tipbutton_up.png",
565                 "tipbutton_hi.png", "tipbutton_dn.png", "next_tip");
566         new_button(
567                 "closetip.png", "tipbutton_up.png",
568                 "tipbutton_hi.png", "tipbutton_dn.png", "close_tip");
569         new_button(
570                 "swap_extents.png", "editpanel_up.png",
571                 "editpanel_hi.png", "editpanel_dn.png", "swap_extents");
572
573         // Record windows
574         preferences_category_overlap = 0;
575         preferencescategory_x = 0;
576         preferencescategory_y = 5;
577         preferencestitle_x = 5;
578         preferencestitle_y = 10;
579         preferencesoptions_x = 5;
580         preferencesoptions_y = 0;
581
582         // MWindow
583         message_normal = resources->text_default;
584
585         mtransport_margin = 10;
586         toggle_margin = 10;
587
588         new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png",
589                            "pane");
590         new_image_set("xpane", 3,
591                                   "xpane_up.png",
592                                   "xpane_hi.png",
593                                   "xpane_dn.png");
594         new_image_set("ypane", 3,
595                                   "ypane_up.png",
596                                   "ypane_hi.png",
597                                   "ypane_dn.png");
598
599         new_image("mbutton_bg", "mbutton_bg.png");
600         new_image("timebar_bg", "timebar_bg_flat.png");
601         new_image("timebar_brender", "timebar_brender.png");
602         new_image("clock_bg", "mclock_flat.png");
603         new_image("patchbay_bg", "patchbay_bg.png");
604         new_image("statusbar", "statusbar.png");
605         // new_image("mscroll_filler", "mscroll_filler.png");
606
607         new_image_set("zoombar_menu", 3,
608                                   "zoompopup_up.png",
609                                   "zoompopup_hi.png",
610                                   "zoompopup_dn.png");
611         new_image_set("zoombar_tumbler", 4,
612                                   "zoomtumble_up.png",
613                                   "zoomtumble_hi.png",
614                                   "zoomtumble_bottom.png",
615                                   "zoomtumble_top.png");
616
617         new_image_set("mode_popup", 3,
618                                   "mode_up.png", "mode_hi.png", "mode_dn.png");
619         new_image("mode_add", "mode_add.png");
620         new_image("mode_divide", "mode_divide.png");
621         new_image("mode_multiply", "mode_multiply.png");
622         new_image("mode_normal", "mode_normal.png");
623         new_image("mode_replace", "mode_replace.png");
624         new_image("mode_subtract", "mode_subtract.png");
625         new_image("mode_max", "mode_max.png");
626
627         new_image_set("plugin_on", 5,
628                                   "plugin_on.png",
629                                   "plugin_onhi.png",
630                                   "plugin_onselect.png",
631                                   "plugin_ondn.png",
632                                   "plugin_onselecthi.png");
633         new_image_set("plugin_show", 5,
634                                   "plugin_show.png",
635                                   "plugin_showhi.png",
636                                   "plugin_showselect.png",
637                                   "plugin_showdn.png",
638                                   "plugin_showselecthi.png");
639         
640         // Mixer
641         new_image_set("mixpatch_data", 5,
642                                   "mixpatch_up.png",
643                                   "mixpatch_hi.png",
644                                   "mixpatch_checked.png",
645                                   "mixpatch_dn.png",
646                                   "mixpatch_checkedhi.png");
647         
648         // CWindow
649         new_image("cpanel_bg", "cpanel_bg.png");
650         new_image("cbuttons_left", "cbuttons_left.png");
651         new_image("cbuttons_right", "cbuttons_right.png");
652         new_image("cmeter_bg", "cmeter_bg.png");
653         new_image("cwindow_focus", "cwindow_focus.png");
654         
655         // VWindow
656         /* The red position indicator is currently only 5 px high.
657            The backgrounds were made according to this. */
658         new_image("vbuttons_left", "vbuttons_left.png");
659         new_image("vbuttons_right", "vbuttons_right.png"); // unset = cbuttons_right
660         new_image("vclock", "vclock.png");
661         //new_image("vmeter_bg", ".png"); // ! 
662   
663         new_image("preferences_bg", "preferences_bg.png");
664
665         new_image("new_bg", "new_bg.png");
666         new_image("setformat_bg", "setformat_bg.png");
667
668         timebar_view_data = new_image("timebar_view.png");
669
670         setformat_w = get_image("setformat_bg")->get_w();
671         setformat_h = get_image("setformat_bg")->get_h();
672         setformat_x1 = 15;
673         setformat_x2 = 110;
674         setformat_x3 = 315;
675         setformat_x4 = 425;
676         setformat_y1 = 20;
677         setformat_y2 = 85;
678         setformat_y3 = 125;
679         setformat_margin = 30;
680         setformat_channels_x = 25;
681         setformat_channels_y = 242;
682         setformat_channels_w = 250;
683         setformat_channels_h = 250;
684
685         loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + 10;
686         browse_pad = 20;
687
688         new_toggle("playpatch.png",
689                            "playpatch_up.png",
690                            "playpatch_hi.png",
691                            "playpatch_checked.png",
692                            "playpatch_dn.png",
693                            "playpatch_checkedhi.png",
694                            "playpatch_data");
695         new_toggle("recordpatch.png",
696                            "recordpatch_up.png",
697                            "recordpatch_hi.png",
698                            "recordpatch_checked.png",
699                            "recordpatch_dn.png",
700                            "recordpatch_checkedhi.png",
701                            "recordpatch_data");
702         new_toggle("gangpatch.png",
703                            "patch_up.png",
704                            "patch_hi.png",
705                            "patch_checked.png",
706                            "patch_dn.png",
707                            "patch_checkedhi.png",
708                            "gangpatch_data");
709         new_toggle("drawpatch.png",
710                            "patch_up.png",
711                            "patch_hi.png",
712                            "patch_checked.png",
713                            "patch_dn.png",
714                            "patch_checkedhi.png",
715                            "drawpatch_data");
716
717         new_image_set("mutepatch_data",
718                                   5,
719                                   "mutepatch_up.png",
720                                   "mutepatch_hi.png",
721                                   "mutepatch_checked.png",
722                                   "mutepatch_dn.png",
723                                   "mutepatch_checkedhi.png");
724         new_image_set("expandpatch_data",
725                                   5,
726                                   "expandpatch_up.png",
727                                   "expandpatch_hi.png",
728                                   "expandpatch_checked.png",
729                                   "expandpatch_dn.png",
730                                   "expandpatch_checkedhi.png");
731
732         build_bg_data();
733         build_overlays();
734
735         out_point = new_image_set(
736                 5,
737                 "out_up.png",
738                 "out_hi.png",
739                 "out_checked.png",
740                 "out_dn.png",
741                 "out_checkedhi.png");
742         in_point = new_image_set(
743                 5,
744                 "in_up.png",
745                 "in_hi.png",
746                 "in_checked.png",
747                 "in_dn.png",
748                 "in_checkedhi.png");
749         label_toggle = new_image_set(
750                 5,
751                 "labeltoggle_up.png",
752                 "labeltoggle_uphi.png",
753                 "label_checked.png",
754                 "labeltoggle_dn.png",
755                 "label_checkedhi.png");
756         ffmpeg_toggle = new_image_set(
757                 5,
758                 "ff_up.png",
759                 "ff_hi.png",
760                 "ff_checked.png",
761                 "ff_down.png",
762                 "ff_checkedhi.png");
763         proxy_p_toggle = new_image_set(
764                 5,
765                 "proxy_p_up.png",
766                 "proxy_p_hi.png",
767                 "proxy_p_chkd.png",
768                 "proxy_p_down.png",
769                 "proxy_p_chkdhi.png");
770         proxy_s_toggle = new_image_set( // proxy use ffmpeg scaler
771                 5,
772                 "proxy_s_up.png",
773                 "proxy_s_hi.png",
774                 "proxy_s_chkd.png",
775                 "proxy_s_down.png",
776                 "proxy_s_chkdhi.png");
777         mask_mode_toggle = new_image_set(5,
778                 "mask_mode_up.png",
779                 "mask_mode_hi.png",
780                 "mask_mode_chkd.png",
781                 "mask_mode_down.png",
782                 "mask_mode_chkdhi.png");
783         shbtn_data = new_image_set(
784                 3,
785                 "shbtn_up.png",
786                 "shbtn_hi.png",
787                 "shbtn_dn.png");
788         new_image_set(
789                 "preset_edit",
790                 3,
791                 "preset_edit0.png",
792                 "preset_edit1.png",
793                 "preset_edit2.png");
794         new_image_set(
795                 "histogram_carrot",
796                 5,
797                 "histogram_carrot_up.png",
798                 "histogram_carrot_hi.png",
799                 "histogram_carrot_checked.png",
800                 "histogram_carrot_dn.png",
801                 "histogram_carrot_checkedhi.png");
802         statusbar_cancel_data = new_image_set(
803                 3,
804                 "statusbar_cancel_up.png",
805                 "statusbar_cancel_hi.png",
806                 "statusbar_cancel_dn.png");
807
808         VFrame *editpanel_up = new_image("editpanel_up.png");
809         VFrame *editpanel_hi = new_image("editpanel_hi.png");
810         VFrame *editpanel_dn = new_image("editpanel_dn.png");
811         VFrame *editpanel_checked = new_image("editpanel_checked.png");
812         VFrame *editpanel_checkedhi = new_image("editpanel_checkedhi.png");
813
814         new_image("panel_divider", "panel_divider.png");
815         new_button("bottom_justify.png",
816                            editpanel_up, editpanel_hi, editpanel_dn,
817                            "bottom_justify");
818         new_button("center_justify.png",
819                            editpanel_up, editpanel_hi, editpanel_dn,
820                            "center_justify");
821         new_button("channel.png",
822                            editpanel_up, editpanel_hi, editpanel_dn,
823                            "channel");
824         new_button("lok.png", // popup slider
825                            editpanel_up, editpanel_hi, editpanel_dn,
826                            "lok");
827         new_toggle("histogram_toggle.png",
828                            editpanel_up,
829                            editpanel_hi,
830                            editpanel_checked,
831                            editpanel_dn,
832                            editpanel_checkedhi,
833                            "histogram_toggle");
834         new_toggle("histogram_rgb.png",
835                            editpanel_up,
836                            editpanel_hi,
837                            editpanel_checked,
838                            editpanel_dn,
839                            editpanel_checkedhi,
840                            "histogram_rgb_toggle");
841         new_toggle("waveform.png",
842                            editpanel_up,
843                            editpanel_hi,
844                            editpanel_checked,
845                            editpanel_dn,
846                            editpanel_checkedhi,
847                            "waveform_toggle");
848         new_toggle("waveform_rgb.png",
849                            editpanel_up,
850                            editpanel_hi,
851                            editpanel_checked,
852                            editpanel_dn,
853                            editpanel_checkedhi,
854                            "waveform_rgb_toggle");
855         new_toggle("scope.png",
856                            editpanel_up,
857                            editpanel_hi,
858                            editpanel_checked,
859                            editpanel_dn,
860                            editpanel_checkedhi,
861                            "scope_toggle");
862
863         new_button("picture.png",
864                            editpanel_up, editpanel_hi, editpanel_dn,
865                            "picture");
866         new_button("histogram_img.png",
867                            editpanel_up, editpanel_hi, editpanel_dn,
868                            "histogram_img");
869         new_button("copy.png",
870                            editpanel_up, editpanel_hi, editpanel_dn,
871                            "copy");
872         new_button("commercial.png",
873                            editpanel_up, editpanel_hi, editpanel_dn,
874                            "commercial"); // cdb
875         new_button("cut.png",
876                            editpanel_up, editpanel_hi, editpanel_dn,
877                            "cut");
878         new_button("fit.png",
879                            editpanel_up, editpanel_hi, editpanel_dn,
880                            "fit");
881         new_button("fitautos.png",
882                            editpanel_up, editpanel_hi, editpanel_dn,
883                            "fitautos");
884         new_button("inpoint.png",
885                            editpanel_up, editpanel_hi, editpanel_dn,
886                            "inbutton");
887         new_button("label.png",
888                            editpanel_up, editpanel_hi, editpanel_dn,
889                            "labelbutton");
890         new_button("left_justify.png",
891                            editpanel_up, editpanel_hi, editpanel_dn,
892                            "left_justify");
893         new_button("magnify.png",
894                            editpanel_up, editpanel_hi, editpanel_dn,
895                            "magnify_button");
896         new_button("middle_justify.png",
897                            editpanel_up, editpanel_hi, editpanel_dn,
898                            "middle_justify");
899         new_button("nextlabel.png",
900                            editpanel_up, editpanel_hi, editpanel_dn,
901                            "nextlabel");
902         new_button("prevlabel.png",
903                            editpanel_up, editpanel_hi, editpanel_dn,
904                            "prevlabel");
905         new_button("nextedit.png",
906                            editpanel_up, editpanel_hi, editpanel_dn,
907                            "nextedit");
908         new_button("prevedit.png",
909                            editpanel_up, editpanel_hi, editpanel_dn,
910                            "prevedit");
911         new_button("outpoint.png",
912                            editpanel_up, editpanel_hi, editpanel_dn,
913                            "outbutton");
914         over_button = new_button("over.png",
915                                                          editpanel_up, editpanel_hi, editpanel_dn,
916                                                          "overbutton");
917         overwrite_data = new_button("overwrite.png",
918                                                                 editpanel_up, editpanel_hi, editpanel_dn,
919                                                                 "overwritebutton");
920         new_button("paste.png",
921                            editpanel_up, editpanel_hi, editpanel_dn,
922                            "paste");
923         new_button("redo.png",
924                            editpanel_up, editpanel_hi, editpanel_dn,
925                            "redo");
926         new_button("right_justify.png",
927                            editpanel_up, editpanel_hi, editpanel_dn,
928                            "right_justify");
929         splice_data = new_button("splice.png",
930                                                          editpanel_up, editpanel_hi, editpanel_dn,
931                                                          "splicebutton");
932         new_button("toclip.png",
933                            editpanel_up, editpanel_hi, editpanel_dn,
934                            "toclip");
935         new_button("goto.png",
936                            editpanel_up, editpanel_hi, editpanel_dn,
937                            "goto");
938         new_button("top_justify.png",
939                            editpanel_up, editpanel_hi, editpanel_dn,
940                            "top_justify");
941         new_button("undo.png",
942                            editpanel_up, editpanel_hi, editpanel_dn,
943                            "undo");
944         new_button("wrench.png",
945                            editpanel_up, editpanel_hi, editpanel_dn,
946                            "wrench");
947
948         VFrame *transport_up = new_image("transportup.png");
949         VFrame *transport_hi = new_image("transporthi.png");
950         VFrame *transport_dn = new_image("transportdn.png");
951
952         new_button("end.png",
953                            transport_up, transport_hi, transport_dn,
954                            "end");
955         new_button("fastfwd.png",
956                            transport_up, transport_hi, transport_dn,
957                            "fastfwd");
958         new_button("fastrev.png",
959                            transport_up, transport_hi, transport_dn,
960                            "fastrev");
961         new_button("play.png",
962                            transport_up, transport_hi, transport_dn,
963                            "play");
964         new_button("framefwd.png",
965                            transport_up, transport_hi, transport_dn,
966                            "framefwd");
967         new_button("framerev.png",
968                            transport_up, transport_hi, transport_dn,
969                            "framerev");
970         new_button("pause.png",
971                            transport_up, transport_hi, transport_dn,
972                            "pause");
973         new_button("record.png",
974                            transport_up, transport_hi, transport_dn,
975                            "record");
976         new_button("singleframe.png",
977                            transport_up, transport_hi, transport_dn,
978                            "recframe");
979         new_button("reverse.png",
980                            transport_up, transport_hi, transport_dn,
981                            "reverse");
982         new_button("rewind.png",
983                            transport_up, transport_hi, transport_dn,
984                            "rewind");
985         new_button("stop.png",
986                            transport_up, transport_hi, transport_dn,
987                            "stop");
988         new_button("stop.png",
989                            transport_up, transport_hi, transport_dn,
990                            "stoprec");
991
992         // CWindow icons (led)
993         new_image("cwindow_inactive", "cwindow_inactive.png");
994         new_image("cwindow_active", "cwindow_active.png");
995
996         new_image_set("category_button",
997                                   3,
998                                   "preferencesbutton_dn.png",
999                                   "preferencesbutton_dnhi.png",
1000                                   "preferencesbutton_dnlo.png");
1001         new_image_set("category_button_checked",
1002                                   3,
1003                                   "preferencesbutton_up.png",
1004                                   "preferencesbutton_uphi.png",
1005                                   "preferencesbutton_dnlo.png");
1006         new_image_set("color3way_point",
1007                                   3,
1008                                   "color3way_up.png",
1009                                   "color3way_hi.png",
1010                                   "color3way_dn.png");
1011
1012         new_toggle("arrow.png",
1013                            editpanel_up, editpanel_hi, editpanel_checked,
1014                            editpanel_dn, editpanel_checkedhi,
1015                            "arrow");
1016         new_toggle("autokeyframe.png",
1017                            transport_up, editpanel_hi, editpanel_checked,
1018                            editpanel_dn, editpanel_checkedhi,
1019                            "autokeyframe");
1020         new_toggle("ibeam.png",
1021                            editpanel_up, editpanel_hi, editpanel_checked,
1022                            editpanel_dn, editpanel_checkedhi,
1023                            "ibeam");
1024         new_toggle("show_meters.png",
1025                            editpanel_up, editpanel_hi, editpanel_checked,
1026                            editpanel_dn, editpanel_checkedhi,
1027                            "meters");
1028         new_toggle("blank30x30.png",
1029                            new_image("locklabels_locked.png"),
1030                            new_image("locklabels_lockedhi.png"),
1031                            new_image("locklabels_unlocked.png"),
1032                            new_image("locklabels_dn.png"), // can't have seperate down for each!!??
1033                            new_image("locklabels_unlockedhi.png"),
1034                            "locklabels");
1035
1036         VFrame *cpanel_up = new_image("cpanel_up.png");
1037         VFrame *cpanel_hi = new_image("cpanel_hi.png");
1038         VFrame *cpanel_dn = new_image("cpanel_dn.png");
1039         VFrame *cpanel_checked = new_image("cpanel_checked.png");
1040         VFrame *cpanel_checkedhi = new_image("cpanel_checkedhi.png");
1041
1042         new_toggle("camera.png",
1043                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1044                            "camera");
1045         new_toggle("crop.png",
1046                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1047                            "crop");
1048         new_toggle("eyedrop.png",
1049                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1050                            "eyedrop");
1051         new_toggle("magnify.png",
1052                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1053                            "magnify");
1054         new_toggle("mask.png",
1055                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1056                            "mask");
1057         new_toggle("ruler.png",
1058                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1059                            "ruler");
1060         new_toggle("projector.png",
1061                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1062                            "projector");
1063         new_toggle("protect.png",
1064                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1065                            "protect");
1066         new_toggle("titlesafe.png",
1067                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1068                            "titlesafe");
1069         new_toggle("toolwindow.png",
1070                            cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi,
1071                            "tool");
1072         // toggle for tangent mode (compositor/tool window)
1073         new_toggle("tan_smooth.png",
1074                            editpanel_up, editpanel_hi, editpanel_checked,
1075                            editpanel_dn, editpanel_checkedhi,
1076                            "tan_smooth");
1077         new_toggle("tan_linear.png",
1078                            editpanel_up, editpanel_hi, editpanel_checked,
1079                            editpanel_dn, editpanel_checkedhi,
1080                            "tan_linear");
1081
1082         flush_images();
1083 }
1084
1085 // Re-align the Clock. theme.c:931 
1086 void NEOPHYTETHEME::get_vwindow_sizes(VWindowGUI *gui)
1087 {
1088         int edit_w = EditPanel::calculate_w(mwindow, 0, 10);
1089         int transport_w = PlayTransport::get_transport_width(mwindow) + toggle_margin;
1090         vtimebar_h = 16;       // The height of the position indicator
1091         int division_w = 30;
1092         
1093         /* For the deco, [150]-10. The remaining space should theoretically
1094            suffice for 999,999:59:59.960 hours. Total size: 140 x 26, where
1095            a height of 24 or 22 px would be nicer. */
1096         vtime_w = 140;
1097         
1098         /* Indent, flat. Larger indentation also puts
1099            the 35% view into the compact view. */
1100         int vtime_border = 15; 
1101   
1102         vmeter_y = widget_border;
1103         vmeter_h = mwindow->session->vwindow_h - cmeter_y - widget_border;
1104
1105         int buttons_h;
1106         if (mwindow->edl->session->vwindow_meter) {
1107                 vmeter_x = mwindow->session->vwindow_w -
1108                         MeterPanel::get_meters_width(this,
1109                                                                                  mwindow->edl->session->audio_channels,
1110                                                                                  mwindow->edl->session->vwindow_meter);
1111         } else {
1112                 vmeter_x = mwindow->session->vwindow_w + widget_border;
1113         }
1114
1115         vcanvas_x = 0;
1116         vcanvas_y = 0;
1117         vcanvas_w = vmeter_x - vcanvas_x - widget_border;
1118
1119         if (edit_w +
1120                 widget_border * 2 +
1121                 transport_w + widget_border +
1122                 vtime_w + division_w +
1123                 vtime_border > vmeter_x) {
1124                 buttons_h = get_image("vbuttons_left")->get_h();
1125                 vedit_x = widget_border;
1126                 vedit_y = mwindow->session->vwindow_h -
1127                         buttons_h +
1128                         vtimebar_h +
1129                         widget_border;
1130
1131                 vtransport_x = widget_border;
1132                 vtransport_y = mwindow->session->vwindow_h -
1133                         get_image_set("autokeyframe")[0]->get_h() -
1134                         widget_border;
1135
1136                 vdivision_x = 280;      // field width, compact
1137                 vtime_x = vedit_x + 38; // concentric
1138                 vtime_y = vedit_y + 24; // vertical alignment
1139         } else {
1140                 buttons_h = vtimebar_h +
1141                         widget_border +
1142                         EditPanel::calculate_h(mwindow) +
1143                         widget_border;
1144                 vtransport_x = widget_border;
1145                 vtransport_y = mwindow->session->vwindow_h -
1146                         buttons_h +
1147                         vtimebar_h +
1148                         widget_border;
1149
1150                 vedit_x = vtransport_x + transport_w + widget_border;
1151                 vedit_y = vtransport_y;
1152
1153                 vdivision_x = vedit_x + edit_w + division_w;
1154                 vtime_x = vdivision_x + vtime_border;
1155                 vtime_y = vedit_y + widget_border - 7; // vertical height concentric at button height
1156         }
1157
1158         // vtimebar_x = vcanvas_x;
1159         // vtimebar_y = vcanvas_y + vcanvas_h;
1160         // vtimebar_w = vcanvas_w;
1161
1162         vcanvas_h = mwindow->session->vwindow_h - buttons_h;
1163         vtimebar_x = 0;
1164         vtimebar_y = vcanvas_y + vcanvas_h;
1165         vtimebar_w = vmeter_x - widget_border;
1166 }
1167
1168 void NEOPHYTETHEME::build_bg_data()
1169 {
1170         // Audio settings
1171         channel_position_data = new VFramePng(get_image_data("channel_position.png"));
1172         // Track bitmaps
1173         new_image("resource1024", "resource1024.png");
1174         new_image("resource512", "resource512.png");
1175         new_image("resource256", "resource256.png");
1176         new_image("resource128", "resource128.png");
1177         new_image("resource64", "resource64.png");
1178         new_image("resource32", "resource32.png");
1179         new_image("plugin_bg_data", "plugin_bg.png");
1180         new_image("title_bg_data", "title_bg.png");
1181         new_image("vtimebar_bg_data", "vwindow_timebar.png");
1182 }
1183
1184 void NEOPHYTETHEME::build_overlays()
1185 {
1186         keyframe_data = new VFramePng(get_image_data("keyframe3.png"));
1187         camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
1188         maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
1189         modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
1190         hardedge_data = new VFramePng(get_image_data("hardedge.png"));
1191         pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
1192         projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
1193 }
1194
1195 void NEOPHYTETHEME::draw_rwindow_bg(RecordGUI *gui)
1196 {
1197         // int y;
1198         // int margin = 50;
1199         // int margin2 = 80;
1200         // gui->draw_9segment(recordgui_batch_x - margin,
1201         //      0,
1202         //      mwindow->session->rwindow_w - recordgui_status_x + margin,
1203         //      recordgui_buttons_y,
1204         //      rgui_batch);
1205         // gui->draw_3segmenth(recordgui_options_x - margin2,
1206         //      recordgui_buttons_y - 5,
1207         //      mwindow->session->rwindow_w - recordgui_options_x + margin2,
1208         //      rgui_controls);
1209         // y = recordgui_buttons_y - 5 + rgui_controls->get_h();
1210         // gui->draw_9segment(0,
1211         //      y,
1212         //      mwindow->session->rwindow_w,
1213         //      mwindow->session->rwindow_h - y,
1214         //      rgui_list);
1215 }
1216
1217 void NEOPHYTETHEME::draw_rmonitor_bg(RecordMonitorGUI *gui)
1218 {
1219         // int margin = 45;
1220         // int panel_w = 300;
1221         // int x = rmonitor_meter_x - margin;
1222         // int w = mwindow->session->rmonitor_w - x;
1223         // if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w();
1224         // gui->clear_box(0,
1225         //      0,
1226         //      mwindow->session->rmonitor_w,
1227         //      mwindow->session->rmonitor_h);
1228         // gui->draw_9segment(x,
1229         //      0,
1230         //      w,
1231         //      mwindow->session->rmonitor_h,
1232         //      rmonitor_meters);
1233 }
1234
1235 void NEOPHYTETHEME::draw_mwindow_bg(MWindowGUI *gui)
1236 {
1237         // Button bar
1238         gui->draw_3segmenth(mbuttons_x, mbuttons_y - 1,
1239                                                 gui->menu_w(), get_image("mbutton_bg"));
1240
1241         int pdw = get_image("panel_divider")->get_w();
1242         int x = mbuttons_x;
1243         x += 9 * get_image("play")->get_w();
1244         x += mtransport_margin;                                     // the control buttons
1245
1246         gui->draw_vframe(get_image("panel_divider"),
1247                                          x - toggle_margin / 2 - pdw / 2 + 2,
1248                                          mbuttons_y - 1);
1249         x += 2 * get_image("arrow")->get_w() + toggle_margin;       // the mode buttons
1250
1251         gui->draw_vframe(get_image("panel_divider"),
1252                                          x - toggle_margin / 2 - pdw / 2 + 2,
1253                                          mbuttons_y - 1);
1254
1255         x += 2 * get_image("autokeyframe")->get_w() + toggle_margin; // the state toggle buttons
1256         gui->draw_vframe(get_image("panel_divider"),
1257                                          x - toggle_margin / 2 - pdw / 2 + 2,
1258                                          mbuttons_y - 1);
1259         // Clock
1260         gui->draw_3segmenth(0,
1261                                                 mbuttons_y - 1 + get_image("mbutton_bg")->get_h(),
1262                                                 get_image("patchbay_bg")->get_w(),
1263                                                 get_image("clock_bg"));
1264         // Patchbay
1265         gui->draw_3segmentv(patchbay_x,
1266                                                 patchbay_y,
1267                                                 patchbay_h,
1268                                                 get_image("patchbay_bg"));
1269         // Track canvas
1270         gui->set_color(BLACK);
1271         gui->draw_box(mcanvas_x + get_image("patchbay_bg")->get_w(),
1272                                   mcanvas_y + mtimebar_h,
1273                                   mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT),
1274                                   mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ) - mtimebar_h);
1275         // Timebar
1276         gui->draw_3segmenth(mtimebar_x,
1277                                                 mtimebar_y,
1278                                                 mtimebar_w,
1279                                                 get_image("timebar_bg"));
1280         // Zoombar
1281         gui->set_color(BlackNineTwo);
1282         gui->draw_box(mzoom_x,
1283                                   mzoom_y,
1284                                   mwindow->session->mwindow_w,
1285                                   25);
1286         // Scrollbar filler
1287         // gui->draw_vframe(get_image("mscroll_filler"),
1288         //                  mcanvas_x + mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT),
1289         //                  mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ));
1290
1291         // Status
1292         gui->draw_3segmenth(mzoom_x,
1293                                                 mzoom_y,
1294                                                 mzoom_w,
1295                                                 get_image("statusbar"));
1296 }
1297
1298 void NEOPHYTETHEME::draw_cwindow_bg(CWindowGUI *gui)
1299 {
1300         gui->draw_3segmentv(0, 0, ccomposite_h, get_image("cpanel_bg"));
1301
1302         gui->draw_3segmenth(0, ccomposite_h, cstatus_x, get_image("cbuttons_left"));
1303
1304         if(mwindow->edl->session->cwindow_meter)
1305         {
1306                 gui->draw_3segmenth(cstatus_x,
1307                                                         ccomposite_h,
1308                                                         cmeter_x - widget_border - cstatus_x,
1309                                                         get_image("cbuttons_right"));
1310                 gui->draw_9segment(cmeter_x - widget_border,
1311                                                    0,
1312                                                    mwindow->session->cwindow_w - cmeter_x + widget_border,
1313                                                    mwindow->session->cwindow_h,
1314                                                    get_image("cmeter_bg"));
1315         } else {
1316                 gui->draw_3segmenth(cstatus_x,
1317                                                         ccomposite_h,
1318                                                         cmeter_x - widget_border - cstatus_x + 100,
1319                                                         get_image("cbuttons_right"));
1320         }
1321 }
1322
1323 void NEOPHYTETHEME::draw_vwindow_bg(VWindowGUI *gui)
1324 {
1325         gui->draw_3segmenth(0,
1326                                                 vcanvas_h,
1327                                                 vdivision_x,
1328                                                 get_image("vbuttons_left"));
1329         if(mwindow->edl->session->vwindow_meter)
1330         {
1331                 gui->draw_3segmenth(vdivision_x,
1332                                                         vcanvas_h,
1333                                                         vmeter_x - widget_border - vdivision_x,
1334                                                         get_image("vbuttons_right"));
1335                 gui->draw_9segment(vmeter_x - widget_border,
1336                                                    0,
1337                                                    mwindow->session->vwindow_w - vmeter_x + widget_border,
1338                                                    mwindow->session->vwindow_h,
1339                                                    get_image("cmeter_bg"));
1340         } else {
1341                 gui->draw_3segmenth(vdivision_x,
1342                                                         vcanvas_h,
1343                                                         vmeter_x - widget_border - vdivision_x + 100,
1344                                                         get_image("vbuttons_right"));
1345         }
1346
1347         // Clock deco
1348         gui->draw_3segmenth(
1349                 vtime_x - 5,  // -left, +right 
1350                 vtime_y + 0,  // -up, +down. Careful, move some of the buttons as well.
1351                 vtime_w + 10, // protruded l/r x*2
1352                 get_image("vclock"));
1353
1354 }
1355
1356 void NEOPHYTETHEME::draw_preferences_bg(PreferencesWindow *gui)
1357 {
1358         gui->draw_vframe(get_image("preferences_bg"), 0, 0);
1359 }
1360
1361 void NEOPHYTETHEME::draw_new_bg(NewWindow *gui)
1362 {
1363         gui->draw_vframe(get_image("new_bg"), 0, 0);
1364 }
1365
1366 void NEOPHYTETHEME::draw_setformat_bg(SetFormatWindow *gui)
1367 {
1368         gui->draw_vframe(get_image("setformat_bg"), 0, 0);
1369 }