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