a/v per track data height, boxblur power fix, add french expanders
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / theme.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 1997-2011 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #include "awindowgui.h"
23 #include "bcsignals.h"
24 #include "clip.h"
25 #include "bccolors.h"
26 #include "cwindowgui.h"
27 #include "edit.h"
28 #include "edl.h"
29 #include "edlsession.h"
30 #include "keyframegui.h"
31 #include "language.h"
32 #include "levelwindowgui.h"
33 #include "loadmode.h"
34 #include "localsession.h"
35 #include "mainmenu.h"
36 #include "mainsession.h"
37 #include "mbuttons.h"
38 #include "meterpanel.h"
39 #include "mwindowgui.h"
40 #include "mwindow.h"
41 #include "overlayframe.h"
42 #include "patchbay.h"
43 #include "playtransport.h"
44 //#include "presetsgui.h"
45 #include "recordgui.h"
46 #include "recordmonitor.h"
47 #include "resourcepixmap.h"
48 #include "statusbar.h"
49 #include "theme.h"
50 #include "track.h"
51 #include "timebar.h"
52 #include "trackcanvas.h"
53 #include "vframe.h"
54 #include "vwindowgui.h"
55 #include "zoombar.h"
56
57
58 #include <errno.h>
59 #include <string.h>
60
61 #define NEW_VFRAME \
62 new VFrame(default_data.get_w(), default_data.get_h(), BC_RGBA8888)
63
64 Theme::Theme()
65  : BC_Theme()
66 {
67         window_border = xS(10);
68         widget_border = xS(5);
69         this->mwindow = 0;
70         theme_title = _(DEFAULT_THEME);
71         last_image = 0;
72         mtransport_margin = 0;
73         toggle_margin = 0;
74         control_pixels = xS(50);
75         stack_button_w = xS(32);
76         timebar_cursor_color = RED;
77
78         BC_WindowBase::get_resources()->bg_color = BLOND;
79         BC_WindowBase::get_resources()->button_up = 0xffc000;
80         BC_WindowBase::get_resources()->button_highlighted = 0xffe000;
81         BC_WindowBase::get_resources()->recursive_resizing = 0;
82         audio_color = BLACK;
83         zero_crossing_color = 0xc03545;
84         graph_active_color = GRAPH_ACTIVE_COLOR;
85         graph_inactive_color = GRAPH_INACTIVE_COLOR;
86         graph_grid_color = GRAPH_GRID_COLOR;
87         graph_bg_color = GRAPH_BG_COLOR;
88         graph_border1_color = GRAPH_BORDER1_COLOR;
89         graph_border2_color = GRAPH_BORDER2_COLOR;
90         fade_h = yS(22);
91         inout_highlight_color = GREEN;
92         meter_h = yS(17);
93         mode_h = yS(30);
94         pan_h = yS(32);
95         pan_x = xS(50);
96         play_h = yS(22);
97         title_h = yS(23);
98         clock_bg_color = BLACK;
99         clock_fg_color = GREEN;
100         assetedit_color = YELLOW;
101         const char *cp = getenv("BC_USE_COMMERCIALS");
102         use_commercials = !cp ? 0 : atoi(cp);
103
104         preferences_category_overlap = 0;
105
106         loadmode_w = xS(350);
107         czoom_w = xS(110);
108
109 #include "data/about_bg_png.h"
110         about_bg = new VFramePng(about_bg_png);
111
112         pane_color = BLACK;
113         drag_pane_color = WHITE;
114
115         appendasset_data = 0;
116         append_data = 0;
117         asset_append_data = 0;
118         asset_disk_data = 0;
119         asset_index_data = 0;
120         asset_info_data = 0;
121         asset_project_data = 0;
122         browse_data = 0;
123         calibrate_data = 0;
124         camerakeyframe_data = 0;
125         cancel_data = 0;
126         chain_data = 0;
127         channel_bg_data = 0;
128         channel_position_data = 0;
129         delete_all_indexes_data = 0;
130         deletebin_data = 0;
131         delete_data = 0;
132         deletedisk_data = 0;
133         deleteproject_data = 0;
134         detach_data = 0;
135         dntriangle_data = 0;
136
137         edit_data = 0;
138         edithandlein_data = 0;
139         edithandleout_data = 0;
140         extract_data = 0;
141         ffmpeg_toggle = 0;
142         proxy_s_toggle = 0;
143         proxy_p_toggle = 0;
144         mask_mode_toggle = 0;
145         infoasset_data = 0;
146         in_point = 0;
147         insert_data = 0;
148         keyframe_data = 0;
149         label_toggle = 0;
150         lift_data = 0;
151         maskkeyframe_data = 0;
152         modekeyframe_data = 0;
153         hardedge_data = 0;
154         movedn_data = 0;
155         moveup_data = 0;
156         newbin_data = 0;
157         no_data = 0;
158         options_data = 0;
159         out_point = 0;
160         over_button = 0;
161         overwrite_data = 0;
162         pankeyframe_data = 0;
163         pasteasset_data = 0;
164         paused_data = 0;
165         picture_data = 0;
166         presentation_data = 0;
167         presentation_loop = 0;
168         presentation_stop = 0;
169         projectorkeyframe_data = 0;
170         redrawindex_data = 0;
171         renamebin_data = 0;
172         reset_data = 0;
173         reverse_data = 0;
174         rewind_data = 0;
175         select_data = 0;
176         shbtn_data = 0;
177         splice_data = 0;
178         start_over_data = 0;
179         statusbar_cancel_data = 0;
180         timebar_view_data = 0;
181         transition_data = 0;
182         uptriangle_data = 0;
183         viewasset_data = 0;
184         vtimebar_bg_data = 0;
185 }
186
187
188 // Need to delete everything here
189 Theme::~Theme()
190 {
191         flush_images();
192
193         aspect_ratios.remove_all_objects();
194         frame_rates.remove_all_objects();
195         frame_sizes.remove_all_objects();
196         sample_rates.remove_all_objects();
197         zoom_values.remove_all_objects();
198
199         delete about_bg;
200 }
201
202 void Theme::flush_images()
203 {
204 }
205
206 void Theme::initialize()
207 {
208         message_normal = BLACK;
209         message_error = RED;
210
211 // Force to use local data for images
212         extern unsigned char _binary_theme_data_start[];
213         set_data(_binary_theme_data_start);
214
215 // Set images which weren't set by subclass
216         new_image("mode_normal", "mode_normal.png");
217         new_image("mode_add", "mode_add.png");
218         new_image("mode_subtract", "mode_subtract.png");
219         new_image("mode_multiply", "mode_multiply.png");
220         new_image("mode_divide", "mode_divide.png");
221         new_image("mode_replace", "mode_replace.png");
222         new_image("mode_max", "mode_max.png");
223         new_image("mode_min", "mode_min.png");
224         new_image("mode_darken", "mode_darken.png");
225         new_image("mode_lighten", "mode_lighten.png");
226         new_image("mode_dst", "mode_dst.png");
227         new_image("mode_dstatop", "mode_dstatop.png");
228         new_image("mode_dstin", "mode_dstin.png");
229         new_image("mode_dstout", "mode_dstout.png");
230         new_image("mode_dstover", "mode_dstover.png");
231         new_image("mode_src", "mode_src.png");
232         new_image("mode_srcatop", "mode_srcatop.png");
233         new_image("mode_srcin", "mode_srcin.png");
234         new_image("mode_srcout", "mode_srcout.png");
235         new_image("mode_srcover", "mode_srcover.png");
236         new_image("mode_and", "mode_and.png");
237         new_image("mode_or", "mode_or.png");
238         new_image("mode_xor", "mode_xor.png");
239         new_image("mode_overlay", "mode_overlay.png");
240         new_image("mode_screen", "mode_screen.png");
241         new_image("mode_burn", "mode_burn.png");
242         new_image("mode_dodge", "mode_dodge.png");
243         new_image("mode_hardlight", "mode_hardlight.png");
244         new_image("mode_softlight", "mode_softlight.png");
245         new_image("mode_difference", "mode_difference.png");
246
247         new_image_set("mode_popup", 3, "mode_up.png", "mode_hi.png", "mode_dn.png");
248
249 // Images all themes have
250         new_image("mwindow_icon", "heroine_icon.png");
251         new_image("vwindow_icon", "heroine_icon.png");
252         new_image("cwindow_icon", "heroine_icon.png");
253         new_image("awindow_icon", "heroine_icon.png");
254         new_image("record_icon", "heroine_icon.png");
255         new_image("clip_icon", "clip_icon.png");
256         new_image_set("mixpatch_data", 5, "mixpatch_up.png", "mixpatch_hi.png",
257                 "mixpatch_checked.png", "mixpatch_dn.png", "mixpatch_checkedhi.png");
258
259
260         new_image("aeffect_icon", "aeffect_icon.png");
261         new_image("veffect_icon", "veffect_icon.png");
262         new_image("atransition_icon", "atransition_icon.png");
263         new_image("vtransition_icon", "atransition_icon.png");
264 }
265
266
267
268
269
270
271 void Theme::build_menus()
272 {
273         aspect_ratios.append(new BC_ListBoxItem("3:2"));
274         aspect_ratios.append(new BC_ListBoxItem("4:3"));
275         aspect_ratios.append(new BC_ListBoxItem("16:9"));
276         aspect_ratios.append(new BC_ListBoxItem("2.10:1"));
277         aspect_ratios.append(new BC_ListBoxItem("2.20:1"));
278         aspect_ratios.append(new BC_ListBoxItem("2.25:1"));
279         aspect_ratios.append(new BC_ListBoxItem("2.30:1"));
280         aspect_ratios.append(new BC_ListBoxItem("2.35:1"));
281         aspect_ratios.append(new BC_ListBoxItem("2.66:1"));
282
283         frame_sizes.append(new BC_ListBoxItem("128x96     "));
284         frame_sizes.append(new BC_ListBoxItem("160x120    "));
285         frame_sizes.append(new BC_ListBoxItem("320x240    "));
286         frame_sizes.append(new BC_ListBoxItem("360x240    "));
287         frame_sizes.append(new BC_ListBoxItem("400x300    "));
288         frame_sizes.append(new BC_ListBoxItem("640x360    nHD"));
289         frame_sizes.append(new BC_ListBoxItem("640x400    "));
290         frame_sizes.append(new BC_ListBoxItem("640x480    VGA"));
291         frame_sizes.append(new BC_ListBoxItem("720x480    NTSC"));
292         frame_sizes.append(new BC_ListBoxItem("720x576    PAL"));
293         frame_sizes.append(new BC_ListBoxItem("768x432    "));
294         frame_sizes.append(new BC_ListBoxItem("800x450    "));
295         frame_sizes.append(new BC_ListBoxItem("800x600    SVGA"));
296         frame_sizes.append(new BC_ListBoxItem("896x504    "));
297         frame_sizes.append(new BC_ListBoxItem("960x540    qHD"));
298         frame_sizes.append(new BC_ListBoxItem("1024x576   "));
299         frame_sizes.append(new BC_ListBoxItem("1024x768   XGA"));
300         frame_sizes.append(new BC_ListBoxItem("1152x648   "));
301         frame_sizes.append(new BC_ListBoxItem("1280x720   HD"));
302         frame_sizes.append(new BC_ListBoxItem("1280x1024  SXGA"));
303         frame_sizes.append(new BC_ListBoxItem("1366x768   WXGA"));
304         frame_sizes.append(new BC_ListBoxItem("1600x900   HD+"));
305         frame_sizes.append(new BC_ListBoxItem("1600x1200  UXGA"));
306         frame_sizes.append(new BC_ListBoxItem("1920x1080  Full HD"));
307         frame_sizes.append(new BC_ListBoxItem("2048x1152  "));
308         frame_sizes.append(new BC_ListBoxItem("2304x1296  "));
309         frame_sizes.append(new BC_ListBoxItem("2560x1440  QHD"));
310         frame_sizes.append(new BC_ListBoxItem("2880x1620  "));
311         frame_sizes.append(new BC_ListBoxItem("3200x1800  QHD+"));
312         frame_sizes.append(new BC_ListBoxItem("3520x1980  "));
313         frame_sizes.append(new BC_ListBoxItem("3840x2160  4K UHD"));
314         frame_sizes.append(new BC_ListBoxItem("4096x2304  Full 4K UHD"));
315         frame_sizes.append(new BC_ListBoxItem("4480x2520  "));
316         frame_sizes.append(new BC_ListBoxItem("5120x2880  5K UHD"));
317         frame_sizes.append(new BC_ListBoxItem("5760x3240  "));
318         frame_sizes.append(new BC_ListBoxItem("6400x3600  "));
319         frame_sizes.append(new BC_ListBoxItem("7040x3960  "));
320         frame_sizes.append(new BC_ListBoxItem("7680x4320  8K UHD"));
321
322         sample_rates.append(new BC_ListBoxItem("8000"));
323         sample_rates.append(new BC_ListBoxItem("16000"));
324         sample_rates.append(new BC_ListBoxItem("22050"));
325         sample_rates.append(new BC_ListBoxItem("32000"));
326         sample_rates.append(new BC_ListBoxItem("44100"));
327         sample_rates.append(new BC_ListBoxItem("48000"));
328         sample_rates.append(new BC_ListBoxItem("96000"));
329         sample_rates.append(new BC_ListBoxItem("192000"));
330
331         frame_rates.append(new BC_ListBoxItem("0.25"));
332         frame_rates.append(new BC_ListBoxItem("1"));
333         frame_rates.append(new BC_ListBoxItem("5"));
334         frame_rates.append(new BC_ListBoxItem("10"));
335         frame_rates.append(new BC_ListBoxItem("12"));
336         frame_rates.append(new BC_ListBoxItem("15"));
337         frame_rates.append(new BC_ListBoxItem("23.976"));
338         frame_rates.append(new BC_ListBoxItem("24"));
339         frame_rates.append(new BC_ListBoxItem("25"));
340         frame_rates.append(new BC_ListBoxItem("29.97"));
341         frame_rates.append(new BC_ListBoxItem("30"));
342         frame_rates.append(new BC_ListBoxItem("50"));
343         frame_rates.append(new BC_ListBoxItem("59.94"));
344         frame_rates.append(new BC_ListBoxItem("60"));
345         frame_rates.append(new BC_ListBoxItem("100"));
346         frame_rates.append(new BC_ListBoxItem("120"));
347         frame_rates.append(new BC_ListBoxItem("1000"));
348
349         char string[BCTEXTLEN];
350         for(int i = 1; i < 17; i++)
351         {
352                 sprintf(string, "%d", (int)pow(2, i));
353                 zoom_values.append(new BC_ListBoxItem(string));
354         }
355 }
356
357
358 void Theme::overlay(VFrame *dst, VFrame *src, int in_x1, int in_x2)
359 {
360         int w;
361         int h;
362         unsigned char **in_rows;
363         unsigned char **out_rows;
364
365         if(in_x1 < 0)
366         {
367                 w = MIN(src->get_w(), dst->get_w());
368                 h = MIN(dst->get_h(), src->get_h());
369                 in_x1 = 0;
370                 in_x2 = w;
371         }
372         else
373         {
374                 w = in_x2 - in_x1;
375                 h = MIN(dst->get_h(), src->get_h());
376         }
377         in_rows = src->get_rows();
378         out_rows = dst->get_rows();
379
380         switch(src->get_color_model())
381         {
382                 case BC_RGBA8888:
383                         switch(dst->get_color_model())
384                         {
385                                 case BC_RGBA8888:
386                                         for(int i = 0; i < h; i++)
387                                         {
388                                                 unsigned char *in_row = in_rows[i] + in_x1 * 4;
389                                                 unsigned char *out_row = out_rows[i];
390                                                 for(int j = 0; j < w; j++)
391                                                 {
392                                                         int opacity = in_row[3];
393                                                         int transparency = out_row[3] * (0xff - opacity) / 0xff;
394                                                         out_row[0] = (in_row[0] * opacity + out_row[0] * transparency) / 0xff;
395                                                         out_row[1] = (in_row[1] * opacity + out_row[1] * transparency) / 0xff;
396                                                         out_row[2] = (in_row[2] * opacity + out_row[2] * transparency) / 0xff;
397                                                         out_row[3] = MAX(in_row[3], out_row[3]);
398                                                         out_row += 4;
399                                                         in_row += 4;
400                                                 }
401                                         }
402                                         break;
403                                 case BC_RGB888:
404                                         for(int i = 0; i < h; i++)
405                                         {
406                                                 unsigned char *in_row = in_rows[i] + in_x1 * 4;
407                                                 unsigned char *out_row = out_rows[i];
408                                                 for(int j = 0; j < w; j++)
409                                                 {
410                                                         int opacity = in_row[3];
411                                                         int transparency = 0xff - opacity;
412                                                         out_row[0] = (in_row[0] * opacity + out_row[0] * transparency) / 0xff;
413                                                         out_row[1] = (in_row[1] * opacity + out_row[1] * transparency) / 0xff;
414                                                         out_row[2] = (in_row[2] * opacity + out_row[2] * transparency) / 0xff;
415                                                         out_row += 3;
416                                                         in_row += 4;
417                                                 }
418                                         }
419                                         break;
420                         }
421                         break;
422         }
423 }
424
425 void Theme::build_transport(char *title,
426         unsigned char *png_overlay,
427         VFrame **bg_data,
428         int third)
429 {
430         if(!png_overlay) return;
431         VFramePng default_data(png_overlay);
432         VFrame *data[3];
433         data[0] = NEW_VFRAME;
434         data[1] = NEW_VFRAME;
435         data[2] = NEW_VFRAME;
436         data[0]->clear_frame();
437         data[1]->clear_frame();
438         data[2]->clear_frame();
439
440         for(int i = 0; i < 3; i++)
441         {
442                 int in_x1 = 0;
443                 int in_x2 = 0;
444                 if(!bg_data[i]) break;
445
446                 switch(third)
447                 {
448                         case 0:
449                                 in_x1 = 0;
450                                 in_x2 = default_data.get_w();
451                                 break;
452
453                         case 1:
454                                 in_x1 = (int)(bg_data[i]->get_w() * 0.33);
455                                 in_x2 = in_x1 + default_data.get_w();
456                                 break;
457
458                         case 2:
459                                 in_x1 = bg_data[i]->get_w() - default_data.get_w();
460                                 in_x2 = in_x1 + default_data.get_w();
461                                 break;
462                 }
463
464                 overlay(data[i], bg_data[i], in_x1, in_x2);
465                 overlay(data[i], &default_data);
466         }
467
468         new_image_set_images(title, 3, data[0], data[1], data[2]);
469 }
470
471
472
473
474
475
476
477
478
479 void Theme::build_patches(VFrame** &data,
480         unsigned char *png_overlay,
481         VFrame **bg_data,
482         int region)
483 {
484         if(!png_overlay || !bg_data) return;
485         VFramePng default_data(png_overlay);
486         data = new VFrame*[5];
487         data[0] = NEW_VFRAME;
488         data[1] = NEW_VFRAME;
489         data[2] = NEW_VFRAME;
490         data[3] = NEW_VFRAME;
491         data[4] = NEW_VFRAME;
492
493         for(int i = 0; i < 5; i++)
494         {
495 #if 0
496                 int in_x1;
497                 int in_x2;
498
499                 switch(region)
500                 {
501                         case 0:
502                                 in_x1 = 0;
503                                 in_x2 = default_data.get_w();
504                                 break;
505
506                         case 1:
507                                 in_x1 = (int)(bg_data[i]->get_w() * 0.33);
508                                 in_x2 = in_x1 + default_data.get_w();
509                                 break;
510
511                         case 2:
512                                 in_x1 = bg_data[i]->get_w() - default_data.get_w();
513                                 in_x2 = in_x1 + default_data.get_w();
514                                 break;
515                 }
516 #endif
517                 overlay(data[i],
518                         bg_data[i]);
519                 overlay(data[i],
520                         &default_data);
521         }
522 }
523
524
525
526
527
528
529
530
531 void Theme::build_button(VFrame** &data,
532         unsigned char *png_overlay,
533         VFrame *up_vframe,
534         VFrame *hi_vframe,
535         VFrame *dn_vframe)
536 {
537         if(!png_overlay) return;
538         VFramePng default_data(png_overlay);
539
540         if(!up_vframe || !hi_vframe || !dn_vframe) return;
541         data = new VFrame*[3];
542         data[0] = NEW_VFRAME;
543         data[1] = NEW_VFRAME;
544         data[2] = NEW_VFRAME;
545         data[0]->copy_from(up_vframe);
546         data[1]->copy_from(hi_vframe);
547         data[2]->copy_from(dn_vframe);
548         for(int i = 0; i < 3; i++)
549                 overlay(data[i],
550                         &default_data);
551 }
552
553 void Theme::build_button(VFrame** &data,
554         unsigned char *png_overlay,
555         VFrame *up_vframe,
556         VFrame *hi_vframe,
557         VFrame *dn_vframe,
558         VFrame *at_vframe)
559 {
560         if(!png_overlay) return;
561         VFramePng default_data(png_overlay);
562
563         if(!up_vframe || !hi_vframe || !dn_vframe) return;
564         data = new VFrame*[4];
565         data[0] = NEW_VFRAME;
566         data[1] = NEW_VFRAME;
567         data[2] = NEW_VFRAME;
568         data[3] = NEW_VFRAME;
569         data[0]->copy_from(up_vframe);
570         data[1]->copy_from(hi_vframe);
571         data[2]->copy_from(dn_vframe);
572         data[2]->copy_from(at_vframe);
573         for(int i = 0; i < 4; i++)
574                 overlay(data[i],
575                         &default_data);
576 }
577
578 void Theme::build_toggle(VFrame** &data,
579         unsigned char *png_overlay,
580         VFrame *up_vframe,
581         VFrame *hi_vframe,
582         VFrame *checked_vframe,
583         VFrame *dn_vframe,
584         VFrame *checkedhi_vframe)
585 {
586         if(!png_overlay ||
587                 !up_vframe ||
588                 !hi_vframe ||
589                 !checked_vframe ||
590                 !dn_vframe ||
591                 !checkedhi_vframe) return;
592         VFramePng default_data(png_overlay);
593         data = new VFrame*[5];
594         data[0] = NEW_VFRAME;
595         data[1] = NEW_VFRAME;
596         data[2] = NEW_VFRAME;
597         data[3] = NEW_VFRAME;
598         data[4] = NEW_VFRAME;
599         data[0]->copy_from(up_vframe);
600         data[1]->copy_from(hi_vframe);
601         data[2]->copy_from(checked_vframe);
602         data[3]->copy_from(dn_vframe);
603         data[4]->copy_from(checkedhi_vframe);
604         for(int i = 0; i < 5; i++)
605                 overlay(data[i],
606                         &default_data);
607 }
608
609
610 void Theme::get_mwindow_sizes(MWindowGUI *gui, int w, int h)
611 {
612         mbuttons_x = 0;
613         mbuttons_y = gui->menu_h() + yS(1);
614         mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+xS(2) +
615                          proxy_p_toggle[0]->get_w()+xS(2) +
616                          stack_button_w);
617         mbuttons_h = get_image("mbutton_bg")->get_h();
618         mclock_x = window_border - xS(5);
619         mclock_y = mbuttons_y-1 + mbuttons_h;
620         mclock_w = get_image("clock_bg")->get_w() - xS(20);
621         mclock_h = get_image("clock_bg")->get_h();
622         mtimebar_x = get_image("patchbay_bg")->get_w();
623         mtimebar_y = mbuttons_y - 1 + mbuttons_h;
624         mtimebar_w = w - mtimebar_x;
625         mtimebar_h = get_image("timebar_bg")->get_h();
626         mzoom_h = yS(25);
627         mzoom_x = 0;
628         mzoom_y = h - get_image("statusbar")->get_h();
629         mzoom_w = w;
630         mstatus_x = 0;
631         mstatus_y = mzoom_y + mzoom_h;
632         mstatus_w = w;
633         mstatus_h = h - mstatus_y;
634         mstatus_message_x = xS(10);
635         mstatus_message_y = yS(5);
636         mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - xS(240);
637         mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h() - yS(3);
638         mstatus_progress_w = xS(230);
639         mstatus_cancel_x = mstatus_w - statusbar_cancel_data[0]->get_w();
640         mstatus_cancel_y = mstatus_h - statusbar_cancel_data[0]->get_h();
641         mcanvas_x = 0;
642         mcanvas_y = mbuttons_y-1 + mbuttons_h;
643         mcanvas_w = w;
644         mcanvas_h = mzoom_y - mtimebar_y;
645         control_pixels = (mcanvas_w * control_pixels) / 1000;
646         patchbay_x = 0;
647         patchbay_y = mcanvas_y + mclock_h;
648         patchbay_w = get_image("patchbay_bg")->get_w();
649         patchbay_h = mcanvas_h - mclock_h;
650         pane_w = get_image_set("xpane")[0]->get_w();
651         pane_h = get_image_set("ypane")[0]->get_h();
652         pane_x = mcanvas_x + mcanvas_w;
653         pane_y = mcanvas_y + mcanvas_h;
654         mhscroll_x = 0;
655         mhscroll_y = mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ);
656         mhscroll_w = w - BC_ScrollBar::get_span(SCROLL_VERT);
657         mvscroll_x = mcanvas_x + mcanvas_w;
658         mvscroll_y = mcanvas_y;
659         mvscroll_h = mcanvas_h;
660 }
661
662 void Theme::get_pane_sizes(MWindowGUI *gui,
663         int *view_x, int *view_y, int *view_w, int *view_h,
664         int number, int x, int y, int w, int h)
665 {
666         *view_x = x;
667         *view_y = y;
668         *view_w = w;
669         *view_h = h;
670
671 // patchbay
672         if(number == TOP_LEFT_PANE ||
673                 number == BOTTOM_LEFT_PANE)
674         {
675                 *view_x += patchbay_w;
676                 *view_w -= patchbay_w;
677         }
678
679 // timebar
680         if(number == TOP_LEFT_PANE ||
681                 number == TOP_RIGHT_PANE)
682         {
683                 *view_y += mtimebar_h;
684                 *view_h -= mtimebar_h;
685         }
686
687 // samplescroll
688         if(number == BOTTOM_LEFT_PANE ||
689                 number == BOTTOM_RIGHT_PANE ||
690                 gui->horizontal_panes() ||
691                 gui->total_panes() == 1)
692         {
693                 *view_h -= BC_ScrollBar::get_span(SCROLL_HORIZ);
694         }
695
696 // trackscroll
697         if(number == TOP_RIGHT_PANE ||
698                 number == BOTTOM_RIGHT_PANE ||
699                 gui->vertical_panes() ||
700                 gui->total_panes() == 1)
701         {
702                 *view_w -= BC_ScrollBar::get_span(SCROLL_VERT);
703         }
704 }
705
706 void Theme::draw_mwindow_bg(MWindowGUI *gui)
707 {
708 }
709
710
711 void Theme::get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls)
712 {
713         int total_buttons = !use_commercials ? 16 : 17;
714         int edit_w = EditPanel::calculate_w(mwindow, 1, total_buttons);
715         int transport_w = PlayTransport::get_transport_width(mwindow) + toggle_margin;
716         int zoom_w = ZoomPanel::calculate_w(czoom_w);
717         int status_w = get_image("cwindow_active")->get_w();
718 // Space between buttons & status icon
719         int division_w = xS(24);
720
721         ctimebar_h = yS(16);
722
723         if(cwindow_controls)
724         {
725 SET_TRACE
726                 if(mwindow->edl->session->cwindow_meter)
727                 {
728                         cmeter_x = mwindow->session->cwindow_w -
729                                 MeterPanel::get_meters_width(this,
730                                         mwindow->edl->session->audio_channels,
731                                         mwindow->edl->session->cwindow_meter);
732                 }
733                 else
734                 {
735                         cmeter_x = mwindow->session->cwindow_w;
736                 }
737
738
739                 int buttons_h = get_image("rewind")->get_h() + widget_border;
740                 int panel_y = mwindow->session->cwindow_h - buttons_h + yS(4);
741                 ctransport_x = widget_border;
742                 if( ctransport_x + transport_w + widget_border +
743                     edit_w + widget_border + zoom_w + widget_border +
744                     division_w + status_w > cmeter_x ) {
745                         ctransport_y = panel_y;
746                         czoom_x = ctransport_x + transport_w + widget_border;
747                         czoom_y = panel_y;
748                         cstatus_x = xS(440);
749                         cstatus_y = panel_y - yS(2);
750                         int edit_h = EditPanel::calculate_h(mwindow) + widget_border;
751                         buttons_h += edit_h;  panel_y -= edit_h;
752                         cedit_x = widget_border;
753                         cedit_y = panel_y;
754                 }
755                 else {
756                         ctransport_x = widget_border;
757                         ctransport_y = panel_y;
758                         cedit_x = ctransport_x + transport_w + widget_border;
759                         cedit_y = panel_y;
760                         czoom_x = cedit_x + edit_w + widget_border;
761                         czoom_y = panel_y;
762                         cstatus_x = czoom_x + zoom_w + division_w;
763                         cstatus_y = panel_y;
764                 }
765                 buttons_h += ctimebar_h;
766
767                 ccomposite_x = xS(0);
768                 ccomposite_y = yS(5);
769                 ccomposite_w = get_image("cpanel_bg")->get_w();
770                 ccomposite_h = mwindow->session->cwindow_h - buttons_h;
771
772                 ccanvas_x = ccomposite_x + ccomposite_w;
773                 ccanvas_y = 0;
774                 ccanvas_h = ccomposite_h;
775
776                 ccanvas_w = cmeter_x - ccanvas_x - widget_border;
777 SET_TRACE
778         }
779         else
780 // no controls
781         {
782 SET_TRACE
783                 ccomposite_x = -get_image("cpanel_bg")->get_w();
784                 ccomposite_y = 0;
785                 ccomposite_w = get_image("cpanel_bg")->get_w();
786                 ccomposite_h = mwindow->session->cwindow_h - get_image("cbuttons_left")->get_h();
787
788                 cedit_x = xS(10);
789                 cedit_y = mwindow->session->cwindow_h + yS(17);
790                 ctransport_x = xS(10);
791                 ctransport_y = cedit_y + yS(40);
792                 ccanvas_x = 0;
793                 ccanvas_y = 0;
794                 ccanvas_w = mwindow->session->cwindow_w;
795                 ccanvas_h = mwindow->session->cwindow_h;
796                 cmeter_x = mwindow->session->cwindow_w;
797                 cstatus_x = mwindow->session->cwindow_w;
798                 cstatus_y = mwindow->session->cwindow_h;
799                 czoom_x = mwindow->session->cwindow_w;
800                 czoom_y = mwindow->session->cwindow_h;
801 SET_TRACE
802         }
803
804 SET_TRACE
805
806
807         cmeter_y = widget_border;
808         cmeter_h = mwindow->session->cwindow_h - cmeter_y - widget_border;
809
810 //      ctimebar_x = ccanvas_x;
811 //      ctimebar_y = ccanvas_y + ccanvas_h;
812 //      ctimebar_w = ccanvas_w;
813         ctimebar_x = 0;
814         ctimebar_y = ccanvas_y + ccanvas_h;
815         ctimebar_w = mwindow->session->cwindow_w;
816         if(mwindow->edl->session->cwindow_meter)
817         {
818                 ctimebar_w = cmeter_x - widget_border;
819         }
820
821 SET_TRACE
822 }
823
824
825
826
827
828 void Theme::draw_awindow_bg(AWindowGUI *gui)
829 {
830         gui->clear_box(0, 0, mwindow->session->awindow_w, mwindow->session->awindow_h);
831         gui->flash();
832 }
833
834 void Theme::draw_vwindow_bg(VWindowGUI *gui)
835 {
836 //      gui->clear_box(0,
837 //              0,
838 //              mwindow->session->vwindow_w,
839 //              mwindow->session->vwindow_h);
840 // // Timebar
841 //      gui->draw_3segmenth(vtimebar_x,
842 //              vtimebar_y,
843 //              vtimebar_w,
844 //              vtimebar_bg_data,
845 //              0);
846 //      gui->flash();
847 }
848
849
850 void Theme::draw_cwindow_bg(CWindowGUI *gui)
851 {
852         gui->clear_box(0, 0, mwindow->session->cwindow_w, mwindow->session->cwindow_h);
853         gui->flash();
854 }
855
856 void Theme::draw_lwindow_bg(LevelWindowGUI *gui)
857 {
858         gui->clear_box(0, 0, mwindow->session->lwindow_w, mwindow->session->lwindow_h);
859         gui->flash();
860 }
861
862
863 void Theme::draw_rmonitor_bg(RecordMonitorGUI *gui)
864 {
865         gui->clear_box(0, 0, mwindow->session->rmonitor_w, mwindow->session->rmonitor_h);
866         gui->flash();
867 }
868
869
870 void Theme::draw_rwindow_bg(RecordGUI *gui)
871 {
872         gui->clear_box(0, 0, mwindow->session->rwindow_w, mwindow->session->rwindow_h);
873 }
874
875
876 void Theme::draw_resource_bg(TrackCanvas *canvas, ResourcePixmap *pixmap,
877                 int color, Edit *edit, int edit_x, int edit_w,
878                 int pixmap_x, int x1, int y1, int x2, int y2)
879 {
880         VFrame *image = 0;
881         int data_h = edit->track->data_h;
882         switch( data_h ) {
883                 case 1024: image = get_image("resource1024");  break;
884                 case 512: image = get_image("resource512");  break;
885                 case 256: image = get_image("resource256");  break;
886                 case 128: image = get_image("resource128");  break;
887                 case 64:  image = get_image("resource64");   break;
888         }
889         if( !image )
890                 image = get_image("resource32");
891
892         VFrame *frame = image;
893         int bg_color = canvas->get_bg_color();
894         if( color ) {
895                 int alpha = (~color >> 24) & 0xff;
896                 frame = pixmap->change_picon_alpha(image, alpha);
897                 canvas->set_bg_color(color & 0xffffff);
898         }
899         canvas->draw_3segmenth(x1, y1, x2 - x1,
900                 edit_x - pixmap_x, edit_w, frame, pixmap);
901         if( frame != image ) {
902                 delete frame;
903                 canvas->set_bg_color(bg_color);
904         }
905 }
906
907
908 void Theme::get_vwindow_sizes(VWindowGUI *gui)
909 {
910         int edit_w = EditPanel::calculate_w(mwindow, 0, 12);
911         int transport_w = PlayTransport::get_transport_width(mwindow) + toggle_margin;
912 // Space between buttons & time
913         int division_w = xS(30);
914         vtime_w = xS(120);
915         vtimebar_h = yS(16);
916         int vtime_border = xS(15);
917
918         vmeter_y = widget_border;
919         vmeter_h = mwindow->session->vwindow_h - cmeter_y - widget_border;
920
921         if(mwindow->edl->session->vwindow_meter)
922         {
923                 vmeter_x = mwindow->session->vwindow_w -
924                         MeterPanel::get_meters_width(this,
925                                 mwindow->edl->session->audio_channels,
926                                 mwindow->edl->session->vwindow_meter);
927         }
928         else
929         {
930                 vmeter_x = mwindow->session->vwindow_w;
931         }
932
933         vcanvas_x = 0;
934         vcanvas_y = 0;
935         vcanvas_w = vmeter_x - vcanvas_x - widget_border;
936
937         int buttons_h = get_image("rewind")->get_h() + widget_border;
938         int panel_y = mwindow->session->vwindow_h - buttons_h + yS(4);
939         vtransport_x = widget_border;
940         if( vtransport_x + transport_w + widget_border +
941             edit_w + widget_border + vtime_w + xS(40) + widget_border > vmeter_x ) {
942                 vtransport_y = panel_y;
943                 vzoom_x = vtransport_x + transport_w + widget_border;
944                 vzoom_y = panel_y;
945                 vdivision_x = xS(320);
946                 vtime_x = vdivision_x;
947                 vtime_y = panel_y;
948                 int edit_h = EditPanel::calculate_h(mwindow) + widget_border;
949                 buttons_h += edit_h;  panel_y -= edit_h;
950                 vedit_x = widget_border;
951                 vedit_y = panel_y;
952         }
953         else {
954                 vtransport_x = widget_border;
955                 vtransport_y = panel_y;
956                 vedit_x = vtransport_x + transport_w + widget_border;
957                 vedit_y = panel_y;
958                 vdivision_x = vedit_x + edit_w + division_w;
959                 vtime_x = vdivision_x + vtime_border;
960                 vtime_y = panel_y;
961         }
962         buttons_h += vtimebar_h;
963
964 //      vtimebar_x = vcanvas_x;
965 //      vtimebar_y = vcanvas_y + vcanvas_h;
966 //      vtimebar_w = vcanvas_w;
967
968         vcanvas_h = mwindow->session->vwindow_h - buttons_h;
969         vtimebar_x = 0;
970         vtimebar_y = vcanvas_y + vcanvas_h;
971         vtimebar_w = vmeter_x - widget_border;
972 }
973
974
975 void Theme::get_awindow_sizes(AWindowGUI *gui)
976 {
977         abuttons_x = 0;
978         abuttons_y = 0;
979         afolders_x = 0;
980 //      afolders_y = deletedisk_data[0]->get_h();
981         afolders_y = 0;
982         afolders_w = mwindow->session->afolders_w;
983         afolders_h = mwindow->session->awindow_h - afolders_y;
984         adivider_x = afolders_x + afolders_w;
985         adivider_y = xS(0);
986         adivider_w = yS(5);
987         adivider_h = afolders_h;
988         alist_x = afolders_x + afolders_w + xS(5);
989         alist_y = afolders_y;
990         alist_w = mwindow->session->awindow_w - alist_x;
991         alist_h = afolders_h;
992 }
993
994 void Theme::get_rmonitor_sizes(int do_audio,
995         int do_video,
996         int do_channel,
997         int do_interlace,
998         int do_avc,
999         int audio_channels)
1000 {
1001         int x = xS(10);
1002         int y = yS(3);
1003
1004
1005         if(do_avc)
1006         {
1007                 rmonitor_canvas_y = yS(30);
1008                 rmonitor_tx_x = xS(10);
1009                 rmonitor_tx_y = 0;
1010         }
1011         else
1012         {
1013                 rmonitor_canvas_y = 0;
1014                 rmonitor_tx_x = 0;
1015                 rmonitor_tx_y = 0;
1016         }
1017
1018
1019         if(do_channel)
1020         {
1021                 y = yS(5);
1022                 rmonitor_channel_x = x;
1023                 rmonitor_channel_y = yS(5);
1024                 x += xS(280);
1025                 rmonitor_canvas_y = yS(35);
1026         }
1027
1028         if(do_interlace)
1029         {
1030                 y = yS(4);
1031                 rmonitor_interlace_x = x;
1032                 rmonitor_interlace_y = y;
1033         }
1034
1035
1036         if(do_audio)
1037         {
1038                 if(do_video)
1039                 {
1040                         rmonitor_meter_x = mwindow->session->rmonitor_w -
1041                                 MeterPanel::get_meters_width(this, audio_channels, 1);
1042                         rmonitor_meter_w = mwindow->session->rmonitor_w;
1043                 }
1044                 else
1045                 {
1046                         rmonitor_meter_x = widget_border;
1047                         rmonitor_meter_w = mwindow->session->rmonitor_w - widget_border * 2;
1048                 }
1049
1050                 rmonitor_meter_y = yS(40);
1051                 rmonitor_meter_h = mwindow->session->rmonitor_h - yS(10) - rmonitor_meter_y;
1052         }
1053         else
1054         {
1055                 rmonitor_meter_x = mwindow->session->rmonitor_w;
1056         }
1057
1058         rmonitor_canvas_x = 0;
1059         rmonitor_canvas_w = rmonitor_meter_x - rmonitor_canvas_x;
1060         if(do_audio) rmonitor_canvas_w -= xS(10);
1061         rmonitor_canvas_h = mwindow->session->rmonitor_h - rmonitor_canvas_y;
1062
1063         if(!do_video && do_audio)
1064         {
1065                 rmonitor_meter_y -= yS(30);
1066                 rmonitor_meter_h += yS(30);
1067         }
1068
1069 }
1070
1071 void Theme::get_recordgui_sizes(RecordGUI *gui, int w, int h)
1072 {
1073 }
1074
1075 void Theme::get_batchrender_sizes(BatchRenderGUI *gui,
1076         int w,
1077         int h)
1078 {
1079         batchrender_x1 = xS(10);
1080         batchrender_x2 = xS(300);
1081         batchrender_x3 = xS(400);
1082 }
1083
1084 void Theme::get_plugindialog_sizes()
1085 {
1086         int xs10 = xS(10), ys10 = yS(10);
1087         int xs20 = xS(20), ys100 = yS(100);
1088         int x = xs10, y = yS(30);
1089         plugindialog_new_x = x;
1090         plugindialog_new_y = y;
1091         plugindialog_shared_x = mwindow->session->plugindialog_w / 3;
1092         plugindialog_shared_y = y;
1093         plugindialog_module_x = mwindow->session->plugindialog_w * 2 / 3;
1094         plugindialog_module_y = y;
1095
1096         plugindialog_new_w = plugindialog_shared_x - plugindialog_new_x - xs10;
1097         plugindialog_new_h = mwindow->session->plugindialog_h - ys100;
1098         plugindialog_shared_w = plugindialog_module_x - plugindialog_shared_x - xs10;
1099         plugindialog_shared_h = mwindow->session->plugindialog_h - ys100;
1100         plugindialog_module_w = mwindow->session->plugindialog_w - plugindialog_module_x - xs10;
1101         plugindialog_module_h = mwindow->session->plugindialog_h - ys100;
1102
1103         plugindialog_newattach_x = plugindialog_new_x + xs20;
1104         plugindialog_newattach_y = plugindialog_new_y + plugindialog_new_h + ys10;
1105         plugindialog_sharedattach_x = plugindialog_shared_x + xs20;
1106         plugindialog_sharedattach_y = plugindialog_shared_y + plugindialog_shared_h + ys10;
1107         plugindialog_moduleattach_x = plugindialog_module_x + xs20;
1108         plugindialog_moduleattach_y = plugindialog_module_y + plugindialog_module_h + ys10;
1109 }
1110
1111 // void Theme::get_presetdialog_sizes(PresetsWindow *gui)
1112 // {
1113 //      int x = window_border;
1114 //      int y = window_border + BC_Title::calculate_h(gui, "P") + widget_border;
1115 //
1116 //      presets_list_x = x;
1117 //      presets_list_y = y;
1118 //      presets_list_w = mwindow->session->presetdialog_w / 2;
1119 //      presets_list_h = mwindow->session->presetdialog_h -
1120 //              BC_OKButton::calculate_h() -
1121 //              presets_list_y -
1122 //              widget_border -
1123 //              window_border;
1124 //      presets_text_x = presets_list_x + presets_list_w + widget_border;
1125 //      presets_text_y = y;
1126 //      presets_text_w = mwindow->session->presetdialog_w - presets_text_x - window_border;
1127 //      y += BC_TextBox::calculate_h(gui,
1128 //              MEDIUMFONT,
1129 //              1,
1130 //              1) + widget_border;
1131 //
1132 //      presets_delete_x = presets_text_x;
1133 //      presets_delete_y = y;
1134 //      y += BC_GenericButton::calculate_h() + widget_border;
1135 //
1136 //      presets_save_x = presets_text_x;
1137 //      presets_save_y = y;
1138 //      y += BC_GenericButton::calculate_h() + widget_border;
1139 //
1140 //      presets_apply_x = presets_text_x;
1141 //      presets_apply_y = y;
1142 //      y += BC_GenericButton::calculate_h();
1143 // }
1144
1145 void Theme::get_keyframedialog_sizes(KeyFrameWindow *gui)
1146 {
1147         int x = window_border;
1148         int y = window_border + 
1149                 BC_Title::calculate_h(gui, "P", LARGEFONT) + 
1150                 widget_border;
1151
1152         presets_list_x = x;
1153         presets_list_y = y;
1154 #ifdef EDIT_KEYFRAME
1155         presets_list_w = mwindow->session->keyframedialog_w / 2 - 
1156                 widget_border - 
1157                 window_border;
1158 #else
1159         presets_list_w = mwindow->session->keyframedialog_w - 
1160                 presets_list_x -
1161                 window_border;
1162 #endif
1163         presets_list_h = mwindow->session->keyframedialog_h - 
1164                 BC_OKButton::calculate_h() - 
1165                 presets_list_y -
1166                 widget_border -
1167                 widget_border -
1168                 BC_Title::calculate_h(gui, "P") - 
1169                 widget_border -
1170                 BC_TextBox::calculate_h(gui, 
1171                         MEDIUMFONT, 
1172                         1, 
1173                         1) -
1174                 widget_border -
1175                 (BC_GenericButton::calculate_h() + widget_border) * 3 - 
1176                 window_border;
1177         y += presets_list_h + widget_border + widget_border + BC_Title::calculate_h(gui, "P");
1178         presets_text_x = x;
1179         presets_text_y = y;
1180         presets_text_w = presets_list_w;
1181         y += BC_TextBox::calculate_h(gui, 
1182                 MEDIUMFONT, 
1183                 1, 
1184                 1) + widget_border;
1185
1186         presets_delete_x = presets_text_x;
1187         presets_delete_y = y;
1188         y += BC_GenericButton::calculate_h() + widget_border;
1189
1190         presets_save_x = presets_text_x;
1191         presets_save_y = y;
1192         y += BC_GenericButton::calculate_h() + widget_border;
1193
1194         presets_apply_x = presets_text_x;
1195         presets_apply_y = y;
1196         y += BC_GenericButton::calculate_h();
1197
1198 #ifdef EDIT_KEYFRAME
1199         x = mwindow->session->keyframedialog_w / 2 + widget_border;
1200         y = window_border + 
1201                 BC_Title::calculate_h(gui, "P", LARGEFONT) + 
1202                 widget_border;
1203
1204         keyframe_list_x = x;
1205         keyframe_list_y = y;
1206         keyframe_list_w = mwindow->session->keyframedialog_w / 2 - 
1207                 widget_border - 
1208                 window_border;
1209         keyframe_list_h = mwindow->session->keyframedialog_h - 
1210                 keyframe_list_y -
1211                 widget_border -
1212                 widget_border -
1213                 BC_Title::calculate_h(gui, "P") -
1214                 widget_border - 
1215                 BC_TextBox::calculate_h(gui,
1216                         MEDIUMFONT,
1217                         1,
1218                         1) -
1219                 widget_border - 
1220                 BC_Title::calculate_h(gui, "P") -
1221                 widget_border -
1222                 BC_OKButton::calculate_h() - 
1223                 window_border;
1224 //      keyframe_text_x = keyframe_list_x + keyframe_list_w + widget_border;
1225 //      keyframe_text_y = y;
1226 //      keyframe_text_w = mwindow->session->keyframedialog_w - keyframe_text_x - window_border;
1227 //      y += BC_TextBox::calculate_h(gui, 
1228 //              MEDIUMFONT, 
1229 //              1, 
1230 //              1) + widget_border;
1231 // 
1232
1233         y += keyframe_list_h + BC_Title::calculate_h(gui, "P") + widget_border + widget_border;
1234         keyframe_value_x = keyframe_list_x;
1235         keyframe_value_y = y;
1236         keyframe_value_w = keyframe_list_w;
1237         y += BC_TextBox::calculate_h(gui, 
1238                 MEDIUMFONT, 
1239                 1, 
1240                 1) + widget_border;
1241
1242         keyframe_all_x = keyframe_value_x;
1243         keyframe_all_y = y;
1244
1245 #endif
1246
1247 }
1248
1249
1250 void Theme::get_menueffect_sizes(int use_list)
1251 {
1252         if(use_list)
1253         {
1254                 menueffect_list_x = xS(10);
1255                 menueffect_list_y = yS(10);
1256                 menueffect_list_w = mwindow->session->menueffect_w - xS(400);
1257                 menueffect_list_h = mwindow->session->menueffect_h -
1258                         menueffect_list_y -
1259                         BC_OKButton::calculate_h() - yS(10);
1260         }
1261         else
1262         {
1263                 menueffect_list_x = 0;
1264                 menueffect_list_y = yS(10);
1265                 menueffect_list_w = 0;
1266                 menueffect_list_h = 0;
1267         }
1268
1269         menueffect_file_x = menueffect_list_x + menueffect_list_w + xS(10);
1270         menueffect_file_y = yS(10);
1271
1272         menueffect_tools_x = menueffect_file_x;
1273         menueffect_tools_y = menueffect_file_y + yS(20);
1274 }
1275
1276 void Theme::get_preferences_sizes()
1277 {
1278 }
1279
1280 void Theme::draw_preferences_bg(PreferencesWindow *gui)
1281 {
1282 }
1283
1284 void Theme::get_new_sizes(NewWindow *gui)
1285 {
1286 }
1287
1288 void Theme::draw_new_bg(NewWindow *gui)
1289 {
1290 }
1291
1292 void Theme::draw_setformat_bg(SetFormatWindow *window)
1293 {
1294 }
1295
1296
1297 int Theme::get_color_title_bg()
1298 {
1299         VFrame *title_bg = get_image("title_bg_data");
1300         int tw = title_bg->get_w(), th = title_bg->get_h();
1301         int colormodel = title_bg->get_color_model();
1302         int bpp = BC_CModels::calculate_pixelsize(colormodel);
1303         uint8_t **rows = title_bg->get_rows();
1304         int cx = tw / 2, cy = th / 2;
1305         uint8_t *bp = rows[cy] + cx * bpp;
1306         int br = bp[0], bg = bp[1], bb = bp[2];
1307         int color = (br<<16) | (bg<<8) | (bb<<0);
1308         return color;
1309 }
1310
1311