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