From: Good Guy Date: Sun, 20 Oct 2019 22:57:55 +0000 (-0600) Subject: add BC_SCALE env var for hi def monitors, cleanup theme data X-Git-Tag: 2019-10~6 X-Git-Url: https://git.cinelerra-gg.org/?a=commitdiff_plain;h=0df48ad2d876409c5beeae2e21933a728ea76c33;p=goodguy%2Fcinelerra.git add BC_SCALE env var for hi def monitors, cleanup theme data --- diff --git a/cinelerra-5.1/cinelerra/aboutprefs.C b/cinelerra-5.1/cinelerra/aboutprefs.C index d07ce4de..f6fdde4a 100644 --- a/cinelerra-5.1/cinelerra/aboutprefs.C +++ b/cinelerra-5.1/cinelerra/aboutprefs.C @@ -47,8 +47,6 @@ void AboutPrefs::create_objects() { lock_window("AboutPrefs::create_objects"); int x, y; - - BC_Resources *resources = BC_WindowBase::get_resources(); // add_subwindow(new BC_Title(mwindow->theme->preferencestitle_x, @@ -99,12 +97,12 @@ void AboutPrefs::create_objects() about.append(new BC_ListBoxItem(msg)); } BC_ListBox *listbox; - add_subwindow(listbox = new BC_ListBox(x, y, 450, 280, + add_subwindow(listbox = new BC_ListBox(x, y, xS(450), yS(280), LISTBOX_TEXT, &about, 0, 0, 1)); - y += listbox->get_h() + get_text_height(LARGEFONT) + 10; + y += listbox->get_h() + get_text_height(LARGEFONT) + yS(10); } else - y += 300 + get_text_height(LARGEFONT) + 10; + y += yS(300) + get_text_height(LARGEFONT) + yS(10); set_font(LARGEFONT); set_color(resources->text_default); @@ -130,22 +128,17 @@ void AboutPrefs::create_objects() draw_text(x, y, REPOMAINTXT); #endif - x = get_w() - mwindow->theme->about_bg->get_w() - 10; + x = get_w() - mwindow->theme->about_bg->get_w() - xS(10); y = mwindow->theme->preferencesoptions_y; BC_Pixmap *temp_pixmap = new BC_Pixmap(this, mwindow->theme->about_bg, PIXMAP_ALPHA); - draw_pixmap(temp_pixmap, - x, - y); - + draw_pixmap(temp_pixmap, x, y); delete temp_pixmap; - - x += mwindow->theme->about_bg->get_w() + 10; + x += mwindow->theme->about_bg->get_w() + xS(10); y += get_text_height(LARGEFONT) * 2; - flash(); flush(); unlock_window(); diff --git a/cinelerra-5.1/cinelerra/adeviceprefs.C b/cinelerra-5.1/cinelerra/adeviceprefs.C index d93cef30..4d93df69 100644 --- a/cinelerra-5.1/cinelerra/adeviceprefs.C +++ b/cinelerra-5.1/cinelerra/adeviceprefs.C @@ -108,10 +108,7 @@ int ADevicePrefs::initialize(int creation) if(!menu) { dialog->add_subwindow(menu = new ADriverMenu(x, - y + 10, - this, - (mode == MODERECORD), - driver)); + y + yS(10), this, (mode == MODERECORD), driver)); menu->create_objects(); } @@ -270,7 +267,7 @@ int ADevicePrefs::create_oss_objs() BC_Resources *resources = BC_WindowBase::get_resources(); for(int i = 0; i < MAXDEVICES; i++) { - int x1 = x + menu->get_w() + 5; + int x1 = x + menu->get_w() + xS(5); #if 0 switch(mode) { case MODEPLAY: @@ -283,7 +280,7 @@ int ADevicePrefs::create_oss_objs() output_int = &out_config->oss_enable[i]; break; } - dialog->add_subwindow(oss_enable[i] = new OSSEnable(x1, y1 + 20, output_int)); + dialog->add_subwindow(oss_enable[i] = new OSSEnable(x1, y1 + yS(20), output_int)); x1 += oss_enable[i]->get_w() + margin; #endif switch(mode) { @@ -378,7 +375,7 @@ int ADevicePrefs::create_alsa_objs() alsa_device->create_objects(); int x2 = x1; - x1 += alsa_device->get_w() + 5; + x1 += alsa_device->get_w() + xS(5); switch(mode) { case MODEPLAY: output_int = &out_config->alsa_out_bits; @@ -415,7 +412,7 @@ int ADevicePrefs::create_alsa_objs() int ADevicePrefs::create_esound_objs() { - int x1 = x + menu->get_w() + 5; + int x1 = x + menu->get_w() + xS(5); char *output_char = 0; int *output_int = 0; BC_Resources *resources = BC_WindowBase::get_resources(); @@ -434,7 +431,7 @@ int ADevicePrefs::create_esound_objs() server_title = new BC_Title(x1, y, _("Server:"), MEDIUMFONT, resources->text_default); dialog->add_subwindow(server_title); - esound_server = new ADeviceTextBox(x1, y + 20, output_char); + esound_server = new ADeviceTextBox(x1, y + yS(20), output_char); dialog->add_subwindow(esound_server); switch(mode) { @@ -448,18 +445,20 @@ int ADevicePrefs::create_esound_objs() output_int = &out_config->esound_out_port; break; } - x1 += esound_server->get_w() + 5; + x1 += esound_server->get_w() + xS(5); port_title = new BC_Title(x1, y, _("Port:"), MEDIUMFONT, resources->text_default); dialog->add_subwindow(port_title); - esound_port = new ADeviceIntBox(x1, y + 20, output_int); + esound_port = new ADeviceIntBox(x1, y + yS(20), output_int); dialog->add_subwindow(esound_port); return 0; } int ADevicePrefs::create_firewire_objs() { - int x1 = x + menu->get_w() + 5; + int xs5 = xS(5); + int ys20 = yS(20); + int x1 = x + menu->get_w() + xs5; int *output_int = 0; char *output_char = 0; BC_Resources *resources = BC_WindowBase::get_resources(); @@ -481,8 +480,8 @@ int ADevicePrefs::create_firewire_objs() if(output_char) { dialog->add_subwindow(path_title = new BC_Title(x1, y, _("Device Path:"), MEDIUMFONT, resources->text_default)); - dialog->add_subwindow(firewire_path = new ADeviceTextBox(x1, y + 20, output_char)); - x1 += firewire_path->get_w() + 5; + dialog->add_subwindow(firewire_path = new ADeviceTextBox(x1, y + ys20, output_char)); + x1 += firewire_path->get_w() + xs5; } // Firewire port @@ -503,10 +502,10 @@ int ADevicePrefs::create_firewire_objs() port_title = new BC_Title(x1, y, _("Port:"), MEDIUMFONT, resources->text_default); dialog->add_subwindow(port_title); - firewire_port = new ADeviceIntBox(x1, y + 20, output_int); + firewire_port = new ADeviceIntBox(x1, y + ys20, output_int); dialog->add_subwindow(firewire_port); - x1 += firewire_port->get_w() + 5; + x1 += firewire_port->get_w() + xs5; // Firewire channel switch(mode) { @@ -523,9 +522,9 @@ int ADevicePrefs::create_firewire_objs() channel_title = new BC_Title(x1, y, _("Channel:"), MEDIUMFONT, resources->text_default); dialog->add_subwindow(channel_title); - firewire_channel = new ADeviceIntBox(x1, y + 20, output_int); + firewire_channel = new ADeviceIntBox(x1, y + ys20, output_int); dialog->add_subwindow(firewire_channel); - x1 += firewire_channel->get_w() + 5; + x1 += firewire_channel->get_w() + xs5; // Syt offset switch(mode) { @@ -547,9 +546,9 @@ int ADevicePrefs::create_firewire_objs() syt_title = new BC_Title(x1, y, _("Syt Offset:"), MEDIUMFONT, resources->text_default); dialog->add_subwindow(syt_title); - firewire_syt = new ADeviceIntBox(x1, y + 20, output_int); + firewire_syt = new ADeviceIntBox(x1, y + ys20, output_int); dialog->add_subwindow(firewire_syt); - x1 += firewire_syt->get_w() + 5; + x1 += firewire_syt->get_w() + xs5; } return 0; @@ -559,31 +558,31 @@ int ADevicePrefs::create_firewire_objs() int ADevicePrefs::create_dvb_objs() { - int x1 = x + menu->get_w() + 30; - int y1 = y + 10; + int x1 = x + menu->get_w() + xS(30); + int y1 = y + yS(10); char *output_char = in_config->dvb_in_adapter; - int y2 = y1 - BC_Title::calculate_h(dialog, _("DVB Adapter:"), MEDIUMFONT) - 5; + int y2 = y1 - BC_Title::calculate_h(dialog, _("DVB Adapter:"), MEDIUMFONT) - yS(5); BC_Resources *resources = BC_WindowBase::get_resources(); dvb_adapter_title = new BC_Title(x1, y2, _("DVB Adapter:"), MEDIUMFONT, resources->text_default); dialog->add_subwindow(dvb_adapter_title); dvb_adapter_path = new ADeviceTextBox(x1, y1, output_char); dialog->add_subwindow(dvb_adapter_path); - int x2 = x1 + dvb_adapter_path->get_w() + 5; + int x2 = x1 + dvb_adapter_path->get_w() + xS(5); dvb_device_title = new BC_Title(x2, y2, _("dev:"), MEDIUMFONT, resources->text_default); dialog->add_subwindow(dvb_device_title); int *output_int = &in_config->dvb_in_device; - dvb_adapter_device = new ADeviceTumbleBox(this, x2, y1, output_int, 0, 9, 20); + dvb_adapter_device = new ADeviceTumbleBox(this, x2, y1, output_int, 0, 9, xS(20)); dvb_adapter_device->create_objects(); - x2 += dvb_device_title->get_w() + 30; + x2 += dvb_device_title->get_w() + xS(30); bits_title = new BC_Title(x2, y2, _("Bits:"), MEDIUMFONT, resources->text_default); dialog->add_subwindow(bits_title); output_int = &in_config->dvb_in_bits; dvb_bits = new BitsPopup(dialog, x2, y1, output_int, 0, 0, 0, 0, 1); dvb_bits->create_objects(); - x1 += 100; y1 += dvb_adapter_path->get_h() + 5; + x1 += xS(100); y1 += dvb_adapter_path->get_h() + yS(5); output_int = &in_config->follow_audio; follow_audio_config = new BC_CheckBox(x1, y1, output_int, _("Follow audio config")); dialog->add_subwindow(follow_audio_config); @@ -592,9 +591,9 @@ int ADevicePrefs::create_dvb_objs() int ADevicePrefs::create_v4l2mpeg_objs() { - int x1 = x + menu->get_w() + 30; - int y1 = y + 10; - int y2 = y1 - BC_Title::calculate_h(dialog, _("Bits:"), MEDIUMFONT) - 5; + int x1 = x + menu->get_w() + xS(30); + int y1 = y + yS(10); + int y2 = y1 - BC_Title::calculate_h(dialog, _("Bits:"), MEDIUMFONT) - yS(5); BC_Resources *resources = BC_WindowBase::get_resources(); bits_title = new BC_Title(x1, y2, _("Bits:"), MEDIUMFONT, resources->text_default); @@ -602,7 +601,7 @@ int ADevicePrefs::create_v4l2mpeg_objs() int *output_int = &in_config->v4l2_in_bits; v4l2_bits = new BitsPopup(dialog, x1, y1, output_int, 0, 0, 0, 0, 1); v4l2_bits->create_objects(); - x1 += v4l2_bits->get_w() + 10; + x1 += v4l2_bits->get_w() + xS(10); follow_audio_config = new BC_CheckBox(x1, y1, &in_config->follow_audio, _("Follow audio config")); dialog->add_subwindow(follow_audio_config); @@ -612,7 +611,7 @@ int ADevicePrefs::create_v4l2mpeg_objs() ADriverMenu::ADriverMenu(int x, int y, ADevicePrefs *device_prefs, int do_input, int *output) - : BC_PopupMenu(x, y, 125, adriver_to_string(*output), 1) + : BC_PopupMenu(x, y, xS(125), adriver_to_string(*output), 1) { this->output = output; this->do_input = do_input; @@ -730,7 +729,7 @@ int OSSEnable::handle_event() ADeviceTextBox::ADeviceTextBox(int x, int y, char *output) - : BC_TextBox(x, y, 150, 1, output) + : BC_TextBox(x, y, xS(150), 1, output) { this->output = output; } @@ -742,7 +741,7 @@ int ADeviceTextBox::handle_event() } ADeviceIntBox::ADeviceIntBox(int x, int y, int *output) - : BC_TextBox(x, y, 80, 1, *output) + : BC_TextBox(x, y, xS(80), 1, *output) { this->output = output; } @@ -775,7 +774,7 @@ ALSADevice::ALSADevice(PreferencesDialog *dialog, int y, char *output, ArrayList *devices) - : BC_PopupTextBox(dialog, devices, output, x, y, 200, 200) + : BC_PopupTextBox(dialog, devices, output, x, y, xS(200), yS(200)) { this->output = output; } diff --git a/cinelerra-5.1/cinelerra/apanel.C b/cinelerra-5.1/cinelerra/apanel.C index 0f39c10b..de2ad953 100644 --- a/cinelerra-5.1/cinelerra/apanel.C +++ b/cinelerra-5.1/cinelerra/apanel.C @@ -40,17 +40,18 @@ APanel::~APanel() void APanel::create_objects() { - int x = this->x + 5, y = this->y + 10; + int ys10 = yS(10), ys20 = yS(20); + int x = this->x + xS(5), y = this->y + ys10; char string[BCTEXTLEN]; int x1 = x; subwindow->add_subwindow(new BC_Title(x, y, _("Automation"))); - y += 20; + y += ys20; for(int i = 0; i < PLUGINS; i++) { sprintf(string, _("Plugin %d"), i + 1); subwindow->add_subwindow(new BC_Title(x, y, string, SMALLFONT)); - subwindow->add_subwindow(plugin_autos[i] = new APanelPluginAuto(mwindow, this, x, y + 20)); + subwindow->add_subwindow(plugin_autos[i] = new APanelPluginAuto(mwindow, this, x, y + ys20)); if(x == x1) { x += plugin_autos[i]->get_w(); @@ -58,7 +59,7 @@ void APanel::create_objects() else { x = x1; - y += plugin_autos[i]->get_h() + 20; + y += plugin_autos[i]->get_h() + ys20; } } @@ -71,11 +72,7 @@ void APanel::create_objects() APanelPluginAuto::APanelPluginAuto(MWindow *mwindow, APanel *gui, int x, int y) - : BC_FPot(x, - y, - 0, - -1, - 1) + : BC_FPot(x, y, 0, -1, 1) { this->mwindow = mwindow; this->gui = gui; diff --git a/cinelerra-5.1/cinelerra/apatchgui.C b/cinelerra-5.1/cinelerra/apatchgui.C index 8743268d..0e8adca2 100644 --- a/cinelerra-5.1/cinelerra/apatchgui.C +++ b/cinelerra-5.1/cinelerra/apatchgui.C @@ -115,7 +115,7 @@ int APatchGUI::update(int x, int y) else if( h >= y2 ) { float v = mwindow->get_float_auto(this, AUTOMATION_FADE)->get_value(); patchbay->add_subwindow(fade = new AFadePatch(this, x1+x, y1+y, - patchbay->get_w() - 10, v)); + patchbay->get_w() - xS(10), v)); } y1 = y2; @@ -162,11 +162,11 @@ int APatchGUI::update(int x, int y) } else if( h >= y2 ) { patchbay->add_subwindow(mix = new AMixPatch(mwindow, this, x1+x, y1+y+5)); - x1 += mix->get_w() + 10; + x1 += mix->get_w() + xS(10); patchbay->add_subwindow(pan = new APanPatch(mwindow, this, x1+x, y1+y)); - x1 += pan->get_w() + 20; + x1 += pan->get_w() + xS(20); patchbay->add_subwindow(nudge = new NudgePatch(mwindow, this, x1+x, y1+y, - patchbay->get_w() - x1-x - 10)); + patchbay->get_w() - x1-x - xS(10))); } y1 = y2; @@ -221,7 +221,7 @@ int AFadePatch::handle_event() } AKeyFadePatch::AKeyFadePatch(MWindow *mwindow, APatchGUI *patch, int x, int y) - : BC_SubWindow(x,y, 200,20, GWindowGUI::auto_colors[AUTOMATION_FADE]) + : BC_SubWindow(x,y, xS(200),yS(20), GWindowGUI::auto_colors[AUTOMATION_FADE]) { this->mwindow = mwindow; this->patch = patch; @@ -231,7 +231,7 @@ void AKeyFadePatch::create_objects() { int x = 0, y = 0; float v = mwindow->get_float_auto(patch, AUTOMATION_FADE)->get_value(); - add_subwindow(akey_fade_text = new AKeyFadeText(this, x, y, 64, v)); + add_subwindow(akey_fade_text = new AKeyFadeText(this, x, y, xS(64), v)); x += akey_fade_text->get_w(); VFrame **lok_images = mwindow->theme->get_image_set("lok"); int w1 = get_w() - x - lok_images[0]->get_w(); @@ -345,14 +345,13 @@ int AKeyPanPatch::handle_event() AMeterPatch::AMeterPatch(MWindow *mwindow, APatchGUI *patch, int x, int y) - : BC_Meter(x, y, METER_HORIZ, patch->patchbay->get_w() - 10, + : BC_Meter(x, y, METER_HORIZ, patch->patchbay->get_w() - xS(10), mwindow->edl->session->min_meter_db, mwindow->edl->session->max_meter_db, mwindow->edl->session->meter_format, 0, -1) { this->mwindow = mwindow; this->patch = patch; - set_delays(TRACKING_RATE * 10, - TRACKING_RATE); + set_delays(TRACKING_RATE * 10, TRACKING_RATE); } int AMeterPatch::button_press_event() diff --git a/cinelerra-5.1/cinelerra/appearanceprefs.C b/cinelerra-5.1/cinelerra/appearanceprefs.C index 4ca46b2d..840dccc6 100644 --- a/cinelerra-5.1/cinelerra/appearanceprefs.C +++ b/cinelerra-5.1/cinelerra/appearanceprefs.C @@ -61,51 +61,54 @@ AppearancePrefs::~AppearancePrefs() void AppearancePrefs::create_objects() { + int xs5 = xS(5), xs10 = xS(10), xs30 = xS(30); + int ys5 = yS(5), ys10 = yS(10), ys15 = yS(15); + int ys20 = yS(20), ys35 = yS(35); BC_Resources *resources = BC_WindowBase::get_resources(); int margin = mwindow->theme->widget_border; char string[BCTEXTLEN]; int x0 = mwindow->theme->preferencesoptions_x; int y0 = mwindow->theme->preferencesoptions_y; - int x = x0, y = y0, x1 = x + 100; + int x = x0, y = y0, x1 = x + xS(100); add_subwindow(new BC_Title(x, y, _("Layout:"), LARGEFONT, resources->text_default)); - y += 35; + y += ys35; int y1 = y; ViewTheme *theme; add_subwindow(new BC_Title(x, y, _("Theme:"))); add_subwindow(theme = new ViewTheme(x1, y, pwindow)); theme->create_objects(); - y += theme->get_h() + 5; + y += theme->get_h() + ys5; x = x0; ViewPluginIcons *plugin_icons; add_subwindow(new BC_Title(x, y, _("Plugin Icons:"))); add_subwindow(plugin_icons = new ViewPluginIcons(x1, y, pwindow)); plugin_icons->create_objects(); - y += plugin_icons->get_h() + 15; + y += plugin_icons->get_h() + ys15; x1 = get_w()/2; - int x2 = x1 + 160, y2 = y; + int x2 = x1 + xS(160), y2 = y; y = y1; add_subwindow(new BC_Title(x1, y, _("View thumbnail size:"))); thumbnail_size = new ViewThumbnailSize(pwindow, this, x2, y); thumbnail_size->create_objects(); - y += thumbnail_size->get_h() + 5; + y += thumbnail_size->get_h() + ys5; add_subwindow(new BC_Title(x1, y, _("Vicon quality:"))); vicon_size = new ViewViconSize(pwindow, this, x2, y); vicon_size->create_objects(); - y += vicon_size->get_h() + 5; + y += vicon_size->get_h() + ys5; add_subwindow(new BC_Title(x1, y, _("Vicon color mode:"))); add_subwindow(vicon_color_mode = new ViewViconColorMode(pwindow, x2, y)); vicon_color_mode->create_objects(); - y += vicon_color_mode->get_h() + 5; + y += vicon_color_mode->get_h() + ys5; y = bmax(y, y2); - y += 10; - add_subwindow(new BC_Bar(5, y, get_w() - 10)); - y += 15; + y += ys10; + add_subwindow(new BC_Bar(xs5, y, get_w() - xs10)); + y += ys15; add_subwindow(new BC_Title(x, y, _("Time Format:"), LARGEFONT, resources->text_default)); @@ -113,124 +116,124 @@ void AppearancePrefs::create_objects() add_subwindow(new BC_Title(x1, y, _("Flags:"), LARGEFONT, resources->text_default)); - y += get_text_height(LARGEFONT) + 5; - y += 10; + y += get_text_height(LARGEFONT) + ys5; + y += ys10; y1 = y; add_subwindow(hms = new TimeFormatHMS(pwindow, this, pwindow->thread->edl->session->time_format == TIME_HMS, x, y)); - y += 20; + y += ys20; add_subwindow(hmsf = new TimeFormatHMSF(pwindow, this, pwindow->thread->edl->session->time_format == TIME_HMSF, x, y)); - y += 20; + y += ys20; add_subwindow(samples = new TimeFormatSamples(pwindow, this, pwindow->thread->edl->session->time_format == TIME_SAMPLES, x, y)); - y += 20; + y += ys20; add_subwindow(hex = new TimeFormatHex(pwindow, this, pwindow->thread->edl->session->time_format == TIME_SAMPLES_HEX, x, y)); - y += 20; + y += ys20; add_subwindow(frames = new TimeFormatFrames(pwindow, this, pwindow->thread->edl->session->time_format == TIME_FRAMES, x, y)); - y += 20; + y += ys20; add_subwindow(feet = new TimeFormatFeet(pwindow, this, pwindow->thread->edl->session->time_format == TIME_FEET_FRAMES, x, y)); - x += feet->get_w() + 15; + x += feet->get_w() + xS(15); BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Frames per foot:"))); x += title->get_w() + margin; sprintf(string, "%0.2f", pwindow->thread->edl->session->frames_per_foot); add_subwindow(new TimeFormatFeetSetting(pwindow, - x, y - 5, string)); + x, y - ys5, string)); x = x0; - y += 20; + y += ys20; add_subwindow(seconds = new TimeFormatSeconds(pwindow, this, pwindow->thread->edl->session->time_format == TIME_SECONDS, x, y)); x = x0; - y += 35; - add_subwindow(new BC_Bar(5, y, get_w()/2 - 30)); - y += 15; + y += ys35; + add_subwindow(new BC_Bar(xs5, y, get_w()/2 - xs30)); + y += ys15; add_subwindow(new BC_Title(x, y, _("Color:"), LARGEFONT, resources->text_default)); - y += 35; + y += ys35; add_subwindow(title = new BC_Title(x, y, _("Highlighting Inversion color:"))); x += title->get_w() + margin; char hex_color[BCSTRLEN]; sprintf(hex_color, "%06x", preferences->highlight_inverse); add_subwindow(new HighlightInverseColor(pwindow, x, y, hex_color)); x2 = x; x = x0; - y += 35; + y += ys35; add_subwindow(title = new BC_Title(x, y, _("Composer BG Color:"))); int clr_color = pwindow->thread->edl->session->cwindow_clear_color; int clr_alpha = pwindow->thread->edl->session->cwindow_clear_alpha; add_subwindow(cwdw_bg_color = new Composer_BG_Color(pwindow, - x2, y, 80, 24, clr_color, clr_alpha)); + x2, y, xS(80), yS(24), clr_color, clr_alpha)); draw_3d_border(x2-2,y-2, 80+4,24+4, 1); cwdw_bg_color->create_objects(); - y += 35; + y += ys35; x = x0; add_subwindow(title = new BC_Title(x, y, _("YUV color space:"))); x += title->get_w() + margin; add_subwindow(yuv_color_space = new YuvColorSpace(x, y, pwindow)); yuv_color_space->create_objects(); - y += yuv_color_space->get_h() + 5; + y += yuv_color_space->get_h() + ys5; x = x0; add_subwindow(title = new BC_Title(x, y, _("YUV color range:"))); x += title->get_w() + margin; add_subwindow(yuv_color_range = new YuvColorRange(x, y, pwindow)); yuv_color_range->create_objects(); - y += yuv_color_range->get_h() + 5; + y += yuv_color_range->get_h() + ys5; UseTipWindow *tip_win = new UseTipWindow(pwindow, x1, y1); add_subwindow(tip_win); - y1 += tip_win->get_h() + 5; + y1 += tip_win->get_h() + ys5; AutocolorAssets *autocolor_assets = new AutocolorAssets(pwindow, x1, y1); add_subwindow(autocolor_assets); - y1 += autocolor_assets->get_h() + 5; + y1 += autocolor_assets->get_h() + ys5; UseWarnIndecies *idx_win = new UseWarnIndecies(pwindow, x1, y1); add_subwindow(idx_win); - y1 += idx_win->get_h() + 5; + y1 += idx_win->get_h() + ys5; UseWarnVersion *ver_win = new UseWarnVersion(pwindow, x1, y1); add_subwindow(ver_win); - y1 += ver_win->get_h() + 5; + y1 += ver_win->get_h() + ys5; BD_WarnRoot *bdwr_win = new BD_WarnRoot(pwindow, x1, y1); add_subwindow(bdwr_win); - y1 += bdwr_win->get_h() + 5; + y1 += bdwr_win->get_h() + ys5; PopupMenuBtnup *pop_win = new PopupMenuBtnup(pwindow, x1, y1); add_subwindow(pop_win); - y1 += pop_win->get_h() + 5; + y1 += pop_win->get_h() + ys5; GrabFocusPolicy *grab_input_focus = new GrabFocusPolicy(pwindow, x1, y1); add_subwindow(grab_input_focus); - y1 += grab_input_focus->get_h() + 5; + y1 += grab_input_focus->get_h() + ys5; ActivateFocusPolicy *focus_activate = new ActivateFocusPolicy(pwindow, x1, y1); add_subwindow(focus_activate); - y1 += focus_activate->get_h() + 5; + y1 += focus_activate->get_h() + ys5; DeactivateFocusPolicy *focus_deactivate = new DeactivateFocusPolicy(pwindow, x1, y1); add_subwindow(focus_deactivate); - y1 += focus_deactivate->get_h() + 5; + y1 += focus_deactivate->get_h() + ys5; ForwardRenderDisplacement *displacement = new ForwardRenderDisplacement(pwindow, x1, y1); add_subwindow(displacement); - y1 += displacement->get_h() + 5; + y1 += displacement->get_h() + ys5; add_subwindow(thumbnails = new ViewThumbnails(x1, y1, pwindow)); - y1 += thumbnails->get_h() + 5; + y1 += thumbnails->get_h() + ys5; PerpetualSession *perpetual = new PerpetualSession(x1, y1, pwindow); add_subwindow(perpetual); - y1 += perpetual->get_h() + 5; + y1 += perpetual->get_h() + ys5; CtrlToggle *ctrl_toggle = new CtrlToggle(x1, y1, pwindow); add_subwindow(ctrl_toggle); - y1 += ctrl_toggle->get_h() + 5; + y1 += ctrl_toggle->get_h() + ys5; RectifyAudioToggle *rect_toggle = new RectifyAudioToggle(x1, y1, pwindow); add_subwindow(rect_toggle); - y1 += rect_toggle->get_h() + 5; + y1 += rect_toggle->get_h() + ys5; if( y < y1 ) y = y1; } @@ -323,7 +326,7 @@ int TimeFormatFeet::handle_event() } TimeFormatFeetSetting::TimeFormatFeetSetting(PreferencesWindow *pwindow, int x, int y, char *string) - : BC_TextBox(x, y, 90, 1, string) + : BC_TextBox(x, y, xS(90), 1, string) { this->pwindow = pwindow; } int TimeFormatFeetSetting::handle_event() @@ -335,7 +338,7 @@ int TimeFormatFeetSetting::handle_event() ViewTheme::ViewTheme(int x, int y, PreferencesWindow *pwindow) - : BC_PopupMenu(x, y, 200, pwindow->thread->preferences->theme, 1) + : BC_PopupMenu(x, y, xS(200), pwindow->thread->preferences->theme, 1) { this->pwindow = pwindow; } @@ -374,7 +377,7 @@ int ViewThemeItem::handle_event() ViewPluginIcons::ViewPluginIcons(int x, int y, PreferencesWindow *pwindow) - : BC_PopupMenu(x, y, 200, pwindow->thread->preferences->plugin_icons, 1) + : BC_PopupMenu(x, y, xS(200), pwindow->thread->preferences->plugin_icons, 1) { this->pwindow = pwindow; } @@ -441,7 +444,7 @@ ViewThumbnailSize::ViewThumbnailSize(PreferencesWindow *pwindow, AppearancePrefs *aprefs, int x, int y) : BC_TumbleTextBox(aprefs, pwindow->thread->preferences->awindow_picon_h, - 16, 512, x, y, 80) + 16, 512, x, y, xS(80)) { this->pwindow = pwindow; @@ -460,7 +463,7 @@ ViewViconSize::ViewViconSize(PreferencesWindow *pwindow, AppearancePrefs *aprefs, int x, int y) : BC_TumbleTextBox(aprefs, pwindow->thread->preferences->vicon_size, - 16, 512, x, y, 80) + 16, 512, x, y, xS(80)) { this->pwindow = pwindow; @@ -476,7 +479,7 @@ int ViewViconSize::handle_event() } ViewViconColorMode::ViewViconColorMode(PreferencesWindow *pwindow, int x, int y) - : BC_PopupMenu(x, y, 100, + : BC_PopupMenu(x, y, xS(100), _(vicon_color_modes[pwindow->thread->preferences->vicon_color_mode]), 1) { this->pwindow = pwindow; @@ -658,7 +661,7 @@ int AutocolorAssets::handle_event() } HighlightInverseColor::HighlightInverseColor(PreferencesWindow *pwindow, int x, int y, const char *hex) - : BC_TextBox(x, y, 80, 1, hex) + : BC_TextBox(x, y, xS(80), 1, hex) { this->pwindow = pwindow; } @@ -684,7 +687,7 @@ const char *YuvColorSpace::color_space[] = { }; YuvColorSpace::YuvColorSpace(int x, int y, PreferencesWindow *pwindow) - : BC_PopupMenu(x, y, 100, + : BC_PopupMenu(x, y, xS(100), _(color_space[pwindow->thread->preferences->yuv_color_space]), 1) { this->pwindow = pwindow; @@ -727,7 +730,7 @@ const char *YuvColorRange::color_range[] = { }; YuvColorRange::YuvColorRange(int x, int y, PreferencesWindow *pwindow) - : BC_PopupMenu(x, y, 100, + : BC_PopupMenu(x, y, xS(100), _(color_range[pwindow->thread->preferences->yuv_color_range]), 1) { this->pwindow = pwindow; diff --git a/cinelerra-5.1/cinelerra/assetedit.C b/cinelerra-5.1/cinelerra/assetedit.C index 609bc0f6..c8ff4a9f 100644 --- a/cinelerra-5.1/cinelerra/assetedit.C +++ b/cinelerra-5.1/cinelerra/assetedit.C @@ -197,13 +197,15 @@ int AssetEdit::window_height() h += 42; } } - return h; + return yS(h); } +#define AEW_W xS(450) + AssetEditWindow::AssetEditWindow(MWindow *mwindow, AssetEdit *asset_edit) : BC_Window(_(PROGRAM_NAME ": Asset Info"), - asset_edit->x - 450/2, asset_edit->y - asset_edit->window_height()/2, - 450, asset_edit->window_height(), 0, 0, 1) + asset_edit->x - AEW_W/2, asset_edit->y - asset_edit->window_height()/2, + AEW_W, asset_edit->window_height(), 0, 0, 1) { this->mwindow = mwindow; this->asset_edit = asset_edit; @@ -235,9 +237,10 @@ AssetEditWindow::~AssetEditWindow() void AssetEditWindow::create_objects() { - int y = 10, x = 10, x1 = 10, x2 = 190; + int xpad10 = xS(10); + int ypad5 = yS(5), ypad10 = yS(10), ypad20 = yS(20), ypad30 = yS(30); + int y = ypad10, x = xpad10, x1 = xpad10, x2 = xS(190); char string[BCTEXTLEN]; - int vmargin; FileSystem fs; BC_Title *title; Asset *asset = 0; @@ -248,23 +251,16 @@ void AssetEditWindow::create_objects() else nested_edl = (EDL*)asset_edit->indexable; - if( asset && asset->format == FILE_PCM ) - allow_edits = 1; - else - allow_edits = 0; - + allow_edits = asset && asset->format == FILE_PCM ? 1 : 0; + int vmargin = yS(allow_edits ? 30 : 20); lock_window("AssetEditWindow::create_objects"); - if( allow_edits ) - vmargin = 30; - else - vmargin = 20; add_subwindow(path_text = new AssetEditPathText(this, y)); add_subwindow(path_button = new AssetEditPath(mwindow, this, path_text, y, asset_edit->indexable->path, _(PROGRAM_NAME ": Asset path"), _("Select a file for this asset:"))); - y += 30; + y += yS(30); if( asset ) { add_subwindow(new BC_Title(x, y, _("File format:"))); @@ -273,7 +269,7 @@ void AssetEditWindow::create_objects() MEDIUMFONT, mwindow->theme->assetedit_color)); x = x1; - y += 20; + y += ypad20; int64_t bytes = fs.get_size(asset->path); add_subwindow(new BC_Title(x, y, _("Bytes:"))); @@ -284,15 +280,15 @@ void AssetEditWindow::create_objects() add_subwindow(new BC_Title(x2, y, string, MEDIUMFONT, mwindow->theme->assetedit_color)); if( asset->format == FILE_MPEG || asset->format == FILE_FFMPEG ) { detail_dialog = new DetailAssetDialog(mwindow); - BC_GenericButton *detail = new DetailAssetButton(this, x2+120, y); + BC_GenericButton *detail = new DetailAssetButton(this, x2+xS(120), y); add_subwindow(detail); } - y += 20; + y += ypad20; x = x1; double length = 0.; - y += 20; + y += ypad20; x = x1; if( asset->audio_length > 0 ) @@ -310,17 +306,17 @@ void AssetEditWindow::create_objects() Units::punctuate(string); add_subwindow(new BC_Title(x2, y, string, MEDIUMFONT, mwindow->theme->assetedit_color)); - y += 30; + y += ypad30; x = x1; } if( (asset && asset->audio_data) || nested_edl ) { add_subwindow(new BC_Bar(x, y, get_w() - x * 2)); - y += 5; + y += ypad5; add_subwindow(new BC_Title(x, y, _("Audio:"), LARGEFONT, RED)); - y += 30; + y += ypad30; if( asset ) { if( asset->get_compression_text(1, 0) ) { @@ -350,7 +346,7 @@ void AssetEditWindow::create_objects() } else { add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color)); - y += 20; + y += ypad20; } x = x1; @@ -368,7 +364,7 @@ void AssetEditWindow::create_objects() add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color)); } - y += 30; + y += ypad30; x = x1; if( asset ) { @@ -405,14 +401,10 @@ void AssetEditWindow::create_objects() x = x2; add_subwindow(lohi = new AssetEditByteOrderLOHI(this, - asset->byte_order, - x, - y)); - x += 70; + asset->byte_order, x, y)); + x += xS(70); add_subwindow(hilo = new AssetEditByteOrderHILO(this, - !asset->byte_order, - x, - y)); + !asset->byte_order, x, y)); y += vmargin; } else { @@ -437,17 +429,17 @@ void AssetEditWindow::create_objects() add_subwindow(new BC_Title(x, y, _("Values are signed"))); } - y += 30; + y += ypad30; } } x = x1; if( (asset && asset->video_data) || nested_edl ) { add_subwindow(new BC_Bar(x, y, get_w() - x * 2)); - y += 5; + y += ypad5; add_subwindow(new BC_Title(x, y, _("Video:"), LARGEFONT, RED)); - y += 30; + y += ypad30; x = x1; @@ -471,14 +463,14 @@ void AssetEditWindow::create_objects() if( asset ) { BC_TextBox *framerate; add_subwindow(framerate = new AssetEditFRate(this, string, x, y)); - x += 105; + x += framerate->get_w(); add_subwindow(new FrameRatePulldown(mwindow, framerate, x, y)); } else { add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color)); } - y += 30; + y += ypad30; x = x1; add_subwindow(new BC_Title(x, y, _("Width:"))); x = x2; @@ -493,17 +485,17 @@ void AssetEditWindow::create_objects() sprintf(string, "%d", asset_edit->changed_params->height); win_height = new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color); add_subwindow(win_height); - y += win_height->get_h() + 5; + y += win_height->get_h() + ypad5; if( asset && File::can_scale_input(asset) ) { - y += 5; + y += ypad5; x = x1; add_subwindow(new BC_Title(x, y, _("Actual width:"))); x = x2; sprintf(string, "%d", asset->actual_width); add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color)); - BC_GenericButton *resize = new ResizeAssetButton(this, x+64, y); + BC_GenericButton *resize = new ResizeAssetButton(this, x+xS(64), y); add_subwindow(resize); y += vmargin; @@ -513,13 +505,13 @@ void AssetEditWindow::create_objects() sprintf(string, "%d", asset->actual_height); title = new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color); add_subwindow(title); - y += title->get_h() + 5; + y += title->get_h() + ypad5; } if( asset ) { add_subwindow(title = new BC_Title(x1, y, _("Asset's interlacing:"))); ilacemode_to_text(string, asset->interlace_mode); AssetEditILacemode *edit_ilace_mode; - add_subwindow(edit_ilace_mode = new AssetEditILacemode(this, string, x2, y, 160)); + add_subwindow(edit_ilace_mode = new AssetEditILacemode(this, string, x2, y, xS(160))); add_subwindow(new AssetEditInterlacemodePulldown(mwindow, edit_ilace_mode, &asset_edit->changed_params->interlace_mode, (ArrayList*)&mwindow->interlace_asset_modes, @@ -545,13 +537,8 @@ AssetEditChannels::AssetEditChannels(AssetEditWindow *fwindow, char *text, int x, int y) - : BC_TumbleTextBox(fwindow, - (int)atol(text), - (int)1, - (int)MAXCHANNELS, - x, - y, - 50) + : BC_TumbleTextBox(fwindow, (int)atol(text), (int)1, + (int)MAXCHANNELS, x, y, xS(50)) { this->fwindow = fwindow; } @@ -564,7 +551,7 @@ int AssetEditChannels::handle_event() } AssetEditRate::AssetEditRate(AssetEditWindow *fwindow, char *text, int x, int y) - : BC_TextBox(x, y, 100, 1, text) + : BC_TextBox(x, y, xS(100), 1, text) { this->fwindow = fwindow; } @@ -577,7 +564,7 @@ int AssetEditRate::handle_event() } AssetEditFRate::AssetEditFRate(AssetEditWindow *fwindow, char *text, int x, int y) - : BC_TextBox(x, y, 100, 1, text) + : BC_TextBox(x, y, xS(100), 1, text) { this->fwindow = fwindow; } @@ -606,7 +593,7 @@ int AssetEditILacemode::handle_event() AssetEditInterlacemodePulldown::AssetEditInterlacemodePulldown(MWindow *mwindow, BC_TextBox *output_text, int *output_value, ArrayList *data, int x, int y) - : BC_ListBox(x, y, 160, 80, LISTBOX_TEXT, data, 0, 0, 1, 0, 1) + : BC_ListBox(x, y, xS(160), yS(80), LISTBOX_TEXT, data, 0, 0, 1, 0, 1) { this->mwindow = mwindow; this->output_text = output_text; @@ -628,7 +615,7 @@ char* AssetEditInterlacemodePulldown::interlacemode_to_text() } AssetEditHeader::AssetEditHeader(AssetEditWindow *fwindow, char *text, int x, int y) - : BC_TextBox(x, y, 100, 1, text) + : BC_TextBox(x, y, xS(100), 1, text) { this->fwindow = fwindow; } @@ -699,7 +686,7 @@ int AssetEditSigned::handle_event() AssetEditPathText::AssetEditPathText(AssetEditWindow *fwindow, int y) - : BC_TextBox(5, y, 300, 1, fwindow->asset_edit->changed_params->path) + : BC_TextBox(5, y, xS(300), 1, fwindow->asset_edit->changed_params->path) { this->fwindow = fwindow; } @@ -715,7 +702,7 @@ int AssetEditPathText::handle_event() AssetEditPath::AssetEditPath(MWindow *mwindow, AssetEditWindow *fwindow, BC_TextBox *textbox, int y, const char *text, const char *window_title, const char *window_caption) - : BrowseButton(mwindow->theme, fwindow, textbox, 310, y, text, + : BrowseButton(mwindow->theme, fwindow, textbox, yS(310), y, text, window_title, window_caption, 0) { this->fwindow = fwindow; @@ -742,10 +729,13 @@ int DetailAssetButton::handle_event() return 1; } +#define DTL_W xS(600) +#define DTL_H yS(500) + DetailAssetWindow::DetailAssetWindow(MWindow *mwindow, DetailAssetDialog *detail_dialog, Asset *asset) : BC_Window(_("Asset Detail"), - detail_dialog->x - 600/2, detail_dialog->y - 500/2, 600, 500) + detail_dialog->x - DTL_W/2, detail_dialog->y - DTL_H/2, DTL_W, DTL_H) { this->mwindow = mwindow; this->detail_dialog = detail_dialog; @@ -775,7 +765,7 @@ DetailAssetDialog::~DetailAssetDialog() void DetailAssetWindow::create_objects() { - int y = 10, x = 10; + int y = yS(10), x = xS(10); char file_name[BCTEXTLEN]; int len = sizeof(info); strncpy(info,_("no info available"),len); @@ -792,7 +782,9 @@ void DetailAssetWindow::create_objects() } } lock_window("DetailAssetWindow::create_objects"); - text = new BC_ScrollTextBox(this, x, y, get_w()-32, 23, info, -len); + int text_h = get_h()-y - BC_OKButton::calculate_h() - yS(15); + int lines = BC_TextBox::pixels_to_rows(this, MEDIUMFONT, text_h); + text = new BC_ScrollTextBox(this, x, y, get_w()-xS(32), lines, info, -len); text->create_objects(); text->set_text_row(0); add_subwindow(new BC_OKButton(this)); show_window(); diff --git a/cinelerra-5.1/cinelerra/assetpopup.C b/cinelerra-5.1/cinelerra/assetpopup.C index 6b717309..5ff3a07b 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.C +++ b/cinelerra-5.1/cinelerra/assetpopup.C @@ -164,10 +164,11 @@ int AssetPopupInfo::handle_event() popup->gui->get_abs_cursor(cur_x, cur_y); int n = mwindow->session->drag_assets->size(); if( n > 0 ) { + int xs30 = xS(30), ys30 = yS(30); for( int i=0; iawindow->get_asset_editor(); asset_edit->edit_asset( - mwindow->session->drag_assets->values[i], cur_x-30*i, cur_y-30*i); + mwindow->session->drag_assets->values[i], cur_x-xs30*i, cur_y-ys30*i); } } else if( mwindow->session->drag_clips->size() ) { @@ -573,11 +574,13 @@ void AssetCopyDialog::handle_close_event(int result) copy_window = 0; } +#define ACW_W xS(500) +#define ACW_H yS(200) AssetCopyWindow::AssetCopyWindow(AssetCopyDialog *copy_dialog) : BC_Window(_(PROGRAM_NAME ": Copy File List"), - copy_dialog->x - 500/2, copy_dialog->y - 200/2, - 500, 200, 500, 200, 1, 0, 1) + copy_dialog->x - ACW_W/2, copy_dialog->y - ACW_H/2, + ACW_W, ACW_H, ACW_W, ACW_H, 1, 0, 1) { this->copy_dialog = copy_dialog; } @@ -590,11 +593,13 @@ void AssetCopyWindow::create_objects() { lock_window("AssetCopyWindow::create_objects"); BC_Title *title; - int x = 10, y = 10, pad = 5; + int xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10); + int x = xs10, y = ys10; add_subwindow(title = new BC_Title(x, y, _("List of asset paths:"))); - y += title->get_h() + pad; + y += title->get_h() + ys5; int text_w = get_w() - x - 10; - int text_h = get_h() - y - BC_OKButton::calculate_h() - pad; + int text_h = get_h() - y - BC_OKButton::calculate_h() - ys5; int text_rows = BC_TextBox::pixels_to_rows(this, MEDIUMFONT, text_h); char *text = copy_dialog->text; int len = strlen(text) + BCTEXTLEN; @@ -608,9 +613,9 @@ void AssetCopyWindow::create_objects() int AssetCopyWindow::resize_event(int w, int h) { - int fx = file_list->get_x(), fy = file_list->get_y(), pad = 5; - int text_w = w - fx - 10; - int text_h = h - fy - BC_OKButton::calculate_h() - pad; + int fx = file_list->get_x(), fy = file_list->get_y(); + int text_w = w - fx - xS(10); + int text_h = h - fy - BC_OKButton::calculate_h() - yS(5); int text_rows = BC_TextBox::pixels_to_rows(this, MEDIUMFONT, text_h); file_list->reposition_window(fx, fy, text_w, text_rows); return 0; @@ -701,10 +706,13 @@ void AssetPasteDialog::start(int x, int y) BC_DialogThread::start(); } +#define APW_W xS(500) +#define APW_H yS(200) + AssetPasteWindow::AssetPasteWindow(AssetPasteDialog *paste_dialog) : BC_Window(_(PROGRAM_NAME ": Paste File List"), - paste_dialog->x - 500/2, paste_dialog->y - 200/2, - 500, 200, 500, 200, 1, 0, 1) + paste_dialog->x - APW_W/2, paste_dialog->y - APW_H/2, + APW_W, APW_H, APW_W, APW_H, 1, 0, 1) { this->paste_dialog = paste_dialog; } @@ -717,11 +725,13 @@ void AssetPasteWindow::create_objects() { lock_window("AssetPasteWindow::create_objects()"); BC_Title *title; - int x = 10, y = 10, pad = 5; + int xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10); + int x = xs10, y = ys10; add_subwindow(title = new BC_Title(x, y, _("Enter list of asset paths:"))); - y += title->get_h() + pad; - int text_w = get_w() - x - 10; - int text_h = get_h() - y - BC_OKButton::calculate_h() - pad; + y += title->get_h() + ys5; + int text_w = get_w() - x - xs10; + int text_h = get_h() - y - BC_OKButton::calculate_h() - ys5; int text_rows = BC_TextBox::pixels_to_rows(this, MEDIUMFONT, text_h); file_list = new BC_ScrollTextBox(this, x, y, text_w, text_rows, (char*)0, 65536); file_list->create_objects(); @@ -733,9 +743,9 @@ void AssetPasteWindow::create_objects() int AssetPasteWindow::resize_event(int w, int h) { - int fx = file_list->get_x(), fy = file_list->get_y(), pad = 5; - int text_w = w - fx - 10; - int text_h = h - fy - BC_OKButton::calculate_h() - pad; + int fx = file_list->get_x(), fy = file_list->get_y(); + int text_w = w - fx - xS(10); + int text_h = h - fy - BC_OKButton::calculate_h() - yS(5); int text_rows = BC_TextBox::pixels_to_rows(this, MEDIUMFONT, text_h); file_list->reposition_window(fx, fy, text_w, text_rows); return 0; diff --git a/cinelerra-5.1/cinelerra/assetremove.C b/cinelerra-5.1/cinelerra/assetremove.C index 49e82414..564c18cf 100644 --- a/cinelerra-5.1/cinelerra/assetremove.C +++ b/cinelerra-5.1/cinelerra/assetremove.C @@ -32,13 +32,7 @@ AssetRemoveWindow::AssetRemoveWindow(MWindow *mwindow) : BC_Window(_(PROGRAM_NAME ": Remove assets"), mwindow->gui->get_abs_cursor_x(1), mwindow->gui->get_abs_cursor_y(1), - 320, - 400, - -1, - -1, - 0, - 0, - 1) + xS(320), yS(400), -1, -1, 0, 0, 1) { this->mwindow = mwindow; data = 0; @@ -54,7 +48,7 @@ AssetRemoveWindow::~AssetRemoveWindow() void AssetRemoveWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); int margin = mwindow->theme->widget_border; data = new ArrayList; diff --git a/cinelerra-5.1/cinelerra/auto.C b/cinelerra-5.1/cinelerra/auto.C index f1cf457d..4171fa83 100644 --- a/cinelerra-5.1/cinelerra/auto.C +++ b/cinelerra-5.1/cinelerra/auto.C @@ -30,8 +30,8 @@ Auto::Auto() this->autos = 0; position = 0; skip = 0; - WIDTH = 10; - HEIGHT = 10; + WIDTH = xS(10); + HEIGHT = yS(10); is_default = 0; } @@ -42,8 +42,8 @@ Auto::Auto(EDL *edl, Autos *autos) this->autos = autos; position = 0; skip = 0; - WIDTH = 10; - HEIGHT = 10; + WIDTH = xS(10); + HEIGHT = yS(10); is_default = 0; } diff --git a/cinelerra-5.1/cinelerra/avc1394transport.C b/cinelerra-5.1/cinelerra/avc1394transport.C index 7ff3a509..ba961769 100644 --- a/cinelerra-5.1/cinelerra/avc1394transport.C +++ b/cinelerra-5.1/cinelerra/avc1394transport.C @@ -111,7 +111,7 @@ void AVC1394Transport::create_objects() window->add_subwindow(end_button = new AVC1394GUISeekEnd(mwindow, avc, x, y)); x += end_button->get_w(); - x_end = x + 10; + x_end = x + xS(10); } @@ -156,7 +156,7 @@ void AVC1394Transport::reposition_window(int x, int y) x += fforward_button->get_w(); end_button->reposition_window(x, y); - x_end = x + 10; + x_end = x + xS(10); } diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index f668ee51..03c8f221 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -1258,7 +1258,7 @@ AWindowGUI::AWindowGUI(MWindow *mwindow, AWindow *awindow) : BC_Window(_(PROGRAM_NAME ": Resources"), mwindow->session->awindow_x, mwindow->session->awindow_y, mwindow->session->awindow_w, mwindow->session->awindow_h, - 100, 100, 1, 1, 1) + xS(100), yS(100), 1, 1, 1) { this->mwindow = mwindow; this->awindow = awindow; @@ -1422,6 +1422,7 @@ void AWindowGUI::plugin_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, un void AWindowGUI::create_objects() { + int ys5 = yS(5), ys10 = yS(10); lock_window("AWindowGUI::create_objects"); asset_titles[0] = C_("Title"); asset_titles[1] = _("Comments"); @@ -1482,9 +1483,9 @@ void AWindowGUI::create_objects() int x1 = mwindow->theme->alist_x, y1 = mwindow->theme->alist_y; int w1 = mwindow->theme->alist_w, h1 = mwindow->theme->alist_h; - search_text = new AWindowSearchText(mwindow, this, x1, y1+5); + search_text = new AWindowSearchText(mwindow, this, x1, y1+ys5); search_text->create_objects(); - int dy = search_text->get_h() + 10; + int dy = search_text->get_h() + ys10; y1 += dy; h1 -= dy; add_subwindow(asset_list = new AWindowAssets(mwindow, this, x1, y1, w1, h1)); @@ -1507,7 +1508,7 @@ void AWindowGUI::create_objects() int nw = get_text_width(MEDIUMFONT, _(av_names[i])); if( tw < nw ) tw = nw; } - int pw = BC_PopupMenu::calculate_w(16, tw, 1); + int pw = BC_PopupMenu::calculate_w(xS(16), tw, 1); const char *text = _(AVIconDrawing::avicon_names[vicon_drawing]); add_subwindow(avicon_drawing = new AVIconDrawing(this, fw, fy, pw, text)); avicon_drawing->create_objects(); @@ -1596,10 +1597,11 @@ int AWindowGUI::translation_event() void AWindowGUI::reposition_objects() { + int ys5 = yS(5), ys10 = yS(10); int x1 = mwindow->theme->alist_x, y1 = mwindow->theme->alist_y; int w1 = mwindow->theme->alist_w, h1 = mwindow->theme->alist_h; - search_text->reposition_window(x1, y1+5, w1); - int dy = search_text->get_h() + 10; + search_text->reposition_window(x1, y1+ys5, w1); + int dy = search_text->get_h() + ys10; y1 += dy; h1 -= dy; asset_list->reposition_window(x1, y1, w1, h1); divider->reposition_window( @@ -1738,7 +1740,9 @@ void AWindowGUI::hide_tip_info() AWindowRemovePluginGUI:: AWindowRemovePluginGUI(AWindow *awindow, AWindowRemovePlugin *thread, int x, int y, PluginServer *plugin) - : BC_Window(_(PROGRAM_NAME ": Remove plugin"), x,y, 500,200, 50, 50, 1, 0, 1, -1, "", 1) + : BC_Window(_(PROGRAM_NAME ": Remove plugin"), x,y, + xS(500),yS(200), xS(50), yS(50), + 1, 0, 1, -1, "", 1) { this->awindow = awindow; this->thread = thread; @@ -1758,17 +1762,19 @@ AWindowRemovePluginGUI:: void AWindowRemovePluginGUI::create_objects() { + int xs10 = xS(10), xs20 = xS(20); + int ys5 = yS(5), ys10 = yS(10); lock_window("AWindowRemovePluginGUI::create_objects"); BC_Button *ok_button = new BC_OKButton(this); add_subwindow(ok_button); BC_Button *cancel_button = new BC_CancelButton(this); add_subwindow(cancel_button); - int x = 10, y = 10; + int x = xs10, y = ys10; BC_Title *title = new BC_Title(x, y, _("remove plugin?")); add_subwindow(title); - y += title->get_h() + 5; + y += title->get_h() + ys5; list = new BC_ListBox(x, y, - get_w() - 20, ok_button->get_y() - y - 5, LISTBOX_TEXT, &plugin_list, + get_w() - xs20, ok_button->get_y() - y - ys5, LISTBOX_TEXT, &plugin_list, 0, 0, 1, 0, 0, LISTBOX_SINGLE, ICON_LEFT, 0); add_subwindow(list); show_window(); @@ -2496,7 +2502,7 @@ int AWindowDivider::button_press_event() int AWindowDivider::cursor_motion_event() { if( mwindow->session->current_operation == DRAG_PARTITION ) { - int wmin = 25; + int wmin = xS(25); int wmax = mwindow->session->awindow_w - mwindow->theme->adivider_w - wmin; int fw = gui->get_relative_cursor_x(); if( fw > wmax ) fw = wmax; @@ -2887,7 +2893,7 @@ void AWindowAssets::draw_background() set_font(LARGEFONT); int folder = mwindow->edl->session->awindow_folder; const char *title = mwindow->edl->get_folder_name(folder); - draw_text(get_w() - get_text_width(LARGEFONT, title) - 4, 30, + draw_text(get_w() - get_text_width(LARGEFONT, title) - xS(4), yS(30), title, -1, get_bg_surface()); } @@ -3129,11 +3135,10 @@ int AWindowAssets::mouse_over_event(int no) void AWindowAssets::show_tip_info(const char *info, int no) { - int margin = 28; int tw = get_text_width(MEDIUMFONT, info) + TOOLTIP_MARGIN * 2; int th = get_text_height(MEDIUMFONT, info) + TOOLTIP_MARGIN * 2; - int tx = get_w() - (tw + margin); - int ty = get_h() - (th + margin); + int tx = get_w() - (tw + xS(28)); + int ty = get_h() - (th + yS(28)); show_tooltip(info, tx, ty, tw, th); info_tip = no; } @@ -3166,10 +3171,11 @@ AWindowSearchText::AWindowSearchText(MWindow *mwindow, AWindowGUI *gui, int x, i void AWindowSearchText::create_objects() { - int x1 = x, y1 = y, margin = 10; + int xs10 = xS(10); + int x1 = x, y1 = y; gui->add_subwindow(text_title = new BC_Title(x1, y1, _("Search:"))); - x1 += text_title->get_w() + margin; - int w1 = gui->get_w() - x1 - 2*margin; + x1 += text_title->get_w() + xs10; + int w1 = gui->get_w() - x1 - 2*xs10; gui->add_subwindow(text_box = new AWindowSearchTextBox(this, x1, y1, w1)); } @@ -3181,7 +3187,7 @@ int AWindowSearchText::handle_event() int AWindowSearchText::get_w() { - return text_box->get_w() + text_title->get_w() + 10; + return text_box->get_w() + text_title->get_w() + xS(10); } int AWindowSearchText::get_h() @@ -3191,10 +3197,11 @@ int AWindowSearchText::get_h() void AWindowSearchText::reposition_window(int x, int y, int w) { - int x1 = x, y1 = y, margin = 10; + int xs10 = xS(10); + int x1 = x, y1 = y; text_title->reposition_window(x1, y1); - x1 += text_title->get_w() + margin; - int w1 = gui->get_w() - x1 - 2*margin; + x1 += text_title->get_w() + xs10; + int w1 = gui->get_w() - x1 - 2*xs10; text_box->reposition_window(x1, y1, w1); } diff --git a/cinelerra-5.1/cinelerra/batchrender.C b/cinelerra-5.1/cinelerra/batchrender.C index 6f1129f0..734ee3aa 100644 --- a/cinelerra-5.1/cinelerra/batchrender.C +++ b/cinelerra-5.1/cinelerra/batchrender.C @@ -316,7 +316,7 @@ void BatchRenderThread::load_defaults(BC_Hash *defaults) for( int i = 0; i < BATCHRENDER_COLUMNS; i++ ) { char string[BCTEXTLEN]; sprintf(string, "BATCHRENDER_COLUMN%d", i); - list_width[i] = defaults->get(string, column_widths[i]); + list_width[i] = defaults->get(string, xS(column_widths[i])); } } @@ -724,7 +724,7 @@ void BatchRenderThread::trap_hook(FILE *fp, void *vp) BatchRenderGUI::BatchRenderGUI(MWindow *mwindow, BatchRenderThread *thread, int x, int y, int w, int h) : BC_Window(_(PROGRAM_NAME ": Batch Render"), - x, y, w, h, 730, 400, 1, 0, 1) + x, y, w, h, xS(730), yS(400), 1, 0, 1) { this->mwindow = mwindow; this->thread = thread; @@ -743,21 +743,23 @@ BatchRenderGUI::~BatchRenderGUI() void BatchRenderGUI::create_objects() { + int xs10 = xS(10), xs30 = xS(30), xs40 = xS(40); + int ys5 = yS(5), ys10 = yS(10), ys15 = yS(15); lock_window("BatchRenderGUI::create_objects"); mwindow->theme->get_batchrender_sizes(this, get_w(), get_h()); create_list(0); int x = mwindow->theme->batchrender_x1; - int y = 5; - int x1 = x, x2 = get_w()/2 + 30; // mwindow->theme->batchrender_x2; - int y1 = 5, y2 = 5; + int y = ys5; + int x1 = x, x2 = get_w()/2 + xs30; // mwindow->theme->batchrender_x2; + int y1 = ys5, y2 = ys5; // output file add_subwindow(output_path_title = new BC_Title(x1, y1, _("Output path:"))); y1 += output_path_title->get_h() + mwindow->theme->widget_border; format_tools = new BatchFormat(mwindow, this, thread->get_current_asset()); - format_tools->set_w(x2 - 40); + format_tools->set_w(x2 - xs40); BatchRenderJob *current_job = thread->get_current_job(); format_tools->create_objects(x1, y1, 1, 1, 1, 1, 0, 1, 0, 0, thread->do_labeled ? ¤t_job->labeled : 0, 0); @@ -767,7 +769,7 @@ void BatchRenderGUI::create_objects() use_renderfarm = new BatchRenderUseFarm(thread, x1, y1, ¤t_job->farmed); add_subwindow(use_renderfarm); - y1 += use_renderfarm->get_h() + 10; + y1 += use_renderfarm->get_h() + ys10; if( thread->do_farmed < 0 ) use_renderfarm->disable(); } @@ -778,7 +780,7 @@ void BatchRenderGUI::create_objects() x = x2; y = y2; add_subwindow(edl_path_text = new BatchRenderEDLPath( thread, - x, y, get_w()-x - 40, thread->get_current_edl())); + x, y, get_w()-x - xs40, thread->get_current_edl())); x = x2 + edl_path_text->get_w(); add_subwindow(edl_path_browse = new BrowseButton( mwindow->theme, this, edl_path_text, x, y, thread->get_current_edl(), @@ -809,15 +811,15 @@ void BatchRenderGUI::create_objects() add_subwindow(batch_path = new BC_Title(x1, y, thread->batch_path, MEDIUMFONT)); y += list_title->get_h() + mwindow->theme->widget_border; y1 = get_h(); - y1 -= 15 + BC_GenericButton::calculate_h() + mwindow->theme->widget_border; + y1 -= ys15 + BC_GenericButton::calculate_h() + mwindow->theme->widget_border; add_subwindow(batch_list = new BatchRenderList(thread, x, y, - get_w() - x - 10, y1 - y)); + get_w() - x - xs10, y1 - y)); y += batch_list->get_h() + mwindow->theme->widget_border; add_subwindow(start_button = new BatchRenderStart(thread, x, y)); x = get_w() / 2 - BC_GenericButton::calculate_w(this, _("Stop")) / 2; add_subwindow(stop_button = new BatchRenderStop(thread, x, y)); - x = get_w() - BC_GenericButton::calculate_w(this, _("Close")) - 10; + x = get_w() - BC_GenericButton::calculate_w(this, _("Close")) - xs10; add_subwindow(cancel_button = new BatchRenderCancel(thread, x, y)); show_window(1); @@ -843,14 +845,16 @@ void BatchRenderGUI::button_enable() int BatchRenderGUI::resize_event(int w, int h) { + int xs10 = xS(10), xs40 = xS(40); + int ys5 = yS(5), ys15 = yS(15); mwindow->session->batchrender_w = w; mwindow->session->batchrender_h = h; mwindow->theme->get_batchrender_sizes(this, w, h); int x = mwindow->theme->batchrender_x1; - int y = 5; - int x1 = x, x2 = get_w()/2 + 10; // mwindow->theme->batchrender_x2; - int y1 = 5, y2 = 5; + int y = ys5; + int x1 = x, x2 = get_w()/2 + xs10; // mwindow->theme->batchrender_x2; + int y1 = ys5, y2 = ys5; // output file output_path_title->reposition_window(x1, y1); @@ -862,7 +866,7 @@ int BatchRenderGUI::resize_event(int w, int h) x = x2, y = y2; edl_path_title->reposition_window(x, y); y += edl_path_title->get_h() + mwindow->theme->widget_border; - edl_path_text->reposition_window(x, y, w - x - 40); + edl_path_text->reposition_window(x, y, w - x - xs40); x += edl_path_text->get_w(); edl_path_browse->reposition_window(x, y); y2 = y + edl_path_browse->get_h() + mwindow->theme->widget_border; @@ -883,20 +887,20 @@ int BatchRenderGUI::resize_event(int w, int h) y += loadlist_batch->get_h() + mwindow->theme->widget_border; warning->reposition_window(x2, y); - y1 = 15 + BC_GenericButton::calculate_h() + mwindow->theme->widget_border; + y1 = ys15 + BC_GenericButton::calculate_h() + mwindow->theme->widget_border; y2 = get_h() - y1 - batch_list->get_h(); y2 -= list_title->get_h() + mwindow->theme->widget_border; x = mwindow->theme->batchrender_x1; y = y2; list_title->reposition_window(x, y); y += list_title->get_h() + mwindow->theme->widget_border; - batch_list->reposition_window(x, y, w - x - 10, h - y - y1); + batch_list->reposition_window(x, y, w - x - xs10, h - y - y1); y += batch_list->get_h() + mwindow->theme->widget_border; start_button->reposition_window(x, y); x = w / 2 - stop_button->get_w() / 2; stop_button->reposition_window(x, y); - x = w - cancel_button->get_w() - 10; + x = w - cancel_button->get_w() - xs10; cancel_button->reposition_window(x, y); return 1; } @@ -1103,7 +1107,8 @@ void BatchRenderSaveList::run() char default_path[BCTEXTLEN]; sprintf(default_path, "~"); thread->mwindow->defaults->get("DEFAULT_BATCHLOADPATH", default_path); - BC_FileBox filewindow(100, 100, default_path, _("Save Batch Render List"), + BC_FileBox filewindow(xS(100), yS(100), default_path, + _("Save Batch Render List"), _("Enter a Batch Render filename to save as:"), 0, 0, 0, 0); gui = &filewindow; @@ -1181,7 +1186,7 @@ void BatchRenderLoadList::run() char default_path[BCTEXTLEN]; sprintf(default_path, "~"); thread->mwindow->defaults->get("DEFAULT_BATCHLOADPATH", default_path); - BC_FileBox filewindow(100, 100, default_path, _("Load Batch Render List"), + BC_FileBox filewindow(xS(100), yS(100), default_path, _("Load Batch Render List"), _("Enter a Batch Render filename to load from:"), 0, 0, 0, 0); gui = &filewindow; diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C index 6ebaa967..5251979e 100644 --- a/cinelerra-5.1/cinelerra/bdcreate.C +++ b/cinelerra-5.1/cinelerra/bdcreate.C @@ -478,7 +478,7 @@ BC_Window* CreateBD_Thread::new_gui() int scr_x = mwindow->gui->get_screen_x(0, -1); int scr_w = mwindow->gui->get_screen_w(0, -1); int scr_h = mwindow->gui->get_screen_h(0, -1); - int w = 500, h = 290; + int w = xS(500), h = yS(290); int x = scr_x + scr_w/2 - w/2, y = scr_h/2 - h/2; gui = new CreateBD_GUI(this, x, y, w, h); @@ -709,7 +709,7 @@ CreateBD_WideAudio::~CreateBD_WideAudio() CreateBD_GUI::CreateBD_GUI(CreateBD_Thread *thread, int x, int y, int w, int h) - : BC_Window(_(PROGRAM_NAME ": Create BD"), x, y, w, h, 50, 50, 1, 0, 1) + : BC_Window(_(PROGRAM_NAME ": Create BD"), x, y, w, h, xS(50), yS(50), 1, 0, 1) { this->thread = thread; at_x = at_y = tmp_x = tmp_y = 0; @@ -739,20 +739,23 @@ CreateBD_GUI::~CreateBD_GUI() void CreateBD_GUI::create_objects() { + int xs10 = xS(10), xs30 = xS(30), xs35 = xS(35); + int xs160 = xS(160), xs170 = xS(170); + int ys5 = yS(5), ys10 = yS(10); lock_window("CreateBD_GUI::create_objects"); - int pady = BC_TextBox::calculate_h(this, MEDIUMFONT, 0, 1) + 5; + int pady = BC_TextBox::calculate_h(this, MEDIUMFONT, 0, 1) + ys5; int padx = BC_Title::calculate_w(this, (char*)"X", MEDIUMFONT); int x = padx/2, y = pady/2; BC_Title *title = new BC_Title(x, y, _("Title:"), MEDIUMFONT, YELLOW); add_subwindow(title); at_x = x + title->get_w(); at_y = y; - asset_title = new CreateBD_AssetTitle(this, at_x, at_y, get_w()-at_x-10); + asset_title = new CreateBD_AssetTitle(this, at_x, at_y, get_w()-at_x-xs10); add_subwindow(asset_title); y += title->get_h() + pady/2; title = new BC_Title(x, y, _("Work path:"), MEDIUMFONT, YELLOW); add_subwindow(title); tmp_x = x + title->get_w(); tmp_y = y; - tmp_path = new CreateBD_TmpPath(this, tmp_x, tmp_y, get_w()-tmp_x-35); + tmp_path = new CreateBD_TmpPath(this, tmp_x, tmp_y, get_w()-tmp_x-xs35); add_subwindow(tmp_path); btmp_path = new BrowseButton(thread->mwindow->theme, this, tmp_path, tmp_x+tmp_path->get_w(), tmp_y, "/tmp", @@ -761,7 +764,7 @@ void CreateBD_GUI::create_objects() y += title->get_h() + pady/2; disk_space = new CreateBD_DiskSpace(this, x, y); add_subwindow(disk_space); - int x0 = get_w() - 170; + int x0 = get_w() - xs170; title = new BC_Title(x0, y, _("Media:"), MEDIUMFONT, YELLOW); add_subwindow(title); int x1 = x0+title->get_w()+padx; @@ -779,7 +782,7 @@ void CreateBD_GUI::create_objects() add_subwindow(standard); standard->create_objects(); standard->set_text(bd_formats[thread->use_standard].name); - x0 -= 30; + x0 -= xs30; title = new BC_Title(x0, y, _("Scale:"), MEDIUMFONT, YELLOW); add_subwindow(title); x1 = x0+title->get_w()+padx; @@ -794,9 +797,9 @@ void CreateBD_GUI::create_objects() need_histogram = new CreateBD_Histogram(this, x1, y); add_subwindow(need_histogram); y += need_histogram->get_h() + pady/2; - non_standard = new BC_Title(x1, y+5, "", MEDIUMFONT, RED); + non_standard = new BC_Title(x1, y+ys5, "", MEDIUMFONT, RED); add_subwindow(non_standard); - x1 += 160; y = y1; + x1 += xs160; y = y1; need_inverse_telecine = new CreateBD_InverseTelecine(this, x1, y); add_subwindow(need_inverse_telecine); y += need_inverse_telecine->get_h() + pady/2; @@ -805,7 +808,7 @@ void CreateBD_GUI::create_objects() y += need_wide_audio->get_h() + pady/2; need_resize_tracks = new CreateBD_ResizeTracks(this, x1, y); add_subwindow(need_resize_tracks); - x1 += 160; y = y1; + x1 += xs160; y = y1; need_labeled = new CreateBD_LabelChapters(this, x1, y); add_subwindow(need_labeled); y += need_labeled->get_h() + pady/2; @@ -813,14 +816,14 @@ void CreateBD_GUI::create_objects() add_subwindow(need_farmed); ok_w = BC_OKButton::calculate_w(); ok_h = BC_OKButton::calculate_h(); - ok_x = 10; - ok_y = get_h() - ok_h - 10; + ok_x = xs10; + ok_y = get_h() - ok_h - xs10; ok = new CreateBD_OK(this, ok_x, ok_y); add_subwindow(ok); cancel_w = BC_CancelButton::calculate_w(); cancel_h = BC_CancelButton::calculate_h(); - cancel_x = get_w() - cancel_w - 10, - cancel_y = get_h() - cancel_h - 10; + cancel_x = get_w() - cancel_w - xs10, + cancel_y = get_h() - cancel_h - ys10; cancel = new CreateBD_Cancel(this, cancel_x, cancel_y); add_subwindow(cancel); show_window(); @@ -829,13 +832,15 @@ void CreateBD_GUI::create_objects() int CreateBD_GUI::resize_event(int w, int h) { - asset_title->reposition_window(at_x, at_y, get_w()-at_x-10); - tmp_path->reposition_window(tmp_x, tmp_y, get_w()-tmp_x-35); + int xs10 = xS(10), xs35 = xS(35); + int ys10 = yS(10); + asset_title->reposition_window(at_x, at_y, get_w()-at_x-xs10); + tmp_path->reposition_window(tmp_x, tmp_y, get_w()-tmp_x-xs35); btmp_path->reposition_window(tmp_x+tmp_path->get_w(), tmp_y); - ok_y = h - ok_h - 10; + ok_y = h - ok_h - ys10; ok->reposition_window(ok_x, ok_y); - cancel_x = w - cancel_w - 10, - cancel_y = h - cancel_h - 10; + cancel_x = w - cancel_w - xs10, + cancel_y = h - cancel_h - ys10; cancel->reposition_window(cancel_x, cancel_y); return 0; } @@ -1018,7 +1023,7 @@ int CreateBD_FormatItem::handle_event() CreateBD_Format::CreateBD_Format(CreateBD_GUI *gui, int x, int y) - : BC_PopupMenu(x, y, 180, bd_formats[gui->thread->use_standard].name, 1) + : BC_PopupMenu(x, y, xS(180), bd_formats[gui->thread->use_standard].name, 1) { this->gui = gui; } @@ -1073,7 +1078,7 @@ int CreateBD_ScaleItem::handle_event() CreateBD_Scale::CreateBD_Scale(CreateBD_GUI *gui, int x, int y) - : BC_PopupMenu(x, y, 100, "", 1) + : BC_PopupMenu(x, y, xS(100), "", 1) { this->gui = gui; } @@ -1099,7 +1104,7 @@ int CreateBD_Scale::handle_event() CreateBD_MediaSize::CreateBD_MediaSize(CreateBD_GUI *gui, int x, int y) - : BC_PopupTextBox(gui, 0, 0, x, y, 70,50) + : BC_PopupTextBox(gui, 0, 0, x, y, xS(70),yS(50)) { this->gui = gui; } diff --git a/cinelerra-5.1/cinelerra/binfolder.C b/cinelerra-5.1/cinelerra/binfolder.C index e8a8411d..4dfc2f89 100644 --- a/cinelerra-5.1/cinelerra/binfolder.C +++ b/cinelerra-5.1/cinelerra/binfolder.C @@ -826,7 +826,7 @@ BinFolderTargetPatterns::~BinFolderTargetPatterns() { delete [] text; } - + void BinFolderTargetPatterns::save_xml(FileXML *file) {} void BinFolderTargetPatterns::load_xml(FileXML *file) {} @@ -1458,10 +1458,10 @@ void BinFolderList::create_objects() list_titles[FOLDER_COLUMN_TARGET] = _("Target"); list_titles[FOLDER_COLUMN_OP] = _("Op"); list_titles[FOLDER_COLUMN_VALUE] = _("Value"); - list_width[FOLDER_COLUMN_ENABLE] = 80; - list_width[FOLDER_COLUMN_TARGET] = 80; - list_width[FOLDER_COLUMN_OP] = 50; - list_width[FOLDER_COLUMN_VALUE] = 180; + list_width[FOLDER_COLUMN_ENABLE] = xS(80); + list_width[FOLDER_COLUMN_TARGET] = xS(80); + list_width[FOLDER_COLUMN_OP] = xS(50); + list_width[FOLDER_COLUMN_VALUE] = xS(180); load_defaults(mwindow->defaults); create_list(); add_subwindow(enabled_popup = new BinFolderEnabledPopup(this)); @@ -1524,11 +1524,11 @@ int BinFolderList::selection_changed() break; case FOLDER_COLUMN_VALUE: { modify_target->close_window(); - int cw = filter->target->type == FOLDER_TARGET_PATTERNS ? 400 : 320; - int ch = filter->target->type == FOLDER_TARGET_PATTERNS ? 300 : 120; + int cw = xS(filter->target->type == FOLDER_TARGET_PATTERNS ? 400 : 320); + int ch = yS(filter->target->type == FOLDER_TARGET_PATTERNS ? 300 : 120); int cx, cy; get_abs_cursor(cx, cy); - if( (cx-=cw/2) < 50 ) cx = 50; - if( (cy-=ch/2) < 50 ) cy = 50; + if( (cx-=cw/2) < xS(50) ) cx = xS(50); + if( (cy-=ch/2) < yS(50) ) cy = yS(50); modify_target->start(filter->target, cx, cy, cw, ch); break; } } @@ -1671,7 +1671,7 @@ int BinFolderApplyFilter::handle_event() NewFolderGUI::NewFolderGUI(NewFolderThread *thread, int x, int y, int w, int h) : BC_Window(_(PROGRAM_NAME ": New folder"), - x, y, w, h, -1, -1, 0, 0, 1) + x, y, xS(w), yS(h), -1, -1, 0, 0, 1) { this->thread = thread; } @@ -1682,13 +1682,15 @@ NewFolderGUI::~NewFolderGUI() void NewFolderGUI::create_objects() { + int xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10); lock_window("NewFolderGUI::create_objects"); - int x = 10, y = 10; + int x = xs10, y = ys10; BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Folder name:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; const char *text = !thread->is_clips ? _("media bin") : _("clip bin"); - add_subwindow(text_box = new BC_TextBox(x, y, 300, 1, text)); + add_subwindow(text_box = new BC_TextBox(x, y, xS(300), 1, text)); add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); show_window(); @@ -1743,7 +1745,7 @@ void NewFolderThread::handle_close_event(int result) } ModifyFolderGUI::ModifyFolderGUI(ModifyFolderThread *thread, int x, int y, int w, int h) - : BC_Window(_(PROGRAM_NAME ": Modify folder"), x, y, w, h, 320, 200, 1, 0, 1) + : BC_Window(_(PROGRAM_NAME ": Modify folder"), x, y, w, h, xS(320), yS(200), 1, 0, 1) { this->thread = thread; } @@ -1771,28 +1773,30 @@ void ModifyFolderGUI::async_update_filters() void ModifyFolderGUI::create_objects() { + int xs10 = xS(10), xs15 = xS(15); + int ys10 = yS(10), ys30 = yS(30); lock_window("ModifyFolderGUI::create_objects"); modify_folder_xatom = create_xatom("CWINDOWGUI_UPDATE_FILTERS"); - int x = 10, y = 10; + int x = xs10, y = ys10; BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Enter the name of the folder:"))); const char *text = !thread->folder->is_clips ? _("Media") : _("Clips"); int tw = BC_Title::calculate_w(this, text, LARGEFONT); - int x0 = get_w() - 50 - tw; + int x0 = get_w() - xS(50) - tw; add_subwindow(text_title = new BC_Title(x0, y, text, LARGEFONT, YELLOW)); - y += title->get_h() + 10; - add_subwindow(text_box = new BC_TextBox(x, y, 300, 1, thread->folder->title)); - y += text_box->get_h() + 10; - int lh = get_h() - y - BC_OKButton::calculate_h() - 30; - int lw = get_w() - x - 160; + y += title->get_h() + ys10; + add_subwindow(text_box = new BC_TextBox(x, y, xS(300), 1, thread->folder->title)); + y += text_box->get_h() + ys10; + int lh = get_h() - y - BC_OKButton::calculate_h() - ys30; + int lw = get_w() - x - xS(160); add_subwindow(folder_list = new BinFolderList(thread->folder, thread->agui->mwindow, this, x, y, lw, lh)); folder_list->create_objects(); - int x1 = x + folder_list->get_w() + 15, y1 = y; + int x1 = x + folder_list->get_w() + xs15, y1 = y; add_subwindow(add_filter = new BinFolderAddFilter(folder_list, x1, y1)); - y1 += add_filter->get_h() + 10; + y1 += add_filter->get_h() + ys10; add_subwindow(del_filter = new BinFolderDelFilter(folder_list, x1, y1)); - y1 += del_filter->get_h() + 10; + y1 += del_filter->get_h() + ys10; add_subwindow(apply_filter = new BinFolderApplyFilter(folder_list, x1, y1)); add_subwindow(ok_button = new BC_OKButton(this)); add_subwindow(cancel_button = new BC_CancelButton(this)); @@ -1810,10 +1814,10 @@ int ModifyFolderGUI::resize_event(int w, int h) text_title->reposition_window(tx, ty); int lx = folder_list->get_x(); int ly = folder_list->get_y(); - int lh = h - ly - BC_OKButton::calculate_h() - 30; - int lw = w - lx - 160; + int lh = h - ly - BC_OKButton::calculate_h() - yS(30); + int lw = w - lx - xS(160); folder_list->reposition_window(lx, ly, lw, lh); - int x1 = lx + lw + 15; + int x1 = lx + lw + xS(15); add_filter->reposition_window(x1, add_filter->get_y()); del_filter->reposition_window(x1, del_filter->get_y()); apply_filter->reposition_window(x1,apply_filter->get_y()); @@ -1936,7 +1940,7 @@ void ModifyTargetThread::handle_close_event(int result) ModifyTargetGUI::ModifyTargetGUI(ModifyTargetThread *thread, int allow_resize) : BC_Window(_(PROGRAM_NAME ": Modify target"), - thread->wx, thread->wy, thread->ww, thread->wh, + thread->wx, thread->wy, xS(thread->ww), yS(thread->wh), -1, -1, allow_resize, 0, 1) { this->thread = thread; @@ -1948,10 +1952,12 @@ ModifyTargetGUI::~ModifyTargetGUI() void ModifyTargetGUI::create_objects(BC_TextBox *&text_box) { + int xs10 = xS(10), xs20 = xS(20); + int ys10 = yS(10); lock_window("ModifyTargetGUI::create_objects"); - int x = 10, y = 10; + int x = xs10, y = ys10; const char *text = thread->target->filter->value->get_text(); - add_subwindow(text_box = new BC_TextBox(x, y, get_w()-20, 1, text)); + add_subwindow(text_box = new BC_TextBox(x, y, get_w()-xs20, 1, text)); add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); show_window(); @@ -1978,16 +1984,18 @@ ModifyTargetPatternsGUI::~ModifyTargetPatternsGUI() void ModifyTargetPatternsGUI::create_objects() { + int xs10 = xS(10), xs20 = xS(20); + int ys10 = yS(10), ys20 = yS(20); lock_window("ModifyTargetPatternsGUI::create_objects"); BinFolderTargetPatterns *target = (BinFolderTargetPatterns *)thread->target; - int x = 10, y = 10; + int x = xs10, y = ys10; int text_font = MEDIUMFONT; text_rowsz = get_text_ascent(text_font)+1 + get_text_descent(text_font)+1; - int th = get_h() - y - BC_OKButton::calculate_h() - 20; + int th = get_h() - y - BC_OKButton::calculate_h() - ys20; int rows = th / text_rowsz; int text_len = strlen(target->text); if( text_len < BCTEXTLEN ) text_len = BCTEXTLEN; - scroll_text_box = new BC_ScrollTextBox(this, x, y, get_w()-20, rows, + scroll_text_box = new BC_ScrollTextBox(this, x, y, get_w()-xs20, rows, target->text, 2*text_len); scroll_text_box->create_objects(); add_subwindow(ok_button = new BC_OKButton(this)); @@ -1998,10 +2006,12 @@ void ModifyTargetPatternsGUI::create_objects() int ModifyTargetPatternsGUI::resize_event(int w, int h) { + int xs20 = xS(20); + int ys20 = yS(20); int tx = scroll_text_box->get_x(); int ty = scroll_text_box->get_y(); - int th = h - ty - BC_OKButton::calculate_h() - 20; - int tw = w - 20; + int th = h - ty - BC_OKButton::calculate_h() - ys20; + int tw = w - xs20; int rows = th / text_rowsz; scroll_text_box->reposition_window(tx, ty, tw, rows); ok_button->resize_event(w, h); diff --git a/cinelerra-5.1/cinelerra/bitspopup.C b/cinelerra-5.1/cinelerra/bitspopup.C index 8528ec77..83048639 100644 --- a/cinelerra-5.1/cinelerra/bitspopup.C +++ b/cinelerra-5.1/cinelerra/bitspopup.C @@ -24,15 +24,9 @@ #include "file.h" -BitsPopup::BitsPopup(BC_WindowBase *parent_window, - int x, - int y, - int *output, - int use_ulaw, - int use_adpcm, - int use_float, - int use_32linear, - int use_8linear) +BitsPopup::BitsPopup(BC_WindowBase *parent_window, int x, int y, int *output, + int use_ulaw, int use_adpcm, int use_float, int use_32linear, + int use_8linear) { this->parent_window = parent_window; this->output = output; @@ -79,17 +73,8 @@ int BitsPopup::get_h() } BitsPopupMenu::BitsPopupMenu(BitsPopup *popup, int x, int y) - : BC_ListBox(x, - y, - 120, - 100, - LISTBOX_TEXT, - &popup->bits_items, - 0, - 0, - 1, - 0, - 1) + : BC_ListBox(x, y, xS(120), yS(100), LISTBOX_TEXT, + &popup->bits_items, 0, 0, 1, 0, 1) { this->popup = popup; } @@ -102,7 +87,7 @@ int BitsPopupMenu::handle_event() } BitsPopupText::BitsPopupText(BitsPopup *popup, int x, int y) - : BC_TextBox(x, y, 120, 1, File::bitstostr(*popup->output)) + : BC_TextBox(x, y, xS(120), 1, File::bitstostr(*popup->output)) { this->popup = popup; } diff --git a/cinelerra-5.1/cinelerra/canvas.C b/cinelerra-5.1/cinelerra/canvas.C index be0a2af0..125472ae 100644 --- a/cinelerra-5.1/cinelerra/canvas.C +++ b/cinelerra-5.1/cinelerra/canvas.C @@ -36,20 +36,15 @@ -Canvas::Canvas(MWindow *mwindow, - BC_WindowBase *subwindow, - int x, - int y, - int w, - int h, - int output_w, - int output_h, +Canvas::Canvas(MWindow *mwindow, BC_WindowBase *subwindow, + int x, int y, int w, int h, int output_w, int output_h, int use_scrollbars) { reset(); - if(w < 10) w = 10; - if(h < 10) h = 10; + int xs10 = xS(10), ys10 = yS(10); + if(w < xs10) w = xs10; + if(h < ys10) h = ys10; this->mwindow = mwindow; this->subwindow = subwindow; this->x = x; diff --git a/cinelerra-5.1/cinelerra/channeledit.C b/cinelerra-5.1/cinelerra/channeledit.C index db680c17..57f07856 100644 --- a/cinelerra-5.1/cinelerra/channeledit.C +++ b/cinelerra-5.1/cinelerra/channeledit.C @@ -165,7 +165,7 @@ ChannelEditWindow::ChannelEditWindow(ChannelEditThread *thread, : BC_Window(_(PROGRAM_NAME ": Channels"), channel_picker->mwindow->session->channels_x, channel_picker->mwindow->session->channels_y, - 375, 400, 375, 400, 0, 0, 1) + xS(375), yS(400), xS(375), yS(400), 0, 0, 1) { this->thread = thread; this->channel_picker = channel_picker; @@ -186,8 +186,9 @@ ChannelEditWindow::~ChannelEditWindow() void ChannelEditWindow::create_objects() { + int xs10 = xS(10), ys10 = yS(10), ys30 = yS(30); lock_window("ChannelEditWindow::create_objects"); - int x = 10, y = 10; + int x = xs10, y = ys10; // Create channel list for(int i = 0; i < thread->new_channels->size(); i++) @@ -196,36 +197,36 @@ void ChannelEditWindow::create_objects() } add_subwindow(list_box = new ChannelEditList(this, x, y)); - x += 200; + x += xS(200); if(channel_picker->use_select()) { add_subwindow(new ChannelEditSelect(this, x, y)); - y += 30; + y += ys30; } add_subwindow(new ChannelEditAdd(this, x, y)); - y += 30; + y += ys30; add_subwindow(new ChannelEdit(this, x, y)); - y += 30; + y += ys30; add_subwindow(new ChannelEditMoveUp(this, x, y)); - y += 30; + y += ys30; add_subwindow(new ChannelEditMoveDown(this, x, y)); - y += 30; + y += ys30; add_subwindow(new ChannelEditSort(this, x, y)); - y += 30; + y += ys30; Channel *channel_usage = channel_picker->get_channel_usage(); if(channel_usage && channel_usage->has_scanning) { add_subwindow(new ChannelEditScan(this, x, y)); - y += 30; + y += ys30; } add_subwindow(new ChannelEditDel(this, x, y)); - y += 30; + y += ys30; add_subwindow(new ChannelEditPicture(this, x, y)); - y += 100; - x = 10; + y += yS(100); + x = xs10; add_subwindow(new BC_OKButton(this)); - x += 150; + x += xS(150); add_subwindow(new BC_CancelButton(this)); @@ -430,14 +431,9 @@ int ChannelEditWindow::move_channel_up() temp_text = channel_list.values[number1]; channel_list.values[number1] = channel_list.values[number2]; channel_list.values[number2] = temp_text; - list_box->update(&channel_list, - 0, - 0, - 1, - list_box->get_xposition(), - list_box->get_yposition(), - number1, - 1); + list_box->update(&channel_list, 0, 0, 1, + list_box->get_xposition(), list_box->get_yposition(), + number1, 1); } return 0; } @@ -459,14 +455,9 @@ int ChannelEditWindow::move_channel_down() temp_text = channel_list.values[number1]; channel_list.values[number1] = channel_list.values[number2]; channel_list.values[number2] = temp_text; - list_box->update(&channel_list, - 0, - 0, - 1, - list_box->get_xposition(), - list_box->get_yposition(), - number1, - 1); + list_box->update(&channel_list, 0, 0, 1, + list_box->get_xposition(), list_box->get_yposition(), + number1, 1); } return 0; } @@ -511,12 +502,9 @@ int ChannelEditAdd::handle_event() } ChannelEditList::ChannelEditList(ChannelEditWindow *window, int x, int y) - : BC_ListBox(x, - y, - 185, - window->get_h() - BC_OKButton::calculate_h() - y - 10, - LISTBOX_TEXT, - &(window->channel_list)) + : BC_ListBox(x, y, + xS(185), window->get_h() - BC_OKButton::calculate_h() - y - yS(10), + LISTBOX_TEXT, &(window->channel_list)) { this->window = window; } @@ -633,7 +621,7 @@ int ChannelEditPicture::handle_event() ConfirmScan::ConfirmScan(ChannelEditWindow *gui, int x, int y) : BC_Window(_(PROGRAM_NAME ": Scan confirm"), - x, y, 350, BC_OKButton::calculate_h() + 130, + x, y, xS(350), BC_OKButton::calculate_h() + yS(130), 0, 0, 0, 0, 1) { this->gui = gui; @@ -641,12 +629,14 @@ ConfirmScan::ConfirmScan(ChannelEditWindow *gui, int x, int y) void ConfirmScan::create_objects() { + int xs5 = xS(5), xs10 = xS(10); + int ys10 = yS(10); lock_window("ConfirmScan::create_objects"); - int x = 10, y = 10; + int x = xs10, y = ys10; int y2 = 0, x2 = 0; BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Set parameters for channel scanning."))); - y += title->get_h() + 10; + y += title->get_h() + ys10; y2 = y; add_subwindow(title = new BC_Title(x, y, _("Frequency table:"))); @@ -658,31 +648,22 @@ void ConfirmScan::create_objects() add_subwindow(title = new BC_Title(x, y, _("Input:"))); x2 = MAX(x2, title->get_w()); y += BC_PopupMenu::calculate_h(); - x2 += x + 5; + x2 += x + xs5; y = y2; x = x2; ChannelEditEditFreqtable *table; - add_subwindow(table = new ChannelEditEditFreqtable(x, - y, - 0, - gui->thread)); + add_subwindow(table = new ChannelEditEditFreqtable(x, y, 0, gui->thread)); table->add_items(); - y += table->get_h() + 10; + y += table->get_h() + ys10; ChannelEditEditNorm *norm; - add_subwindow(norm = new ChannelEditEditNorm(x, - y, - 0, - gui->thread)); + add_subwindow(norm = new ChannelEditEditNorm(x, y, 0, gui->thread)); norm->add_items(); - y += norm->get_h() + 10; + y += norm->get_h() + ys10; ChannelEditEditInput *input; - add_subwindow(input = new ChannelEditEditInput(x, - y, - 0, - gui->thread)); + add_subwindow(input = new ChannelEditEditInput(x, y, 0, gui->thread)); input->add_items(); @@ -973,9 +954,9 @@ ChannelEditEditWindow::ChannelEditEditWindow(ChannelEditEditThread *thread, ChannelEditWindow *window, ChannelPicker *channel_picker) : BC_Window(_(PROGRAM_NAME ": Edit Channel"), - channel_picker->parent_window->get_abs_cursor_x(1), + channel_picker->parent_window->get_abs_cursor_x(1), channel_picker->parent_window->get_abs_cursor_y(1), - 390, 300, 390, 300, 0, 0, 1) + xS(390), yS(300), xS(390), yS(300), 0, 0, 1) { this->channel_picker = channel_picker; this->window = window; @@ -987,12 +968,14 @@ ChannelEditEditWindow::~ChannelEditEditWindow() void ChannelEditEditWindow::create_objects(Channel *channel) { + int xs10 = xS(10), xs130 = xS(130); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30); lock_window("ChannelEditEditWindow::create_objects"); this->new_channel = channel; Channel *channel_usage = channel_picker->get_channel_usage(); title_text = 0; - int x = 10, y = 10; + int x = xs10, y = ys10; // if(!channel_usage || // (!channel_usage->use_frequency && // !channel_usage->use_fine && @@ -1000,50 +983,46 @@ void ChannelEditEditWindow::create_objects(Channel *channel) // !channel_usage->use_input)) // { // add_subwindow(new BC_Title(x, y, MSG_NO_INP_SELECTION)); -// y += 30; +// y += ys30; // } // else // { add_subwindow(new BC_Title(x, y, _("Title:"))); - add_subwindow(title_text = new ChannelEditEditTitle(x, y + 20, thread)); - y += 50; + add_subwindow(title_text = new ChannelEditEditTitle(x, y + ys20, thread)); + y += yS(50); // } if(channel_usage && channel_usage->use_frequency) { add_subwindow(new BC_Title(x, y, _("Channel:"))); - y += 20; + y += ys20; add_subwindow(thread->source_text = new ChannelEditEditSource(x, y, thread)); - add_subwindow(new ChannelEditEditSourceTumbler(x + 160, y, thread)); - y += 40; + add_subwindow(new ChannelEditEditSourceTumbler(x + xS(160), y, thread)); + y += yS(40); add_subwindow(new BC_Title(x, y, _("Frequency table:"))); ChannelEditEditFreqtable *table; - add_subwindow(table = new ChannelEditEditFreqtable(x + 130, - y, - thread, - window->thread)); + add_subwindow(table = new ChannelEditEditFreqtable(x + xs130, + y, thread, window->thread)); table->add_items(); - y += 30; + y += ys30; } if(channel_usage && channel_usage->use_fine) { add_subwindow(new BC_Title(x, y, _("Fine:"))); - add_subwindow(new ChannelEditEditFine(x + 130, y, thread)); - y += 30; + add_subwindow(new ChannelEditEditFine(x + xs130, y, thread)); + y += ys30; } if(channel_usage && channel_usage->use_norm) { add_subwindow(new BC_Title(x, y, _("Norm:"))); ChannelEditEditNorm *norm; - add_subwindow(norm = new ChannelEditEditNorm(x + 130, - y, - thread, - window->thread)); + add_subwindow(norm = new ChannelEditEditNorm(x + xs130, + y, thread, window->thread)); norm->add_items(); - y += 30; + y += ys30; } if( (channel_usage && channel_usage->use_input) || @@ -1051,16 +1030,14 @@ void ChannelEditEditWindow::create_objects(Channel *channel) { add_subwindow(new BC_Title(x, y, _("Input:"))); ChannelEditEditInput *input; - add_subwindow(input = new ChannelEditEditInput(x + 130, - y, - thread, - window->thread)); + add_subwindow(input = new ChannelEditEditInput(x + xs130, + y, thread, window->thread)); input->add_items(); - y += 30; + y += ys30; } add_subwindow(new BC_OKButton(this)); - x += 200; + x += xS(200); add_subwindow(new BC_CancelButton(this)); show_window(); unlock_window(); @@ -1069,7 +1046,7 @@ void ChannelEditEditWindow::create_objects(Channel *channel) ChannelEditEditTitle::ChannelEditEditTitle(int x, int y, ChannelEditEditThread *thread) - : BC_TextBox(x, y, 150, 1, thread->new_channel.title) + : BC_TextBox(x, y, xS(150), 1, thread->new_channel.title) { this->thread = thread; } @@ -1088,7 +1065,7 @@ int ChannelEditEditTitle::handle_event() ChannelEditEditSource::ChannelEditEditSource(int x, int y, ChannelEditEditThread *thread) - : BC_TextBox(x, y, 150, 1, chanlists[thread->new_channel.freqtable].list[thread->new_channel.entry].name) + : BC_TextBox(x, y, xS(150), 1, chanlists[thread->new_channel.freqtable].list[thread->new_channel.entry].name) { this->thread = thread; } @@ -1126,9 +1103,7 @@ ChannelEditEditInput::ChannelEditEditInput(int x, int y, ChannelEditEditThread *thread, ChannelEditThread *edit) - : BC_PopupMenu(x, - y, - 150, + : BC_PopupMenu(x, y, xS(150), edit->value_to_input(thread ? thread->new_channel.input : edit->scan_params.input)) { this->thread = thread; @@ -1193,9 +1168,7 @@ ChannelEditEditNorm::ChannelEditEditNorm(int x, int y, ChannelEditEditThread *thread, ChannelEditThread *edit) - : BC_PopupMenu(x, - y, - 100, + : BC_PopupMenu(x, y, xS(100), edit->value_to_norm(thread ? thread->new_channel.norm : edit->scan_params.norm)) { this->thread = thread; @@ -1246,9 +1219,7 @@ ChannelEditEditFreqtable::ChannelEditEditFreqtable(int x, int y, ChannelEditEditThread *thread, ChannelEditThread *edit) - : BC_PopupMenu(x, - y, - 150, + : BC_PopupMenu(x, y, xS(150), edit->value_to_freqtable(thread ? thread->new_channel.freqtable : edit->scan_params.freqtable)) { this->thread = thread; @@ -1301,13 +1272,7 @@ int ChannelEditEditFreqItem::handle_event() ChannelEditEditFine::ChannelEditEditFine(int x, int y, ChannelEditEditThread *thread) - : BC_ISlider(x, - y, - 0, - 240, - 240, - -100, - 100, + : BC_ISlider(x, y, 0, xS(240), xS(240), -100, 100, thread->new_channel.fine_tune) { this->thread = thread; @@ -1383,7 +1348,7 @@ int ChannelEditPictureWindow::calculate_h(ChannelPicker *channel_picker) PictureConfig *picture_usage = channel_picker->get_picture_usage(); int pad = BC_Pot::calculate_h(); int text_h = channel_picker->parent_window->get_text_height(MEDIUMFONT); - int result = 20 + text_h + 5 + BC_OKButton::calculate_h(); + int result = yS(20+5) + text_h + BC_OKButton::calculate_h(); // Only used for Video4Linux 1 if( !picture_usage || ( @@ -1431,7 +1396,7 @@ int ChannelEditPictureWindow::calculate_w(ChannelPicker *channel_picker) !channel_picker->get_controls())) { result = BC_Title::calculate_w(channel_picker->parent_window, - MSG_NO_PIC_CONTROLS) + 20; + MSG_NO_PIC_CONTROLS) + xS(20); } // Only used for Video4Linux 1 @@ -1478,8 +1443,9 @@ int ChannelEditPictureWindow::calculate_w(ChannelPicker *channel_picker) void ChannelEditPictureWindow::create_objects() { + int xs10 = xS(10), ys10 = yS(10); lock_window("ChannelEditPictureWindow::create_objects"); - int x = 10, y = 10; + int x = xs10, y = ys10; int widget_border = ((Theme*)channel_picker->get_theme())->widget_border; int x1 = get_w() - BC_Pot::calculate_w() * 2 - widget_border * 2; int x2 = get_w() - BC_Pot::calculate_w() - widget_border; @@ -1499,13 +1465,13 @@ void ChannelEditPictureWindow::create_objects() !channel_picker->get_controls())) { add_subwindow(new BC_Title(x, y, MSG_NO_PIC_CONTROLS)); - y += 50; + y += yS(50); } // Only used for Video4Linux 1 if(picture_usage && picture_usage->use_brightness) { - add_subwindow(new BC_Title(x, y + 10, _("Brightness:"))); + add_subwindow(new BC_Title(x, y + ys10, _("Brightness:"))); add_subwindow(new ChannelEditBright(x1, y, channel_picker, channel_picker->get_brightness())); y += pad; SWAP_X @@ -1514,7 +1480,7 @@ void ChannelEditPictureWindow::create_objects() if(picture_usage && picture_usage->use_contrast) { - add_subwindow(new BC_Title(x, y + 10, _("Contrast:"))); + add_subwindow(new BC_Title(x, y + ys10, _("Contrast:"))); add_subwindow(new ChannelEditContrast(x1, y, channel_picker, channel_picker->get_contrast())); y += pad; SWAP_X @@ -1522,7 +1488,7 @@ void ChannelEditPictureWindow::create_objects() if(picture_usage && picture_usage->use_color) { - add_subwindow(new BC_Title(x, y + 10, _("Color:"))); + add_subwindow(new BC_Title(x, y + ys10, _("Color:"))); add_subwindow(new ChannelEditColor(x1, y, channel_picker, channel_picker->get_color())); y += pad; SWAP_X @@ -1530,7 +1496,7 @@ void ChannelEditPictureWindow::create_objects() if(picture_usage && picture_usage->use_hue) { - add_subwindow(new BC_Title(x, y + 10, _("Hue:"))); + add_subwindow(new BC_Title(x, y + ys10, _("Hue:"))); add_subwindow(new ChannelEditHue(x1, y, channel_picker, channel_picker->get_hue())); y += pad; SWAP_X @@ -1538,7 +1504,7 @@ void ChannelEditPictureWindow::create_objects() if(picture_usage && picture_usage->use_whiteness) { - add_subwindow(new BC_Title(x, y + 10, _("Whiteness:"))); + add_subwindow(new BC_Title(x, y + ys10, _("Whiteness:"))); add_subwindow(new ChannelEditWhiteness(x1, y, channel_picker, channel_picker->get_whiteness())); y += pad; SWAP_X @@ -1547,8 +1513,7 @@ void ChannelEditPictureWindow::create_objects() for(int i = 0; i < channel_picker->get_controls(); i++) { BC_Title *title; - add_subwindow(title = new BC_Title(x, - y + 10, + add_subwindow(title = new BC_Title(x, y + ys10, _(channel_picker->get_control(i)->name))); int x3 = x1; @@ -1580,11 +1545,7 @@ int ChannelEditPictureWindow::translation_event() ChannelEditBright::ChannelEditBright(int x, int y, ChannelPicker *channel_picker, int value) - : BC_IPot(x, - y, - value, - -100, - 100) + : BC_IPot(x, y, value, -100, 100) { this->channel_picker = channel_picker; } @@ -1604,11 +1565,7 @@ int ChannelEditBright::button_release_event() } ChannelEditContrast::ChannelEditContrast(int x, int y, ChannelPicker *channel_picker, int value) - : BC_IPot(x, - y, - value, - -100, - 100) + : BC_IPot(x, y, value, -100, 100) { this->channel_picker = channel_picker; } @@ -1629,11 +1586,7 @@ int ChannelEditContrast::button_release_event() ChannelEditColor::ChannelEditColor(int x, int y, ChannelPicker *channel_picker, int value) - : BC_IPot(x, - y, - value, - -100, - 100) + : BC_IPot(x, y, value, -100, 100) { this->channel_picker = channel_picker; } @@ -1653,11 +1606,7 @@ int ChannelEditColor::button_release_event() } ChannelEditHue::ChannelEditHue(int x, int y, ChannelPicker *channel_picker, int value) - : BC_IPot(x, - y, - value, - -100, - 100) + : BC_IPot(x, y, value, -100, 100) { this->channel_picker = channel_picker; } @@ -1677,11 +1626,7 @@ int ChannelEditHue::button_release_event() } ChannelEditWhiteness::ChannelEditWhiteness(int x, int y, ChannelPicker *channel_picker, int value) - : BC_IPot(x, - y, - value, - -100, - 100) + : BC_IPot(x, y, value, -100, 100) { this->channel_picker = channel_picker; } @@ -1704,15 +1649,9 @@ int ChannelEditWhiteness::button_release_event() -ChannelEditCommon::ChannelEditCommon(int x, - int y, - ChannelPicker *channel_picker, - PictureItem *item) - : BC_IPot(x, - y, - item->value, - item->min, - item->max) +ChannelEditCommon::ChannelEditCommon(int x, int y, + ChannelPicker *channel_picker, PictureItem *item) + : BC_IPot(x, y, item->value, item->min, item->max) { this->channel_picker = channel_picker; this->device_id = item->device_id; diff --git a/cinelerra-5.1/cinelerra/channelinfo.C b/cinelerra-5.1/cinelerra/channelinfo.C index 177f2840..e6e8486e 100644 --- a/cinelerra-5.1/cinelerra/channelinfo.C +++ b/cinelerra-5.1/cinelerra/channelinfo.C @@ -259,44 +259,46 @@ int ChanSearchList::move_column_event() void ChanSearchGUI::create_objects() { + int xs10 = xS(10), xs20 = xS(20); + int ys5 = yS(5), ys10 = yS(10); lock_window("ChanSearchGUI::create_objects"); - int pady = BC_TextBox::calculate_h(this, MEDIUMFONT, 0, 1) + 5; + int pady = BC_TextBox::calculate_h(this, MEDIUMFONT, 0, 1) + ys5; int padx = BC_Title::calculate_w(this, (char*)"X", MEDIUMFONT); int x = padx/2, y = pady/4; BC_Title *title = new BC_Title(text_x, text_y, _("Text:"), MEDIUMFONT, YELLOW); add_subwindow(title); x += title->get_w(); text_x = x; text_y = y; - search_text = new ChanSearchText(this, x, y, get_w()-x-10); + search_text = new ChanSearchText(this, x, y, get_w()-x-xs10); add_subwindow(search_text); - x = padx; y += pady + 5; + x = padx; y += pady + ys5; title_text = new ChanSearchTitleText(this, x, y); add_subwindow(title_text); x += title_text->get_w() + padx; info_text = new ChanSearchInfoText(this, x, y); add_subwindow(info_text); x += title_text->get_w() + padx; match_case = new ChanSearchMatchCase(this, x, y); add_subwindow(match_case); x += match_case->get_w() + padx; - results_x = x + 20; results_y = y + 5; + results_x = x + xs20; results_y = y + ys5; results = new BC_Title(results_x, results_y, " ", MEDIUMFONT, YELLOW); add_subwindow(results); - x = padx; y += pady + 5; - search_x = 10; - search_y = get_h() - BC_GenericButton::calculate_h() - 10; + x = padx; y += pady + ys5; + search_x = xs10; + search_y = get_h() - BC_GenericButton::calculate_h() - ys10; search_start = new ChanSearchStart(this, search_x, search_y); add_subwindow(search_start); cancel_w = ChanSearchCancel::calculate_w(); cancel_h = ChanSearchCancel::calculate_h(); - cancel_x = get_w() - cancel_w - 10; - cancel_y = get_h() - cancel_h - 10; + cancel_x = get_w() - cancel_w - xs10; + cancel_y = get_h() - cancel_h - ys10; cancel = new ChanSearchCancel(this, cancel_x, cancel_y); add_subwindow(cancel); list_x = x; list_y = y; - int list_w = get_w()-10 - list_x; - int list_h = min(search_y, cancel_y)-10 - list_y; + int list_w = get_w()-xs10 - list_x; + int list_h = min(search_y, cancel_y)-ys10 - list_y; search_list = new ChanSearchList(this, list_x, list_y, list_w, list_h); add_subwindow(search_list); search_list->show_window(); int clktip_x = list_x; - int clktip_y = list_y + list_h + 5; + int clktip_y = list_y + list_h + ys5; click_tip = new BC_Title(clktip_x, clktip_y, _("dbl clk row to find title")); add_subwindow(click_tip); @@ -305,11 +307,14 @@ void ChanSearchGUI::create_objects() unlock_window(); } +#define CSW_W xS(500) +#define CSW_H yS(300) + ChanSearchGUI::ChanSearchGUI(ChanSearch *cswindow) : BC_Window(_(PROGRAM_NAME ": ChanSearch"), - cswindow->iwindow->gui->get_abs_cursor_x(1) - 500 / 2, - cswindow->iwindow->gui->get_abs_cursor_y(1) - 300 / 2, - 500, 300, 400, 300) + cswindow->iwindow->gui->get_abs_cursor_x(1) - CSW_W/2, + cswindow->iwindow->gui->get_abs_cursor_y(1) - CSW_H/2, + CSW_W, CSW_H, xS(400), yS(300)) { this->cswindow = cswindow; this->iwindow = cswindow->iwindow; @@ -341,9 +346,9 @@ ChanSearchGUI::ChanSearchGUI(ChanSearch *cswindow) search_column_titles[0] = _("Source"); search_column_titles[1] = C_("Title"); search_column_titles[2] = _("Start time"); - search_column_widths[0] = 120; - search_column_widths[2] = 120; - search_column_widths[1] = get_w()-search_column_widths[0]-search_column_widths[2]-32; + search_column_widths[0] = xS(120); + search_column_widths[2] = xS(120); + search_column_widths[1] = get_w()-search_column_widths[0]-search_column_widths[2]-xS(32); } ChanSearchGUI::~ChanSearchGUI() @@ -362,19 +367,21 @@ ChanSearchGUI::~ChanSearchGUI() int ChanSearchGUI::resize_event(int w, int h) { + int xs5 = xS(5), xs10 = xS(10); + int ys10 = yS(10); search_text->reposition_window(text_x, text_y, w-text_x-10); - int cancel_x = w - BC_CancelButton::calculate_w() - 10; - int cancel_y = h - BC_CancelButton::calculate_h() - 10; + int cancel_x = w - BC_CancelButton::calculate_w() - xs10; + int cancel_y = h - BC_CancelButton::calculate_h() - ys10; cancel->reposition_window(cancel_x, cancel_y); - search_x = 10; - search_y = h - BC_GenericButton::calculate_h() - 10; + search_x = xs10; + search_y = h - BC_GenericButton::calculate_h() - ys10; search_start->reposition_window(search_x, search_y); - int list_w = w-10 - list_x; - int list_h = min(search_y, cancel_y)-10 - list_y; - search_column_widths[1] = w-search_column_widths[0]-search_column_widths[2]-32; + int list_w = w-xs10 - list_x; + int list_h = min(search_y, cancel_y)-ys10 - list_y; + search_column_widths[1] = w-search_column_widths[0]-search_column_widths[2]-xS(32); search_list->reposition_window(list_x, list_y, list_w, list_h); int clktip_x = list_x; - int clktip_y = list_y + list_h + 5; + int clktip_y = list_y + list_h + xs5; click_tip->reposition_window(clktip_x, clktip_y); update(); return 1; @@ -1285,6 +1292,8 @@ int ChannelInfoGUIBatches::handle_event() void ChannelInfoGUI::create_objects() { + int xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10); lock_window("ChannelInfoGUI::create_objects"); panel = new ChannelPanel(this,0,0,panel_w,panel_h); add_subwindow(panel); @@ -1311,9 +1320,9 @@ void ChannelInfoGUI::create_objects() batch_bay->set_current_batch(-1); batch_bay->update_batches(-1); - pad = BC_TextBox::calculate_h(this, MEDIUMFONT, 0, 1) + 5; - x0 = bay_x+bay_w + 10; - y0 = bay_y+10; + pad = BC_TextBox::calculate_h(this, MEDIUMFONT, 0, 1) + ys5; + x0 = bay_x+bay_w + xs10; + y0 = bay_y+ys10; int ww = 0; int x = x0; int y = y0; @@ -1361,9 +1370,9 @@ void ChannelInfoGUI::create_objects() x = x0 + pad; add_subwindow(channel_clear_batch = new ChannelClearBatch(this, x, y)); - x += channel_clear_batch->get_w() + 10; + x += channel_clear_batch->get_w() + xs10; add_subwindow(channel_new_batch = new ChannelNewBatch(this, x, y)); - x += channel_new_batch->get_w() + 10; + x += channel_new_batch->get_w() + xs10; add_subwindow(channel_delete_batch = new ChannelDeleteBatch(this, x, y)); x += channel_delete_batch->get_w(); ww = max(x-x0, ww); @@ -1381,9 +1390,12 @@ void ChannelInfoGUI::create_objects() ChannelInfoGUI::ChannelInfoGUI(ChannelInfo *iwindow, int x, int y, int w, int h) - : BC_Window(_(PROGRAM_NAME ": Channel Info"), x, y, w, h, 600, 400, - 1, 0, 0 , -1, iwindow->mwindow->get_cwindow_display()) + : BC_Window(_(PROGRAM_NAME ": Channel Info"), x, y, + w, h, xS(600), yS(400), 1, 0, 0 , -1, + iwindow->mwindow->get_cwindow_display()) { + int xs10 = xS(10), xs20 = xS(20); + int ys5 = yS(5), ys10 = yS(10); this->iwindow = iwindow; panel = 0; batch_bay =0; @@ -1411,31 +1423,31 @@ ChannelInfoGUI::ChannelInfoGUI(ChannelInfo *iwindow, x0 = y0 = title_w = data_w = status_w = pad = 0; ok_w = BC_OKButton::calculate_w(); ok_h = BC_OKButton::calculate_h(); - ok_x = 10; - ok_y = h - ok_h - 10; + ok_x = xs10; + ok_y = h - ok_h - ys10; BC_CheckBox::calculate_extents(this, &cron_w, &cron_h, cron_caption); cron_x = ok_x; - cron_y = ok_y - cron_h - 10; + cron_y = ok_y - cron_h - ys10; BC_CheckBox::calculate_extents(this, &power_w, &power_h, power_caption); power_x = cron_x; - power_y = cron_y - power_h - 5; + power_y = cron_y - power_h - ys5; find_h = BC_GenericButton::calculate_h(); find_x = power_x; - find_y = power_y - find_h - 10; + find_y = power_y - find_h - ys10; cancel_w = BC_CancelButton::calculate_w(); cancel_h = BC_CancelButton::calculate_h(); - cancel_x = w - cancel_w - 10, - cancel_y = h - cancel_h - 10; - max_bay_w = 700; - bay_h = 150; - bay_x = ok_w + 20; - int x1 = cron_x+cron_w + 10; + cancel_x = w - cancel_w - xs10, + cancel_y = h - cancel_h - ys10; + max_bay_w = xS(700); + bay_h = yS(150); + bay_x = ok_w + xs20; + int x1 = cron_x+cron_w + xs10; if( x1 > bay_x ) bay_x = x1; - x1 = power_x+power_w + 10; + x1 = power_x+power_w + xs10; if( x1 > bay_x ) bay_x = x1; bay_y = h - bay_h; // data_w,status_w zero, updated in create_objects - bay_w = (w-bay_x) - (data_w+10) - (max(cancel_w, status_w)+20); + bay_w = (w-bay_x) - (data_w+xs10) - (max(cancel_w, status_w)+xs20); if( bay_w > max_bay_w ) bay_w = max_bay_w; panel_w = w; panel_h = h - bay_h; @@ -1472,39 +1484,41 @@ int ChannelInfoGUI::translation_event() int ChannelInfoGUI::resize_event(int w, int h) { + int xs10 = xS(10), xs20 = xS(20); + int ys5 = yS(5), ys10 = yS(10); iwindow->mwindow->session->cswindow_w = w; iwindow->mwindow->session->cswindow_h = h; panel_w = w; panel_h = h - bay_h; panel->resize(panel_w,panel_h); panel->reposition_window(0,0,panel_w,panel_h); - ok_x = 10; - ok_y = h - ok_h - 10; + ok_x = xs10; + ok_y = h - ok_h - ys10; ok->reposition_window(ok_x, ok_y); cron_x = ok_x; - cron_y = ok_y - cron_h - 10; + cron_y = ok_y - cron_h - ys10; channel_cron->reposition_window(cron_x, cron_y); power_x = cron_x; - power_y = cron_y - power_h - 5; + power_y = cron_y - power_h - ys5; channel_poweroff->reposition_window(power_x, power_y); find_x = power_x; - find_y = power_y - find_h - 10; + find_y = power_y - find_h - ys10; channel_find->reposition_window(find_x, find_y); - cancel_x = w - cancel_w - 10, - cancel_y = h - cancel_h - 10; + cancel_x = w - cancel_w - xs10, + cancel_y = h - cancel_h - ys10; cancel->reposition_window(cancel_x, cancel_y); - bay_x = ok_w + 20; - int x1 = cron_x+cron_w + 10; + bay_x = ok_w + xs20; + int x1 = cron_x+cron_w + xs10; if( x1 > bay_x ) bay_x = x1; - x1 = power_x+power_w + 10; + x1 = power_x+power_w + xs10; if( x1 > bay_x ) bay_x = x1; bay_y = h - bay_h; - bay_w = (w-bay_x) - (data_w+10) - (max(cancel_w, status_w)+20); + bay_w = (w-bay_x) - (data_w+xs10) - (max(cancel_w, status_w)+xs20); if( bay_w > max_bay_w ) bay_w = max_bay_w; batch_bay->reposition_window(bay_x, bay_y, bay_w, bay_h); - int x0 = bay_x+bay_w + 10; - int y0 = bay_y+10; + int x0 = bay_x+bay_w + xs10; + int y0 = bay_y+ys10; int x = x0; int y = y0; @@ -1529,9 +1543,9 @@ int ChannelInfoGUI::resize_event(int w, int h) x = x0 + pad; channel_clear_batch->reposition_window(x, y); - x += channel_clear_batch->get_w() + 10; + x += channel_clear_batch->get_w() + xs10; channel_new_batch->reposition_window(x, y); - x += channel_new_batch->get_w() + 10; + x += channel_new_batch->get_w() + xs10; channel_delete_batch->reposition_window(x, y); y = y0; @@ -1676,8 +1690,8 @@ void ChannelInfo::run() int y = mwindow->session->cswindow_y; int w = mwindow->session->cswindow_w; int h = mwindow->session->cswindow_h; - if( w < 600 ) w = 600; - if( h < 400 ) h = 400; + if( w < xS(600) ) w = xS(600); + if( h < yS(400) ) h = yS(400); int scr_x = mwindow->gui->get_screen_x(1, -1); int scr_w = mwindow->gui->get_screen_w(1, -1); if( x < scr_x ) x = scr_x; @@ -1825,7 +1839,7 @@ ChannelDuration::ChannelDuration(ChannelInfoGUI *gui, int x, int y, int w) ChannelEarlyTime::ChannelEarlyTime(ChannelInfoGUI *gui, int x, int y, double *output_time) - : TimeEntryTumbler(gui, x, y, 0, output_time, 15, TIME_MS2, 75) + : TimeEntryTumbler(gui, x, y, 0, output_time, 15, TIME_MS2, xS(75)) { this->gui = gui; } @@ -1845,7 +1859,7 @@ int ChannelEarlyTime::handle_down_event() ChannelLateTime::ChannelLateTime(ChannelInfoGUI *gui, int x, int y, double *output_time) - : TimeEntryTumbler(gui, x, y, 0, output_time, 15, TIME_MS2, 75) + : TimeEntryTumbler(gui, x, y, 0, output_time, 15, TIME_MS2, xS(75)) { this->gui = gui; } diff --git a/cinelerra-5.1/cinelerra/clipedit.C b/cinelerra-5.1/cinelerra/clipedit.C index 29ebd9f6..e002dd47 100644 --- a/cinelerra-5.1/cinelerra/clipedit.C +++ b/cinelerra-5.1/cinelerra/clipedit.C @@ -131,11 +131,13 @@ void ClipEdit::create_clip(EDL *clip, int x, int y) start(); } +#define CEW_W xS(400) +#define CEW_H yS(350) ClipEditWindow::ClipEditWindow(MWindow *mwindow, ClipEdit *thread) : BC_Window(_(PROGRAM_NAME ": Clip Info"), - thread->x -400/2, thread->y - 350/2, - 400, 350, 400, 430, 0, 0, 1) + thread->x - CEW_W/2, thread->y - CEW_H/2, + CEW_W, CEW_H, CEW_W, CEW_H, 0, 0, 1) { this->mwindow = mwindow; this->thread = thread; @@ -148,31 +150,33 @@ ClipEditWindow::~ClipEditWindow() void ClipEditWindow::create_objects() { + int xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10); lock_window("ClipEditWindow::create_objects"); this->create_it = thread->create_it; - int x = 10, y = 10; + int x = xs10, y = ys10; int x1 = x; BC_TextBox *textbox; BC_Title *title; add_subwindow(title = new BC_Title(x1, y, _("Title:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; add_subwindow(titlebox = new ClipEditTitle(this, x1, y, get_w() - x1 * 2)); int end = strlen(titlebox->get_text()); titlebox->set_selection(0, end, end); - y += titlebox->get_h() + 10; + y += titlebox->get_h() + ys10; add_subwindow(title = new BC_Title(x1, y, _("Comments:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; add_subwindow(textbox = new ClipEditComments(this, x1, y, get_w() - x1 * 2, BC_TextBox::pixels_to_rows(this, MEDIUMFONT, - get_h() - 10 - BC_OKButton::calculate_h() - y))); + get_h() - ys10 - BC_OKButton::calculate_h() - y))); diff --git a/cinelerra-5.1/cinelerra/colorpicker.C b/cinelerra-5.1/cinelerra/colorpicker.C index 57601d7e..ad559a79 100644 --- a/cinelerra-5.1/cinelerra/colorpicker.C +++ b/cinelerra-5.1/cinelerra/colorpicker.C @@ -77,9 +77,9 @@ BC_Window* ColorPicker::new_gui() strcpy(window_title, _(PROGRAM_NAME ": ")); strcat(window_title, title ? title : _("Color Picker")); BC_DisplayInfo display_info; - int x = display_info.get_abs_cursor_x() + 25; - int y = display_info.get_abs_cursor_y() - 100; - int w = 540, h = 330; + int x = display_info.get_abs_cursor_x() + xS(25); + int y = display_info.get_abs_cursor_y() - yS(100); + int w = xS(540), h = yS(330); if( ok_cancel ) h += bmax(BC_OKButton::calculate_h(),BC_CancelButton::calculate_h()); int root_w = display_info.get_root_w(), root_h = display_info.get_root_h(); @@ -148,7 +148,9 @@ ColorWindow::~ColorWindow() void ColorWindow::create_objects() { - int x0 = 10, y0 = 10; + int xs5 = xS(5), xs10 = xS(10), xs15 = xS(15); + int ys10 = yS(10), ys15 = yS(15), ys25 = yS(25), ys40 = yS(40); + int x0 = xs10, y0 = ys10; lock_window("ColorWindow::create_objects"); change_values(); @@ -156,69 +158,69 @@ void ColorWindow::create_objects() add_tool(wheel = new PaletteWheel(this, x, y)); wheel->create_objects(); - x += 180; add_tool(wheel_value = new PaletteWheelValue(this, x, y)); + x += xS(180); add_tool(wheel_value = new PaletteWheelValue(this, x, y)); wheel_value->create_objects(); x = x0; - y += 180; add_tool(output = new PaletteOutput(this, x, y)); + y += yS(180); add_tool(output = new PaletteOutput(this, x, y)); output->create_objects(); - y += output->get_h() + 20; + y += output->get_h() + yS(20); load_history(); int x1 = x; add_tool(hex_btn = new PaletteHexButton(this, x1, y)); char hex[BCSTRLEN]; sprintf(hex,"%06x",thread->output); - x1 += hex_btn->get_w() + 5; + x1 += hex_btn->get_w() + xs5; add_tool(hex_box = new PaletteHex(this, x1, y, hex)); - x1 += hex_box->get_w() + 15; + x1 += hex_box->get_w() + xs15; add_tool(grab_btn = new PaletteGrabButton(this, x1, y)); - y += hex_box->get_h() + 15; - add_tool(history = new PaletteHistory(this, 10, y)); + y += hex_box->get_h() + ys15; + add_tool(history = new PaletteHistory(this, xs10, y)); - x += 240; + x += xS(240); add_tool(new BC_Title(x, y =y0, C_("H:"), SMALLFONT)); - add_tool(new BC_Title(x, y+=25, C_("S:"), SMALLFONT)); - add_tool(new BC_Title(x, y+=25, D_("colorpicker_value#V:"), SMALLFONT)); - add_tool(new BC_Title(x, y+=40, C_("R:"), SMALLFONT)); - add_tool(new BC_Title(x, y+=25, C_("G:"), SMALLFONT)); - add_tool(new BC_Title(x, y+=25, C_("B:"), SMALLFONT)); - add_tool(new BC_Title(x, y+=40, C_("Y:"), SMALLFONT)); - add_tool(new BC_Title(x, y+=25, C_("U:"), SMALLFONT)); - add_tool(new BC_Title(x, y+=25, D_("colorpicker_Cr#V:"), SMALLFONT)); + add_tool(new BC_Title(x, y+=ys25, C_("S:"), SMALLFONT)); + add_tool(new BC_Title(x, y+=ys25, D_("colorpicker_value#V:"), SMALLFONT)); + add_tool(new BC_Title(x, y+=ys40, C_("R:"), SMALLFONT)); + add_tool(new BC_Title(x, y+=ys25, C_("G:"), SMALLFONT)); + add_tool(new BC_Title(x, y+=ys25, C_("B:"), SMALLFONT)); + add_tool(new BC_Title(x, y+=ys40, C_("Y:"), SMALLFONT)); + add_tool(new BC_Title(x, y+=ys25, C_("U:"), SMALLFONT)); + add_tool(new BC_Title(x, y+=ys25, D_("colorpicker_Cr#V:"), SMALLFONT)); if( thread->do_alpha ) - add_tool(new BC_Title(x, y+=40, C_("A:"), SMALLFONT)); - x += 24; + add_tool(new BC_Title(x, y+=ys40, C_("A:"), SMALLFONT)); + x += xS(24); add_tool(hue = new PaletteHue(this, x, y= y0)); - add_tool(sat = new PaletteSat(this, x, y+=25)); - add_tool(val = new PaletteVal(this, x, y+=25)); - add_tool(red = new PaletteRed(this, x, y+=40)); - add_tool(grn = new PaletteGrn(this, x, y+=25)); - add_tool(blu = new PaletteBlu(this, x, y+=25)); - add_tool(lum = new PaletteLum(this, x, y+=40)); - add_tool(c_r = new PaletteCr (this, x, y+=25)); - add_tool(c_b = new PaletteCb (this, x, y+=25)); + add_tool(sat = new PaletteSat(this, x, y+=ys25)); + add_tool(val = new PaletteVal(this, x, y+=ys25)); + add_tool(red = new PaletteRed(this, x, y+=ys40)); + add_tool(grn = new PaletteGrn(this, x, y+=ys25)); + add_tool(blu = new PaletteBlu(this, x, y+=ys25)); + add_tool(lum = new PaletteLum(this, x, y+=ys40)); + add_tool(c_r = new PaletteCr (this, x, y+=ys25)); + add_tool(c_b = new PaletteCb (this, x, y+=ys25)); if( thread->do_alpha ) - add_tool(alpha = new PaletteAlpha(this, x, y+=40)); + add_tool(alpha = new PaletteAlpha(this, x, y+=ys40)); - x += hue->get_w() + 10; + x += hue->get_w() + xs10; hsv_h = new PaletteHSV(this, x,y= y0, hsv.h, 0, 360); hsv_h->create_objects(); hsv_h->set_tooltip(_("Hue")); - hsv_s = new PaletteHSV(this, x,y+=25, hsv.s, 0, 1); + hsv_s = new PaletteHSV(this, x,y+=ys25, hsv.s, 0, 1); hsv_s->create_objects(); hsv_s->set_tooltip(_("Saturation")); - hsv_v = new PaletteHSV(this, x,y+=25, hsv.v, 0, 1); + hsv_v = new PaletteHSV(this, x,y+=ys25, hsv.v, 0, 1); hsv_v->create_objects(); hsv_v->set_tooltip(_("Value")); - rgb_r = new PaletteRGB(this, x,y+=40, rgb.r, 0, 1); + rgb_r = new PaletteRGB(this, x,y+=ys40, rgb.r, 0, 1); rgb_r->create_objects(); rgb_r->set_tooltip(_("Red")); - rgb_g = new PaletteRGB(this, x,y+=25, rgb.g, 0, 1); + rgb_g = new PaletteRGB(this, x,y+=ys25, rgb.g, 0, 1); rgb_g->create_objects(); rgb_g->set_tooltip(_("Green")); - rgb_b = new PaletteRGB(this, x,y+=25, rgb.b, 0, 1); + rgb_b = new PaletteRGB(this, x,y+=ys25, rgb.b, 0, 1); rgb_b->create_objects(); rgb_b->set_tooltip(_("Blue")); - yuv_y = new PaletteYUV(this, x,y+=40, yuv.y, 0, 1); + yuv_y = new PaletteYUV(this, x,y+=ys40, yuv.y, 0, 1); yuv_y->create_objects(); yuv_y->set_tooltip(_("Luminance")); - yuv_u = new PaletteYUV(this, x,y+=25, yuv.u, 0, 1); + yuv_u = new PaletteYUV(this, x,y+=ys25, yuv.u, 0, 1); yuv_u->create_objects(); yuv_u->set_tooltip(_("Blue Luminance Difference")); - yuv_v = new PaletteYUV(this, x,y+=25, yuv.v, 0, 1); + yuv_v = new PaletteYUV(this, x,y+=ys25, yuv.v, 0, 1); yuv_v->create_objects(); yuv_v->set_tooltip(_("Red Luminance Difference")); if( thread->do_alpha ) { - aph_a = new PaletteAPH(this, x,y+=40, aph, 0, 1); + aph_a = new PaletteAPH(this, x,y+=ys40, aph, 0, 1); aph_a->create_objects(); aph_a->set_tooltip(_("Alpha")); } if( thread->ok_cancel ) { @@ -380,7 +382,7 @@ void ColorWindow::update_rgb_hex(const char *hex) PaletteWheel::PaletteWheel(ColorWindow *window, int x, int y) - : BC_SubWindow(x, y, 170, 170) + : BC_SubWindow(x, y, xS(170), yS(170)) { this->window = window; oldhue = 0; @@ -493,27 +495,15 @@ void PaletteWheel::create_objects() } } } -//printf("PaletteWheel::create_objects 1\n"); draw_vframe(&frame, - 0, - 0, - get_w(), - get_h(), - 0, - 0, - get_w(), - get_h(), - 0); -//printf("PaletteWheel::create_objects 1\n"); + 0, 0, get_w(), get_h(), + 0, 0, get_w(), get_h(), 0); oldhue = window->hsv.h; oldsaturation = window->hsv.s; -//printf("PaletteWheel::create_objects 1\n"); draw(oldhue, oldsaturation); -//printf("PaletteWheel::create_objects 1\n"); flash(); -//printf("PaletteWheel::create_objects 2\n"); } float PaletteWheel::torads(float angle) @@ -563,7 +553,7 @@ int PaletteWheel::draw(float hue, float saturation) set_inverse(); set_color(WHITE); - draw_circle(x - 5, y - 5, 10, 10); + draw_circle(x - xS(5), y - yS(5), xS(10), yS(10)); set_opaque(); return 0; } @@ -577,7 +567,7 @@ int PaletteWheel::get_angle(float x1, float y1, float x2, float y2) } PaletteWheelValue::PaletteWheelValue(ColorWindow *window, int x, int y) - : BC_SubWindow(x, y, 40, 170, BLACK) + : BC_SubWindow(x, y, xS(40), yS(170), BLACK) { this->window = window; button_down = 0; @@ -649,7 +639,6 @@ int PaletteWheelValue::draw(float hue, float saturation, float value) row[j * 3 + 2] = b; } } - draw_3d_border(0, 0, get_w(), get_h(), 1); draw_vframe(frame, 2, 2, get_w() - 4, get_h() - 4, 2, 2, get_w() - 4, get_h() - 4, 0); @@ -662,7 +651,7 @@ int PaletteWheelValue::draw(float hue, float saturation, float value) } PaletteOutput::PaletteOutput(ColorWindow *window, int x, int y) - : BC_SubWindow(x, y, 180, 30, BLACK) + : BC_SubWindow(x, y, xS(180), yS(30), BLACK) { this->window = window; } @@ -691,7 +680,7 @@ int PaletteOutput::draw() } PaletteHue::PaletteHue(ColorWindow *window, int x, int y) - : BC_ISlider(x, y, 0, 150, 200, 0, 359, (int)(window->hsv.h), 0) + : BC_ISlider(x, y, 0, xS(150), xS(200), 0, 359, (int)(window->hsv.h), 0) { this->window = window; } @@ -708,7 +697,7 @@ int PaletteHue::handle_event() } PaletteSat::PaletteSat(ColorWindow *window, int x, int y) - : BC_FSlider(x, y, 0, 150, 200, 0, 1.0, window->hsv.s, 0) + : BC_FSlider(x, y, 0, xS(150), xS(200), 0, 1.0, window->hsv.s, 0) { this->window = window; set_precision(0.01); @@ -727,7 +716,7 @@ int PaletteSat::handle_event() PaletteVal::PaletteVal(ColorWindow *window, int x, int y) - : BC_FSlider(x, y, 0, 150, 200, 0, 1.0, window->hsv.v, 0) + : BC_FSlider(x, y, 0, xS(150), xS(200), 0, 1.0, window->hsv.v, 0) { this->window = window; set_precision(0.01); @@ -746,7 +735,7 @@ int PaletteVal::handle_event() PaletteRed::PaletteRed(ColorWindow *window, int x, int y) - : BC_FSlider(x, y, 0, 150, 200, 0, 1, window->rgb.r, 0) + : BC_FSlider(x, y, 0, xS(150), xS(200), 0, 1, window->rgb.r, 0) { this->window = window; set_precision(0.01); @@ -764,7 +753,7 @@ int PaletteRed::handle_event() } PaletteGrn::PaletteGrn(ColorWindow *window, int x, int y) - : BC_FSlider(x, y, 0, 150, 200, 0, 1, window->rgb.g, 0) + : BC_FSlider(x, y, 0, xS(150), xS(200), 0, 1, window->rgb.g, 0) { this->window = window; set_precision(0.01); @@ -782,7 +771,7 @@ int PaletteGrn::handle_event() } PaletteBlu::PaletteBlu(ColorWindow *window, int x, int y) - : BC_FSlider(x, y, 0, 150, 200, 0, 1, window->rgb.b, 0) + : BC_FSlider(x, y, 0, xS(150), xS(200), 0, 1, window->rgb.b, 0) { this->window = window; set_precision(0.01); @@ -800,7 +789,7 @@ int PaletteBlu::handle_event() } PaletteAlpha::PaletteAlpha(ColorWindow *window, int x, int y) - : BC_FSlider(x, y, 0, 150, 200, 0, 1, window->aph, 0) + : BC_FSlider(x, y, 0, xS(150), xS(200), 0, 1, window->aph, 0) { this->window = window; set_precision(0.01); @@ -819,7 +808,7 @@ int PaletteAlpha::handle_event() } PaletteLum::PaletteLum(ColorWindow *window, int x, int y) - : BC_FSlider(x, y, 0, 150, 200, 0, 1, window->yuv.y, 0) + : BC_FSlider(x, y, 0, xS(150), xS(200), 0, 1, window->yuv.y, 0) { this->window = window; set_precision(0.01); @@ -837,7 +826,7 @@ int PaletteLum::handle_event() } PaletteCr::PaletteCr(ColorWindow *window, int x, int y) - : BC_FSlider(x, y, 0, 150, 200, 0, 1, window->yuv.u, 0) + : BC_FSlider(x, y, 0, xS(150), xS(200), 0, 1, window->yuv.u, 0) { this->window = window; set_precision(0.01); @@ -855,7 +844,7 @@ int PaletteCr::handle_event() } PaletteCb::PaletteCb(ColorWindow *window, int x, int y) - : BC_FSlider(x, y, 0, 150, 200, 0, 1, window->yuv.v, 0) + : BC_FSlider(x, y, 0, xS(150), xS(200), 0, 1, window->yuv.v, 0) { this->window = window; set_precision(0.01); @@ -989,7 +978,7 @@ int ColorWindow::alpha8() PaletteNum::PaletteNum(ColorWindow *window, int x, int y, float &output, float min, float max) - : BC_TumbleTextBox(window, output, min, max, x, y, 64) + : BC_TumbleTextBox(window, output, min, max, x, y, xS(64)) { this->window = window; this->output = &output; @@ -1035,7 +1024,7 @@ int PaletteAPH::handle_event() } PaletteHexButton::PaletteHexButton(ColorWindow *window, int x, int y) - : BC_GenericButton(x, y, 50, "#") + : BC_GenericButton(x, y, xS(50), "#") { this->window = window; set_tooltip(_("hex rgb color")); @@ -1051,7 +1040,7 @@ int PaletteHexButton::handle_event() } PaletteHex::PaletteHex(ColorWindow *window, int x, int y, const char *hex) - : BC_TextBox(x, y, 100, 1, hex) + : BC_TextBox(x, y, xS(100), 1, hex) { this->window = window; } @@ -1104,7 +1093,7 @@ int PaletteGrabButton::handle_event() } PaletteHistory::PaletteHistory(ColorWindow *window, int x, int y) - : BC_SubWindow(x,y, 200, 24) + : BC_SubWindow(x,y, xS(200), yS(24)) { this->window = window; button_down = 0; diff --git a/cinelerra-5.1/cinelerra/commercials.C b/cinelerra-5.1/cinelerra/commercials.C index 3a3de586..a3461b6d 100644 --- a/cinelerra-5.1/cinelerra/commercials.C +++ b/cinelerra-5.1/cinelerra/commercials.C @@ -164,7 +164,7 @@ put_clip(File *file, int track, double position, double length) clip_id = mdb->clip_id(); cancelled = 0; - scan_status = new ScanStatus(this, 30, 30, 1, 1, + scan_status = new ScanStatus(this, xS(30), yS(30), 1, 1, cancelled, _("Cutting Ads")); scan_status->update_length(0, frames); scan_status->update_position(0, 0); @@ -574,7 +574,7 @@ int Commercials:: scan_media() { cancelled = 0; - scan_status = new ScanStatus(this, 30, 30, 2, 2, + scan_status = new ScanStatus(this, xS(30), yS(30), 2, 2, cancelled, _("Cutting Ads")); if( !openDb() ) { scan_video(); @@ -697,11 +697,11 @@ update_status(int clip, double start, double end) ScanStatusGUI:: ScanStatusGUI(ScanStatus *sswindow, int x, int y, int nlines, int nbars) - : BC_Window(_("Scanning"), x, y, 340, - 40 + BC_CancelButton::calculate_h() + + : BC_Window(_("Scanning"), x, y, xS(340), + yS(40) + BC_CancelButton::calculate_h() + (BC_Title::calculate_h((BC_WindowBase*) sswindow-> - commercials->mwindow->gui, _("My")) + 5) * nlines + - (BC_ProgressBar::calculate_h() + 5) * nbars, 0, 0, 0) + commercials->mwindow->gui, _("My")) + yS(5)) * nlines + + (BC_ProgressBar::calculate_h() + yS(5)) * nbars, 0, 0, 0) { this->sswindow = sswindow; this->nlines = nlines; @@ -720,16 +720,18 @@ ScanStatusGUI:: void ScanStatusGUI:: create_objects(const char *text) { + int xs10 = xS(10), xs20 = xS(20); + int ys5 = yS(5), ys10 = yS(10); lock_window("ScanStatusGUI::create_objects"); - int x = 10, y = 10; + int x = xs10, y = ys10; int dy = BC_Title::calculate_h((BC_WindowBase*) sswindow-> - commercials->mwindow->gui, "My") + 5; + commercials->mwindow->gui, "My") + ys5; for( int i=0; igui->get_abs_cursor_x(1), + mwindow->gui->get_abs_cursor_x(1), mwindow->gui->get_abs_cursor_y(1), - 375, - 160) + xS(375), yS(160)) { this->mwindow = mwindow; } @@ -45,7 +44,7 @@ ConfirmQuitWindow::~ConfirmQuitWindow() void ConfirmQuitWindow::create_objects(char *string) { - int x = 10, y = 10; + int x = xS(10), y = yS(10); BC_Title *title; lock_window("ConfirmQuitWindow::create_objects"); @@ -62,8 +61,8 @@ void ConfirmQuitWindow::create_objects(char *string) ConfirmQuitYesButton::ConfirmQuitYesButton(MWindow *mwindow, ConfirmQuitWindow *gui) - : BC_GenericButton(10, - gui->get_h() - BC_GenericButton::calculate_h() - 10, + : BC_GenericButton(xS(10), + gui->get_h() - BC_GenericButton::calculate_h() - yS(10), _("Yes")) { set_underline(0); @@ -85,7 +84,7 @@ int ConfirmQuitYesButton::keypress_event() ConfirmQuitNoButton::ConfirmQuitNoButton(MWindow *mwindow, ConfirmQuitWindow *gui) : BC_GenericButton(gui->get_w() / 2 - BC_GenericButton::calculate_w(gui, _("No")) / 2, - gui->get_h() - BC_GenericButton::calculate_h() - 10, + gui->get_h() - BC_GenericButton::calculate_h() - yS(10), _("No")) { set_underline(0); @@ -106,8 +105,8 @@ int ConfirmQuitNoButton::keypress_event() ConfirmQuitCancelButton::ConfirmQuitCancelButton(MWindow *mwindow, ConfirmQuitWindow *gui) - : BC_GenericButton(gui->get_w() - BC_GenericButton::calculate_w(gui, _("Cancel")) - 10, - gui->get_h() - BC_GenericButton::calculate_h() - 10, + : BC_GenericButton(gui->get_w() - BC_GenericButton::calculate_w(gui, _("Cancel")) - xS(10), + gui->get_h() - BC_GenericButton::calculate_h() - yS(10), _("Cancel")) { } diff --git a/cinelerra-5.1/cinelerra/confirmsave.C b/cinelerra-5.1/cinelerra/confirmsave.C index 3542a049..7fdc98da 100644 --- a/cinelerra-5.1/cinelerra/confirmsave.C +++ b/cinelerra-5.1/cinelerra/confirmsave.C @@ -88,16 +88,16 @@ int ConfirmSave::test_files(MWindow *mwindow, ArrayList *paths) - +#define CSW_W 320 +#define CSW_H 120 ConfirmSaveWindow::ConfirmSaveWindow(MWindow *mwindow, ArrayList *list) : BC_Window(_(PROGRAM_NAME ": File Exists"), - mwindow->gui->get_abs_cursor_x(1) - 160, - mwindow->gui->get_abs_cursor_y(1) - 120, - 320, - 320) + mwindow->gui->get_abs_cursor_x(1) - CSW_W/2, + mwindow->gui->get_abs_cursor_y(1) - CSW_H/2, + CSW_W, CSW_H) { this->list = list; } @@ -109,7 +109,9 @@ ConfirmSaveWindow::~ConfirmSaveWindow() void ConfirmSaveWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; lock_window("ConfirmSaveWindow::create_objects"); add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); @@ -117,16 +119,13 @@ void ConfirmSaveWindow::create_objects() add_subwindow(title = new BC_Title(x, y, _("The following files exist. Overwrite them?"))); - y += 30; - add_subwindow(listbox = new BC_ListBox(x, - y, - get_w() - x - 10, - get_h() - y - BC_OKButton::calculate_h() - 10, + y += ys30; + add_subwindow(listbox = new BC_ListBox(x, y, + get_w() - x - xs10, + get_h() - y - BC_OKButton::calculate_h() - ys10, LISTBOX_TEXT, list)); - y = get_h() - 40; add_subwindow(new BC_OKButton(this)); - x = get_w() - 100; add_subwindow(new BC_CancelButton(this)); show_window(1); unlock_window(); @@ -134,13 +133,14 @@ void ConfirmSaveWindow::create_objects() int ConfirmSaveWindow::resize_event(int w, int h) { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; title->reposition_window(x, y); - y += 30; - listbox->reposition_window(x, - y, - w - x - 10, - h - y - 50); + y += ys30; + listbox->reposition_window(x, y, + w - x - xs10, + h - y - BC_OKButton::calculate_h() - ys10); return 1; } diff --git a/cinelerra-5.1/cinelerra/cpanel.C b/cinelerra-5.1/cinelerra/cpanel.C index e73879e4..fa440711 100644 --- a/cinelerra-5.1/cinelerra/cpanel.C +++ b/cinelerra-5.1/cinelerra/cpanel.C @@ -79,8 +79,8 @@ void CPanel::create_objects() y += operation[CWINDOW_TOOL_WINDOW]->get_h(); subwindow->add_subwindow(operation[CWINDOW_TITLESAFE] = new CPanelTitleSafe(mwindow, this, x, y)); y += operation[CWINDOW_TITLESAFE]->get_h(); - x += (w - BC_Slider::get_span(1)) / 2; y += 15; - subwindow->add_subwindow(cpanel_zoom = new CPanelZoom(mwindow, this, x, y, h-y-20)); + x += (w - BC_Slider::get_span(1)) / 2; y += yS(15); + subwindow->add_subwindow(cpanel_zoom = new CPanelZoom(mwindow, this, x, y, h-y-yS(20))); } void CPanel::reposition_buttons(int x, int y, int h) @@ -95,9 +95,9 @@ void CPanel::reposition_buttons(int x, int y, int h) y += operation[i]->get_h(); } x += (w - BC_Slider::get_span(1)) / 2; - y += 15; + y += yS(15); h = this->h - this->y; - cpanel_zoom->reposition_window(x, y, w, h-y-20); + cpanel_zoom->reposition_window(x, y, w, h-y-yS(20)); cpanel_zoom->set_pointer_motion_range(h); } diff --git a/cinelerra-5.1/cinelerra/cropvideo.C b/cinelerra-5.1/cinelerra/cropvideo.C index f1c2abf5..72aa0b9d 100644 --- a/cinelerra-5.1/cinelerra/cropvideo.C +++ b/cinelerra-5.1/cinelerra/cropvideo.C @@ -94,7 +94,7 @@ int CropVideo::save_defaults() } CropVideoWindow::CropVideoWindow(MWindow *mwindow, CropVideo *thread) - : BC_Window(_(PROGRAM_NAME ": Crop"), 380, 75, 0, 0) + : BC_Window(_(PROGRAM_NAME ": Crop"), xS(380), yS(75), 0, 0) { this->mwindow = mwindow; this->thread = thread; @@ -107,11 +107,11 @@ CropVideoWindow::~CropVideoWindow() void CropVideoWindow::create_objects() { lock_window("CropVideoWindow::create_objects"); - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(new BC_Title(x, y, _("Select a region to crop in the video output window"))); - y += 30; + y += yS(30); add_subwindow(new BC_OKButton(x, y)); - x = get_w() - 100; + x = get_w() - xS(100); add_subwindow(new BC_CancelButton(x, y)); unlock_window(); } diff --git a/cinelerra-5.1/cinelerra/cwindowgui.C b/cinelerra-5.1/cinelerra/cwindowgui.C index 50938bd3..13ac058b 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.C +++ b/cinelerra-5.1/cinelerra/cwindowgui.C @@ -81,7 +81,7 @@ CWindowGUI::CWindowGUI(MWindow *mwindow, CWindow *cwindow) mwindow->session->cwindow_y, mwindow->session->cwindow_w, mwindow->session->cwindow_h, - 100, 100, 1, 1, 1, + xS(100), yS(100), 1, 1, 1, BC_WindowBase::get_resources()->bg_color, mwindow->get_cwindow_display()) { @@ -946,14 +946,7 @@ int CWindowZoom::handle_event() #ifdef USE_SLIDER CWindowSlider::CWindowSlider(MWindow *mwindow, CWindow *cwindow, int x, int y, int pixels) - : BC_PercentageSlider(x, - y, - 0, - pixels, - pixels, - 0, - 1, - 0) + : BC_PercentageSlider(x, y, 0, pixels, pixels, 0, 1, 0) { this->mwindow = mwindow; this->cwindow = cwindow; @@ -1036,15 +1029,10 @@ void CWindowTransport::goto_end() CWindowCanvas::CWindowCanvas(MWindow *mwindow, CWindowGUI *gui) - : Canvas(mwindow, - gui, - mwindow->theme->ccanvas_x, - mwindow->theme->ccanvas_y, - mwindow->theme->ccanvas_w, - mwindow->theme->ccanvas_h, - 0, - 0, - mwindow->edl->session->cwindow_scrollbars) + : Canvas(mwindow, gui, + mwindow->theme->ccanvas_x, mwindow->theme->ccanvas_y, + mwindow->theme->ccanvas_w, mwindow->theme->ccanvas_h, + 0, 0, mwindow->edl->session->cwindow_scrollbars) { this->mwindow = mwindow; this->gui = gui; @@ -1132,8 +1120,8 @@ void CWindowCanvas::draw_refresh(int flush) //printf("CWindowCanvas::draw_refresh 10\n"); } -#define CROPHANDLE_W 10 -#define CROPHANDLE_H 10 +#define CROPHANDLE_W xS(10) +#define CROPHANDLE_H yS(10) void CWindowCanvas::draw_crophandle(int x, int y) { @@ -1141,20 +1129,18 @@ void CWindowCanvas::draw_crophandle(int x, int y) } -#define CONTROL_W 10 -#define CONTROL_H 10 -#define FIRST_CONTROL_W 20 -#define FIRST_CONTROL_H 20 +#define CONTROL_W xS(10) +#define CONTROL_H yS(10) +#define FIRST_CONTROL_W xS(20) +#define FIRST_CONTROL_H yS(20) #undef BC_INFINITY #define BC_INFINITY 65536 -#define RULERHANDLE_W 16 -#define RULERHANDLE_H 16 +#define RULERHANDLE_W xS(16) +#define RULERHANDLE_H yS(16) -int CWindowCanvas::do_ruler(int draw, - int motion, - int button_press, - int button_release) +int CWindowCanvas::do_ruler(int draw, int motion, + int button_press, int button_release) { int result = 0; float x1 = mwindow->edl->session->ruler_x1; @@ -1265,9 +1251,7 @@ int CWindowCanvas::do_ruler(int draw, { double angle_value = fabs(atan((mwindow->edl->session->ruler_y2 - mwindow->edl->session->ruler_y1) / (mwindow->edl->session->ruler_x2 - mwindow->edl->session->ruler_x1)) * - 360 / - 2 / - M_PI); + 360 / 2 / M_PI); double distance_value = sqrt(SQR(mwindow->edl->session->ruler_x2 - mwindow->edl->session->ruler_x1) + SQR(mwindow->edl->session->ruler_y2 - mwindow->edl->session->ruler_y1)); @@ -1315,9 +1299,7 @@ int CWindowCanvas::do_ruler(int draw, { double angle_value = fabs(atan((mwindow->edl->session->ruler_y2 - mwindow->edl->session->ruler_y1) / (mwindow->edl->session->ruler_x2 - mwindow->edl->session->ruler_x1)) * - 360 / - 2 / - M_PI); + 360 / 2 / M_PI); double distance_value = sqrt(SQR(mwindow->edl->session->ruler_x2 - mwindow->edl->session->ruler_x1) + SQR(mwindow->edl->session->ruler_y2 - mwindow->edl->session->ruler_y1)); @@ -1813,15 +1795,13 @@ int CWindowCanvas::do_mask(int &redraw, int &rerender, // Make copy of current parameters in local keyframe gui->mask_keyframe = (MaskAuto*)gui->cwindow->calculate_affected_auto( - mask_autos, - 0); + mask_autos, 0); gui->orig_mask_keyframe->copy_data(gui->mask_keyframe); #else gui->mask_keyframe = (MaskAuto*)gui->cwindow->calculate_affected_auto( - mask_autos, - 1); + mask_autos, 1); #endif } SubMask *mask = gui->mask_keyframe->get_submask(mwindow->edl->session->cwindow_mask); @@ -3128,7 +3108,7 @@ int CWindowCanvas::test_bezier(int button_press, float z_val = gui->affected_z->get_value(); if( gui->translating_zoom ) { - float z = gui->center_z + (cursor_y - gui->y_origin) / 128; + float z = gui->center_z + (cursor_y - gui->y_origin) / yS(128); if( z < 0 ) z = 0; if( !EQUIV(z_val, z) ) { rerender = 1; diff --git a/cinelerra-5.1/cinelerra/cwindowtool.C b/cinelerra-5.1/cinelerra/cwindowtool.C index 88a524d7..64c3c78e 100644 --- a/cinelerra-5.1/cinelerra/cwindowtool.C +++ b/cinelerra-5.1/cinelerra/cwindowtool.C @@ -263,20 +263,10 @@ void CWindowTool::update_values() CWindowToolGUI::CWindowToolGUI(MWindow *mwindow, - CWindowTool *thread, - const char *title, - int w, - int h) + CWindowTool *thread, const char *title, int w, int h) : BC_Window(title, - mwindow->session->ctool_x, - mwindow->session->ctool_y, - w, - h, - w, - h, - 0, - 0, - 1) + mwindow->session->ctool_x, mwindow->session->ctool_y, + w, h, w, h, 0, 0, 1) { this->mwindow = mwindow; this->thread = thread; @@ -354,14 +344,14 @@ void CWindowToolGUI::draw_preview(int changed_edl) CWindowCoord::CWindowCoord(CWindowToolGUI *gui, int x, int y, float value, int log_increment = 0) - : BC_TumbleTextBox(gui, (float)value, (float)-65536, (float)65536, x, y, 70, 3) + : BC_TumbleTextBox(gui, (float)value, (float)-65536, (float)65536, x, y, xS(70), 3) { this->gui = gui; set_log_floatincrement(log_increment); } CWindowCoord::CWindowCoord(CWindowToolGUI *gui, int x, int y, int value) - : BC_TumbleTextBox(gui, (int64_t)value, (int64_t)-65536, (int64_t)65536, x, y, 70) + : BC_TumbleTextBox(gui, (int64_t)value, (int64_t)-65536, (int64_t)65536, x, y, xS(70)) { this->gui = gui; } @@ -404,11 +394,11 @@ const char *CWindowCropOpMode::crop_ops[] = { CWindowCropOpMode::CWindowCropOpMode(MWindow *mwindow, CWindowCropGUI *crop_gui, int mode, int x, int y) - : BC_PopupMenu(x, y, 140, _(crop_ops[mode]), 1) + : BC_PopupMenu(x, y, xS(140), _(crop_ops[mode]), 1) { - this->mwindow = mwindow; - this->crop_gui = crop_gui; - this->mode = mode; + this->mwindow = mwindow; + this->crop_gui = crop_gui; + this->mode = mode; } CWindowCropOpMode::~CWindowCropOpMode() { @@ -446,11 +436,7 @@ int CWindowCropOpItem::handle_event() CWindowCropGUI::CWindowCropGUI(MWindow *mwindow, CWindowTool *thread) - : CWindowToolGUI(mwindow, - thread, - _(PROGRAM_NAME ": Crop"), - 330, - 100) + : CWindowToolGUI(mwindow, thread, _(PROGRAM_NAME ": Crop"), xS(330), yS(100)) { } @@ -461,13 +447,15 @@ CWindowCropGUI::~CWindowCropGUI() void CWindowCropGUI::create_objects() { - int x = 10, y = 10; + int xs5 = xS(5), xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10); + int x = xs10, y = ys10; BC_Title *title; lock_window("CWindowCropGUI::create_objects"); int column1 = 0; int pad = MAX(BC_TextBox::calculate_h(this, MEDIUMFONT, 1, 1), - BC_Title::calculate_h(this, "X")) + 5; + BC_Title::calculate_h(this, "X")) + ys5; add_subwindow(title = new BC_Title(x, y, "X1:")); column1 = MAX(column1, title->get_w()); y += pad; @@ -476,8 +464,8 @@ void CWindowCropGUI::create_objects() y += pad; add_subwindow(new CWindowCropApply(mwindow, this, x, y)); - x += column1 + 5; - y = 10; + x += column1 + xs5; + y = ys10; x1 = new CWindowCoord(thread->tool_gui, x, y, mwindow->edl->session->crop_x1); x1->create_objects(); @@ -489,8 +477,8 @@ void CWindowCropGUI::create_objects() width->set_boundaries((int64_t)1, (int64_t)65536); - x += x1->get_w() + 10; - y = 10; + x += x1->get_w() + xs10; + y = ys10; int column2 = 0; add_subwindow(title = new BC_Title(x, y, "Y1:")); column2 = MAX(column2, title->get_w()); @@ -499,8 +487,8 @@ void CWindowCropGUI::create_objects() column2 = MAX(column2, title->get_w()); y += pad; - y = 10; - x += column2 + 5; + y = ys10; + x += column2 + xs5; y1 = new CWindowCoord(thread->tool_gui, x, y, mwindow->edl->session->crop_y1); y1->create_objects(); @@ -539,10 +527,10 @@ void CWindowCropGUI::handle_event() mwindow->edl->session->crop_y1; mwindow->edl->session->crop_y1 = atol(y1->get_text()); } - mwindow->edl->session->crop_x2 = atol(width->get_text()) + - mwindow->edl->session->crop_x1; - mwindow->edl->session->crop_y2 = atol(height->get_text()) + - mwindow->edl->session->crop_y1; + mwindow->edl->session->crop_x2 = atol(width->get_text()) + + mwindow->edl->session->crop_x1; + mwindow->edl->session->crop_y2 = atol(height->get_text()) + + mwindow->edl->session->crop_y1; update(); mwindow->cwindow->gui->canvas->redraw(1); } @@ -559,7 +547,7 @@ void CWindowCropGUI::update() CWindowEyedropGUI::CWindowEyedropGUI(MWindow *mwindow, CWindowTool *thread) - : CWindowToolGUI(mwindow, thread, _(PROGRAM_NAME ": Color"), 220, 290) + : CWindowToolGUI(mwindow, thread, _(PROGRAM_NAME ": Color"), xS(220), yS(290)) { } @@ -569,10 +557,11 @@ CWindowEyedropGUI::~CWindowEyedropGUI() void CWindowEyedropGUI::create_objects() { + int xs10 = xS(10), ys10 = yS(10); int margin = mwindow->theme->widget_border; - int x = 10 + margin; - int y = 10 + margin; - int x2 = 70, x3 = x2 + 60; + int x = xs10 + margin; + int y = ys10 + margin; + int x2 = xS(70), x3 = x2 + xS(60); lock_window("CWindowEyedropGUI::create_objects"); BC_Title *title0, *title1, *title2, *title3, *title4, *title5, *title6, *title7; add_subwindow(title0 = new BC_Title(x, y,_("X,Y:"))); @@ -611,7 +600,7 @@ void CWindowEyedropGUI::create_objects() add_subwindow(yuv_hex = new BC_Title(x3, this->y->get_y(), "#000000")); y = title6->get_y() + this->v->get_h() + 2*margin; - add_subwindow(sample = new BC_SubWindow(x, y, 50, 50)); + add_subwindow(sample = new BC_SubWindow(x, y, xS(50), yS(50))); y += sample->get_h() + margin; add_subwindow(use_max = new CWindowEyedropCheckBox(mwindow, this, x, y)); update(); @@ -789,7 +778,7 @@ int CWindowCurveToggle::handle_event() } -CWindowEyedropCheckBox::CWindowEyedropCheckBox(MWindow *mwindow, +CWindowEyedropCheckBox::CWindowEyedropCheckBox(MWindow *mwindow, CWindowEyedropGUI *gui, int x, int y) : BC_CheckBox(x, y, mwindow->edl->local_session->use_max, _("Use maximum")) { @@ -807,11 +796,7 @@ int CWindowEyedropCheckBox::handle_event() CWindowCameraGUI::CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread) - : CWindowToolGUI(mwindow, - thread, - _(PROGRAM_NAME ": Camera"), - 170, - 170) + : CWindowToolGUI(mwindow, thread, _(PROGRAM_NAME ": Camera"), xS(170), yS(170)) { } CWindowCameraGUI::~CWindowCameraGUI() @@ -820,7 +805,9 @@ CWindowCameraGUI::~CWindowCameraGUI() void CWindowCameraGUI::create_objects() { - int x = 10, y = 10, x1; + int xs10 = xS(10), xs15 = xS(15); + int ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10, x1; Track *track = mwindow->cwindow->calculate_affected_track(); FloatAuto *x_auto = 0, *y_auto = 0, *z_auto = 0; BC_Title *title; @@ -839,15 +826,15 @@ void CWindowCameraGUI::create_objects() this->x->create_objects(); - y += 30; - x = 10; + y += ys30; + x = xs10; add_subwindow(title = new BC_Title(x, y, "Y:")); x += title->get_w(); this->y = new CWindowCoord(this, x, y, y_auto ? y_auto->get_value() : (float)0); this->y->create_objects(); - y += 30; - x = 10; + y += ys30; + x = xs10; add_subwindow(title = new BC_Title(x, y, "Z:")); x += title->get_w(); this->z = new CWindowCoord(this, x, y, @@ -855,29 +842,29 @@ void CWindowCameraGUI::create_objects() this->z->create_objects(); this->z->set_increment(0.01); - y += 30; - x1 = 10; + y += ys30; + x1 = xs10; add_subwindow(button = new CWindowCameraLeft(mwindow, this, x1, y)); x1 += button->get_w(); add_subwindow(button = new CWindowCameraCenter(mwindow, this, x1, y)); x1 += button->get_w(); add_subwindow(button = new CWindowCameraRight(mwindow, this, x1, y)); // additional Buttons to control the curve mode of the "current" keyframe - x1 += button->get_w() + 15; + x1 += button->get_w() + xs15; add_subwindow(this->t_smooth = new CWindowCurveToggle(Camera_Crv_Smooth, mwindow, this, x1, y)); - x1 += button->get_w() + 10; + x1 += button->get_w() + xs10; add_subwindow(this->t_linear = new CWindowCurveToggle(Camera_Crv_Linear, mwindow, this, x1, y)); y += button->get_h(); - x1 = 10; + x1 = xs10; add_subwindow(button = new CWindowCameraTop(mwindow, this, x1, y)); x1 += button->get_w(); add_subwindow(button = new CWindowCameraMiddle(mwindow, this, x1, y)); x1 += button->get_w(); add_subwindow(button = new CWindowCameraBottom(mwindow, this, x1, y)); - x1 += button->get_w() + 15; + x1 += button->get_w() + xs15; add_subwindow(this->add_keyframe = new CWindowCameraAddKeyframe(mwindow, this, x1, y)); - x1 += button->get_w() + 10; + x1 += button->get_w() + xs10; add_subwindow(this->reset = new CWindowCameraReset(mwindow, this, x1, y)); // fill in current auto keyframe values, set toggle states. @@ -897,8 +884,7 @@ void CWindowCameraGUI::handle_event() if(event_caller == x) { x_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto( - track->automation->autos[AUTOMATION_CAMERA_X], - 1); + track->automation->autos[AUTOMATION_CAMERA_X], 1); if(x_auto) { x_auto->set_value(atof(x->get_text())); @@ -910,8 +896,7 @@ void CWindowCameraGUI::handle_event() if(event_caller == y) { y_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto( - track->automation->autos[AUTOMATION_CAMERA_Y], - 1); + track->automation->autos[AUTOMATION_CAMERA_Y], 1); if(y_auto) { y_auto->set_value(atof(y->get_text())); @@ -923,8 +908,7 @@ void CWindowCameraGUI::handle_event() if(event_caller == z) { z_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto( - track->automation->autos[AUTOMATION_CAMERA_Z], - 1); + track->automation->autos[AUTOMATION_CAMERA_Z], 1); if(z_auto) { float zoom = atof(z->get_text()); @@ -1003,8 +987,7 @@ int CWindowCameraLeft::handle_event() int w = 0, h = 0; track->get_source_dimensions( mwindow->edl->local_session->get_selectionstart(1), - w, - h); + w, h); if(w && h) { @@ -1035,8 +1018,7 @@ int CWindowCameraCenter::handle_event() Track *track = mwindow->cwindow->calculate_affected_track(); if(track) x_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto( - track->automation->autos[AUTOMATION_CAMERA_X], - 1); + track->automation->autos[AUTOMATION_CAMERA_X], 1); if(x_auto) { @@ -1073,8 +1055,7 @@ int CWindowCameraRight::handle_event() int w = 0, h = 0; track->get_source_dimensions( mwindow->edl->local_session->get_selectionstart(1), - w, - h); + w, h); if(w && h) { @@ -1113,8 +1094,7 @@ int CWindowCameraTop::handle_event() int w = 0, h = 0; track->get_source_dimensions( mwindow->edl->local_session->get_selectionstart(1), - w, - h); + w, h); if(w && h) { @@ -1181,8 +1161,7 @@ int CWindowCameraBottom::handle_event() int w = 0, h = 0; track->get_source_dimensions( mwindow->edl->local_session->get_selectionstart(1), - w, - h); + w, h); if(w && h) { @@ -1228,11 +1207,7 @@ int CWindowCameraReset::handle_event() CWindowProjectorGUI::CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread) - : CWindowToolGUI(mwindow, - thread, - _(PROGRAM_NAME ": Projector"), - 170, - 170) + : CWindowToolGUI(mwindow, thread, _(PROGRAM_NAME ": Projector"), xS(170), yS(170)) { } CWindowProjectorGUI::~CWindowProjectorGUI() @@ -1240,7 +1215,9 @@ CWindowProjectorGUI::~CWindowProjectorGUI() } void CWindowProjectorGUI::create_objects() { - int x = 10, y = 10, x1; + int xs10 = xS(10), xs15 = xS(15); + int ys30 = yS(30); + int x = xs10, y = yS(10); Track *track = mwindow->cwindow->calculate_affected_track(); FloatAuto *x_auto = 0; FloatAuto *y_auto = 0; @@ -1259,15 +1236,15 @@ void CWindowProjectorGUI::create_objects() this->x = new CWindowCoord(this, x, y, x_auto ? x_auto->get_value() : (float)0); this->x->create_objects(); - y += 30; - x = 10; + y += ys30; + x = xs10; add_subwindow(title = new BC_Title(x, y, "Y:")); x += title->get_w(); this->y = new CWindowCoord(this, x, y, y_auto ? y_auto->get_value() : (float)0); this->y->create_objects(); - y += 30; - x = 10; + y += ys30; + x = xs10; add_subwindow(title = new BC_Title(x, y, "Z:")); x += title->get_w(); this->z = new CWindowCoord(this, x, y, @@ -1275,29 +1252,29 @@ void CWindowProjectorGUI::create_objects() this->z->create_objects(); this->z->set_increment(0.01); - y += 30; - x1 = 10; + y += ys30; + int x1 = xs10; add_subwindow(button = new CWindowProjectorLeft(mwindow, this, x1, y)); x1 += button->get_w(); add_subwindow(button = new CWindowProjectorCenter(mwindow, this, x1, y)); x1 += button->get_w(); add_subwindow(button = new CWindowProjectorRight(mwindow, this, x1, y)); // additional Buttons to control the curve mode of the "current" keyframe - x1 += button->get_w() + 15; + x1 += button->get_w() + xs15; add_subwindow(this->t_smooth = new CWindowCurveToggle(Projector_Crv_Smooth, mwindow, this, x1, y)); - x1 += button->get_w() + 10; + x1 += button->get_w() + xs10; add_subwindow(this->t_linear = new CWindowCurveToggle(Projector_Crv_Linear, mwindow, this, x1, y)); y += button->get_h(); - x1 = 10; + x1 = xs10; add_subwindow(button = new CWindowProjectorTop(mwindow, this, x1, y)); x1 += button->get_w(); add_subwindow(button = new CWindowProjectorMiddle(mwindow, this, x1, y)); x1 += button->get_w(); add_subwindow(button = new CWindowProjectorBottom(mwindow, this, x1, y)); - x1 += button->get_w() + 15; + x1 += button->get_w() + xs15; add_subwindow(this->add_keyframe = new CWindowProjectorAddKeyframe(mwindow, this, x1, y)); - x1 += button->get_w() + 10; + x1 += button->get_w() + xs10; add_subwindow(this->reset = new CWindowProjectorReset(mwindow, this, x1, y)); // fill in current auto keyframe values, set toggle states. @@ -1318,8 +1295,7 @@ void CWindowProjectorGUI::handle_event() if(event_caller == x) { x_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto( - track->automation->autos[AUTOMATION_PROJECTOR_X], - 1); + track->automation->autos[AUTOMATION_PROJECTOR_X], 1); if(x_auto) { x_auto->set_value(atof(x->get_text())); @@ -1331,8 +1307,7 @@ void CWindowProjectorGUI::handle_event() if(event_caller == y) { y_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto( - track->automation->autos[AUTOMATION_PROJECTOR_Y], - 1); + track->automation->autos[AUTOMATION_PROJECTOR_Y], 1); if(y_auto) { y_auto->set_value(atof(y->get_text())); @@ -1344,8 +1319,7 @@ void CWindowProjectorGUI::handle_event() if(event_caller == z) { z_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto( - track->automation->autos[AUTOMATION_PROJECTOR_Z], - 1); + track->automation->autos[AUTOMATION_PROJECTOR_Z], 1); if(z_auto) { float zoom = atof(z->get_text()); @@ -1440,8 +1414,7 @@ int CWindowProjectorCenter::handle_event() Track *track = mwindow->cwindow->calculate_affected_track(); if(track) x_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto( - track->automation->autos[AUTOMATION_PROJECTOR_X], - 1); + track->automation->autos[AUTOMATION_PROJECTOR_X], 1); if(x_auto) { @@ -1617,7 +1590,7 @@ int CWindowToolGUI::press(void (CWindowCanvas::*fn)()) CWindowMaskOnTrack::CWindowMaskOnTrack(MWindow *mwindow, CWindowMaskGUI *gui, int x, int y, int w, const char *text) - : BC_PopupTextBox(gui, 0, text, x, y, w, 120) + : BC_PopupTextBox(gui, 0, text, x, y, w, yS(120)) { this->mwindow = mwindow; this->gui = gui; @@ -1723,7 +1696,7 @@ int CWindowMaskTrackTumbler::do_event(int dir) CWindowMaskName::CWindowMaskName(MWindow *mwindow, CWindowMaskGUI *gui, int x, int y, const char *text) - : BC_PopupTextBox(gui, 0, text, x, y, 100, 160) + : BC_PopupTextBox(gui, 0, text, x, y, xS(100), yS(160)) { this->mwindow = mwindow; this->gui = gui; @@ -2055,7 +2028,7 @@ CWindowMaskAffectedPoint::CWindowMaskAffectedPoint(MWindow *mwindow, CWindowMaskGUI *gui, int x, int y) : BC_TumbleTextBox(gui, (int64_t)mwindow->cwindow->gui->affected_point, - (int64_t)0, INT64_MAX, x, y, 70) + (int64_t)0, INT64_MAX, x, y, xS(70)) { this->mwindow = mwindow; this->gui = gui; @@ -2205,7 +2178,7 @@ int CWindowMaskDrawBoundary::handle_event() CWindowMaskFeather::CWindowMaskFeather(MWindow *mwindow, CWindowMaskGUI *gui, int x, int y) - : BC_TumbleTextBox(gui, 0, INT_MIN, INT_MAX, x, y, 64, 2) + : BC_TumbleTextBox(gui, 0, INT_MIN, INT_MAX, x, y, xS(64), 2) { this->mwindow = mwindow; this->gui = gui; @@ -2336,7 +2309,7 @@ int CWindowMaskFeatherSlider::update(int r, float v, float mn, float mx) } CWindowMaskFade::CWindowMaskFade(MWindow *mwindow, CWindowMaskGUI *gui, int x, int y) - : BC_TumbleTextBox(gui, 0, -100.f, 100.f, x, y, 64, 2) + : BC_TumbleTextBox(gui, 0, -100.f, 100.f, x, y, xS(64), 2) { this->mwindow = mwindow; this->gui = gui; @@ -2643,7 +2616,7 @@ int CWindowMaskGangFeather::handle_event() CWindowMaskGUI::CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread) : CWindowToolGUI(mwindow, thread, - _(PROGRAM_NAME ": Mask"), 440, 700) + _(PROGRAM_NAME ": Mask"), xS(440), yS(700)) { this->mwindow = mwindow; this->thread = thread; @@ -2669,24 +2642,28 @@ CWindowMaskGUI::~CWindowMaskGUI() void CWindowMaskGUI::create_objects() { + int t[SUBMASKS]; Theme *theme = mwindow->theme; - int x = 10, y = 10, margin = theme->widget_border, t[SUBMASKS]; + int xs10 = xS(10), ys10 = yS(10); + int x = xs10, y = ys10; + int margin = theme->widget_border; int clr_w = CWindowMaskClrMask::calculate_w(mwindow); int clr_x = get_w()-x - clr_w; lock_window("CWindowMaskGUI::create_objects"); BC_TitleBar *title_bar; - add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, 20, 10, _("Masks on Track"))); + add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xS(20), xS(10), + _("Masks on Track"))); y += title_bar->get_h() + margin; BC_Title *title; add_subwindow(title = new BC_Title(x,y, _("Track:"))); - int x1 = x + 90, ww = clr_x-2*margin - x1; + int x1 = x + xS(90), ww = clr_x-2*margin - x1; for( int i=0,n=sizeof(t)/sizeof(t[0]); icwindow->calculate_affected_track(); const char *text = track ? track->title : ""; mwindow->cwindow->mask_track_id = track ? track->get_id() : -1; - mask_on_track = new CWindowMaskOnTrack(mwindow, this, x1, y, 100, text); + mask_on_track = new CWindowMaskOnTrack(mwindow, this, x1, y, xS(100), text); mask_on_track->create_objects(); mask_on_track->set_tooltip(_("Video track")); int x2 = x1 + mask_on_track->get_w(); @@ -2694,7 +2671,8 @@ void CWindowMaskGUI::create_objects() mwindow->edl->local_session->solo_track_id = -1; add_subwindow(mask_solo_track = new CWindowMaskSoloTrack(mwindow, this, del_x, y, 0)); y += mask_on_track->get_h() + margin; - add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, 20, 10, _("Masks"))); + add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xS(20), xS(10), + _("Masks"))); y += title_bar->get_h() + margin; add_subwindow(title = new BC_Title(x, y, _("Mask:"))); mask_name = new CWindowMaskName(mwindow, this, x1, y, ""); @@ -2731,7 +2709,8 @@ void CWindowMaskGUI::create_objects() } add_subwindow(mask_unclr = new CWindowMaskUnclear(mwindow, this, clr_x, y)); y += mask_enables[0]->get_h() + 2*margin; - add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, 20, 10, _("Preset Shapes"))); + add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xS(20), xS(10), + _("Preset Shapes"))); y += title_bar->get_h() + margin; add_subwindow(mask_shape_sqr = new CWindowMaskShape(mwindow, this, "mask_prst_sqr_images", MASK_SHAPE_SQUARE, t[0], y, _("Square"))); @@ -2742,14 +2721,15 @@ void CWindowMaskGUI::create_objects() add_subwindow(mask_shape_ovl = new CWindowMaskShape(mwindow, this, "mask_prst_ovl_images", MASK_SHAPE_OVAL, t[3], y, _("Oval"))); add_subwindow(mask_load_list = new CWindowMaskLoadList(mwindow, this)); - add_subwindow(mask_load = new CWindowMaskLoad(mwindow, this, t[5], y, 80)); - add_subwindow(mask_save = new CWindowMaskSave(mwindow, this, t[6], y, 80)); - add_subwindow(mask_delete = new CWindowMaskDelete(mwindow, this, t[7], y, 80)); + add_subwindow(mask_load = new CWindowMaskLoad(mwindow, this, t[5], y, xS(80))); + add_subwindow(mask_save = new CWindowMaskSave(mwindow, this, t[6], y, xS(80))); + add_subwindow(mask_delete = new CWindowMaskDelete(mwindow, this, t[7], y, xS(80))); y += mask_load->get_h() + 2*margin; - add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, 20, 10, _("Position & Scale"))); + add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xS(20), xS(10), + _("Position & Scale"))); y += title_bar->get_h() + 2*margin; - add_subwindow(mask_center = new CWindowMaskCenter(mwindow, this, t[0], y, 80)); - add_subwindow(mask_normal = new CWindowMaskNormal(mwindow, this, t[1], y, 80)); + add_subwindow(mask_center = new CWindowMaskCenter(mwindow, this, t[0], y, xS(80))); + add_subwindow(mask_normal = new CWindowMaskNormal(mwindow, this, t[1], y, xS(80))); add_subwindow(mask_scale_x = new CWindowMaskScaleXY(mwindow, this, t[5], y, theme->get_image_set("mask_scale_x"), 0, MASK_SCALE_X, _("xlate/scale x"))); @@ -2758,7 +2738,8 @@ void CWindowMaskGUI::create_objects() add_subwindow(mask_scale_xy = new CWindowMaskScaleXY(mwindow, this, t[7], y, theme->get_image_set("mask_scale_xy"), 1, MASK_SCALE_XY, _("xlate/scale xy"))); y += mask_center->get_h() + 2*margin; - add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, 20, 10, _("Fade & Feather"))); + add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xS(20), xS(10), + _("Fade & Feather"))); y += title_bar->get_h() + 2*margin; add_subwindow(title = new BC_Title(x, y, _("Fade:"))); @@ -2777,7 +2758,8 @@ void CWindowMaskGUI::create_objects() add_subwindow(feather_slider); add_subwindow(gang_feather = new CWindowMaskGangFeather(mwindow, this, clr_x, y)); y += feather->get_h() + 2*margin; - add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, 20, 10, _("Mask Points"))); + add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xS(20), xS(10), + _("Mask Points"))); y += title_bar->get_h() + margin; add_subwindow(title = new BC_Title(x, y, _("Point:"))); @@ -2811,7 +2793,8 @@ void CWindowMaskGUI::create_objects() _("smooth all"), -1, 1, t[4], y, "mask_all_smooth_images")); add_subwindow(draw_boundary = new CWindowMaskDrawBoundary(mwindow, this, del_x, y)); y += this->y->get_h() + 2*margin; - add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, 20, 10, _("Pivot Point"))); + add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xS(20), xS(10), + _("Pivot Point"))); y += title_bar->get_h() + margin; add_subwindow(title = new BC_Title(x, y, "X:")); @@ -2828,9 +2811,9 @@ void CWindowMaskGUI::create_objects() y += focus_y->get_h() + 2*margin; add_subwindow(bar = new BC_Bar(x, y, get_w()-2*x)); y += bar->get_h() + margin; - add_subwindow(this->apply_before_plugins = new CWindowMaskBeforePlugins(this, 10, y)); + add_subwindow(this->apply_before_plugins = new CWindowMaskBeforePlugins(this, x, y)); y += this->apply_before_plugins->get_h(); - add_subwindow(this->disable_opengl_masking = new CWindowDisableOpenGLMasking(this, 10, y)); + add_subwindow(this->disable_opengl_masking = new CWindowDisableOpenGLMasking(this, x, y)); add_subwindow(help = new CWindowMaskHelp(mwindow, this, del_x, y)); y += this->disable_opengl_masking->get_h() + 2*margin; help_y = y; @@ -3317,7 +3300,7 @@ int CWindowMaskLoad::handle_event() gui->mask_load_list->create_objects(); int px, py; get_abs_cursor(px, py); - return gui->mask_load_list->activate(px, py, 120,160); + return gui->mask_load_list->activate(px, py, xS(120),yS(160)); } @@ -3399,24 +3382,26 @@ void CWindowMaskPresetDialog::start_dialog(int sx, int sy, MaskAuto *keyframe) CWindowMaskPresetGUI::CWindowMaskPresetGUI(CWindowMaskPresetDialog *preset_dialog, int x, int y, const char *title) - : BC_Window(title, x, y, 320, 100, 320, 100, 0, 0, 1) + : BC_Window(title, x, y, xS(320), yS(100), xS(320), yS(100), 0, 0, 1) { this->preset_dialog = preset_dialog; } void CWindowMaskPresetGUI::create_objects() { - int x = 10, y = 10, pad = 8; + int xs8 = xS(8), xs10 = xS(10); + int ys10 = yS(10); + int x = xs10, y = ys10; lock_window("CWindowMaskPresetGUI::create_objects"); BC_Title *title; add_subwindow(title = new BC_Title(x, y, preset_dialog->keyframe ? _("Save mask:") : _("Delete mask:"))); - int x1 = x + title->get_w() + pad; - int x2 = get_w() - x - pad - x1 - + int x1 = x + title->get_w() + xs8; + int x2 = get_w() - x - xs8 - x1 - BC_WindowBase::get_resources()->listbox_button[0]->get_w(); CWindowMaskGUI *gui = preset_dialog->gui; preset_text = new CWindowMaskPresetText(this, - x1, y, x2, 120, gui->mask_name->get_text()); + x1, y, x2, yS(120), gui->mask_name->get_text()); preset_text->create_objects(); preset_text->set_tooltip(_("Mask name")); preset_text->update_items(); @@ -3669,7 +3654,7 @@ void CWindowMaskGUI::save_masks(ArrayList &masks) CWindowRulerGUI::CWindowRulerGUI(MWindow *mwindow, CWindowTool *thread) - : CWindowToolGUI(mwindow, thread, _(PROGRAM_NAME ": Ruler"), 320, 240) + : CWindowToolGUI(mwindow, thread, _(PROGRAM_NAME ": Ruler"), xS(320), yS(240)) { } @@ -3679,28 +3664,30 @@ CWindowRulerGUI::~CWindowRulerGUI() void CWindowRulerGUI::create_objects() { - int x = 10, y = 10, x1 = 100; + int xs10 = xS(10), xs200 = xS(200); + int ys5 = yS(5), ys10 = yS(10); + int x = xs10, y = ys10, x1 = xS(100); BC_Title *title; lock_window("CWindowRulerGUI::create_objects"); add_subwindow(title = new BC_Title(x, y, _("Current:"))); - add_subwindow(current = new BC_TextBox(x1, y, 200, 1, "")); - y += title->get_h() + 5; + add_subwindow(current = new BC_TextBox(x1, y, xs200, 1, "")); + y += title->get_h() + ys5; add_subwindow(title = new BC_Title(x, y, _("Point 1:"))); - add_subwindow(point1 = new BC_TextBox(x1, y, 200, 1, "")); - y += title->get_h() + 5; + add_subwindow(point1 = new BC_TextBox(x1, y, xs200, 1, "")); + y += title->get_h() + ys5; add_subwindow(title = new BC_Title(x, y, _("Point 2:"))); - add_subwindow(point2 = new BC_TextBox(x1, y, 200, 1, "")); - y += title->get_h() + 5; + add_subwindow(point2 = new BC_TextBox(x1, y, xs200, 1, "")); + y += title->get_h() + ys5; add_subwindow(title = new BC_Title(x, y, _("Deltas:"))); - add_subwindow(deltas = new BC_TextBox(x1, y, 200, 1, "")); - y += title->get_h() + 5; + add_subwindow(deltas = new BC_TextBox(x1, y, xs200, 1, "")); + y += title->get_h() + ys5; add_subwindow(title = new BC_Title(x, y, _("Distance:"))); - add_subwindow(distance = new BC_TextBox(x1, y, 200, 1, "")); - y += title->get_h() + 5; + add_subwindow(distance = new BC_TextBox(x1, y, xs200, 1, "")); + y += title->get_h() + ys5; add_subwindow(title = new BC_Title(x, y, _("Angle:"))); - add_subwindow(angle = new BC_TextBox(x1, y, 200, 1, "")); - y += title->get_h() + 10; + add_subwindow(angle = new BC_TextBox(x1, y, xs200, 1, "")); + y += title->get_h() + ys10; char string[BCTEXTLEN]; sprintf(string, _("Press Ctrl to lock ruler to the\nnearest 45%c%c angle."), @@ -3708,7 +3695,7 @@ void CWindowRulerGUI::create_objects() add_subwindow(title = new BC_Title(x, y, string)); - y += title->get_h() + 10; + y += title->get_h() + ys10; sprintf(string, _("Press Alt to translate the ruler.")); add_subwindow(title = new BC_Title(x, y, diff --git a/cinelerra-5.1/cinelerra/dbwindow.C b/cinelerra-5.1/cinelerra/dbwindow.C index d61e6363..28603bc6 100644 --- a/cinelerra-5.1/cinelerra/dbwindow.C +++ b/cinelerra-5.1/cinelerra/dbwindow.C @@ -504,39 +504,41 @@ selection_changed() void DbWindowGUI:: create_objects() { - int pady = BC_TextBox::calculate_h(this, MEDIUMFONT, 0, 1) + 5; + int xs10 = xS(10), xs15 = xS(15); + int ys5 = yS(5), ys10 = yS(10); + int pady = BC_TextBox::calculate_h(this, MEDIUMFONT, 0, 1) + ys5; int padx = BC_Title::calculate_w(this, (char*)"X", MEDIUMFONT); int x = padx/2, y = pady/4; text_x = x; text_y = y; BC_Title *title = new BC_Title(text_x, text_y, _("Text:"), MEDIUMFONT, YELLOW); add_subwindow(title); x += title->get_w(); - search_text = new DbWindowText(this, x, y, get_w()-x-10); + search_text = new DbWindowText(this, x, y, get_w()-x-xs10); add_subwindow(search_text); - x = padx; y += pady + 5; + x = padx; y += pady + ys5; title_text = new DbWindowTitleText(this, x, y); add_subwindow(title_text); x += title_text->get_w() + padx; info_text = new DbWindowInfoText(this, x, y); add_subwindow(info_text); x += title_text->get_w() + padx; match_case = new DbWindowMatchCase(this, x, y); add_subwindow(match_case); x += match_case->get_w() + padx; - x = padx; y += pady + 5; - search_x = 10; - search_y = get_h() - DbWindowStart::calculate_h() - 10; + x = padx; y += pady + ys5; + search_x = xs10; + search_y = get_h() - DbWindowStart::calculate_h() - ys10; search_start = new DbWindowStart(this, search_x, search_y); add_subwindow(search_start); - del_items_x = search_x + DbWindowStart::calculate_w(this, search_start->get_text()) + 15; + del_items_x = search_x + DbWindowStart::calculate_w(this, search_start->get_text()) + xs15; del_items_y = search_y; del_items = new DbWindowDeleteItems(this, del_items_x, del_items_y); add_subwindow(del_items); cancel_w = DbWindowCancel::calculate_w(); cancel_h = DbWindowCancel::calculate_h(); - cancel_x = get_w() - cancel_w - 10; - cancel_y = get_h() - cancel_h - 10; + cancel_x = get_w() - cancel_w - xs10; + cancel_y = get_h() - cancel_h - ys10; cancel = new DbWindowCancel(this, cancel_x, cancel_y); add_subwindow(cancel); list_x = x; list_y = y; - int list_w = get_w()-10 - list_x; - int list_h = min(search_y, cancel_y)-10 - list_y; + int list_w = get_w()-xs10 - list_x; + int list_h = min(search_y, cancel_y)-ys10 - list_y; search_list = new DbWindowList(this, list_x, list_y, list_w, list_h); add_subwindow(search_list); vicon_thread = new DbWindowVIconThread(this); @@ -552,13 +554,15 @@ create_objects() set_icon(dwindow->mwindow->theme->get_image("record_icon")); } +#define DBW_W xS(900) +#define DBW_H yS(600) DbWindowGUI:: DbWindowGUI(DbWindow *dwindow) : BC_Window(_(PROGRAM_NAME ": DbWindow"), - dwindow->mwindow->gui->get_abs_cursor_x(1) - 900 / 2, - dwindow->mwindow->gui->get_abs_cursor_y(1) - 600 / 2, - 900, 600, 400, 400) + dwindow->mwindow->gui->get_abs_cursor_x(1) - DBW_W / 2, + dwindow->mwindow->gui->get_abs_cursor_y(1) - DBW_H / 2, + DBW_W, DBW_H, xS(400), yS(400)) { this->dwindow = dwindow; @@ -592,18 +596,18 @@ DbWindowGUI(DbWindow *dwindow) search_column_titles[col_start_time] = _("Start time"); search_column_titles[col_access_time] = _("Access time"); search_column_titles[col_access_count] = _("count"); - search_column_widths[col_vicon] = 90; - search_column_widths[col_id] = 60; - search_column_widths[col_length] = 80; - search_column_widths[col_source] = 50; - search_column_widths[col_title] = 160; - search_column_widths[col_start_time] = 140; - search_column_widths[col_access_time] = 140; - search_column_widths[col_access_count] = 60; + search_column_widths[col_vicon] = xS(90); + search_column_widths[col_id] = xS(60); + search_column_widths[col_length] = xS(80); + search_column_widths[col_source] = xS(50); + search_column_widths[col_title] = xS(160); + search_column_widths[col_start_time] = xS(140); + search_column_widths[col_access_time] = xS(140); + search_column_widths[col_access_count] = xS(60); int wd = 0; for( int i=0; ireposition_window(cancel_x, cancel_y); - search_x = 10; - search_y = h - BC_GenericButton::calculate_h() - 10; + search_x = xs10; + search_y = h - BC_GenericButton::calculate_h() - ys10; search_start->reposition_window(search_x, search_y); - del_items_x = search_x + DbWindowStart::calculate_w(this, search_start->get_text()) + 15; + del_items_x = search_x + DbWindowStart::calculate_w(this, search_start->get_text()) + xs15; del_items_y = search_y; del_items->reposition_window(del_items_x,del_items_y); - int list_w = w-10 - list_x; - int list_h = min(search_y, cancel_y)-10 - list_y; + int list_w = w-xs10 - list_x; + int list_h = min(search_y, cancel_y)-ys10 - list_y; canvas_w = SWIDTH; canvas_h = SHEIGHT; - canvas_x = cancel_x - canvas_w - 15; - canvas_y = get_h() - canvas_h - 10; + canvas_x = cancel_x - canvas_w - xs15; + canvas_y = get_h() - canvas_h - ys10; canvas->reposition_window(0, canvas_x, canvas_y, canvas_w, canvas_h); // int wd = 0; // for( int i=0; ireposition_window(list_x, list_y, list_w, list_h); start_drawing(); return 1; @@ -801,8 +807,8 @@ update() if( !cp ) continue; DbSearchItem *item = new DbSearchItem(cp, LTYELLOW); if( search_columns[k] == col_vicon ) { - item->set_text_w(SWIDTH+10); - item->set_text_h(SHEIGHT+5); + item->set_text_w(SWIDTH+xS(10)); + item->set_text_h(SHEIGHT+yS(5)); item->set_searchable(0); } search_items[k].append(item); diff --git a/cinelerra-5.1/cinelerra/deleteallindexes.C b/cinelerra-5.1/cinelerra/deleteallindexes.C index c600a455..3dbc628b 100644 --- a/cinelerra-5.1/cinelerra/deleteallindexes.C +++ b/cinelerra-5.1/cinelerra/deleteallindexes.C @@ -77,8 +77,7 @@ ConfirmDeleteAllIndexes::ConfirmDeleteAllIndexes(MWindow *mwindow, char *string) : BC_Window(_(PROGRAM_NAME ": Delete All Indexes"), mwindow->gui->get_abs_cursor_x(1), mwindow->gui->get_abs_cursor_y(1), - 340, - 140) + xS(340), yS(140)) { this->string = string; } @@ -90,12 +89,12 @@ ConfirmDeleteAllIndexes::~ConfirmDeleteAllIndexes() void ConfirmDeleteAllIndexes::create_objects() { lock_window("ConfirmDeleteAllIndexes::create_objects"); - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(new BC_Title(x, y, string)); - y += 20; + y += yS(20); add_subwindow(new BC_OKButton(x, y)); - x = get_w() - 100; + x = get_w() - xS(100); add_subwindow(new BC_CancelButton(x, y)); unlock_window(); } diff --git a/cinelerra-5.1/cinelerra/dvdcreate.C b/cinelerra-5.1/cinelerra/dvdcreate.C index 5bbe2efd..8779e3c9 100644 --- a/cinelerra-5.1/cinelerra/dvdcreate.C +++ b/cinelerra-5.1/cinelerra/dvdcreate.C @@ -614,7 +614,7 @@ BC_Window* CreateDVD_Thread::new_gui() int scr_x = mwindow->gui->get_screen_x(0, -1); int scr_w = mwindow->gui->get_screen_w(0, -1); int scr_h = mwindow->gui->get_screen_h(0, -1); - int w = 520, h = 280; + int w = xS(520), h = yS(280); int x = scr_x + scr_w/2 - w/2, y = scr_h/2 - h/2; gui = new CreateDVD_GUI(this, x, y, w, h); @@ -852,7 +852,7 @@ CreateDVD_UseFFMpeg::~CreateDVD_UseFFMpeg() CreateDVD_GUI::CreateDVD_GUI(CreateDVD_Thread *thread, int x, int y, int w, int h) - : BC_Window(_(PROGRAM_NAME ": Create DVD"), x, y, w, h, 50, 50, 1, 0, 1) + : BC_Window(_(PROGRAM_NAME ": Create DVD"), x, y, w, h, xS(50), yS(50), 1, 0, 1) { this->thread = thread; at_x = at_y = tmp_x = tmp_y = 0; @@ -881,20 +881,22 @@ CreateDVD_GUI::~CreateDVD_GUI() void CreateDVD_GUI::create_objects() { + int xs10 = xS(10), xs30 = xS(30), xs35 = xS(35), xs170 = xS(170); + int ys5 = yS(5), ys10 = yS(10); lock_window("CreateDVD_GUI::create_objects"); - int pady = BC_TextBox::calculate_h(this, MEDIUMFONT, 0, 1) + 5; + int pady = BC_TextBox::calculate_h(this, MEDIUMFONT, 0, 1) + ys5; int padx = BC_Title::calculate_w(this, (char*)"X", MEDIUMFONT); int x = padx/2, y = pady/2; BC_Title *title = new BC_Title(x, y, _("Title:"), MEDIUMFONT, YELLOW); add_subwindow(title); at_x = x + title->get_w(); at_y = y; - asset_title = new CreateDVD_AssetTitle(this, at_x, at_y, get_w()-at_x-10); + asset_title = new CreateDVD_AssetTitle(this, at_x, at_y, get_w()-at_x-xs10); add_subwindow(asset_title); y += title->get_h() + pady/2; title = new BC_Title(x, y, _("Work path:"), MEDIUMFONT, YELLOW); add_subwindow(title); tmp_x = x + title->get_w(); tmp_y = y; - tmp_path = new CreateDVD_TmpPath(this, tmp_x, tmp_y, get_w()-tmp_x-35); + tmp_path = new CreateDVD_TmpPath(this, tmp_x, tmp_y, get_w()-tmp_x-xs35); add_subwindow(tmp_path); btmp_path = new BrowseButton(thread->mwindow->theme, this, tmp_path, tmp_x+tmp_path->get_w(), tmp_y, "/tmp", @@ -903,7 +905,7 @@ void CreateDVD_GUI::create_objects() y += title->get_h() + pady/2; disk_space = new CreateDVD_DiskSpace(this, x, y); add_subwindow(disk_space); - int x0 = get_w() - 170; + int x0 = get_w() - xs170; title = new BC_Title(x0, y, _("Media:"), MEDIUMFONT, YELLOW); add_subwindow(title); int x1 = x0+title->get_w()+padx; @@ -920,7 +922,7 @@ void CreateDVD_GUI::create_objects() standard = new CreateDVD_Format(this, title->get_w() + padx, y); add_subwindow(standard); standard->create_objects(); - x0 -= 30; + x0 -= xs30; title = new BC_Title(x0, y, _("Scale:"), MEDIUMFONT, YELLOW); add_subwindow(title); x1 = x0+title->get_w()+padx; @@ -934,7 +936,7 @@ void CreateDVD_GUI::create_objects() y += need_deinterlace->get_h() + pady/2; need_histogram = new CreateDVD_Histogram(this, x, y); add_subwindow(need_histogram); - y = y1; x1 += 170; + y = y1; x1 += xs170; need_inverse_telecine = new CreateDVD_InverseTelecine(this, x1, y); add_subwindow(need_inverse_telecine); y += need_inverse_telecine->get_h() + pady/2; @@ -946,7 +948,7 @@ void CreateDVD_GUI::create_objects() y += need_use_ffmpeg->get_h() + pady/2; need_resize_tracks = new CreateDVD_ResizeTracks(this, x1, y); add_subwindow(need_resize_tracks); - y = y1; x1 += 170; + y = y1; x1 += xs170; need_labeled = new CreateDVD_LabelChapters(this, x1, y); add_subwindow(need_labeled); y += need_labeled->get_h() + pady/2; @@ -954,14 +956,14 @@ void CreateDVD_GUI::create_objects() add_subwindow(need_farmed); ok_w = BC_OKButton::calculate_w(); ok_h = BC_OKButton::calculate_h(); - ok_x = 10; - ok_y = get_h() - ok_h - 10; + ok_x = xs10; + ok_y = get_h() - ok_h - ys10; ok = new CreateDVD_OK(this, ok_x, ok_y); add_subwindow(ok); cancel_w = BC_CancelButton::calculate_w(); cancel_h = BC_CancelButton::calculate_h(); - cancel_x = get_w() - cancel_w - 10, - cancel_y = get_h() - cancel_h - 10; + cancel_x = get_w() - cancel_w - xs10, + cancel_y = get_h() - cancel_h - ys10; cancel = new CreateDVD_Cancel(this, cancel_x, cancel_y); add_subwindow(cancel); show_window(); @@ -970,13 +972,15 @@ void CreateDVD_GUI::create_objects() int CreateDVD_GUI::resize_event(int w, int h) { - asset_title->reposition_window(at_x, at_y, get_w()-at_x-10); - tmp_path->reposition_window(tmp_x, tmp_y, get_w()-tmp_x-35); + int xs10 = xS(10), xs35 = xS(35); + int ys10 = yS(10); + asset_title->reposition_window(at_x, at_y, get_w()-at_x-xs10); + tmp_path->reposition_window(tmp_x, tmp_y, get_w()-tmp_x-xs35); btmp_path->reposition_window(tmp_x+tmp_path->get_w(), tmp_y); - ok_y = h - ok_h - 10; + ok_y = h - ok_h - ys10; ok->reposition_window(ok_x, ok_y); - cancel_x = w - cancel_w - 10, - cancel_y = h - cancel_h - 10; + cancel_x = w - cancel_w - xs10, + cancel_y = h - cancel_h - ys10; cancel->reposition_window(cancel_x, cancel_y); return 0; } @@ -1149,7 +1153,7 @@ int CreateDVD_FormatItem::handle_event() CreateDVD_Format::CreateDVD_Format(CreateDVD_GUI *gui, int x, int y) - : BC_PopupMenu(x, y, 180, "", 1) + : BC_PopupMenu(x, y, xS(180), "", 1) { this->gui = gui; } @@ -1201,7 +1205,7 @@ int CreateDVD_ScaleItem::handle_event() CreateDVD_Scale::CreateDVD_Scale(CreateDVD_GUI *gui, int x, int y) - : BC_PopupMenu(x, y, 100, "", 1) + : BC_PopupMenu(x, y, xS(100), "", 1) { this->gui = gui; } @@ -1227,7 +1231,7 @@ int CreateDVD_Scale::handle_event() CreateDVD_MediaSize::CreateDVD_MediaSize(CreateDVD_GUI *gui, int x, int y) - : BC_PopupTextBox(gui, 0, 0, x, y, 70,50) + : BC_PopupTextBox(gui, 0, 0, x, y, xS(70), 50) { this->gui = gui; } diff --git a/cinelerra-5.1/cinelerra/edit.C b/cinelerra-5.1/cinelerra/edit.C index e9e9f1b4..f716bb42 100644 --- a/cinelerra-5.1/cinelerra/edit.C +++ b/cinelerra-5.1/cinelerra/edit.C @@ -653,7 +653,7 @@ int Edit::select_handle(float view_start, float zoom_units, int cursor_x, int cu int64_t pixel1, pixel2; pixel1 = left; - pixel2 = pixel1 + 10; + pixel2 = pixel1 + xS(10); // test left edit // cursor_x is faked in acanvas @@ -665,7 +665,7 @@ int Edit::select_handle(float view_start, float zoom_units, int cursor_x, int cu //int64_t endproject = startproject + length; pixel2 = right; - pixel1 = pixel2 - 10; + pixel1 = pixel2 - xS(10); // test right edit if(cursor_x >= pixel1 && cursor_x <= pixel2) diff --git a/cinelerra-5.1/cinelerra/editlength.C b/cinelerra-5.1/cinelerra/editlength.C index 0cd5cd7e..188d415a 100644 --- a/cinelerra-5.1/cinelerra/editlength.C +++ b/cinelerra-5.1/cinelerra/editlength.C @@ -89,56 +89,38 @@ void EditLengthThread::start(Edit *edit) BC_DialogThread::start(); } +#define ELW_W xS(300) +#define ELW_H yS(100) + BC_Window* EditLengthThread::new_gui() { BC_DisplayInfo display_info; - int x = display_info.get_abs_cursor_x() - 150; - int y = display_info.get_abs_cursor_y() - 50; - EditLengthDialog *gui = new EditLengthDialog(mwindow, - this, - x, - y); + int x = display_info.get_abs_cursor_x() - ELW_W/2; + int y = display_info.get_abs_cursor_y() - ELW_H/2; + EditLengthDialog *gui = new EditLengthDialog(mwindow, this, x, y); gui->create_objects(); return gui; } void EditLengthThread::handle_close_event(int result) { - if(!result) - { - if(edit) - { + if(!result) { + if(edit) { // mwindow->set_edit_length(edit, length); } - else - { + else { mwindow->set_edit_length(length); } } } - - - - - - - EditLengthDialog::EditLengthDialog(MWindow *mwindow, EditLengthThread *thread, int x, int y) - : BC_Window(_(PROGRAM_NAME ": Edit length"), - x, - y, - 300, - 100, - -1, - -1, - 0, - 0, - 1) + : BC_Window(_(PROGRAM_NAME ": Edit length"), x, y, + ELW_W, ELW_H, -1, -1, 0, 0, 1) { this->mwindow = mwindow; this->thread = thread; @@ -151,9 +133,11 @@ EditLengthDialog::~EditLengthDialog() void EditLengthDialog::create_objects() { + int xs10 = xS(10), xs100 = xS(100); + int ys10 = yS(10); lock_window("EditLengthDialog::create_objects"); - add_subwindow(new BC_Title(10, 10, _("Seconds:"))); - text = new EditLengthText(mwindow, this, 100, 10); + add_subwindow(new BC_Title(xs10, ys10, _("Seconds:"))); + text = new EditLengthText(mwindow, this, xs100, ys10); text->create_objects(); add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); @@ -168,21 +152,10 @@ int EditLengthDialog::close_event() } - - - - EditLengthText::EditLengthText(MWindow *mwindow, - EditLengthDialog *gui, - int x, - int y) - : BC_TumbleTextBox(gui, - (float)gui->thread->length, - (float)0, - (float)100, - x, - y, - 100) + EditLengthDialog *gui, int x, int y) + : BC_TumbleTextBox(gui, (float)gui->thread->length, + 0.f, 100.f, x, y, xS(100)) { this->mwindow = mwindow; this->gui = gui; @@ -199,12 +172,3 @@ int EditLengthText::handle_event() return 1; } - - - - - - - - - diff --git a/cinelerra-5.1/cinelerra/edlsession.C b/cinelerra-5.1/cinelerra/edlsession.C index 4c5cfdd3..00120844 100644 --- a/cinelerra-5.1/cinelerra/edlsession.C +++ b/cinelerra-5.1/cinelerra/edlsession.C @@ -44,8 +44,9 @@ EDLSession::EDLSession(EDL *edl) for(int i = 0; i < MAXCHANNELS; i++) achannel_positions[i] = 0; assetlist_format = ASSETS_ICONS; + int xs100 = xS(100); for(int i = 0; i < ASSET_COLUMNS; i++) - asset_columns[i] = 100; + asset_columns[i] = xs100; auto_conf = new AutoConf; awindow_folder = AW_MEDIA_FOLDER; aspect_w = 4; aspect_h = 3; @@ -58,8 +59,8 @@ EDLSession::EDLSession(EDL *edl) clipboard_length = 0; // unused color_model = BC_RGBA8888; interlace_mode = ILACE_MODE_UNDETECTED; - crop_x1 = 0; crop_x2 = 320; - crop_y1 = 0; crop_y2 = 240; + crop_x1 = 0; crop_x2 = xS(320); + crop_y1 = 0; crop_y2 = yS(240); eyedrop_radius = 0; ruler_x1 = ruler_y1 = 0.0; ruler_x2 = ruler_y2 = 0.0; diff --git a/cinelerra-5.1/cinelerra/exportedl.C b/cinelerra-5.1/cinelerra/exportedl.C index 73e51cf1..f4e3805c 100644 --- a/cinelerra-5.1/cinelerra/exportedl.C +++ b/cinelerra-5.1/cinelerra/exportedl.C @@ -319,24 +319,15 @@ void ExportEDL::run() } +#define WIDTH xS(410) +#define HEIGHT yS(400) - - - - - - -#define WIDTH 410 -#define HEIGHT 400 - -static const char *default_list_titles[] = -{ +static const char *default_list_titles[] = { N_("No."), N_("Track name") }; -static int default_list_widths[] = -{ +static int default_list_widths[] = { 40, 200 }; @@ -352,7 +343,7 @@ ExportEDLWindow::ExportEDLWindow(MWindow *mwindow, ExportEDL *exportedl, ExportE this->exportasset = exportasset; for( int i=0; i<2; ++i ) { list_titles[i] = _(default_list_titles[i]); - list_widths[i] = default_list_widths[i]; + list_widths[i] = xS(default_list_widths[i]); } } @@ -363,32 +354,33 @@ ExportEDLWindow::~ExportEDLWindow() } - void ExportEDLWindow::create_objects() { + int xs5 = xS(5); + int ys5 = yS(5), ys25 = yS(25); lock_window("ExportEDLWindow::create_objects"); - int x = 5, y = 5; + int x = xs5, y = ys5; add_subwindow(new BC_Title(x, y, _("Select a file to export to:"))); - y += 25; + y += ys25; add_subwindow(path_textbox = new ExportEDLPathText(x, y, this)); - x += 300; + x += xS(300); path_recent = new BC_RecentList("EDLPATH", mwindow->defaults, - path_textbox, 10, x, y, 300, 100); + path_textbox, 10, x, y, xS(300), yS(100)); add_subwindow(path_recent); // FIX path_recent->load_items("EDLPATH"); - x += 24; + x += xS(24); add_subwindow(path_button = new BrowseButton( mwindow->theme, this, path_textbox, x, y - 4, exportasset->path, _("Output to file"), _("Select a file to write to:"), 0)); - y += 34; - x = 5; + y += xS(34); + x = xs5; add_subwindow(new BC_Title(x, y, _("Select track to be exported:"))); - y += 25; + y += ys25; items_tracks[0].remove_all_objects(); @@ -414,7 +406,7 @@ void ExportEDLWindow::create_objects() } - add_subwindow(track_list = new ExportEDLWindowTrackList(this, x, y, 400, 200)); + add_subwindow(track_list = new ExportEDLWindowTrackList(this, x, y, xS(400), yS(200))); y += 5 + track_list->get_h(); add_subwindow(new BC_Title(x, y, _("Currently only CMX 3600 format is supported"))); @@ -428,7 +420,7 @@ void ExportEDLWindow::create_objects() ExportEDLPathText::ExportEDLPathText(int x, int y, ExportEDLWindow *window) - : BC_TextBox(x, y, 300, 1, window->exportasset->path) + : BC_TextBox(x, y, xS(300), 1, window->exportasset->path) { this->window = window; } @@ -461,5 +453,3 @@ int ExportEDLWindowTrackList::handle_event() return 1; } - - diff --git a/cinelerra-5.1/cinelerra/featheredits.C b/cinelerra-5.1/cinelerra/featheredits.C index 6c0c67df..b6e414f5 100644 --- a/cinelerra-5.1/cinelerra/featheredits.C +++ b/cinelerra-5.1/cinelerra/featheredits.C @@ -78,8 +78,7 @@ FeatherEditsWindow::FeatherEditsWindow(MWindow *mwindow, long feather_samples) : BC_Window(_(PROGRAM_NAME ": Feather Edits"), mwindow->gui->get_abs_cursor_x(), mwindow->gui->get_abs_cursor_y(), - 340, - 140) + xS(340), yS(140)) { this->feather_samples = feather_samples; } @@ -91,9 +90,10 @@ FeatherEditsWindow::~FeatherEditsWindow() int FeatherEditsWindow::create_objects(int audio, int video) { + int xs10 = xS(10); + int ys10 = yS(10), ys20 = yS(20); lock_window("FeatherEditsWindow::create_objects"); - int x = 10; - int y = 10; + int x = xs10, y = ys10; this->audio = audio; this->video = video; @@ -102,12 +102,12 @@ int FeatherEditsWindow::create_objects(int audio, int video) else add_subwindow(new BC_Title(x, y, _("Feather by how many frames:"))); - y += 20; + y += ys20; char string[1024]; sprintf(string, "%d", feather_samples); add_subwindow(text = new FeatherEditsTextBox(this, string, x, y)); - y += 20; + y += ys20; add_subwindow(new BC_OKButton(x, y)); add_subwindow(new BC_CancelButton(x, y)); return 0; @@ -115,7 +115,7 @@ int FeatherEditsWindow::create_objects(int audio, int video) } FeatherEditsTextBox::FeatherEditsTextBox(FeatherEditsWindow *window, char *text, int x, int y) - : BC_TextBox(x, y, 100, 1, text) + : BC_TextBox(x, y, xS(100), 1, text) { this->window = window; } @@ -125,3 +125,4 @@ int FeatherEditsTextBox::handle_event() window->feather_samples = atol(get_text()); return 0; } + diff --git a/cinelerra-5.1/cinelerra/fileac3.C b/cinelerra-5.1/cinelerra/fileac3.C index eef48e63..f7d78c59 100644 --- a/cinelerra-5.1/cinelerra/fileac3.C +++ b/cinelerra-5.1/cinelerra/fileac3.C @@ -341,23 +341,14 @@ int FileAC3::write_samples(double **buffer, int64_t len) } - - - - - AC3ConfigAudio::AC3ConfigAudio(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Audio Compression"), parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), - 500, - BC_OKButton::calculate_h() + 100, - 500, - BC_OKButton::calculate_h() + 100, - 0, - 0, - 1) + xS(500), BC_OKButton::calculate_h() + yS(100), + xS(500), BC_OKButton::calculate_h() + yS(100), + 0, 0, 1) { this->parent_window = parent_window; this->asset = asset; @@ -365,15 +356,12 @@ AC3ConfigAudio::AC3ConfigAudio(BC_WindowBase *parent_window, void AC3ConfigAudio::create_objects() { - int x = 10, y = 10; - int x1 = 150; + int x = xS(10), y = yS(10); + int x1 = xS(150); lock_window("AC3ConfigAudio::create_objects"); add_tool(new BC_Title(x, y, _("Bitrate (kbps):"))); AC3ConfigAudioBitrate *bitrate; - add_tool(bitrate = - new AC3ConfigAudioBitrate(this, - x1, - y)); + add_tool(bitrate = new AC3ConfigAudioBitrate(this, x1, y)); bitrate->create_objects(); add_subwindow(new BC_OKButton(this)); @@ -388,16 +376,8 @@ int AC3ConfigAudio::close_event() } - - - - -AC3ConfigAudioBitrate::AC3ConfigAudioBitrate(AC3ConfigAudio *gui, - int x, - int y) - : BC_PopupMenu(x, - y, - 150, +AC3ConfigAudioBitrate::AC3ConfigAudioBitrate(AC3ConfigAudio *gui, int x, int y) + : BC_PopupMenu(x, y, xS(150), AC3ConfigAudioBitrate::bitrate_to_string(gui->string, gui->asset->ac3_bitrate)) { this->gui = gui; diff --git a/cinelerra-5.1/cinelerra/filedv.C b/cinelerra-5.1/cinelerra/filedv.C index bcce24b2..032f64e4 100644 --- a/cinelerra-5.1/cinelerra/filedv.C +++ b/cinelerra-5.1/cinelerra/filedv.C @@ -633,27 +633,13 @@ int FileDV::write_frames(VFrame ***frames, int len) for(int i = 0; i < asset->height; i++) cmodel_buf[i] = data + asset->width * 2 * i; - BC_CModels::transfer(cmodel_buf, - row_pointers, - cmodel_buf[0], - cmodel_buf[1], - cmodel_buf[2], - row_pointers[0], - row_pointers[1], - row_pointers[2], - 0, - 0, - asset->width, - asset->height, - 0, - 0, - asset->width, - asset->height, - temp_frame->get_color_model(), - BC_YUV422, - 0, - asset->width, - asset->width); + BC_CModels::transfer(cmodel_buf, row_pointers, + cmodel_buf[0], cmodel_buf[1], cmodel_buf[2], + row_pointers[0], row_pointers[1], row_pointers[2], + 0, 0, asset->width, asset->height, + 0, 0, asset->width, asset->height, + temp_frame->get_color_model(), BC_YUV422, 0, + asset->width, asset->width); dv_encode_full_frame(encoder, cmodel_buf, e_dv_color_yuv, video_buffer); @@ -868,27 +854,13 @@ TRACE("FileDV::read_frame 69") TRACE("FileDV::read_frame 70") - BC_CModels::transfer(row_pointers, - temp_pointers, - row_pointers[0], - row_pointers[1], - row_pointers[2], - temp_pointers[0], - temp_pointers[1], - temp_pointers[2], - 0, - 0, - asset->width, - asset->height, - 0, - 0, - asset->width, - asset->height, - BC_YUV422, - frame->get_color_model(), - 0, - asset->width, - asset->width); + BC_CModels::transfer(row_pointers, temp_pointers, + row_pointers[0], row_pointers[1], row_pointers[2], + temp_pointers[0], temp_pointers[1], temp_pointers[2], + 0, 0, asset->width, asset->height, + 0, 0, asset->width, asset->height, + BC_YUV422, frame->get_color_model(), 0, + asset->width, asset->width); //for(int i = 0; i < asset->height; i++) // delete[] temp_pointers[i]; @@ -925,21 +897,16 @@ int FileDV::get_best_colormodel(Asset *asset, int driver) { case PLAYBACK_X11: return BC_RGB888; - break; case PLAYBACK_X11_XV: return BC_YUV422; - break; case PLAYBACK_DV1394: case PLAYBACK_FIREWIRE: return BC_COMPRESSED; - break; case VIDEO4LINUX2: case VIDEO4LINUX2JPEG: return BC_YUV422; - break; case CAPTURE_FIREWIRE: return BC_COMPRESSED; - break; } return BC_RGB888; } @@ -958,31 +925,12 @@ int FileDV::get_audio_offset(int64_t pos) return pos - frame * asset->sample_rate / asset->frame_rate; } - - - - - - - - - - - - - - - - - - - DVConfigAudio::DVConfigAudio(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Audio Compression"), parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), - 350, 250) + xS(350), yS(250)) { this->parent_window = parent_window; this->asset = asset; @@ -996,7 +944,7 @@ DVConfigAudio::~DVConfigAudio() void DVConfigAudio::create_objects() { lock_window("DVConfigAudio::create_objects"); - add_tool(new BC_Title(10, 10, _("There are no audio options for this format"))); + add_tool(new BC_Title(xS(10), yS(10), _("There are no audio options for this format"))); add_subwindow(new BC_OKButton(this)); unlock_window(); } @@ -1012,7 +960,7 @@ DVConfigVideo::DVConfigVideo(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Video Compression"), parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), - 350, 250) + xS(350), yS(250)) { this->parent_window = parent_window; this->asset = asset; @@ -1026,7 +974,7 @@ DVConfigVideo::~DVConfigVideo() void DVConfigVideo::create_objects() { lock_window("DVConfigVideo::create_objects"); - add_tool(new BC_Title(10, 10, _("There are no video options for this format"))); + add_tool(new BC_Title(xS(10), yS(10), _("There are no video options for this format"))); add_subwindow(new BC_OKButton(this)); unlock_window(); } diff --git a/cinelerra-5.1/cinelerra/fileexr.C b/cinelerra-5.1/cinelerra/fileexr.C index 351da2a3..998372b5 100644 --- a/cinelerra-5.1/cinelerra/fileexr.C +++ b/cinelerra-5.1/cinelerra/fileexr.C @@ -572,10 +572,8 @@ EXRUnit::~EXRUnit() EXRConfigVideo::EXRConfigVideo(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Video Compression"), - parent_window->get_abs_cursor_x(1), - parent_window->get_abs_cursor_y(1), - 300, - BC_OKButton::calculate_h() + 100) + parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), + xS(300), BC_OKButton::calculate_h() + yS(100)) { this->parent_window = parent_window; this->asset = asset; @@ -588,13 +586,13 @@ EXRConfigVideo::~EXRConfigVideo() void EXRConfigVideo::create_objects() { lock_window("EXRConfigVideo::create_objects"); - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(new EXRUseAlpha(this, x, y)); - y += 30; + y += yS(30); EXRCompression *menu; add_subwindow(new BC_Title(x, y, _("Compression:"))); - x += 110; - add_subwindow(menu = new EXRCompression(this, x, y, 100)); + x += xS(110); + add_subwindow(menu = new EXRCompression(this, x, y, xS(100))); menu->create_objects(); add_subwindow(new BC_OKButton(this)); show_window(1); @@ -623,9 +621,7 @@ int EXRUseAlpha::handle_event() EXRCompression::EXRCompression(EXRConfigVideo *gui, int x, int y, int w) - : BC_PopupMenu(x, - y, - w, + : BC_PopupMenu(x, y, w, FileEXR::compression_to_str(gui->asset->exr_compression)) { this->gui = gui; diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.C b/cinelerra-5.1/cinelerra/fileffmpeg.C index 268f3bed..2e812301 100644 --- a/cinelerra-5.1/cinelerra/fileffmpeg.C +++ b/cinelerra-5.1/cinelerra/fileffmpeg.C @@ -46,7 +46,7 @@ FileFFMPEG::~FileFFMPEG() FFMpegConfigNum::FFMpegConfigNum(BC_Window *window, int x, int y, char *title_text, int *output) - : BC_TumbleTextBox(window, *output, -1, INT_MAX, 100, y, 100) + : BC_TumbleTextBox(window, *output, -1, INT_MAX, xS(100), y, xS(100)) { this->window = window; this->x = x; this->y = y; @@ -462,7 +462,7 @@ FFMPEGConfigAudio::FFMPEGConfigAudio(BC_WindowBase *parent_window, Asset *asset, : BC_Window(_(PROGRAM_NAME ": Audio Preset"), parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), - 420, 420) + xS(420), yS(420)) { this->parent_window = parent_window; this->asset = asset; @@ -490,7 +490,7 @@ void FFMPEGConfigAudio::load_options() void FFMPEGConfigAudio::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); lock_window("FFMPEGConfigAudio::create_objects"); FileSystem fs; @@ -518,11 +518,11 @@ void FFMPEGConfigAudio::create_objects() strcpy(asset->acodec, presets[0]->get_text()); add_tool(new BC_Title(x, y, _("Preset:"))); - y += 25; + y += yS(25); preset_popup = new FFMPEGConfigAudioPopup(this, x, y); preset_popup->create_objects(); - y += 50; + y += yS(50); bitrate = new FFMpegAudioBitrate(this, x, y, _("Bitrate:"), &asset->ff_audio_bitrate); bitrate->create_objects(); bitrate->set_increment(1000); @@ -532,10 +532,10 @@ void FFMPEGConfigAudio::create_objects() quality->create_objects(); quality->set_increment(1); quality->set_boundaries((int64_t)-1, (int64_t)51); - y += quality->get_h() + 10; + y += quality->get_h() + yS(10); add_subwindow(new BC_Title(x, y, _("Samples:"))); - sample_format = new FFMpegSampleFormat(this, x+90, y, 100, 120); + sample_format = new FFMpegSampleFormat(this, x+xS(90), y, xS(100), yS(120)); sample_format->create_objects(); if( asset->acodec[0] ) { sample_format->update_formats(); @@ -544,7 +544,7 @@ void FFMPEGConfigAudio::create_objects() } if( !asset->ff_sample_format[0] ) strcpy(asset->ff_sample_format, _("None")); sample_format->update(asset->ff_sample_format); - y += sample_format->get_h() + 10; + y += sample_format->get_h() + yS(10); BC_Title *title = new BC_Title(x, y, _("Audio Options:")); add_subwindow(title); @@ -553,8 +553,8 @@ void FFMPEGConfigAudio::create_objects() int x1 = x + title->get_w() + 8; add_subwindow(new FFOptionsViewAudio(this, x1, y, _("view"))); - y += 25; - audio_options = new FFAudioOptions(this, x, y, get_w()-x-20, 8, + y += yS(25); + audio_options = new FFAudioOptions(this, x, y, get_w()-x-xS(20), 8, sizeof(asset->ff_audio_options)-1, asset->ff_audio_options); audio_options->create_objects(); add_subwindow(new BC_OKButton(this)); @@ -585,7 +585,7 @@ FFAudioOptions::FFAudioOptions(FFMPEGConfigAudio *audio_popup, FFMPEGConfigAudioPopup::FFMPEGConfigAudioPopup(FFMPEGConfigAudio *popup, int x, int y) - : BC_PopupTextBox(popup, &popup->presets, popup->asset->acodec, x, y, 300, 300) + : BC_PopupTextBox(popup, &popup->presets, popup->asset->acodec, x, y, xS(300), yS(300)) { this->popup = popup; } @@ -626,7 +626,7 @@ FFMPEGConfigVideo::FFMPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset, : BC_Window(_(PROGRAM_NAME ": Video Preset"), parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), - 420, 420) + xS(420), yS(420)) { this->parent_window = parent_window; this->asset = asset; @@ -657,11 +657,11 @@ void FFMPEGConfigVideo::load_options() void FFMPEGConfigVideo::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); lock_window("FFMPEGConfigVideo::create_objects"); add_subwindow(new BC_Title(x, y, _("Compression:"))); - y += 25; + y += yS(25); FileSystem fs; char option_path[BCTEXTLEN]; @@ -694,7 +694,7 @@ void FFMPEGConfigVideo::create_objects() asset->ff_video_bitrate = 0; asset->ff_video_quality = -1; } - y += 50; + y += yS(50); bitrate = new FFMpegVideoBitrate(this, x, y, _("Bitrate:"), &asset->ff_video_bitrate); bitrate->create_objects(); bitrate->set_increment(100000); @@ -704,10 +704,10 @@ void FFMPEGConfigVideo::create_objects() quality->create_objects(); quality->set_increment(1); quality->set_boundaries((int64_t)-1, (int64_t)51); - y += quality->get_h() + 10; + y += quality->get_h() + yS(10); add_subwindow(new BC_Title(x, y, _("Pixels:"))); - pixel_format = new FFMpegPixelFormat(this, x+90, y, 100, 120); + pixel_format = new FFMpegPixelFormat(this, x+xS(90), y, xS(100), yS(120)); pixel_format->create_objects(); if( asset->vcodec[0] ) { pixel_format->update_formats(); @@ -716,7 +716,7 @@ void FFMPEGConfigVideo::create_objects() } if( !asset->ff_pixel_format[0] ) strcpy(asset->ff_pixel_format, _("None")); pixel_format->update(asset->ff_pixel_format); - y += pixel_format->get_h() + 10; + y += pixel_format->get_h() + yS(10); BC_Title *title = new BC_Title(x, y, _("Video Options:")); add_subwindow(title); @@ -725,8 +725,8 @@ void FFMPEGConfigVideo::create_objects() int x1 = x + title->get_w() + 8; add_subwindow(new FFOptionsViewVideo(this, x1, y, _("view"))); - y += 25; - video_options = new FFVideoOptions(this, x, y, get_w()-x-20, 8, + y += yS(25); + video_options = new FFVideoOptions(this, x, y, get_w()-x-xS(20), 8, sizeof(asset->ff_video_options)-1, asset->ff_video_options); video_options->create_objects(); add_subwindow(new BC_OKButton(this)); @@ -756,7 +756,7 @@ FFVideoOptions::FFVideoOptions(FFMPEGConfigVideo *video_popup, FFMPEGConfigVideoPopup::FFMPEGConfigVideoPopup(FFMPEGConfigVideo *popup, int x, int y) - : BC_PopupTextBox(popup, &popup->presets, popup->asset->vcodec, x, y, 300, 300) + : BC_PopupTextBox(popup, &popup->presets, popup->asset->vcodec, x, y, xS(300), yS(300)) { this->popup = popup; } @@ -890,7 +890,7 @@ FFOptions_OptPanel:: void FFOptions_OptPanel::create_objects() { const char *cols[] = { _("option"), _("value"), }; - const int col1_w = 150; + const int col1_w = xS(150); int wids[] = { col1_w, get_w()-col1_w }; BC_ListBox::update(&items[0], &cols[0], &wids[0], sizeof(items)/sizeof(items[0])); } @@ -1456,7 +1456,7 @@ const char *FFOptions_Opt::tip() FFOptionsWindow::FFOptionsWindow(FFOptionsDialog *dialog) - : BC_Window(_(PROGRAM_NAME ": Options"), 60, 30, 640, 400) + : BC_Window(_(PROGRAM_NAME ": Options"), xS(60), yS(30), xS(640), yS(400)) { this->dialog = dialog; this->selected = 0; @@ -1468,44 +1468,46 @@ FFOptionsWindow::~FFOptionsWindow() void FFOptionsWindow::create_objects() { + int xs8 = xS(8), xs10 = xS(10); + int ys10 = yS(10); lock_window("FFOptionsWindow::create_objects"); BC_Title *title; - int x0 = 10, y0 = 10; + int x0 = xs10, y0 = ys10; int x = x0, y = y0; add_subwindow(title = new BC_Title(x, y, _("Format: "))); x += title->get_w(); add_subwindow(new BC_Title(x, y, dialog->format_name)); - x = x0 + 150; + x = x0 + xS(150); add_subwindow(title = new BC_Title(x, y, _("Codec: "))); x += title->get_w(); add_subwindow(new BC_Title(x, y, dialog->codec_name)); - x = x0; y += title->get_h() + 10; y0 = y; + x = x0; y += title->get_h() + ys10; y0 = y; add_subwindow(title = new BC_Title(x, y, _("Type: "))); - x += title->get_w() + 8; + x += title->get_w() + xs8; add_subwindow(type = new BC_Title(x, y, (char *)"")); - x = x0 + 150; + x = x0 + xS(150); add_subwindow(title = new BC_Title(x, y, _("Range: "))); - x += title->get_w() + 8; + x += title->get_w() + xs8; add_subwindow(range = new BC_Title(x, y, (char *)"")); - x = x0; y += title->get_h() + 10; - add_subwindow(units = new FFOptionsUnits(this, x, y, 120)); - x += units->get_w() + 8; - int x1 = get_w() - BC_GenericButton::calculate_w(this, _("Apply")) - 8; - add_subwindow(text = new FFOptionsText(this, x, y, x1-x - 8)); + x = x0; y += title->get_h() + ys10; + add_subwindow(units = new FFOptionsUnits(this, x, y, xS(120))); + x += units->get_w() + xs8; + int x1 = get_w() - BC_GenericButton::calculate_w(this, _("Apply")) - xs8; + add_subwindow(text = new FFOptionsText(this, x, y, x1-x - xs8)); add_subwindow(apply = new FFOptionsApply(this, x1, y)); - y += units->get_h() + 10; + y += units->get_h() + ys10; add_subwindow(kind = new FFOptionsKind(this, x1, y0, apply->get_w())); kind->create_objects(); const char *kind_text = _("Kind:"); - x1 -= BC_Title::calculate_w(this, kind_text) + 8; + x1 -= BC_Title::calculate_w(this, kind_text) + xs8; add_subwindow(kind_title = new BC_Title(x1, y0, kind_text)); y0 = y; panel_x = x0; panel_y = y0; - panel_w = get_w()-10 - panel_x; - panel_h = get_h()-10 - panel_y - BC_OKButton::calculate_h(); + panel_w = get_w()-xs10 - panel_x; + panel_h = get_h()-ys10 - panel_y - BC_OKButton::calculate_h(); panel = new FFOptions_OptPanel(this, panel_x, panel_y, panel_w, panel_h); add_subwindow(panel); add_subwindow(new BC_OKButton(this)); @@ -1524,19 +1526,21 @@ void FFOptionsWindow::draw() int FFOptionsWindow::resize_event(int w, int h) { - int x1 = w - 8 - kind->get_w(); + int xs8 = xS(8), xs10 = xS(10); + int ys10 = yS(10); + int x1 = w - xs8 - kind->get_w(); int y = kind->get_y(); kind->reposition_window(x1, y); - x1 -= kind_title->get_w() + 8; + x1 -= kind_title->get_w() + xs8; kind_title->reposition_window(x1,y); - x1 = get_w() - apply->get_w() - 8; + x1 = get_w() - apply->get_w() - xs8; int y1 = units->get_y(); apply->reposition_window(x1, y1); - int x0 = units->get_x() + units->get_w() + 8; + int x0 = units->get_x() + units->get_w() + xs8; int y0 = units->get_y(); - text->reposition_window(x0,y0, x1-x0-8); - panel_w = get_w()-10 - panel_x; - panel_h = get_h()-10 - panel_y; + text->reposition_window(x0,y0, x1-x0-xs8); + panel_w = get_w()-xs10 - panel_x; + panel_h = get_h()-ys10 - panel_y; panel->reposition_window(panel_x,panel_y, panel_w, panel_h); return 1; } diff --git a/cinelerra-5.1/cinelerra/fileflac.C b/cinelerra-5.1/cinelerra/fileflac.C index 96fdb8bd..ba769a7e 100644 --- a/cinelerra-5.1/cinelerra/fileflac.C +++ b/cinelerra-5.1/cinelerra/fileflac.C @@ -72,17 +72,7 @@ void FileFLAC::get_parameters(BC_WindowBase *parent_window, int FileFLAC::check_sig(Asset *asset, char *test) { - if(test[0] == 'f' && - test[1] == 'L' && - test[2] == 'a' && - test[3] == 'C') - { - return 1; - } - else - { - return 0; - } + return test[0]=='f' && test[1]=='L' && test[2]=='a' && test[3]=='C' ? 1 : 0; } int FileFLAC::reset_parameters_derived() @@ -223,10 +213,7 @@ int FileFLAC::open_file(int rd, int wr) FLAC__stream_encoder_set_channels(flac_encode, asset->channels); FLAC__stream_encoder_set_bits_per_sample(flac_encode, asset->bits); FLAC__stream_encoder_set_sample_rate(flac_encode, asset->sample_rate); - FLAC__stream_encoder_init_file(flac_encode, - asset->path, - 0, - 0); + FLAC__stream_encoder_init_file(flac_encode, asset->path, 0, 0); } return result; @@ -348,26 +335,11 @@ int FileFLAC::read_samples(double *buffer, int64_t len) } - - - - - - - - FLACConfigAudio::FLACConfigAudio(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Audio Compression"), - parent_window->get_abs_cursor_x(1), - parent_window->get_abs_cursor_y(1), - 350, - 170, - -1, - -1, - 0, - 0, - 1) + parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), + xS(350), yS(170), -1, -1, 0, 0, 1) { this->parent_window = parent_window; this->asset = asset; @@ -379,7 +351,7 @@ FLACConfigAudio::~FLACConfigAudio() void FLACConfigAudio::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); lock_window("FLACConfigAudio::create_objects"); bits_popup = new BitsPopup(this, x, y, &asset->bits, 0, 0, 0, 0, 0); bits_popup->create_objects(); diff --git a/cinelerra-5.1/cinelerra/fileformat.C b/cinelerra-5.1/cinelerra/fileformat.C index a8ff043c..6dc11781 100644 --- a/cinelerra-5.1/cinelerra/fileformat.C +++ b/cinelerra-5.1/cinelerra/fileformat.C @@ -34,10 +34,7 @@ FileFormat::FileFormat(MWindow *mwindow) : BC_Window(_(PROGRAM_NAME ": File Format"), mwindow->gui->get_abs_cursor_x(0), mwindow->gui->get_abs_cursor_y(0), - 375, - 300, - 375, - 300) + xS(375), yS(300), xS(375), yS(300)) { this->mwindow = mwindow; } @@ -64,46 +61,48 @@ void FileFormat::create_objects(Asset *asset, char *string2) void FileFormat::create_objects_(char *string2) { + int xs10 = xS(10); + int ys20 = yS(20), ys30 = yS(30); char string[1024]; - int x1 = 10, x2 = 180; - int x = x1, y = 10; + int x1 = xs10, x2 = xS(180); + int x = x1, y = xs10; lock_window("FileFormat::create_objects_"); add_subwindow(new BC_Title(x, y, string2)); - y += 20; + y += ys20; add_subwindow(new BC_Title(x, y, _("Assuming raw PCM:"))); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Channels:"))); sprintf(string, "%d", asset->channels); channels_button = new FileFormatChannels(x2, y, this, string); channels_button->create_objects(); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Sample rate:"))); sprintf(string, "%d", asset->sample_rate); add_subwindow(rate_button = new FileFormatRate(x2, y, this, string)); - add_subwindow(new SampleRatePulldown(mwindow, rate_button, x2 + 100, y)); + add_subwindow(new SampleRatePulldown(mwindow, rate_button, x2 + yS(100), y)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Bits:"))); bitspopup = new BitsPopup(this, x2, y, &asset->bits, 0, 1, 1, 0, 1); bitspopup->create_objects(); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Header length:"))); sprintf(string, "%d", asset->header); add_subwindow(header_button = new FileFormatHeader(x2, y, this, string)); - y += 30; + y += ys30; //printf("FileFormat::create_objects_ 1 %d\n", asset->byte_order); add_subwindow(new BC_Title(x, y, _("Byte order:"))); add_subwindow(lohi = new FileFormatByteOrderLOHI(x2, y, this, asset->byte_order)); add_subwindow(hilo = new FileFormatByteOrderHILO(x2 + 70, y, this, !asset->byte_order)); - y += 30; + y += ys30; add_subwindow(signed_button = new FileFormatSigned(x, y, this, asset->signed_)); add_subwindow(new BC_OKButton(this)); diff --git a/cinelerra-5.1/cinelerra/filejpeg.C b/cinelerra-5.1/cinelerra/filejpeg.C index 65dc0e3b..42dd2189 100644 --- a/cinelerra-5.1/cinelerra/filejpeg.C +++ b/cinelerra-5.1/cinelerra/filejpeg.C @@ -329,7 +329,7 @@ JPEGConfigVideo::JPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Video Compression"), parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), - 400, 200) + xS(400), yS(200)) { this->parent_window = parent_window; this->asset = asset; @@ -341,14 +341,15 @@ JPEGConfigVideo::~JPEGConfigVideo() void JPEGConfigVideo::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), ys10 = yS(10); + int x = xs10, y = ys10; lock_window("JPEGConfigVideo::create_objects"); add_subwindow(new BC_Title(x, y, _("Quality:"))); BC_ISlider *slider; - add_subwindow(slider = new BC_ISlider(x + 80, y, - 0, 200, 200, 0, 100, asset->jpeg_quality, 0, 0, + add_subwindow(slider = new BC_ISlider(x + xS(80), y, + 0, xS(200), xS(200), 0, xS(100), asset->jpeg_quality, 0, 0, &asset->jpeg_quality)); - y += slider->get_h() + 10; + y += slider->get_h() + ys10; add_subwindow(new BC_CheckBox(x, y, &asset->jpeg_sphere, _("Tag for spherical playback"))); diff --git a/cinelerra-5.1/cinelerra/filejpeglist.C b/cinelerra-5.1/cinelerra/filejpeglist.C index d1c7ba9f..4d9a9fb5 100644 --- a/cinelerra-5.1/cinelerra/filejpeglist.C +++ b/cinelerra-5.1/cinelerra/filejpeglist.C @@ -127,7 +127,7 @@ JPEGConfigVideo::JPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Video Compression"), parent_window->get_abs_cursor_x(), parent_window->get_abs_cursor_y(), - 400, 100) + xS(400), yS(100)) { this->parent_window = parent_window; this->asset = asset; @@ -139,11 +139,11 @@ JPEGConfigVideo::~JPEGConfigVideo() void JPEGConfigVideo::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); lock_window("JPEGConfigVideo::create_objects"); add_subwindow(new BC_Title(x, y, _("Quality:"))); - add_subwindow(new BC_ISlider(x + 80, y, 0, - 200, 200, 0, 100, asset->quality, + add_subwindow(new BC_ISlider(x + xS(80), y, 0, + 200, 200, 0, xS(100), asset->quality, 0, 0, &asset->quality)); add_subwindow(new BC_OKButton(this)); diff --git a/cinelerra-5.1/cinelerra/filempeg.C b/cinelerra-5.1/cinelerra/filempeg.C index 6c889b92..986ac928 100644 --- a/cinelerra-5.1/cinelerra/filempeg.C +++ b/cinelerra-5.1/cinelerra/filempeg.C @@ -162,13 +162,13 @@ void FileMPEG::get_info(char *title_path, char *path, char *text, int len) cp += snprintf(cp,ep-cp, _("size: %s"), string); if( mpeg3_is_program_stream(fd) ) - cp += snprintf(cp,ep-cp, _(" program stream\n")); + cp += snprintf(cp,ep-cp, _(" program stream\n")); else if( mpeg3_is_transport_stream(fd) ) - cp += snprintf(cp,ep-cp, _(" transport stream\n")); + cp += snprintf(cp,ep-cp, _(" transport stream\n")); else if( mpeg3_is_video_stream(fd) ) - cp += snprintf(cp,ep-cp, _(" video stream\n")); + cp += snprintf(cp,ep-cp, _(" video stream\n")); else if( mpeg3_is_audio_stream(fd) ) - cp += snprintf(cp,ep-cp, _(" audio stream\n")); + cp += snprintf(cp,ep-cp, _(" audio stream\n")); int64_t sdate = mpeg3_get_source_date(fd); if( !sdate ) { @@ -235,7 +235,7 @@ void FileMPEG::get_info(char *title_path, char *path, char *text, int len) ArrayList cell_times; int cell_no = 0; double cell_time; - while( !mpeg3_get_cell_time(fd, cell_no++, &cell_time) ) { + while( !mpeg3_get_cell_time(fd, cell_no++, &cell_time) ) { cell_times.append(cell_time); } if( cell_times.size() > 1 ) { @@ -287,8 +287,8 @@ void FileMPEG::get_info(char *title_path, char *path, char *text, int len) if( mpeg3_dvb_get_channel(fd,n, &major, &minor) ) continue; cp += snprintf(cp,ep-cp, "\n**chan %3d.%-3d\n", major, minor); int len = mpeg3_dvb_get_chan_info(fd, n, -1, 0, cp, 1023); - if( len < 0 ) len = snprintf(cp,ep-cp,_("no info")); - cp += len; *cp++ = '*'; *cp++ = '*'; *cp++ = '\n'; + if( len < 0 ) len = snprintf(cp,ep-cp,_("no info")); + cp += len; *cp++ = '*'; *cp++ = '*'; *cp++ = '\n'; for( int ord=0; ord<0x80; ++ord ) { for( int i=0; (len=mpeg3_dvb_get_chan_info(fd,n,ord,i,cp,1023)) >= 0; ++i ) { char *bp = cp; cp += len; @@ -355,7 +355,7 @@ int FileMPEG::reset_parameters_derived() mjpeg_out = 0; mjpeg_eof = 0; mjpeg_error = 0; - recd_fd = -1; + recd_fd = -1; fd = 0; video_out = 0; prev_track = 0; @@ -606,7 +606,7 @@ int FileMPEG::open_file(int rd, int wr) // Frame rate int frame_rate_code = -1; int ncodes = sizeof(frame_rate_codes) / sizeof(double); - for(int i = 1; i < ncodes; ++i) + for(int i = 1; i < ncodes; ++i) { if(EQUIV(asset->frame_rate, frame_rate_codes[i])) { @@ -847,7 +847,7 @@ int FileMPEG::create_toc(char *toc_path) gettimeofday(¤t_time, 0); int64_t elapsed_seconds = current_time.tv_sec - start_time.tv_sec; int64_t total_seconds = !bytes_processed ? 0 : - elapsed_seconds * total_bytes / bytes_processed; + elapsed_seconds * total_bytes / bytes_processed; int64_t eta = total_seconds - elapsed_seconds; progress.update(bytes_processed, 1); char string[BCTEXTLEN]; @@ -1713,20 +1713,10 @@ void FileMPEGVideo::run() - - - - - - - - - MPEGConfigAudio::MPEGConfigAudio(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Audio Compression"), - parent_window->get_abs_cursor_x(1), - parent_window->get_abs_cursor_y(1), - 310, 120, -1, -1, 0, 0, 1) + parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), + xS(310), yS(120), -1, -1, 0, 0, 1) { this->parent_window = parent_window; this->asset = asset; @@ -1738,8 +1728,8 @@ MPEGConfigAudio::~MPEGConfigAudio() void MPEGConfigAudio::create_objects() { - int x = 10, y = 10; - int x1 = 150; + int x = xS(10), y = yS(10); + int x1 = xS(150); MPEGLayer *layer; lock_window("MPEGConfigAudio::create_objects"); @@ -1755,7 +1745,7 @@ void MPEGConfigAudio::create_objects() add_tool(layer = new MPEGLayer(x1, y, this)); layer->create_objects(); - y += 30; + y += yS(30); add_tool(new BC_Title(x, y, _("Kbits per second:"))); add_tool(bitrate = new MPEGABitrate(x1, y, this)); bitrate->create_objects(); @@ -1774,7 +1764,7 @@ int MPEGConfigAudio::close_event() MPEGLayer::MPEGLayer(int x, int y, MPEGConfigAudio *gui) - : BC_PopupMenu(x, y, 100, layer_to_string(gui->asset->ampeg_derivative)) + : BC_PopupMenu(x, y, xS(100), layer_to_string(gui->asset->ampeg_derivative)) { this->gui = gui; } @@ -1794,41 +1784,24 @@ int MPEGLayer::handle_event() int MPEGLayer::string_to_layer(char *string) { - if(!strcasecmp(layer_to_string(2), string)) - return 2; - if(!strcasecmp(layer_to_string(3), string)) - return 3; - + if(!strcasecmp(layer_to_string(2), string)) return 2; + if(!strcasecmp(layer_to_string(3), string)) return 3; return 2; } char* MPEGLayer::layer_to_string(int layer) { - switch(layer) - { - case 2: - return _("II"); - break; - - case 3: - return _("III"); - break; - - default: - return _("II"); - break; + switch(layer) { + case 2: return _("II"); + case 3: return _("III"); } + return _("II"); } - - - - - MPEGABitrate::MPEGABitrate(int x, int y, MPEGConfigAudio *gui) - : BC_PopupMenu(x, y, 100, - bitrate_to_string(gui->string, gui->asset->ampeg_bitrate)) + : BC_PopupMenu(x, y, xS(100), + bitrate_to_string(gui->string, gui->asset->ampeg_bitrate)) { this->gui = gui; } @@ -1842,8 +1815,7 @@ void MPEGABitrate::set_layer(int layer) { while(total_items()) del_item(0); - if(layer == 2) - { + if(layer == 2) { add_item(new BC_MenuItem("160")); add_item(new BC_MenuItem("192")); add_item(new BC_MenuItem("224")); @@ -1851,8 +1823,7 @@ void MPEGABitrate::set_layer(int layer) add_item(new BC_MenuItem("320")); add_item(new BC_MenuItem("384")); } - else - { + else { add_item(new BC_MenuItem("8")); add_item(new BC_MenuItem("16")); add_item(new BC_MenuItem("24")); @@ -1894,18 +1865,11 @@ char* MPEGABitrate::bitrate_to_string(char *string, int bitrate) - - - - - - MPEGConfigVideo::MPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Video Compression"), - parent_window->get_abs_cursor_x(1), - parent_window->get_abs_cursor_y(1), - 500, 400, -1, -1, 0, 0, 1) + parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), + xS(500), yS(400), -1, -1, 0, 0, 1) { this->parent_window = parent_window; this->asset = asset; @@ -1918,9 +1882,9 @@ MPEGConfigVideo::~MPEGConfigVideo() void MPEGConfigVideo::create_objects() { - int x = 10, y = 10; - int x1 = x + 150; - //int x2 = x + 300; + int x = xS(10), y = yS(10); + int x1 = x + xS(150); + //int x2 = x + xS(300); lock_window("MPEGConfigVideo::create_objects"); if(asset->format == FILE_MPEG) @@ -1933,7 +1897,7 @@ void MPEGConfigVideo::create_objects() add_subwindow(new BC_Title(x, y, _("Color model:"))); add_subwindow(cmodel = new MPEGColorModel(x1, y, this)); cmodel->create_objects(); - y += 30; + y += yS(30); update_cmodel_objs(); @@ -1985,71 +1949,72 @@ void MPEGConfigVideo::reset_cmodel() void MPEGConfigVideo::update_cmodel_objs() { + int xs10 = xS(10); + int ys5 = yS(5), ys30 = yS(30), ys40 = yS(40); BC_Title *title; - int x = 10; - int y = 40; - int x1 = x + 150; - int x2 = x + 280; + int x = xs10, y = ys40; + int x1 = x + xS(150); + int x2 = x + xS(280); delete_cmodel_objs(); if(asset->vmpeg_cmodel == BC_YUV420P) { - add_subwindow(title = new BC_Title(x, y + 5, _("Format Preset:"))); + add_subwindow(title = new BC_Title(x, y + ys5, _("Format Preset:"))); titles.append(title); add_subwindow(preset = new MPEGPreset(x1, y, this)); preset->create_objects(); - y += 30; + y += ys30; } - add_subwindow(title = new BC_Title(x, y + 5, _("Derivative:"))); + add_subwindow(title = new BC_Title(x, y + ys5, _("Derivative:"))); titles.append(title); add_subwindow(derivative = new MPEGDerivative(x1, y, this)); derivative->create_objects(); - y += 30; + y += ys30; - add_subwindow(title = new BC_Title(x, y + 5, _("Bitrate:"))); + add_subwindow(title = new BC_Title(x, y + ys5, _("Bitrate:"))); titles.append(title); add_subwindow(bitrate = new MPEGBitrate(x1, y, this)); add_subwindow(fixed_bitrate = new MPEGFixedBitrate(x2, y, this)); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Quantization:"))); titles.append(title); quant = new MPEGQuant(x1, y, this); quant->create_objects(); add_subwindow(fixed_quant = new MPEGFixedQuant(x2, y, this)); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("I frame distance:"))); titles.append(title); iframe_distance = new MPEGIFrameDistance(x1, y, this); iframe_distance->create_objects(); - y += 30; + y += ys30; if(asset->vmpeg_cmodel == BC_YUV420P) { - add_subwindow(title = new BC_Title(x, y, _("P frame distance:"))); + add_subwindow(title = new BC_Title(x, y, _("P frame distance:"))); titles.append(title); pframe_distance = new MPEGPFrameDistance(x1, y, this); pframe_distance->create_objects(); - y += 30; + y += ys30; add_subwindow(top_field_first = new BC_CheckBox(x, y, &asset->vmpeg_field_order, _("Bottom field first"))); - y += 30; + y += ys30; } add_subwindow(progressive = new BC_CheckBox(x, y, &asset->vmpeg_progressive, _("Progressive frames"))); - y += 30; + y += ys30; add_subwindow(denoise = new BC_CheckBox(x, y, &asset->vmpeg_denoise, _("Denoise"))); - y += 30; + y += ys30; add_subwindow(seq_codes = new BC_CheckBox(x, y, &asset->vmpeg_seq_codes, _("Sequence start codes in every GOP"))); } MPEGDerivative::MPEGDerivative(int x, int y, MPEGConfigVideo *gui) - : BC_PopupMenu(x, y, 150, derivative_to_string(gui->asset->vmpeg_derivative)) + : BC_PopupMenu(x, y, xS(150), derivative_to_string(gui->asset->vmpeg_derivative)) { this->gui = gui; } @@ -2084,7 +2049,7 @@ char* MPEGDerivative::derivative_to_string(int derivative) MPEGPreset::MPEGPreset(int x, int y, MPEGConfigVideo *gui) - : BC_PopupMenu(x, y, 200, value_to_string(gui->asset->vmpeg_preset)) + : BC_PopupMenu(x, y, xS(200), value_to_string(gui->asset->vmpeg_preset)) { this->gui = gui; } @@ -2133,17 +2098,8 @@ char* MPEGPreset::value_to_string(int derivative) } - - - - - - - - - MPEGBitrate::MPEGBitrate(int x, int y, MPEGConfigVideo *gui) - : BC_TextBox(x, y, 100, 1, gui->asset->vmpeg_bitrate) + : BC_TextBox(x, y, xS(100), 1, gui->asset->vmpeg_bitrate) { this->gui = gui; } @@ -2156,17 +2112,11 @@ int MPEGBitrate::handle_event() }; - - - MPEGQuant::MPEGQuant(int x, int y, MPEGConfigVideo *gui) : BC_TumbleTextBox(gui, - (int64_t)gui->asset->vmpeg_quantization, - (int64_t)1, - (int64_t)100, - x, - y, - 100) + (int64_t)gui->asset->vmpeg_quantization, + (int64_t)1, (int64_t)100, + x, y, xS(100)) { this->gui = gui; } @@ -2207,20 +2157,11 @@ int MPEGFixedQuant::handle_event() - - - - - - MPEGIFrameDistance::MPEGIFrameDistance(int x, int y, MPEGConfigVideo *gui) : BC_TumbleTextBox(gui, - (int64_t)gui->asset->vmpeg_iframe_distance, - (int64_t)1, - (int64_t)100, - x, - y, - 50) + (int64_t)gui->asset->vmpeg_iframe_distance, + (int64_t)1, (int64_t)100, + x, y, xS(50)) { this->gui = gui; } @@ -2232,19 +2173,11 @@ int MPEGIFrameDistance::handle_event() } - - - - - MPEGPFrameDistance::MPEGPFrameDistance(int x, int y, MPEGConfigVideo *gui) : BC_TumbleTextBox(gui, - (int64_t)gui->asset->vmpeg_pframe_distance, - (int64_t)0, - (int64_t)2, - x, - y, - 50) + (int64_t)gui->asset->vmpeg_pframe_distance, + (int64_t)0, (int64_t)2, + x, y, xS(50)) { this->gui = gui; } @@ -2256,14 +2189,8 @@ int MPEGPFrameDistance::handle_event() } - - - - - - MPEGColorModel::MPEGColorModel(int x, int y, MPEGConfigVideo *gui) - : BC_PopupMenu(x, y, 150, cmodel_to_string(gui->asset->vmpeg_cmodel)) + : BC_PopupMenu(x, y, xS(150), cmodel_to_string(gui->asset->vmpeg_cmodel)) { this->gui = gui; } @@ -2301,8 +2228,3 @@ char* MPEGColorModel::cmodel_to_string(int cmodel) } } - - - - - diff --git a/cinelerra-5.1/cinelerra/filepng.C b/cinelerra-5.1/cinelerra/filepng.C index d4b581d7..f6326079 100644 --- a/cinelerra-5.1/cinelerra/filepng.C +++ b/cinelerra-5.1/cinelerra/filepng.C @@ -336,16 +336,6 @@ FrameWriterUnit* FilePNG::new_writer_unit(FrameWriter *writer) } - - - - - - - - - - PNGUnit::PNGUnit(FilePNG *file, FrameWriter *writer) : FrameWriterUnit(writer) { @@ -358,19 +348,10 @@ PNGUnit::~PNGUnit() } - - - - - - - PNGConfigVideo::PNGConfigVideo(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Video Compression"), - parent_window->get_abs_cursor_x(1), - parent_window->get_abs_cursor_y(1), - 200, - 100) + parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), + xS(200), yS(100)) { this->parent_window = parent_window; this->asset = asset; @@ -383,7 +364,7 @@ PNGConfigVideo::~PNGConfigVideo() void PNGConfigVideo::create_objects() { lock_window("PNGConfigVideo::create_objects"); - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(new PNGUseAlpha(this, x, y)); add_subwindow(new BC_OKButton(this)); show_window(1); @@ -409,5 +390,3 @@ int PNGUseAlpha::handle_event() return 1; } - - diff --git a/cinelerra-5.1/cinelerra/fileppm.C b/cinelerra-5.1/cinelerra/fileppm.C index 7df92707..625223ea 100644 --- a/cinelerra-5.1/cinelerra/fileppm.C +++ b/cinelerra-5.1/cinelerra/fileppm.C @@ -195,7 +195,8 @@ int FilePPM::get_best_colormodel(Asset *asset, int driver) PPMConfigVideo::PPMConfigVideo(BC_WindowBase *gui, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Video Compression"), - gui->get_abs_cursor_x(1), gui->get_abs_cursor_y(1), 200, 100) + gui->get_abs_cursor_x(1), gui->get_abs_cursor_y(1), + xS(200), yS(100)) { this->gui = gui; this->asset = asset; @@ -204,7 +205,7 @@ PPMConfigVideo::PPMConfigVideo(BC_WindowBase *gui, Asset *asset) void PPMConfigVideo::create_objects() { lock_window("PPMConfigVideo::create_objects"); - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(new BC_Title(x, y, _("PPM, RGB raw only"))); add_subwindow(new BC_OKButton(this)); show_window(1); diff --git a/cinelerra-5.1/cinelerra/filesndfile.C b/cinelerra-5.1/cinelerra/filesndfile.C index 9351378b..ffd59b46 100644 --- a/cinelerra-5.1/cinelerra/filesndfile.C +++ b/cinelerra-5.1/cinelerra/filesndfile.C @@ -371,10 +371,8 @@ void FileSndFile::get_parameters(BC_WindowBase *parent_window, SndFileConfig::SndFileConfig(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Audio Compression"), - parent_window->get_abs_cursor_x(1), - parent_window->get_abs_cursor_y(1), - 250, - 250) + parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), + xS(250), yS(250)) { this->parent_window = parent_window; this->asset = asset; @@ -392,8 +390,9 @@ SndFileConfig::~SndFileConfig() void SndFileConfig::create_objects() { + int xs10 = xS(10); lock_window("SndFileConfig::create_objects"); - int x = 10, y = 10; + int x = xs10, y = yS(10); bits_popup = 0; switch(asset->format) @@ -402,27 +401,27 @@ void SndFileConfig::create_objects() case FILE_PCM: case FILE_AIFF: add_tool(new BC_Title(x, y, _("Compression:"))); - y += 25; + y += yS(25); if(asset->format == FILE_WAV) bits_popup = new BitsPopup(this, x, y, &asset->bits, 0, 0, 1, 1, 0); else bits_popup = new BitsPopup(this, x, y, &asset->bits, 0, 0, 0, 0, 0); - y += 40; + y += yS(40); bits_popup->create_objects(); break; } - x = 10; + x = xs10; if(asset->format != FILE_AU) add_subwindow(new BC_CheckBox(x, y, &asset->dither, _("Dither"))); - y += 30; + y += yS(30); if(asset->format == FILE_PCM) { add_subwindow(new BC_CheckBox(x, y, &asset->signed_, _("Signed"))); - y += 35; + y += yS(35); add_subwindow(new BC_Title(x, y, _("Byte order:"))); - add_subwindow(hilo = new SndFileHILO(this, x + 100, y)); - add_subwindow(lohi = new SndFileLOHI(this, x + 170, y)); + add_subwindow(hilo = new SndFileHILO(this, x + xS(100), y)); + add_subwindow(lohi = new SndFileLOHI(this, x + xS(170), y)); } add_subwindow(new BC_OKButton(this)); show_window(1); diff --git a/cinelerra-5.1/cinelerra/filetga.C b/cinelerra-5.1/cinelerra/filetga.C index 800661e4..6eded708 100644 --- a/cinelerra-5.1/cinelerra/filetga.C +++ b/cinelerra-5.1/cinelerra/filetga.C @@ -397,27 +397,13 @@ void FileTGA::read_tga(Asset *asset, VFrame *frame, VFrame *data, VFrame* &temp) if(output_frame != frame) { - BC_CModels::transfer(frame->get_rows(), - output_frame->get_rows(), - frame->get_y(), - frame->get_u(), - frame->get_v(), - output_frame->get_y(), - output_frame->get_u(), - output_frame->get_v(), - 0, - 0, - width, - height, - 0, - 0, - frame->get_w(), - frame->get_h(), - output_frame->get_color_model(), - frame->get_color_model(), - 0, - width, - frame->get_w()); + BC_CModels::transfer(frame->get_rows(), output_frame->get_rows(), + frame->get_y(), frame->get_u(), frame->get_v(), + output_frame->get_y(), output_frame->get_u(), output_frame->get_v(), + 0, 0, width, height, + 0, 0, frame->get_w(), frame->get_h(), + output_frame->get_color_model(), frame->get_color_model(), + 0, width, frame->get_w()); } } @@ -494,27 +480,13 @@ void FileTGA::write_tga(Asset *asset, VFrame *frame, VFrame *data, VFrame* &temp } input_frame = temp; - BC_CModels::transfer(input_frame->get_rows(), - frame->get_rows(), - input_frame->get_y(), - input_frame->get_u(), - input_frame->get_v(), - frame->get_y(), - frame->get_u(), - frame->get_v(), - 0, - 0, - frame->get_w(), - frame->get_h(), - 0, - 0, - frame->get_w(), - frame->get_h(), - frame->get_color_model(), - input_frame->get_color_model(), - 0, - frame->get_w(), - frame->get_w()); + BC_CModels::transfer(input_frame->get_rows(), frame->get_rows(), + input_frame->get_y(), input_frame->get_u(), input_frame->get_v(), + frame->get_y(), frame->get_u(), frame->get_v(), + 0, 0, frame->get_w(), frame->get_h(), + 0, 0, frame->get_w(), frame->get_h(), + frame->get_color_model(), input_frame->get_color_model(), + 0, frame->get_w(), frame->get_w()); } //printf("FileTGA::write_tga 1\n"); @@ -586,26 +558,14 @@ void FileTGA::write_data(unsigned char *buffer, //printf("FileTGA::write_data 2 %d\n", len); } -void FileTGA::read_line(unsigned char *row, - unsigned char *data, - int64_t &file_offset, - int image_type, - int bpp, - int image_compression, - int bytes, - int width, - int fliphoriz, - int alphabits, - int data_size) +void FileTGA::read_line(unsigned char *row, unsigned char *data, + int64_t &file_offset, int image_type, int bpp, int image_compression, + int bytes, int width, int fliphoriz, int alphabits, int data_size) { if(file_offset >= data_size) return; if(image_compression == TGA_COMP_RLE) { - rle_read(row, - data, - file_offset, - bytes, - width); + rle_read(row, data, file_offset, bytes, width); } else { @@ -638,24 +598,21 @@ void FileTGA::read_line(unsigned char *row, void FileTGA::flip_line(unsigned char *row, int bytes, int width) { - unsigned char temp; + unsigned char temp; unsigned char *alt; int x, s; - alt = row + (bytes * (width - 1)); - for (x = 0; x * 2 <= width; x++) - { - for(s = 0; s < bytes; ++s) - { + for (x = 0; x * 2 <= width; x++) { + for(s = 0; s < bytes; ++s) { temp = row[s]; row[s] = alt[s]; alt[s] = temp; } - row += bytes; - alt -= bytes; - } + row += bytes; + alt -= bytes; + } } void FileTGA::rle_read(unsigned char *row, @@ -719,10 +676,10 @@ void FileTGA::rle_write(unsigned char *buffer, int64_t &file_offset) { int repeat = 0; - int direct = 0; - unsigned char *from = buffer; + int direct = 0; + unsigned char *from = buffer; unsigned char output; - int x; + int x; for(x = 1; x < width; ++x) { @@ -799,44 +756,26 @@ void FileTGA::rle_write(unsigned char *buffer, } -void FileTGA::bgr2rgb(unsigned char *dest, - unsigned char *src, - int width, - int bytes, - int alpha) +void FileTGA::bgr2rgb(unsigned char *dest, unsigned char *src, + int width, int bytes, int alpha) { int x; unsigned char r, g, b; - if(alpha) - { - for(x = 0; x < width; x++) - { - r = src[2]; - g = src[1]; - b = src[0]; - *(dest++) = r; - *(dest++) = g; - *(dest++) = b; - *(dest++) = src[3]; - - src += bytes; + if(alpha) { + for(x = 0; x < width; x++) { + r = src[2]; g = src[1]; b = src[0]; + *(dest++) = r; *(dest++) = g; *(dest++) = b; + *(dest++) = src[3]; src += bytes; } - } - else - { - for(x = 0; x < width; x++) - { - r = src[2]; - g = src[1]; - b = src[0]; - *(dest++) = r; - *(dest++) = g; - *(dest++) = b; - + } + else { + for(x = 0; x < width; x++) { + r = src[2]; g = src[1]; b = src[0]; + *(dest++) = r; *(dest++) = g; *(dest++) = b; src += bytes; } - } + } } void FileTGA::upsample(unsigned char *dest, @@ -848,30 +787,22 @@ void FileTGA::upsample(unsigned char *dest, dest += (width - 1) * 3; src += (width - 1) * bytes; - for(x = width - 1; x >= 0; x--) - { - dest[0] = ((src[1] << 1) & 0xf8); - dest[0] += (dest[0] >> 5); + for(x = width - 1; x >= 0; x--) { + dest[0] = ((src[1] << 1) & 0xf8); + dest[0] += (dest[0] >> 5); - dest[1] = ((src[0] & 0xe0) >> 2) + ((src[1] & 0x03) << 6); - dest[1] += (dest[1] >> 5); + dest[1] = ((src[0] & 0xe0) >> 2) + ((src[1] & 0x03) << 6); + dest[1] += (dest[1] >> 5); - dest[2] = ((src[0] << 3) & 0xf8); - dest[2] += (dest[2] >> 5); + dest[2] = ((src[0] << 3) & 0xf8); + dest[2] += (dest[2] >> 5); - dest -= 3; - src -= bytes; - } + dest -= 3; + src -= bytes; + } } - - - - - - - TGAUnit::TGAUnit(FileTGA *file, FrameWriter *writer) : FrameWriterUnit(writer) { @@ -885,23 +816,10 @@ TGAUnit::~TGAUnit() } - - - - - - - - - - - TGAConfigVideo::TGAConfigVideo(BC_WindowBase *gui, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Video Compression"), - gui->get_abs_cursor_x(1), - gui->get_abs_cursor_y(1), - 400, - 100) + gui->get_abs_cursor_x(1), gui->get_abs_cursor_y(1), + xS(400), yS(100)) { this->gui = gui; this->asset = asset; @@ -920,14 +838,11 @@ TGAConfigVideo::~TGAConfigVideo() void TGAConfigVideo::create_objects() { lock_window("TGAConfigVideo::create_objects"); - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(new BC_Title(x, y, _("Compression:"))); TGACompression *textbox = new TGACompression(this, - x + 110, - y, - asset, - &compression_items); + x + xS(110), y, asset, &compression_items); textbox->create_objects(); add_subwindow(new BC_OKButton(this)); show_window(1); @@ -941,18 +856,11 @@ int TGAConfigVideo::close_event() } -TGACompression::TGACompression(TGAConfigVideo *gui, - int x, - int y, - Asset *asset, - ArrayList *compression_items) - : BC_PopupTextBox(gui, - compression_items, - FileTGA::compression_to_str(gui->asset->vcodec), - x, - y, - 200, - 200) +TGACompression::TGACompression(TGAConfigVideo *gui, int x, int y, + Asset *asset, ArrayList *compression_items) + : BC_PopupTextBox(gui, compression_items, + FileTGA::compression_to_str(gui->asset->vcodec), + x, y, xS(200), yS(200)) { this->asset = asset; } diff --git a/cinelerra-5.1/cinelerra/filetiff.C b/cinelerra-5.1/cinelerra/filetiff.C index fb1449f1..cde59a0b 100644 --- a/cinelerra-5.1/cinelerra/filetiff.C +++ b/cinelerra-5.1/cinelerra/filetiff.C @@ -514,27 +514,13 @@ int FileTIFF::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit) new VFrame(asset->width, asset->height, color_model, 0); } - BC_CModels::transfer(tiff_unit->temp->get_rows(), - frame->get_rows(), - tiff_unit->temp->get_y(), - tiff_unit->temp->get_u(), - tiff_unit->temp->get_v(), - frame->get_y(), - frame->get_u(), - frame->get_v(), - 0, - 0, - frame->get_w(), - frame->get_h(), - 0, - 0, - frame->get_w(), - frame->get_h(), - frame->get_color_model(), - color_model, - 0, - frame->get_w(), - frame->get_w()); + BC_CModels::transfer(tiff_unit->temp->get_rows(), frame->get_rows(), + tiff_unit->temp->get_y(), tiff_unit->temp->get_u(), tiff_unit->temp->get_v(), + frame->get_y(), frame->get_u(), frame->get_v(), + 0, 0, frame->get_w(), frame->get_h(), + 0, 0, frame->get_w(), frame->get_h(), + frame->get_color_model(), color_model, + 0, frame->get_w(), frame->get_w()); for(int i = 0; i < asset->height; i++) { TIFFWriteScanline(stream, tiff_unit->temp->get_rows()[i], i, 0); @@ -553,12 +539,6 @@ FrameWriterUnit* FileTIFF::new_writer_unit(FrameWriter *writer) } - - - - - - FileTIFFUnit::FileTIFFUnit(FileTIFF *file, FrameWriter *writer) : FrameWriterUnit(writer) { @@ -586,8 +566,7 @@ TIFFConfigVideo::TIFFConfigVideo(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Video Compression"), parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), - 400, - 200) + xS(400), yS(200)) { this->parent_window = parent_window; this->asset = asset; @@ -600,16 +579,16 @@ TIFFConfigVideo::~TIFFConfigVideo() void TIFFConfigVideo::create_objects() { lock_window("TIFFConfigVideo::create_objects"); - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(new BC_Title(x, y, _("Colorspace:"))); TIFFColorspace *menu1; - add_subwindow(menu1 = new TIFFColorspace(this, x + 150, y, 200)); + add_subwindow(menu1 = new TIFFColorspace(this, x + xS(150), y, xS(200))); menu1->create_objects(); - y += 40; + y += yS(40); add_subwindow(new BC_Title(x, y, _("Compression:"))); TIFFCompression *menu2; - add_subwindow(menu2 = new TIFFCompression(this, x + 150, y, 200)); + add_subwindow(menu2 = new TIFFCompression(this, x + xS(150), y, xS(200))); menu2->create_objects(); add_subwindow(new BC_OKButton(this)); @@ -624,10 +603,6 @@ int TIFFConfigVideo::close_event() } - - - - TIFFColorspace::TIFFColorspace(TIFFConfigVideo *gui, int x, int y, int w) : BC_PopupMenu(x, y, diff --git a/cinelerra-5.1/cinelerra/formatpopup.C b/cinelerra-5.1/cinelerra/formatpopup.C index 31a8bd00..6252b0c2 100644 --- a/cinelerra-5.1/cinelerra/formatpopup.C +++ b/cinelerra-5.1/cinelerra/formatpopup.C @@ -28,7 +28,7 @@ FormatPopup::FormatPopup(int x, int y, int do_audio, int do_video, int use_brender) - : BC_ListBox(x, y, 200, 200, LISTBOX_TEXT, 0, 0, 0, 1, 0, 1) + : BC_ListBox(x, y, xS(200), yS(200), LISTBOX_TEXT, 0, 0, 0, 1, 0, 1) { this->do_audio = do_audio; this->do_video = do_video; @@ -104,7 +104,7 @@ int FormatPopup::handle_event() FFMPEGPopup::FFMPEGPopup(int x, int y) - : BC_ListBox(x, y, 100, 200, LISTBOX_TEXT, 0, 0, 0, 1, 0, 1) + : BC_ListBox(x, y, xS(100), yS(200), LISTBOX_TEXT, 0, 0, 0, 1, 0, 1) { set_tooltip(_("Set ffmpeg file type")); } diff --git a/cinelerra-5.1/cinelerra/formatpresets.C b/cinelerra-5.1/cinelerra/formatpresets.C index ab967823..bb27ba0c 100644 --- a/cinelerra-5.1/cinelerra/formatpresets.C +++ b/cinelerra-5.1/cinelerra/formatpresets.C @@ -66,7 +66,7 @@ void FormatPresets::create_objects() gui_base->add_subwindow(new BC_Title(x, y, _("Presets:"))); int x1 = x; - y += 20; + y += yS(20); gui_base->add_subwindow(text = new FormatPresetsText(mwindow, @@ -129,10 +129,7 @@ FormatPresetsText::FormatPresetsText(MWindow *mwindow, FormatPresets *gui, int x, int y) - : BC_TextBox(x, - y, - 200, - 1, + : BC_TextBox(x, y, xS(200), 1, gui->get_preset_text(gui->get_edl())) { this->gui = gui; @@ -157,7 +154,7 @@ FormatPresetsPulldown::FormatPresetsPulldown(MWindow *mwindow, FormatPresets *gui, int x, int y) - : BC_ListBox(x, y, 200, 250, + : BC_ListBox(x, y, xS(200), yS(250), LISTBOX_TEXT, // Display text list or icons (ArrayList*)&gui->preset_items, // Each column has an ArrayList of BC_ListBoxItems. 0, // Titles for columns. Set to 0 for no titles diff --git a/cinelerra-5.1/cinelerra/formattools.C b/cinelerra-5.1/cinelerra/formattools.C index dc189a02..9199fff0 100644 --- a/cinelerra-5.1/cinelerra/formattools.C +++ b/cinelerra-5.1/cinelerra/formattools.C @@ -112,6 +112,7 @@ void FormatTools::create_objects( int brender, int horizontal_layout) { + int ys10 = yS(10); int x = init_x; int y = init_y; int ylev = init_y; @@ -136,7 +137,7 @@ void FormatTools::create_objects( window->add_subwindow(path_textbox = new FormatPathText(px, y, this)); px += path_textbox->get_w() + 5; path_recent = new BC_RecentList("PATH", mwindow->defaults, - path_textbox, 10, px, y, 300, 100); + path_textbox, 10, px, y, xS(300), yS(100)); window->add_subwindow(path_recent); path_recent->load_items(File::formattostr(asset->format)); px += path_recent->get_w(); @@ -145,32 +146,32 @@ void FormatTools::create_objects( _("Output to file"), _("Select a file to write to:"), 0)); // Set w for user. - w = MAX(w, 305); - y += path_textbox->get_h() + 10; + w = MAX(w, xS(305)); + y += path_textbox->get_h() + ys10; } else { -// w = x + 305; - w = 305; +// w = x + xS(305); + w = xS(305); } x = init_x; window->add_subwindow(format_title = new BC_Title(x, y, _("File Format:"))); x += format_title->get_w() + margin; - window->add_subwindow(format_text = new BC_TextBox(x, y, 160, 1, + window->add_subwindow(format_text = new BC_TextBox(x, y, xS(160), 1, File::formattostr(asset->format))); x += format_text->get_w() + margin; //printf("FormatTools::create_objects %d %p\n", __LINE__, window); window->add_subwindow(format_button = new FormatFormat(x, y, this)); format_button->create_objects(); x += format_button->get_w() + 5; - window->add_subwindow(ffmpeg_type = new FFMpegType(x, y, 70, 1, asset->fformat)); + window->add_subwindow(ffmpeg_type = new FFMpegType(x, y, xS(70), 1, asset->fformat)); FFMPEG::set_asset_format(asset, mwindow->edl, asset->fformat); x += ffmpeg_type->get_w(); window->add_subwindow(format_ffmpeg = new FormatFFMPEG(x, y, this)); format_ffmpeg->create_objects(); x = init_x; - y += format_button->get_h() + 10; + y += format_button->get_h() + ys10; if( do_audio ) { window->add_subwindow(audio_title = new BC_Title(x, y, _("Audio:"), LARGEFONT, BC_WindowBase::get_resources()->audiovideo_color)); @@ -182,7 +183,7 @@ void FormatTools::create_objects( } x = init_x; ylev = y; - y += aparams_button->get_h() + 10; + y += aparams_button->get_h() + ys10; //printf("FormatTools::create_objects 6\n"); aparams_thread = new FormatAThread(this); @@ -191,7 +192,7 @@ void FormatTools::create_objects( //printf("FormatTools::create_objects 7\n"); if( do_video ) { if( horizontal_layout && do_audio ) { - x += 370; + x += xS(370); y = ylev; } @@ -214,7 +215,7 @@ void FormatTools::create_objects( } //printf("FormatTools::create_objects 10\n"); - y += 10; + y += ys10; vparams_thread = new FormatVThread(this); } @@ -224,7 +225,7 @@ void FormatTools::create_objects( if( file_per_label ) { labeled_files = new FormatFilePerLabel(this, x, y, file_per_label); window->add_subwindow(labeled_files); - y += labeled_files->get_h() + 10; + y += labeled_files->get_h() + ys10; } //printf("FormatTools::create_objects 12\n"); @@ -442,6 +443,8 @@ void FormatTools::set_w(int w) void FormatTools::reposition_window(int &init_x, int &init_y) { + int xs10 = xS(10), xs80 = xS(80); + int ys10 = yS(10); int x = init_x; int y = init_y; @@ -449,43 +452,43 @@ void FormatTools::reposition_window(int &init_x, int &init_y) { int px = x; path_textbox->reposition_window(px, y); - px += path_textbox->get_w() + 5; + px += path_textbox->get_w() + xS(5); path_recent->reposition_window(px, y); - px += path_recent->get_w() + 8; + px += path_recent->get_w() + xS(8); path_button->reposition_window(px, y); - y += path_textbox->get_h() + 10; + y += path_textbox->get_h() + ys10; } format_title->reposition_window(x, y); - x += 90; + x += xS(90); format_text->reposition_window(x, y); x += format_text->get_w(); format_button->reposition_window(x, y); x = init_x; - y += format_button->get_h() + 10; + y += format_button->get_h() + ys10; if(do_audio) { audio_title->reposition_window(x, y); - x += 80; + x += xs80; aparams_button->reposition_window(x, y); - x += aparams_button->get_w() + 10; + x += aparams_button->get_w() + xs10; if(prompt_audio) audio_switch->reposition_window(x, y); x = init_x; - y += aparams_button->get_h() + 10; + y += aparams_button->get_h() + ys10; } if(do_video) { video_title->reposition_window(x, y); - x += 80; + x += xs80; if(prompt_video_compression) { vparams_button->reposition_window(x, y); - x += vparams_button->get_w() + 10; + x += vparams_button->get_w() + xs10; } if(prompt_video) @@ -498,13 +501,13 @@ void FormatTools::reposition_window(int &init_x, int &init_y) y += vparams_button->get_h(); } - y += 10; + y += ys10; x = init_x; } if( file_per_label ) { labeled_files->reposition_window(x, y); - y += labeled_files->get_h() + 10; + y += labeled_files->get_h() + ys10; } init_y = y; @@ -658,7 +661,7 @@ void FormatVThread::run() FormatPathText::FormatPathText(int x, int y, FormatTools *format) : BC_TextBox(x, y, format->w - x - - 2*format->mwindow->theme->get_image_set("wrench")[0]->get_w() - 20, 1, + 2*format->mwindow->theme->get_image_set("wrench")[0]->get_w() - xS(20), 1, format->asset->path) { this->format = format; diff --git a/cinelerra-5.1/cinelerra/formatwindow.C b/cinelerra-5.1/cinelerra/formatwindow.C index a2c1ba36..67f7416d 100644 --- a/cinelerra-5.1/cinelerra/formatwindow.C +++ b/cinelerra-5.1/cinelerra/formatwindow.C @@ -26,9 +26,8 @@ FormatAWindow::FormatAWindow(Asset *asset, int *dither) - : BC_Window(_(PROGRAM_NAME ": File format"), 410, - (asset->format == FILE_WAV) ? 115 : 185, - 0, 0) + : BC_Window(_(PROGRAM_NAME ": File format"), xS(410), + yS((asset->format == FILE_WAV) ? 115 : 185), 0, 0) { this->asset = asset; this->dither = dither; } FormatAWindow::~FormatAWindow() @@ -40,42 +39,42 @@ void FormatAWindow::create_objects() lock_window("FormatAWindow::create_objects"); int x; int init_x; - int y = 10; + int y = yS(10); File file; - x = init_x = 10; + x = init_x = xS(10); add_subwindow(new BC_Title(x, y, _("Set parameters for this audio format:"))); - y += 30; + y += yS(30); add_subwindow(new BC_Title(x, y, _("Bits:"))); - x += 45; + x += yS(45); add_subwindow(new FormatBits(x, y, asset)); - x += 100; + x += xS(100); add_subwindow(new FormatDither(x, y, this->dither)); if(asset->format == FILE_PCM) { - x += 90; + x += xS(90); add_subwindow(new FormatSigned(x, y, asset)); } - y += 40; + y += yS(40); x = init_x; if(asset->format == FILE_PCM) { add_subwindow(new BC_Title(x, y, _("Byte order:"))); - y += 25; + y += yS(25); add_subwindow(new BC_Title(x, y, _("HiLo:"), SMALLFONT)); - add_subwindow(hilo_button = new FormatHILO(x + 30, y, asset)); - x += 50; + add_subwindow(hilo_button = new FormatHILO(x + xS(30), y, asset)); + x += xS(50); add_subwindow(new BC_Title(x, y, _("LoHi:"), SMALLFONT)); - add_subwindow(lohi_button = new FormatLOHI(x + 30, y, hilo_button, asset)); + add_subwindow(lohi_button = new FormatLOHI(x + xS(30), y, hilo_button, asset)); hilo_button->lohi = lohi_button; - y += 30; + y += yS(30); } x = init_x; - add_subwindow(new BC_OKButton(x + 170, y)); + add_subwindow(new BC_OKButton(x + xS(170), y)); unlock_window(); } @@ -88,8 +87,11 @@ int FormatAWindow::close_event() FormatVWindow::FormatVWindow(Asset *asset, int recording) - : BC_Window(_(PROGRAM_NAME ": File format"), 410, 115, 0, 0) -{ this->asset = asset; this->recording = recording; } + : BC_Window(_(PROGRAM_NAME ": File format"), xS(410), yS(115), 0, 0) +{ + this->asset = asset; + this->recording = recording; +} FormatVWindow::~FormatVWindow() { @@ -98,28 +100,28 @@ FormatVWindow::~FormatVWindow() void FormatVWindow::create_objects() { lock_window("FormatVWindow::create_objects"); - int x, y = 10; + int x, y = yS(10); int init_x; - init_x = x = 10; + init_x = x = xS(10); if(asset->format == FILE_JPEG_LIST) { add_subwindow(new BC_Title(x, y, _("Set parameters for this video format:"))); - y += 30; + y += yS(30); add_subwindow(new BC_Title(x, y, _("Quality:"))); - x += 70; + x += xS(70); add_subwindow(new FormatQuality(x, y, asset, asset->quality)); - y += 40; + y += yS(40); x = init_x; } else { add_subwindow(new BC_Title(x, y, _("Video is not supported in this format."))); - y += 40; + y += yS(40); } - add_subwindow(new BC_OKButton(x + 170, y)); + add_subwindow(new BC_OKButton(x + xS(170), y)); unlock_window(); } @@ -130,7 +132,7 @@ int FormatVWindow::close_event() FormatQuality::FormatQuality(int x, int y, Asset *asset, int default_) - : BC_ISlider(x, y, 0, 100, 100, 0, 100, default_, 1) + : BC_ISlider(x, y, 0, xS(100), xS(100), 0, 100, default_, 1) { this->asset = asset; } diff --git a/cinelerra-5.1/cinelerra/gwindowgui.C b/cinelerra-5.1/cinelerra/gwindowgui.C index 3fef296e..3bcb853e 100644 --- a/cinelerra-5.1/cinelerra/gwindowgui.C +++ b/cinelerra-5.1/cinelerra/gwindowgui.C @@ -170,14 +170,15 @@ void GWindowGUI::calculate_extents(BC_WindowBase *gui, int *w, int *h) { int temp1, temp2, temp3, temp4, temp5, temp6, temp7; int current_w, current_h; - *w = 10; - *h = 10; + int ys5 = yS(5), ys10 = yS(10); + *w = xS(10); + *h = ys10; for( int i=0; i<(int)(sizeof(toggle_order)/sizeof(toggle_order[0])); ++i ) { toggleinfo *tp = &toggle_order[i]; int ref = tp->ref; if( ref < 0 ) { - *h += get_resources()->bar_data->get_h() + 5; + *h += get_resources()->bar_data->get_h() + ys5; continue; } BC_Toggle::calculate_extents(gui, @@ -187,11 +188,11 @@ void GWindowGUI::calculate_extents(BC_WindowBase *gui, int *w, int *h) toggle_text(tp), MEDIUMFONT); current_w += current_h; *w = MAX(current_w, *w); - *h += current_h + 5; + *h += current_h + ys5; } - *h += 10; - *w += 20; + *h += ys10; + *w += xS(20); } GWindowColorButton::GWindowColorButton(GWindowToggle *auto_toggle, @@ -237,17 +238,19 @@ void GWindowColorButton::handle_done_event(int result) void GWindowGUI::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10); + int x = xs10, y = ys10; lock_window("GWindowGUI::create_objects"); for( int i=0; i<(int)(sizeof(toggle_order)/sizeof(toggle_order[0])); ++i ) { toggleinfo *tp = &toggle_order[i]; int ref = tp->ref; if( ref < 0 ) { - BC_Bar *bar = new BC_Bar(x,y,get_w()-x-10); + BC_Bar *bar = new BC_Bar(x,y,get_w()-x-xs10); add_tool(bar); toggles[i] = 0; - y += bar->get_h() + 5; + y += bar->get_h() + ys5; continue; } const char *label = toggle_text(tp); @@ -264,14 +267,14 @@ void GWindowGUI::create_objects() case AUTOMATION_MASK: vframe = mwindow->theme->maskkeyframe_data; break; } if( !vframe ) { - int wh = toggle->get_h() - 4; + int wh = toggle->get_h() - yS(4); GWindowColorButton *color_button = - new GWindowColorButton(toggle, get_w()-wh-10, y+2, wh, color); + new GWindowColorButton(toggle, get_w()-wh-ys10, y+yS(2), wh, color); add_tool(color_button); color_button->create_objects(); } else - draw_vframe(vframe, get_w()-vframe->get_w()-10, y); + draw_vframe(vframe, get_w()-vframe->get_w()-xs10, y); } else { const char *accel = 0; @@ -286,16 +289,16 @@ void GWindowGUI::create_objects() break; case NON_AUTOMATION_HARD_EDGES: VFrame *vframe = mwindow->theme->hardedge_data; - draw_vframe(vframe, get_w()-vframe->get_w()-10, y); + draw_vframe(vframe, get_w()-vframe->get_w()-xs10, y); hard_edges = toggle; break; } if( accel ) { - int x1 = get_w() - BC_Title::calculate_w(this, accel) - 10; + int x1 = get_w() - BC_Title::calculate_w(this, accel) - xs10; add_subwindow(new BC_Title(x1, y, accel)); } } - y += toggles[i]->get_h() + 5; + y += toggles[i]->get_h() + ys5; } update_toggles(0); unlock_window(); diff --git a/cinelerra-5.1/cinelerra/interfaceprefs.C b/cinelerra-5.1/cinelerra/interfaceprefs.C index c7dcc8a0..9a861e68 100644 --- a/cinelerra-5.1/cinelerra/interfaceprefs.C +++ b/cinelerra-5.1/cinelerra/interfaceprefs.C @@ -61,6 +61,8 @@ InterfacePrefs::~InterfacePrefs() void InterfacePrefs::create_objects() { + int xs4 = xS(4), xs5 = xS(5), xs10 = xS(10), xs30 = xS(30); + int ys5 = yS(5), ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys35 = yS(35); BC_Resources *resources = BC_WindowBase::get_resources(); int margin = mwindow->theme->widget_border; char string[BCTEXTLEN]; @@ -70,143 +72,143 @@ void InterfacePrefs::create_objects() add_subwindow(new BC_Title(x, y, _("Editing:"), LARGEFONT, resources->text_default)); - y += 35; + y += ys35; int x2 = get_w()/2, y2 = y; x = x2; BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Keyframe reticle:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; keyframe_reticle = new KeyframeReticle(pwindow, this, x, y, &pwindow->thread->preferences->keyframe_reticle); add_subwindow(keyframe_reticle); keyframe_reticle->create_objects(); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Snapshot path:"))); - y += title->get_h() + 5; - add_subwindow(snapshot_path = new SnapshotPathText(pwindow, this, x, y, get_w()-x-30)); + y += title->get_h() + ys5; + add_subwindow(snapshot_path = new SnapshotPathText(pwindow, this, x, y, get_w()-x-xs30)); x = x0; y = y2; add_subwindow(title = new BC_Title(x, y, _("Clicking on edit boundaries does what:"))); - y += title->get_h() + 10; + y += title->get_h() + ys10; add_subwindow(new BC_Title(x, y, _("Button 1:"))); - int x1 = x + 100; + int x1 = x + xS(100); ViewBehaviourText *text; - add_subwindow(text = new ViewBehaviourText(x1, y - 5, + add_subwindow(text = new ViewBehaviourText(x1, y - ys5, behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[0]), pwindow, &(pwindow->thread->edl->session->edit_handle_mode[0]))); text->create_objects(); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Button 2:"))); add_subwindow(text = new ViewBehaviourText(x1, - y - 5, + y - ys5, behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[1]), pwindow, &(pwindow->thread->edl->session->edit_handle_mode[1]))); text->create_objects(); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Button 3:"))); - add_subwindow(text = new ViewBehaviourText(x1, y - 5, + add_subwindow(text = new ViewBehaviourText(x1, y - ys5, behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[2]), pwindow, &(pwindow->thread->edl->session->edit_handle_mode[2]))); text->create_objects(); - y += text->get_h() + 30; + y += text->get_h() + ys30; x = x0; - add_subwindow(new BC_Bar(5, y, get_w() - 10)); - y += 5; + add_subwindow(new BC_Bar(xs5, y, get_w() - xs10)); + y += ys5; add_subwindow(new BC_Title(x, y, _("Operation:"), LARGEFONT, resources->text_default)); int y1 = y; - y += 15; + y += yS(15); AndroidRemote *android_remote = new AndroidRemote(pwindow, x2, y); add_subwindow(android_remote); - y += android_remote->get_h() + 10; + y += android_remote->get_h() + ys10; add_subwindow(title = new BC_Title(x2, y, _("Port:"))); int x3 = x2 + title->get_w() + margin; AndroidPort *android_port = new AndroidPort(pwindow, x3, y); add_subwindow(android_port); - y += title->get_h() + 10; + y += title->get_h() + ys10; add_subwindow(title = new BC_Title(x2, y, _("PIN:"))); AndroidPIN *android_pin = new AndroidPIN(pwindow, x3, y); add_subwindow(android_pin); - y += title->get_h() + 20; + y += title->get_h() + ys20; ShBtnPrefs *shbtn_prefs = new ShBtnPrefs(pwindow, this, x2, y); add_subwindow(shbtn_prefs); - y += shbtn_prefs->get_h() + 20; + y += shbtn_prefs->get_h() + ys20; add_subwindow(reload_plugins = new PrefsReloadPlugins(pwindow, this, x2, y)); - y += reload_plugins->get_h() + 10; + y += reload_plugins->get_h() + ys10; add_subwindow(title = new BC_Title(x2, y, _("Default LV2_PATH:"))); - y += title->get_h() + 10; - PrefsLV2PathText *lv2_path_text = new PrefsLV2PathText(pwindow, this, x2, y, get_w()-x2-30); + y += title->get_h() + ys10; + PrefsLV2PathText *lv2_path_text = new PrefsLV2PathText(pwindow, this, x2, y, get_w()-x2-xs30); add_subwindow(lv2_path_text); - y += 30; + y += xs30; y2 = y; - x = x0; y = y1 + 35; + x = x0; y = y1 + ys35; add_subwindow(file_probes = new PrefsFileProbes(pwindow, this, x, y)); - y += 30; + y += ys30; PrefsTrapSigSEGV *trap_segv = new PrefsTrapSigSEGV(this, x, y); add_subwindow(trap_segv); - x1 = x + trap_segv->get_w() + 10; + x1 = x + trap_segv->get_w() + xs10; add_subwindow(new BC_Title(x1, y, _("(must be root)"), MEDIUMFONT, RED)); - y += 30; + y += ys30; PrefsTrapSigINTR *trap_intr = new PrefsTrapSigINTR(this, x, y); add_subwindow(trap_intr); add_subwindow(new BC_Title(x1, y, _("(must be root)"), MEDIUMFONT, RED)); - y += 30; + y += ys30; yuv420p_dvdlace = new PrefsYUV420P_DVDlace(pwindow, this, x, y); add_subwindow(yuv420p_dvdlace); - y += 30; + y += ys30; - add_subwindow(title = new BC_Title(x1=x, y + 5, _("Min DB for meter:"))); - x1 += title->get_w() + 4; + add_subwindow(title = new BC_Title(x1=x, y + ys5, _("Min DB for meter:"))); + x1 += title->get_w() + xs4; sprintf(string, "%d", pwindow->thread->edl->session->min_meter_db); add_subwindow(min_db = new MeterMinDB(pwindow, string, x1, y)); - x1 += min_db->get_w() + 4; - add_subwindow(title = new BC_Title(x1, y + 5, _("Max:"))); - x1 += title->get_w() + 4; + x1 += min_db->get_w() + xs4; + add_subwindow(title = new BC_Title(x1, y + ys5, _("Max:"))); + x1 += title->get_w() + xs4; sprintf(string, "%d", pwindow->thread->edl->session->max_meter_db); add_subwindow(max_db = new MeterMaxDB(pwindow, string, x1, y)); - y += 30; + y += ys30; StillImageUseDuration *use_stduration = new StillImageUseDuration(pwindow, pwindow->thread->edl->session->si_useduration, x, y); add_subwindow(use_stduration); - x1 = x + use_stduration->get_w() + 10; + x1 = x + use_stduration->get_w() + xs10; StillImageDuration *stduration = new StillImageDuration(pwindow, x1, y); add_subwindow(stduration); - x1 += stduration->get_w() + 10; + x1 += stduration->get_w() + xs10; add_subwindow(new BC_Title(x1, y, _("Seconds"))); - y += 30; + y += ys30; PrefsAutostartLV2UI *autostart_lv2ui = new PrefsAutostartLV2UI(x, y,pwindow); add_subwindow(autostart_lv2ui); - y += autostart_lv2ui->get_h() + 10; + y += autostart_lv2ui->get_h() + ys10; if( y2 > y ) y = y2; x = x0; - add_subwindow(new BC_Bar(5, y, get_w() - 10)); - y += 5; + add_subwindow(new BC_Bar(xs5, y, get_w() - xs10)); + y += ys5; add_subwindow(new BC_Title(x, y, _("Index files:"), LARGEFONT, resources->text_default)); - y += 30; + y += ys30; - add_subwindow(new BC_Title(x, y + 5, + add_subwindow(new BC_Title(x, y + ys5, _("Index files go here:"), MEDIUMFONT, resources->text_default)); - x1 = x + 230; + x1 = x + xS(230); add_subwindow(ipathtext = new IndexPathText(x1, y, pwindow, pwindow->thread->preferences->index_directory)); x1 += ipathtext->get_w(); @@ -214,23 +216,23 @@ void InterfacePrefs::create_objects() pwindow->thread->preferences->index_directory, _("Index Path"), _("Select the directory for index files"), 1)); - y += 30; - add_subwindow(new BC_Title(x, y + 5, _("Size of index file in KB:"), + y += ys30; + add_subwindow(new BC_Title(x, y + ys5, _("Size of index file in KB:"), MEDIUMFONT, resources->text_default)); sprintf(string, "%jd", pwindow->thread->preferences->index_size/1024); - add_subwindow(isize = new IndexSize(x + 230, y, pwindow, string)); - add_subwindow(new ScanCommercials(pwindow, 400,y)); + add_subwindow(isize = new IndexSize(x + xS(230), y, pwindow, string)); + add_subwindow(new ScanCommercials(pwindow, xS(400),y)); - y += 30; - add_subwindow(new BC_Title(x, y + 5, _("Number of index files to keep:"), + y += ys30; + add_subwindow(new BC_Title(x, y + ys5, _("Number of index files to keep:"), MEDIUMFONT, resources->text_default)); sprintf(string, "%ld", (long)pwindow->thread->preferences->index_count); - add_subwindow(icount = new IndexCount(x + 230, y, pwindow, string)); - add_subwindow(del_indexes = new DeleteAllIndexes(mwindow, pwindow, 400, y, + add_subwindow(icount = new IndexCount(x + xS(230), y, pwindow, string)); + add_subwindow(del_indexes = new DeleteAllIndexes(mwindow, pwindow, xS(400), y, _("Delete existing indexes"), "[*.idx][*.toc][*.mkr]")); - y += 30; + y += ys30; add_subwindow(ffmpeg_marker_files = new IndexFFMPEGMarkerFiles(this, x, y)); - add_subwindow(del_clipngs = new DeleteAllIndexes(mwindow, pwindow, 400, y, + add_subwindow(del_clipngs = new DeleteAllIndexes(mwindow, pwindow, xS(400), y, _("Delete clip thumbnails"), "clip_*.png")); } @@ -248,7 +250,7 @@ const char* InterfacePrefs::behavior_to_text(int mode) } IndexPathText::IndexPathText(int x, int y, PreferencesWindow *pwindow, char *text) - : BC_TextBox(x, y, 240, 1, text) + : BC_TextBox(x, y, xS(240), 1, text) { this->pwindow = pwindow; } @@ -265,7 +267,7 @@ int IndexPathText::handle_event() IndexSize::IndexSize(int x, int y, PreferencesWindow *pwindow, char *text) - : BC_TextBox(x, y, 100, 1, text) + : BC_TextBox(x, y, xS(100), 1, text) { this->pwindow = pwindow; } @@ -321,7 +323,7 @@ int IndexFFMPEGMarkerFiles::handle_event() ViewBehaviourText::ViewBehaviourText(int x, int y, const char *text, PreferencesWindow *pwindow, int *output) - : BC_PopupMenu(x, y, 250, text) + : BC_PopupMenu(x, y, xS(250), text) { this->output = output; } @@ -364,7 +366,7 @@ int ViewBehaviourItem::handle_event() MeterMinDB::MeterMinDB(PreferencesWindow *pwindow, char *text, int x, int y) - : BC_TextBox(x, y, 50, 1, text) + : BC_TextBox(x, y, xS(50), 1, text) { this->pwindow = pwindow; } @@ -378,7 +380,7 @@ int MeterMinDB::handle_event() MeterMaxDB::MeterMaxDB(PreferencesWindow *pwindow, char *text, int x, int y) - : BC_TextBox(x, y, 50, 1, text) + : BC_TextBox(x, y, xS(50), 1, text) { this->pwindow = pwindow; } @@ -420,7 +422,7 @@ int AndroidRemote::handle_event() } AndroidPIN::AndroidPIN(PreferencesWindow *pwindow, int x, int y) - : BC_TextBox(x, y, 240, 1, pwindow->thread->preferences->android_pin) + : BC_TextBox(x, y, xS(240), 1, pwindow->thread->preferences->android_pin) { this->pwindow = pwindow; } @@ -435,7 +437,7 @@ int AndroidPIN::handle_event() AndroidPort::AndroidPort(PreferencesWindow *pwindow, int x, int y) - : BC_TextBox(x, y, 72, 1, pwindow->thread->preferences->android_port) + : BC_TextBox(x, y, xS(72), 1, pwindow->thread->preferences->android_port) { this->pwindow = pwindow; } @@ -486,7 +488,7 @@ int StillImageUseDuration::handle_event() } StillImageDuration::StillImageDuration(PreferencesWindow *pwindow, int x, int y) - : BC_TextBox(x, y, 70, 1, pwindow->thread->edl->session->si_duration) + : BC_TextBox(x, y, xS(70), 1, pwindow->thread->edl->session->si_duration) { this->pwindow = pwindow; } @@ -519,7 +521,7 @@ int HairlineItem::handle_event() KeyframeReticle::KeyframeReticle(PreferencesWindow *pwindow, InterfacePrefs *iface_prefs, int x, int y, int *output) - : BC_PopupMenu(x, y, 220, hairline_to_string(*output)) + : BC_PopupMenu(x, y, xS(220), hairline_to_string(*output)) { this->pwindow = pwindow; this->iface_prefs = iface_prefs; diff --git a/cinelerra-5.1/cinelerra/keyframegui.C b/cinelerra-5.1/cinelerra/keyframegui.C index 03c8804b..744106b9 100644 --- a/cinelerra-5.1/cinelerra/keyframegui.C +++ b/cinelerra-5.1/cinelerra/keyframegui.C @@ -457,7 +457,7 @@ KeyFrameWindow::KeyFrameWindow(MWindow *mwindow, KeyFrameThread *thread, : BC_Window(title_string, x, y, mwindow->session->keyframedialog_w, mwindow->session->keyframedialog_h, - 320, 240, 1, 0, 1) + xS(320), yS(240), 1, 0, 1) { this->mwindow = mwindow; this->thread = thread; diff --git a/cinelerra-5.1/cinelerra/labeledit.C b/cinelerra-5.1/cinelerra/labeledit.C index 22681918..9a728a0e 100644 --- a/cinelerra-5.1/cinelerra/labeledit.C +++ b/cinelerra-5.1/cinelerra/labeledit.C @@ -74,10 +74,13 @@ BC_Window *LabelEdit::new_gui() return label_edit_window; } +#define LEW_W xS(400) +#define LEW_H yS(350) + LabelEditWindow::LabelEditWindow(MWindow *mwindow, LabelEdit *thread) : BC_Window(_(PROGRAM_NAME ": Label Info"), - thread->x - 400/2, thread->y - 350/2, - 400, 350, 400, 430, 0, 0, 1) + thread->x - LEW_W/2, thread->y - LEW_H/2, + LEW_W, LEW_H, xS(400), yS(430), 0, 0, 1) { this->mwindow = mwindow; this->thread = thread; @@ -92,14 +95,14 @@ void LabelEditWindow::create_objects() lock_window("LabelEditWindow::create_objects"); this->label = thread->label; - int x = 10, y = 10; + int x = xS(10), y = yS(10); int x1 = x; BC_Title *title; add_subwindow(title = new BC_Title(x1, y, _("Label Text:"))); y += title->get_h() + 5; add_subwindow(textbox = new LabelEditComments(this, x1, y, get_w() - x1 * 2, - BC_TextBox::pixels_to_rows(this, MEDIUMFONT, get_h() - 10 - 40 - y))); + BC_TextBox::pixels_to_rows(this, MEDIUMFONT, get_h() - y - yS(10 + 40)))); add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); diff --git a/cinelerra-5.1/cinelerra/levelwindowgui.C b/cinelerra-5.1/cinelerra/levelwindowgui.C index 22a0c173..b35409be 100644 --- a/cinelerra-5.1/cinelerra/levelwindowgui.C +++ b/cinelerra-5.1/cinelerra/levelwindowgui.C @@ -35,15 +35,9 @@ LevelWindowGUI::LevelWindowGUI(MWindow *mwindow, LevelWindow *thread) : BC_Window(_(PROGRAM_NAME ": Levels"), - mwindow->session->lwindow_x, - mwindow->session->lwindow_y, - mwindow->session->lwindow_w, - mwindow->session->lwindow_h, - 10, - 10, - 1, - 0, - 1) + mwindow->session->lwindow_x, mwindow->session->lwindow_y, + mwindow->session->lwindow_w, mwindow->session->lwindow_h, + xS(10), yS(10), 1, 0, 1) { this->thread = thread; this->mwindow = mwindow; diff --git a/cinelerra-5.1/cinelerra/maincursor.C b/cinelerra-5.1/cinelerra/maincursor.C index 4c3c5590..daf4eec1 100644 --- a/cinelerra-5.1/cinelerra/maincursor.C +++ b/cinelerra-5.1/cinelerra/maincursor.C @@ -126,9 +126,10 @@ void MainCursor::draw(int do_plugintoggles) mwindow->edl->session->sample_rate / zoom_sample - view_start)); - if(pixel1 < -10) pixel1 = -10; - if(pixel2 > pane->canvas->get_w() + 10) - pixel2 = pane->canvas->get_w() + 10; + int xs10 = xS(10); + if(pixel1 < -xs10) pixel1 = -xs10; + if(pixel2 > pane->canvas->get_w() + xs10) + pixel2 = pane->canvas->get_w() + xs10; if(pixel2 < pixel1) pixel2 = pixel1; //printf("MainCursor::draw 2\n"); } diff --git a/cinelerra-5.1/cinelerra/mainerror.C b/cinelerra-5.1/cinelerra/mainerror.C index c82d23a3..e206a22d 100644 --- a/cinelerra-5.1/cinelerra/mainerror.C +++ b/cinelerra-5.1/cinelerra/mainerror.C @@ -41,18 +41,8 @@ MainError* MainError::main_error = 0; MainErrorGUI::MainErrorGUI(MWindow *mwindow, MainError *thread, int x, int y) : BC_Window(_(PROGRAM_NAME ": Messages"), - x, - y, - mwindow->session->ewindow_w, - mwindow->session->ewindow_h, - 50, - 50, - 1, - 0, - 1, - -1, - "", - 1) + x, y, mwindow->session->ewindow_w, mwindow->session->ewindow_h, + xS(50), yS(50), 1, 0, 1, -1, "", 1) { this->mwindow = mwindow; this->thread = thread; @@ -67,11 +57,11 @@ void MainErrorGUI::create_objects() lock_window("MainErrorGUI::create_objects"); BC_Button *button; add_subwindow(button = new BC_OKButton(this)); - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(title = new BC_Title(x, y, _("Message log:"))); - y += title->get_h() + 5; + y += title->get_h() + yS(5); add_subwindow(list = new BC_ListBox(x, y, - get_w() - 20, button->get_y() - y - 5, + get_w() - xS(20), button->get_y() - y - yS(5), LISTBOX_TEXT, // Display text list or icons &thread->errors, // Each column has an ArrayList of BC_ListBoxItems. 0, // Titles for columns. Set to 0 for no titles @@ -105,10 +95,6 @@ int MainErrorGUI::resize_event(int w, int h) } - - - - MainError::MainError(MWindow *mwindow) : BC_DialogThread() { @@ -197,9 +183,3 @@ void MainError::show_error(const char *string) printf("%s%s", string, len>0 && string[len-1] == '\n' ? "" : "\n"); } - - - - - - diff --git a/cinelerra-5.1/cinelerra/mainmenu.C b/cinelerra-5.1/cinelerra/mainmenu.C index f33a5c74..7b9b3707 100644 --- a/cinelerra-5.1/cinelerra/mainmenu.C +++ b/cinelerra-5.1/cinelerra/mainmenu.C @@ -1857,7 +1857,7 @@ int LoadLayoutNameText::handle_event() } LoadLayoutConfirm::LoadLayoutConfirm(LoadLayoutDialog *layout_dialog, int x, int y) - : BC_Window(_(PROGRAM_NAME ": Layout"), x, y, 300,140, 300,140, 0) + : BC_Window(_(PROGRAM_NAME ": Layout"), x, y, xS(300),yS(140), xS(300),yS(140), 0) { this->layout_dialog = layout_dialog; } @@ -1868,20 +1868,22 @@ LoadLayoutConfirm::~LoadLayoutConfirm() void LoadLayoutConfirm::create_objects() { + int xs10 = xS(10), xs20 = xS(20); + int ys10 = yS(10); lock_window("LoadLayoutConfirm::create_objects"); - int x = 10, y = 10, pad = 10; + int x = xs10, y = ys10; BC_SubMenu *layout_submenu = layout_dialog->load_layout->get_submenu(); LoadLayoutItem *item = (LoadLayoutItem *) layout_submenu->get_item(layout_dialog->idx); BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Layout Name:"))); - int x1 = x + title->get_w() + 10; + int x1 = x + title->get_w() + xs10; add_subwindow(title = new BC_Title(x1, y, item->get_text())); - y += title->get_h() + pad; + y += title->get_h() + ys10; add_subwindow(name_text = new LoadLayoutNameText(this, - x, y, get_w()-x-20, item->layout_text)); + x, y, get_w()-x-xs20, item->layout_text)); y += name_text->get_h(); - x1 = x + 80; + x1 = x + xS(80); char legend[BCTEXTLEN]; sprintf(legend, _("a-z,A-Z,0-9_ only, %dch max"), LAYOUT_NAME_LEN); add_subwindow(title = new BC_Title(x1, y, legend)); diff --git a/cinelerra-5.1/cinelerra/mainsession.C b/cinelerra-5.1/cinelerra/mainsession.C index e40f343e..16a20fe8 100644 --- a/cinelerra-5.1/cinelerra/mainsession.C +++ b/cinelerra-5.1/cinelerra/mainsession.C @@ -275,10 +275,10 @@ void MainSession::default_window_positions(int window_config) BC_DisplayInfo b_display_info(b_x11_host); b_root_w = b_display_info.get_root_w(); b_root_h = b_display_info.get_root_h(); - cwindow_x = 50; - cwindow_y = 50; - cwindow_w = b_root_w-100; - cwindow_h = b_root_h-100; + cwindow_x = xS(50); + cwindow_y = yS(50); + cwindow_w = b_root_w-xS(100); + cwindow_h = b_root_h-yS(100); } ctool_x = cwindow_x + cwindow_w / 2; @@ -294,11 +294,11 @@ void MainSession::default_window_positions(int window_config) awindow_w = root_x + root_w - awindow_x - border_left - border_right; awindow_h = mwindow_h; - bwindow_w = 600; - bwindow_h = 360; + bwindow_w = xS(600); + bwindow_h = yS(360); - ewindow_w = 640; - ewindow_h = 240; + ewindow_w = xS(640); + ewindow_h = yS(240); channels_x = 0; channels_y = 0; @@ -306,12 +306,12 @@ void MainSession::default_window_positions(int window_config) picture_y = 0; scope_x = 0; scope_y = 0; - scope_w = 640; - scope_h = 320; + scope_w = xS(640); + scope_h = yS(320); histogram_x = 0; histogram_y = 0; - histogram_w = 320; - histogram_h = 480; + histogram_w = xS(320); + histogram_h = yS(480); record_scope = 0; use_hist = 1; use_wave = 1; @@ -324,7 +324,7 @@ void MainSession::default_window_positions(int window_config) mwindow->edl->session->audio_channels, 1); else - lwindow_w = 100; + lwindow_w = xS(100); lwindow_y = 0; lwindow_x = root_w - lwindow_w; @@ -332,36 +332,36 @@ void MainSession::default_window_positions(int window_config) rwindow_x = root_x; rwindow_y = root_y; - rwindow_h = 500; - rwindow_w = 650; + rwindow_h = yS(500); + rwindow_w = xS(650); cswindow_x = root_x; cswindow_y = root_y; - cswindow_w = 1280; - cswindow_h = 600; + cswindow_w = xS(1280); + cswindow_h = yS(600); if( !dual_head || window_config != 2 ) { - rmonitor_x = rwindow_x + rwindow_w + 10; + rmonitor_x = rwindow_x + rwindow_w + xS(10); rmonitor_y = rwindow_y; rmonitor_w = root_x + root_w - rmonitor_x; rmonitor_h = rwindow_h; } else { - rmonitor_x = cswindow_x = 50; - rmonitor_y = cswindow_y = 50; - rmonitor_w = b_root_w-100; - rmonitor_h = b_root_h-100; + rmonitor_x = cswindow_x = xS(50); + rmonitor_y = cswindow_y = yS(50); + rmonitor_w = b_root_w-xS(100); + rmonitor_h = b_root_h-yS(100); if( cswindow_w < rmonitor_w ) cswindow_w = rmonitor_w; if( cswindow_h < rmonitor_h ) cswindow_h = rmonitor_h; } swindow_x = root_x; swindow_y = root_y; - swindow_w = 600; - swindow_h = 400; + swindow_w = xS(600); + swindow_h = yS(400); - batchrender_w = 750; - batchrender_h = 400; + batchrender_w = xS(750); + batchrender_h = yS(400); batchrender_x = root_w / 2 - batchrender_w / 2; batchrender_y = root_h / 2 - batchrender_h / 2; } diff --git a/cinelerra-5.1/cinelerra/manualgoto.C b/cinelerra-5.1/cinelerra/manualgoto.C index 8aa5cabd..eeb1a12e 100644 --- a/cinelerra-5.1/cinelerra/manualgoto.C +++ b/cinelerra-5.1/cinelerra/manualgoto.C @@ -27,6 +27,9 @@ #include "mwindowgui.h" #include "keys.h" +#define MGT_W xS(250) +#define MGT_H yS(80) + ManualGoto::ManualGoto(MWindow *mwindow, EditPanel *panel) : BC_DialogThread() { @@ -43,8 +46,8 @@ ManualGoto::~ManualGoto() BC_Window *ManualGoto::new_gui() { BC_DisplayInfo dpy_info; - int x = dpy_info.get_abs_cursor_x() - 250 / 2; - int y = dpy_info.get_abs_cursor_y() - 80 / 2; + int x = dpy_info.get_abs_cursor_x() - MGT_W / 2; + int y = dpy_info.get_abs_cursor_y() - MGT_H / 2; gotowindow = new ManualGotoWindow(this, x, y); gotowindow->create_objects(); double position = panel->get_position(); @@ -72,7 +75,7 @@ void ManualGoto::handle_done_event(int result) ManualGotoWindow::ManualGotoWindow(ManualGoto *mango, int x, int y) : BC_Window(_(PROGRAM_NAME ": Goto position"), x, y, - 250, 80, 250, 80, 0, 0, 1) + MGT_W, MGT_H, MGT_W, MGT_H, 0, 0, 1) { this->mango = mango; } @@ -118,22 +121,22 @@ void ManualGotoWindow::update_position(double position) void ManualGotoWindow::create_objects() { lock_window("ManualGotoWindow::create_objects"); - int x = 76, y = 5; + int x = xS(76), y = yS(5); BC_Title *title = new BC_Title(x - 2, y, _("hour min sec msec"), SMALLFONT); add_subwindow(title); y += title->get_h() + 3; - signtitle = new BC_Title(x - 17, y, "=", LARGEFONT); + signtitle = new BC_Title(x - xS(17), y, "=", LARGEFONT); add_subwindow(signtitle); - hours = new ManualGotoNumber(this, x, y, 16, 9, "%i"); + hours = new ManualGotoNumber(this, x, y, xS(16), 9, "%i"); add_subwindow(hours); x += hours->get_w() + 4; - minutes = new ManualGotoNumber(this, x, y, 26, 59, "%02i"); + minutes = new ManualGotoNumber(this, x, y, xS(26), 59, "%02i"); add_subwindow(minutes); x += minutes->get_w() + 4; - seconds = new ManualGotoNumber(this, x, y, 26, 59, "%02i"); + seconds = new ManualGotoNumber(this, x, y, xS(26), 59, "%02i"); add_subwindow(seconds); x += seconds->get_w() + 4; - msecs = new ManualGotoNumber(this, x, y, 34, 999, "%03i"); + msecs = new ManualGotoNumber(this, x, y, xS(34), 999, "%03i"); add_subwindow(msecs); - y += hours->get_h() + 10; + y += hours->get_h() + yS(10); add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); diff --git a/cinelerra-5.1/cinelerra/menuattachtransition.C b/cinelerra-5.1/cinelerra/menuattachtransition.C index 13307fb9..efd0a823 100644 --- a/cinelerra-5.1/cinelerra/menuattachtransition.C +++ b/cinelerra-5.1/cinelerra/menuattachtransition.C @@ -123,7 +123,7 @@ TransitionDialog::TransitionDialog(MWindow *mwindow, : BC_Window(_("Attach Transition"), x, y, mwindow->session->transitiondialog_w, mwindow->session->transitiondialog_h, - 320, 240, 1, 0, 1) + xS(320), yS(240), 1, 0, 1) { this->mwindow = mwindow; this->thread = thread; @@ -170,21 +170,21 @@ TransitionDefaultText::~TransitionDefaultText() void TransitionDialog::create_objects() { - int x = 10; - int y = 10; + int x = xS(10); + int y = yS(10); lock_window("TransitionDialog::create_objects"); add_subwindow(name_title = new BC_Title(x, y, _("Select transition from list"))); - y += name_title->get_h() + 5; + y += name_title->get_h() + yS(5); add_subwindow(name_list = new TransitionDialogName(thread, &thread->transition_names, x, y, get_w() - x - x, - get_h() - y - BC_OKButton::calculate_h() - 100)); - y += name_list->get_h() + 20; + get_h() - y - BC_OKButton::calculate_h() - yS(100))); + y += name_list->get_h() + yS(20); add_subwindow(set_default = new TransitionSetDefault(this, x, y)); - y += set_default->get_h() + 10; + y += set_default->get_h() + yS(10); const char *default_transition = ""; EDL *edl = mwindow->edl; switch( thread->data_type ) { @@ -196,7 +196,7 @@ void TransitionDialog::create_objects() break; } add_subwindow(set_default_text = new TransitionDefaultText(this, x, y, - get_w()-x-20, default_transition)); + get_w()-x-xS(20), default_transition)); if( thread->number >= 0 ) { name_list->update_selection(&thread->transition_names, thread->number, 0); name_list->draw_items(0); @@ -210,22 +210,21 @@ void TransitionDialog::create_objects() int TransitionDialog::resize_event(int w, int h) { - int x = 10; - int y = 10; + int x = xS(10); + int y = yS(10); name_title->reposition_window(x, y); - y += name_title->get_h() + 5; + y += name_title->get_h() + yS(5); name_list->reposition_window(x, y, - w - x - x, h - y - BC_OKButton::calculate_h() - 100); - y += name_list->get_h() + 20; + w - x - x, h - y - BC_OKButton::calculate_h() - yS(100)); + y += name_list->get_h() + yS(20); set_default->reposition_window(x, y); - y += set_default->get_h() + 10; - set_default_text->reposition_window(x, y, get_w()-x-20); + y += set_default->get_h() + yS(10); + set_default_text->reposition_window(x, y, get_w()-x-xS(20)); return 1; } - TransitionDialogName::TransitionDialogName(TransitionDialogThread *thread, ArrayList *standalone_data, int x, int y, int w, int h) : BC_ListBox(x, @@ -252,6 +251,3 @@ int TransitionDialogName::selection_changed() return 1; } - - - diff --git a/cinelerra-5.1/cinelerra/menueffects.C b/cinelerra-5.1/cinelerra/menueffects.C index d8dfdfab..1dcbe8a7 100644 --- a/cinelerra-5.1/cinelerra/menueffects.C +++ b/cinelerra-5.1/cinelerra/menueffects.C @@ -566,15 +566,11 @@ MenuEffectWindow::MenuEffectWindow(MWindow *mwindow, ArrayList *plugin_list, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Render effect"), - mwindow->gui->get_abs_cursor_x(1), + mwindow->gui->get_abs_cursor_x(1), mwindow->gui->get_abs_cursor_y(1) - mwindow->session->menueffect_h / 2, mwindow->session->menueffect_w, mwindow->session->menueffect_h, - 580, - 350, - 1, - 0, - 1) + xS(580), yS(350), 1, 0, 1) { this->menueffects = menueffects; this->plugin_list = plugin_list; @@ -607,11 +603,12 @@ void MenuEffectWindow::create_objects() add_subwindow(list_title = new BC_Title(mwindow->theme->menueffect_list_x, mwindow->theme->menueffect_list_y, _("Select an effect"))); + int ys5 = yS(5); add_subwindow(list = new MenuEffectWindowList(this, mwindow->theme->menueffect_list_x, - mwindow->theme->menueffect_list_y + list_title->get_h() + 5, + mwindow->theme->menueffect_list_y + list_title->get_h() + ys5, mwindow->theme->menueffect_list_w, - mwindow->theme->menueffect_list_h - list_title->get_h() - 5, + mwindow->theme->menueffect_list_h - list_title->get_h() - ys5, plugin_list)); } @@ -649,10 +646,11 @@ int MenuEffectWindow::resize_event(int w, int h) { list_title->reposition_window(mwindow->theme->menueffect_list_x, mwindow->theme->menueffect_list_y); + int ys5 = yS(5); list->reposition_window(mwindow->theme->menueffect_list_x, - mwindow->theme->menueffect_list_y + list_title->get_h() + 5, + mwindow->theme->menueffect_list_y + list_title->get_h() + ys5, mwindow->theme->menueffect_list_w, - mwindow->theme->menueffect_list_h - list_title->get_h() - 5); + mwindow->theme->menueffect_list_h - list_title->get_h() - ys5); } if(file_title) file_title->reposition_window(mwindow->theme->menueffect_file_x, @@ -719,12 +717,7 @@ MenuEffectWindowList::MenuEffectWindowList(MenuEffectWindow *window, int w, int h, ArrayList *plugin_list) - : BC_ListBox(x, - y, - w, - h, - LISTBOX_TEXT, - plugin_list) + : BC_ListBox(x, y, w, h, LISTBOX_TEXT, plugin_list) { this->window = window; } @@ -737,12 +730,14 @@ int MenuEffectWindowList::handle_event() } #define PROMPT_TEXT _("Set up effect panel and hit \"OK\"") +#define MEP_W xS(260) +#define MEP_H yS(100) MenuEffectPrompt::MenuEffectPrompt(MWindow *mwindow) : BC_Window(_(PROGRAM_NAME ": Effect Prompt"), - mwindow->gui->get_abs_cursor_x(1) - 260 / 2, - mwindow->gui->get_abs_cursor_y(1) - 300, - MenuEffectPrompt::calculate_w(mwindow->gui), + mwindow->gui->get_abs_cursor_x(1) - MEP_W/2, + mwindow->gui->get_abs_cursor_y(1) - MEP_H/2, + MenuEffectPrompt::calculate_w(mwindow->gui), MenuEffectPrompt::calculate_h(mwindow->gui), MenuEffectPrompt::calculate_w(mwindow->gui), MenuEffectPrompt::calculate_h(mwindow->gui), @@ -752,15 +747,15 @@ MenuEffectPrompt::MenuEffectPrompt(MWindow *mwindow) int MenuEffectPrompt::calculate_w(BC_WindowBase *gui) { - int w = BC_Title::calculate_w(gui, PROMPT_TEXT) + 10; - w = MAX(w, BC_OKButton::calculate_w() + BC_CancelButton::calculate_w() + 30); + int w = BC_Title::calculate_w(gui, PROMPT_TEXT) + xS(10); + w = MAX(w, BC_OKButton::calculate_w() + BC_CancelButton::calculate_w() + xS(30)); return w; } int MenuEffectPrompt::calculate_h(BC_WindowBase *gui) { int h = BC_Title::calculate_h(gui, PROMPT_TEXT); - h += BC_OKButton::calculate_h() + 30; + h += BC_OKButton::calculate_h() + yS(30); return h; } @@ -768,7 +763,7 @@ int MenuEffectPrompt::calculate_h(BC_WindowBase *gui) void MenuEffectPrompt::create_objects() { lock_window("MenuEffectPrompt::create_objects"); - int x = 10, y = 10; + int x = xS(10), y = yS(10); BC_Title *title; add_subwindow(title = new BC_Title(x, y, PROMPT_TEXT)); add_subwindow(new BC_OKButton(this)); diff --git a/cinelerra-5.1/cinelerra/mixersalign.C b/cinelerra-5.1/cinelerra/mixersalign.C index 8092b14a..b5fe9227 100644 --- a/cinelerra-5.1/cinelerra/mixersalign.C +++ b/cinelerra-5.1/cinelerra/mixersalign.C @@ -85,7 +85,7 @@ MixersAlignMixerList::MixersAlignMixerList(MixersAlignWindow *gui, this->dialog = dialog; this->gui = gui; for( int i=MIX_SZ; --i>=0; ) { - col_widths[i] = mix_widths[i]; + col_widths[i] = xS(mix_widths[i]); col_titles[i] = _(mix_titles[i]); } } @@ -200,7 +200,7 @@ MixersAlignMTrackList::MixersAlignMTrackList(MixersAlignWindow *gui, this->dialog = dialog; this->gui = gui; for( int i=MTK_SZ; --i>=0; ) { - col_widths[i] = mtk_widths[i]; + col_widths[i] = xS(mtk_widths[i]); col_titles[i] = _(mtk_titles[i]); } } @@ -273,7 +273,7 @@ MixersAlignATrackList::MixersAlignATrackList(MixersAlignWindow *gui, this->dialog = dialog; this->gui = gui; for( int i=ATK_SZ; --i>=0; ) { - col_widths[i] = atk_widths[i]; + col_widths[i] = xS(atk_widths[i]); col_titles[i] = _(atk_titles[i]); } } @@ -479,7 +479,7 @@ int MixersAlignUndoItem::handle_event() MixersAlignUndo::MixersAlignUndo(MixersAlignWindow *gui, MixersAlign *dialog, int x, int y) - : BC_PopupMenu(x, y, 100, _("Undo")) + : BC_PopupMenu(x, y, xS(100), _("Undo")) { this->gui = gui; this->dialog = dialog; @@ -505,7 +505,7 @@ void MixersAlignUndo::add_undo_item(int no) MixersAlignCheckPoint::MixersAlignCheckPoint(MixersAlignWindow *gui, MixersAlign *dialog, int x, int y) - : BC_GenericButton(x, y, 100, _("CheckPoint")) + : BC_GenericButton(x, y, xS(100), _("CheckPoint")) { this->gui = gui; this->dialog = dialog; @@ -518,7 +518,7 @@ int MixersAlignCheckPoint::handle_event() } MixersAlignWindow::MixersAlignWindow(MixersAlign *dialog, int x, int y) - : BC_Window(_("Align Mixers"), x, y, 880, 380, 880, 380, 1) + : BC_Window(_("Align Mixers"), x, y, xS(880), yS(380), xS(880), yS(380), 1) { this->dialog = dialog; } @@ -528,7 +528,9 @@ MixersAlignWindow::~MixersAlignWindow() void MixersAlignWindow::create_objects() { - int x = 10, y = 10, w4 = (get_w()-x-10)/4, lw = w4 + 20; + int xs10 = xS(10), xs20 = xS(20); + int ys10 = yS(10), ys20 = yS(20); + int x = xs10, y = ys10, w4 = (get_w()-x-xs10)/4, lw = w4 + xs20; int x1 = x, x2 = x1 + lw , x3 = x2 + lw, x4 = get_w()-x; mixer_title = new BC_Title(x1,y, _("Mixers:"), MEDIUMFONT, YELLOW); add_subwindow(mixer_title); @@ -536,25 +538,25 @@ void MixersAlignWindow::create_objects() add_subwindow(mtrack_title); atrack_title = new BC_Title(x3,y, _("Audio Tracks:"), MEDIUMFONT, YELLOW); add_subwindow(atrack_title); - y += mixer_title->get_h() + 10; - int y1 = y, y2 = get_h() - BC_OKButton::calculate_h() - 32; + y += mixer_title->get_h() + ys10; + int y1 = y, y2 = get_h() - BC_OKButton::calculate_h() - yS(32); int lh = y2 - y1; - mixer_list = new MixersAlignMixerList(this, dialog, x1, y, x2-x1-20, lh); + mixer_list = new MixersAlignMixerList(this, dialog, x1, y, x2-x1-xs20, lh); add_subwindow(mixer_list); - mtrack_list = new MixersAlignMTrackList(this, dialog, x2, y, x3-x2-20, lh); + mtrack_list = new MixersAlignMTrackList(this, dialog, x2, y, x3-x2-xs20, lh); add_subwindow(mtrack_list); - atrack_list = new MixersAlignATrackList(this, dialog, x3, y, x4-x3-20, lh); + atrack_list = new MixersAlignATrackList(this, dialog, x3, y, x4-x3-xs20, lh); add_subwindow(atrack_list); - int xr = x2-10 - MixersAlignReset::calculate_width(this); - y1 = y2+20; + int xr = x2-xs10 - MixersAlignReset::calculate_width(this); + y1 = y2+ys20; add_subwindow(reset = new MixersAlignReset(this, dialog, xr, y1)); - add_subwindow(match = new MixersAlignMatch(this, dialog, x2+10, y1)); - int xa = x3-10 - MixersAlignNudgeTracks::calculate_width(this); + add_subwindow(match = new MixersAlignMatch(this, dialog, x2+xs10, y1)); + int xa = x3-xs10 - MixersAlignNudgeTracks::calculate_width(this); add_subwindow(nudge_tracks = new MixersAlignNudgeTracks(this, dialog, xa, y1)); - y2 = y1 + nudge_tracks->get_h() + 10; + y2 = y1 + nudge_tracks->get_h() + ys10; add_subwindow(match_all = new MixersAlignMatchAll(this, dialog, xr, y2)); add_subwindow(nudge_selected = new MixersAlignNudgeSelected(this, dialog, xa, y2)); - int xu = x3+10; + int xu = x3+xs10; add_subwindow(check_point = new MixersAlignCheckPoint(this, dialog, xu, y1)); add_subwindow(undo = new MixersAlignUndo(this, dialog, xu, y2)); undo->create_objects(); @@ -565,27 +567,29 @@ void MixersAlignWindow::create_objects() int MixersAlignWindow::resize_event(int w, int h) { - int x = 10, y = 10, w4 = (w-x-10)/4, lw = w4 + 20; + int xs10 = xS(10), xs20 = xS(20); + int ys10 = yS(10), ys20 = yS(20); + int x = xs10, y = ys10, w4 = (w-x-xs10)/4, lw = w4 + xs20; int x1 = x, x2 = x1 + lw , x3 = x2 + lw, x4 = w-x; mixer_title->reposition_window(x1, y); mtrack_title->reposition_window(x2, y); atrack_title->reposition_window(x3, y); - y += mixer_title->get_h() + 10; - int y1 = y, y2 = h - BC_OKButton::calculate_h() - 32; + y += mixer_title->get_h() + ys10; + int y1 = y, y2 = h - BC_OKButton::calculate_h() - yS(32); int lh = y2 - y1; - mixer_list->reposition_window(x1, y, x2-x1-20, lh); - mtrack_list->reposition_window(x2, y, x3-x2-20, lh); - atrack_list->reposition_window(x3, y, x4-x3-20, lh); - int xr = x2-10 - MixersAlignReset::calculate_width(this); - y1 = y2+20; + mixer_list->reposition_window(x1, y, x2-x1-xs20, lh); + mtrack_list->reposition_window(x2, y, x3-x2-xs20, lh); + atrack_list->reposition_window(x3, y, x4-x3-xs20, lh); + int xr = x2-xs10 - MixersAlignReset::calculate_width(this); + y1 = y2+ys20; reset->reposition_window(xr, y1); - match->reposition_window(x2+10, y1); - int xa = x3-10 - MixersAlignNudgeTracks::calculate_width(this); + match->reposition_window(x2+xs10, y1); + int xa = x3-xs10 - MixersAlignNudgeTracks::calculate_width(this); nudge_tracks->reposition_window(xa, y1); - y2 = y1 + nudge_tracks->get_h() + 10; + y2 = y1 + nudge_tracks->get_h() + ys10; match_all->reposition_window(xr, y2); nudge_selected->reposition_window(xa, y2); - int xu = x3+10; + int xu = x3+xs10; check_point->reposition_window(xu, y1); undo->reposition_window(xu, y2); return 0; diff --git a/cinelerra-5.1/cinelerra/mtimebar.C b/cinelerra-5.1/cinelerra/mtimebar.C index bf00a1b7..7eec4d34 100644 --- a/cinelerra-5.1/cinelerra/mtimebar.C +++ b/cinelerra-5.1/cinelerra/mtimebar.C @@ -101,10 +101,11 @@ void MTimeBar::stop_transport() gui->stop_transport("MTimeBar::stop_transport"); } -#define TEXT_MARGIN 4 -#define TICK_SPACING 5 -#define LINE_MARGIN 3 -#define TICK_MARGIN 16 +#define TEXT_MARGIN xS(4) +#define TICK_SPACING xS(5) +#define LINE_MARGIN yS(3) +#define TICK_MARGIN yS(16) + void MTimeBar::draw_time() { @@ -399,7 +400,7 @@ void MTimeBar::draw_time() set_font(MEDIUMFONT); draw_text(pixel + TEXT_MARGIN, get_text_ascent(MEDIUMFONT), string); - draw_line(pixel, LINE_MARGIN, pixel, get_h() - 2); + draw_line(pixel, LINE_MARGIN, pixel, get_h() - yS(2)); double position2 = start_position + text_interval * (iteration + 1); int pixel2 = (int64_t)(position2 / time_per_pixel) - @@ -413,7 +414,7 @@ void MTimeBar::draw_time() mwindow->edl->local_session->view_start[pane->number]; if(labs(pixel - pixel1) > 1 && labs(pixel - pixel2) > 1) - draw_line(pixel, TICK_MARGIN, pixel, get_h() - 2); + draw_line(pixel, TICK_MARGIN, pixel, get_h() - yS(2)); } iteration++; } diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index a99d3098..b074950f 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -1453,7 +1453,7 @@ void MWindow::tile_mixers() int bw = lt + BC_DisplayInfo::get_right_border(); // borders int bh = top + BC_DisplayInfo::get_bottom_border(); int zx = 0, zy = 0; // window origins - int mw = 10+10, mh = 10+10; // canvas margins + int mw = xS(10+10), mh = yS(10+10); // canvas margins int rsz = 0, n = 0, dz = 0; int ow = edl->session->output_w, oh = edl->session->output_h; for( int i=0; i mx ) xx = mx; if( yy > my ) yy = my; - xx += lt + dz; yy += top + dz; + xx += lt + xS(dz); yy += top + yS(dz); zwindow->reposition(xx,yy, ww,hh); if( zwindow->running() ) { ZWindowGUI *gui = (ZWindowGUI *)zwindow->get_gui(); diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index 5716c37e..477d256c 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -80,15 +80,9 @@ // the main window uses its own private colormap for video MWindowGUI::MWindowGUI(MWindow *mwindow) : BC_Window(_(PROGRAM_NAME ": Program"), - mwindow->session->mwindow_x, - mwindow->session->mwindow_y, - mwindow->session->mwindow_w, - mwindow->session->mwindow_h, - 100, - 100, - 1, - 1, - 1) + mwindow->session->mwindow_x, mwindow->session->mwindow_y, + mwindow->session->mwindow_w, mwindow->session->mwindow_h, + xS(100), yS(100), 1, 1, 1) { this->mwindow = mwindow; // samplescroll = 0; @@ -124,7 +118,7 @@ MWindowGUI::MWindowGUI(MWindow *mwindow) keyframe_menu = 0; keyframe_hide = 0; keyvalue_popup = 0; - transition_menu = 0; + transition_menu = 0; remote_control = 0; cwindow_remote_handler = 0; record_remote_handler = 0; @@ -281,9 +275,9 @@ void MWindowGUI::create_objects() add_subwindow(mbuttons = new MButtons(mwindow, this)); mbuttons->create_objects(); - int x1 = mbuttons->get_x() + mbuttons->get_w(), y1 = mbuttons->get_y()+2; + int x1 = mbuttons->get_x() + mbuttons->get_w(), y1 = mbuttons->get_y()+yS(2); add_subwindow(proxy_toggle = new ProxyToggle(mwindow, mbuttons, x1, y1)); - x1 += proxy_toggle->get_w() + 3; + x1 += proxy_toggle->get_w() + xS(3); add_subwindow(ffmpeg_toggle = new FFMpegToggle(mwindow, mbuttons, x1, y1)); pane[TOP_LEFT_PANE] = new TimelinePane(mwindow, @@ -417,9 +411,9 @@ int MWindowGUI::resize_event(int w, int h) mwindow->theme->get_mwindow_sizes(this, w, h); mwindow->theme->draw_mwindow_bg(this); mbuttons->resize_event(); - int x1 = mbuttons->get_x() + mbuttons->get_w(), y1 = mbuttons->get_y()+2; + int x1 = mbuttons->get_x() + mbuttons->get_w(), y1 = mbuttons->get_y()+yS(2); proxy_toggle->reposition_window(x1, y1); - x1 += proxy_toggle->get_w() + 3; + x1 += proxy_toggle->get_w() + xS(3); ffmpeg_toggle->reposition_window(x1, y1); statusbar->resize_event(); zoombar->resize_event(); @@ -1010,10 +1004,9 @@ int MWindowGUI::drag_motion() mwindow->session->current_operation == DRAG_EDIT || mwindow->session->current_operation == DRAG_GROUP || mwindow->session->current_operation == DRAG_AEFFECT_COPY || - mwindow->session->current_operation == DRAG_VEFFECT_COPY ) - { - redraw = 1; - } + mwindow->session->current_operation == DRAG_VEFFECT_COPY ) { + redraw = 1; + } // printf("drag_motion %d %d over_track=%p over_edit=%p\n", diff --git a/cinelerra-5.1/cinelerra/mwindowmove.C b/cinelerra-5.1/cinelerra/mwindowmove.C index 9d8dae5c..c76b9b74 100644 --- a/cinelerra-5.1/cinelerra/mwindowmove.C +++ b/cinelerra-5.1/cinelerra/mwindowmove.C @@ -537,8 +537,7 @@ int MWindow::move_left(int64_t distance) { TimelinePane *pane = gui->get_focused_pane(); if(!distance) - distance = pane->canvas->get_w() / - 10; + distance = pane->canvas->get_w() / 10; edl->local_session->view_start[pane->number] -= distance; samplemovement(edl->local_session->view_start[pane->number], pane->number); @@ -549,8 +548,7 @@ int MWindow::move_right(int64_t distance) { TimelinePane *pane = gui->get_focused_pane(); if(!distance) - distance = pane->canvas->get_w() / - 10; + distance = pane->canvas->get_w() / 10; edl->local_session->view_start[pane->number] += distance; samplemovement(edl->local_session->view_start[pane->number], pane->number); diff --git a/cinelerra-5.1/cinelerra/new.C b/cinelerra-5.1/cinelerra/new.C index de417e1d..f24876bc 100644 --- a/cinelerra-5.1/cinelerra/new.C +++ b/cinelerra-5.1/cinelerra/new.C @@ -54,13 +54,13 @@ #include -#define WIDTH 640 +#define WIDTH xS(640) // full height -#define HEIGHT0 585 +#define HEIGHT0 yS(585) // add tracks dialog -#define HEIGHT1 240 +#define HEIGHT1 yS(240) // offset for folder panel -#define HEIGHT2 440 +#define HEIGHT2 yS(440) New::New(MWindow *mwindow) { @@ -318,7 +318,11 @@ NewWindow::~NewWindow() void NewWindow::create_objects() { - int x = 10, y = 10, x1, y1; + int xs10 = xS(10), xs20 = xS(20); + int ys5 = yS(5), ys10 = yS(10), ys20 = yS(20), ys30 = yS(30); + int xs2 = xS(2), xs64 = xS(64), xs115 = xS(115), xs150 = xS(150); + int ys40 = yS(40); + int x = xs10, y = ys10, x1, y1; BC_TextBox *textbox; BC_Title *title; @@ -328,160 +332,152 @@ void NewWindow::create_objects() add_subwindow( new BC_Title(x, y, new_thread->load_mode == LOADMODE_REPLACE ? _("Parameters for the new project:") : _("Parameters for additional tracks:") ) ); - y += 20; + y += ys20; - format_presets = new NewPresets(mwindow, - this, - x, - y); + format_presets = new NewPresets(mwindow, this, x, y); format_presets->create_objects(); x = format_presets->x; y = format_presets->y; - y += 40; + y += ys40; y1 = y; add_subwindow(new BC_Title(x, y, _("Audio"), LARGEFONT)); - y += 30; + y += ys30; x1 = x; add_subwindow(new BC_Title(x1, y, _("Tracks:"))); - x1 += 100; + int xs100 = xS(100); + x1 += xs100; add_subwindow(atracks = new NewATracks(this, "", x1, y)); x1 += atracks->get_w(); add_subwindow(new NewATracksTumbler(this, x1, y)); - y += atracks->get_h() + 5; + y += atracks->get_h() + ys5; if( new_thread->load_mode == LOADMODE_REPLACE ) { x1 = x; add_subwindow(new BC_Title(x1, y, _("Channels:"))); - x1 += 100; + x1 += xs100; add_subwindow(achannels = new NewAChannels(this, "", x1, y)); x1 += achannels->get_w(); add_subwindow(new NewAChannelsTumbler(this, x1, y)); - y += achannels->get_h() + 5; + y += achannels->get_h() + ys5; x1 = x; add_subwindow(new BC_Title(x1, y, _("Samplerate:"))); - x1 += 100; + x1 += xs100; add_subwindow(sample_rate = new NewSampleRate(this, "", x1, y)); x1 += sample_rate->get_w(); add_subwindow(new SampleRatePulldown(mwindow, sample_rate, x1, y)); } - x += 250; + x += xS(250); y = y1; add_subwindow(new BC_Title(x, y, _("Video"), LARGEFONT)); - y += 30; + y += ys30; x1 = x; add_subwindow(new BC_Title(x1, y, _("Tracks:"))); - x1 += 115; + x1 += xs115; add_subwindow(vtracks = new NewVTracks(this, "", x1, y)); x1 += vtracks->get_w(); add_subwindow(new NewVTracksTumbler(this, x1, y)); - y += vtracks->get_h() + 5; + y += vtracks->get_h() + ys5; if( new_thread->load_mode == LOADMODE_REPLACE ) { // x1 = x; // add_subwindow(new BC_Title(x1, y, _("Channels:"))); -// x1 += 100; +// x1 += xs100; // add_subwindow(vchannels = new NewVChannels(this, "", x1, y)); // x1 += vchannels->get_w(); // add_subwindow(new NewVChannelsTumbler(this, x1, y)); -// y += vchannels->get_h() + 5; +// y += vchannels->get_h() + ys5; x1 = x; add_subwindow(new BC_Title(x1, y, _("Framerate:"))); - x1 += 115; + x1 += xs115; add_subwindow(frame_rate = new NewFrameRate(this, "", x1, y)); x1 += frame_rate->get_w(); add_subwindow(new FrameRatePulldown(mwindow, frame_rate, x1, y)); - y += frame_rate->get_h() + 5; + y += frame_rate->get_h() + ys5; } // x1 = x; // add_subwindow(new BC_Title(x1, y, _("Canvas size:"))); -// x1 += 100; +// x1 += xs100; // add_subwindow(canvas_w_text = new NewTrackW(this, x1, y)); -// x1 += canvas_w_text->get_w() + 2; +// x1 += canvas_w_text->get_w() + xs2; // add_subwindow(new BC_Title(x1, y, "x")); -// x1 += 10; +// x1 += xs10; // add_subwindow(canvas_h_text = new NewTrackH(this, x1, y)); // x1 += canvas_h_text->get_w(); // add_subwindow(new FrameSizePulldown(mwindow, -// canvas_w_text, -// canvas_h_text, -// x1, -// y)); -// x1 += 100; +// canvas_w_text, canvas_h_text, x1, y)); +// x1 += xs100; // add_subwindow(new NewCloneToggle(mwindow, this, x1, y)); -// y += canvas_h_text->get_h() + 5; +// y += canvas_h_text->get_h() + ys5; x1 = x; add_subwindow(new BC_Title(x1, y, new_thread->load_mode == LOADMODE_REPLACE ? _("Canvas size:") : _("Track size:"))); - x1 += 115; + x1 += xs115; add_subwindow(output_w_text = new NewOutputW(this, x1, y)); - x1 += output_w_text->get_w() + 2; + x1 += output_w_text->get_w() + xs2; add_subwindow(new BC_Title(x1, y, "x")); - x1 += 10; + x1 += xs10; add_subwindow(output_h_text = new NewOutputH(this, x1, y)); x1 += output_h_text->get_w(); FrameSizePulldown *pulldown; add_subwindow(pulldown = new FrameSizePulldown(mwindow->theme, - output_w_text, - output_h_text, - x1, - y)); - x1 += pulldown->get_w() + 10; + output_w_text, output_h_text, x1, y)); + x1 += pulldown->get_w() + xs10; add_subwindow(new NewSwapExtents(mwindow, this, x1, y)); - y += output_h_text->get_h() + 5; + y += output_h_text->get_h() + ys5; if( new_thread->load_mode == LOADMODE_REPLACE ) { x1 = x; add_subwindow(new BC_Title(x1, y, _("Aspect ratio:"))); - x1 += 115; + x1 += xs115; add_subwindow(aspect_w_text = new NewAspectW(this, "", x1, y)); - x1 += aspect_w_text->get_w() + 2; + x1 += aspect_w_text->get_w() + xs2; add_subwindow(new BC_Title(x1, y, ":")); - x1 += 10; + x1 += xs10; add_subwindow(aspect_h_text = new NewAspectH(this, "", x1, y)); x1 += aspect_h_text->get_w(); add_subwindow(new AspectPulldown(mwindow, aspect_w_text, aspect_h_text, x1, y)); x1 = aspect_w_text->get_x(); - y += aspect_w_text->get_h() + 5; + y += aspect_w_text->get_h() + ys5; add_subwindow(new NewAspectAuto(this, x1, y)); - y += 40; + y += ys40; add_subwindow(title = new BC_Title(x, y, _("Color model:"))); x1 = x + title->get_w(); - y1 = y; y += title->get_h() + 10; + y1 = y; y += title->get_h() + ys10; add_subwindow(title = new BC_Title(x, y, _("Interlace mode:"))); int x2 = x + title->get_w(); - int y2 = y; y += title->get_h() + 10; + int y2 = y; y += title->get_h() + ys10; if( x1 < x2 ) x1 = x2; - x1 += 20; - add_subwindow(textbox = new BC_TextBox(x1, y1, 150, 1, "")); + x1 += xs20; + add_subwindow(textbox = new BC_TextBox(x1, y1, xs150, 1, "")); add_subwindow(color_model = new ColormodelPulldown(mwindow, textbox, &new_edl->session->color_model, x1+textbox->get_w(), y1)); - add_subwindow(textbox = new BC_TextBox(x1, y2, 150, 1, "")); + add_subwindow(textbox = new BC_TextBox(x1, y2, xs150, 1, "")); add_subwindow(interlace_pulldown = new InterlacemodePulldown(mwindow, textbox, &new_edl->session->interlace_mode, (ArrayList*)&mwindow->interlace_project_modes, x1+textbox->get_w(), y2)); - x = 20; y = HEIGHT2; + x = xs20; y = HEIGHT2; add_subwindow(title = new BC_Title(x, y, _("Create project folder in:"))); - x1 = x; y += title->get_h() + 5; - add_subwindow(folder = new BC_TextBox(x1, y, get_w()-x1-64, 1, "")); - x1 += folder->get_w() + 10; + x1 = x; y += title->get_h() + ys5; + add_subwindow(folder = new BC_TextBox(x1, y, get_w()-x1-xs64, 1, "")); + x1 += folder->get_w() + xs10; add_subwindow(recent_folder = new BC_RecentList("FOLDER", mwindow->defaults, folder)); recent_folder->load_items("PROJECT"); x1 = recent_folder->get_x() + recent_folder->get_w(); add_subwindow(new BrowseButton(mwindow->theme, this, folder, x1, y, "", _("Project Directory"), _("Project Directory Path:"), 1)); - y += folder->get_h() + 10; x1 = x; + y += folder->get_h() + ys10; x1 = x; add_subwindow(title = new BC_Title(x1, y, _("Project Name:"))); - x1 += title->get_w() + 10; - add_subwindow(name = new BC_TextBox(x1, y, get_w()-x1-64, 1, "")); + x1 += title->get_w() + xs10; + add_subwindow(name = new BC_TextBox(x1, y, get_w()-x1-xs64, 1, "")); } add_subwindow(new BC_OKButton(this, @@ -533,7 +529,7 @@ EDL* NewPresets::get_edl() NewATracks::NewATracks(NewWindow *nwindow, const char *text, int x, int y) - : BC_TextBox(x, y, 90, 1, text) + : BC_TextBox(x, y, xS(90), 1, text) { this->nwindow = nwindow; } @@ -566,7 +562,7 @@ int NewATracksTumbler::handle_down_event() NewAChannels::NewAChannels(NewWindow *nwindow, const char *text, int x, int y) - : BC_TextBox(x, y, 90, 1, text) + : BC_TextBox(x, y, xS(90), 1, text) { this->nwindow = nwindow; } @@ -600,7 +596,7 @@ int NewAChannelsTumbler::handle_down_event() NewSampleRate::NewSampleRate(NewWindow *nwindow, const char *text, int x, int y) - : BC_TextBox(x, y, 90, 1, text) + : BC_TextBox(x, y, xS(90), 1, text) { this->nwindow = nwindow; } @@ -613,7 +609,7 @@ int NewSampleRate::handle_event() SampleRatePulldown::SampleRatePulldown(MWindow *mwindow, BC_TextBox *output, int x, int y) - : BC_ListBox(x, y, 100, 200, LISTBOX_TEXT, + : BC_ListBox(x, y, xS(100), xS(200), LISTBOX_TEXT, &mwindow->theme->sample_rates, 0, 0, 1, 0, 1) { this->mwindow = mwindow; @@ -629,7 +625,7 @@ int SampleRatePulldown::handle_event() NewVTracks::NewVTracks(NewWindow *nwindow, const char *text, int x, int y) - : BC_TextBox(x, y, 90, 1, text) + : BC_TextBox(x, y, xS(90), 1, text) { this->nwindow = nwindow; } @@ -663,7 +659,7 @@ int NewVTracksTumbler::handle_down_event() NewVChannels::NewVChannels(NewWindow *nwindow, const char *text, int x, int y) - : BC_TextBox(x, y, 90, 1, text) + : BC_TextBox(x, y, xS(90), 1, text) { this->nwindow = nwindow; } @@ -697,7 +693,7 @@ int NewVChannelsTumbler::handle_down_event() NewFrameRate::NewFrameRate(NewWindow *nwindow, const char *text, int x, int y) - : BC_TextBox(x, y, 90, 1, text) + : BC_TextBox(x, y, xS(90), 1, text) { this->nwindow = nwindow; } @@ -711,7 +707,7 @@ int NewFrameRate::handle_event() FrameRatePulldown::FrameRatePulldown(MWindow *mwindow, BC_TextBox *output, int x, int y) - : BC_ListBox(x, y, 150, 250, LISTBOX_TEXT, + : BC_ListBox(x, y, xS(150), yS(250), LISTBOX_TEXT, &mwindow->theme->frame_rates, 0, 0, 1, 0, 1) { this->mwindow = mwindow; @@ -727,7 +723,7 @@ int FrameRatePulldown::handle_event() FrameSizePulldown::FrameSizePulldown(Theme *theme, BC_TextBox *output_w, BC_TextBox *output_h, int x, int y) - : BC_ListBox(x, y, 180, 250, LISTBOX_TEXT, + : BC_ListBox(x, y, xS(180), yS(250), LISTBOX_TEXT, &theme->frame_sizes, 0, 0, 1, 0, 1) { this->theme = theme; @@ -760,7 +756,7 @@ int FrameSizePulldown::handle_event() NewOutputW::NewOutputW(NewWindow *nwindow, int x, int y) - : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->output_w) + : BC_TextBox(x, y, xS(70), 1, nwindow->new_edl->session->output_w) { this->nwindow = nwindow; } @@ -773,7 +769,7 @@ int NewOutputW::handle_event() NewOutputH::NewOutputH(NewWindow *nwindow, int x, int y) - : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->output_h) + : BC_TextBox(x, y, xS(70), 1, nwindow->new_edl->session->output_h) { this->nwindow = nwindow; } @@ -786,7 +782,7 @@ int NewOutputH::handle_event() NewAspectW::NewAspectW(NewWindow *nwindow, const char *text, int x, int y) - : BC_TextBox(x, y, 70, 1, text) + : BC_TextBox(x, y, xS(70), 1, text) { this->nwindow = nwindow; } @@ -799,7 +795,7 @@ int NewAspectW::handle_event() NewAspectH::NewAspectH(NewWindow *nwindow, const char *text, int x, int y) - : BC_TextBox(x, y, 70, 1, text) + : BC_TextBox(x, y, xS(70), 1, text) { this->nwindow = nwindow; } @@ -813,7 +809,7 @@ int NewAspectH::handle_event() AspectPulldown::AspectPulldown(MWindow *mwindow, BC_TextBox *output_w, BC_TextBox *output_h, int x, int y) - : BC_ListBox(x, y, 100, 200, LISTBOX_TEXT, + : BC_ListBox(x, y, xS(100), yS(200), LISTBOX_TEXT, &mwindow->theme->aspect_ratios, 0, 0, 1, 0, 1) { this->mwindow = mwindow; @@ -853,7 +849,7 @@ ColormodelItem::ColormodelItem(const char *text, int value) ColormodelPulldown::ColormodelPulldown(MWindow *mwindow, BC_TextBox *output_text, int *output_value, int x, int y) - : BC_ListBox(x, y, 200, 150, LISTBOX_TEXT, + : BC_ListBox(x, y, xS(200), yS(150), LISTBOX_TEXT, (ArrayList*)&mwindow->colormodels, 0, 0, 1, 0, 1) { this->mwindow = mwindow; @@ -896,7 +892,7 @@ InterlacemodePulldown::InterlacemodePulldown(MWindow *mwindow, ArrayList *data, int x, int y) - : BC_ListBox(x, y, 200, 150, LISTBOX_TEXT, data, 0, 0, 1, 0, 1) + : BC_ListBox(x, y, xS(200), xS(150), LISTBOX_TEXT, data, 0, 0, 1, 0, 1) { this->mwindow = mwindow; this->output_text = output_text; diff --git a/cinelerra-5.1/cinelerra/performanceprefs.C b/cinelerra-5.1/cinelerra/performanceprefs.C index 687e7e48..12a8fc95 100644 --- a/cinelerra-5.1/cinelerra/performanceprefs.C +++ b/cinelerra-5.1/cinelerra/performanceprefs.C @@ -54,11 +54,12 @@ PerformancePrefs::~PerformancePrefs() void PerformancePrefs::create_objects() { + int xs5 = xS(5), xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys35 = yS(35); int x, y; - int xmargin1; - int xmargin2 = 180; - int xmargin3 = 260; - int xmargin4 = 420; + int xmargin2 = xS(180); + int xmargin3 = xS(260); + int xmargin4 = xS(420); char string[BCTEXTLEN]; BC_Resources *resources = BC_WindowBase::get_resources(); BC_WindowBase *win; @@ -67,70 +68,70 @@ void PerformancePrefs::create_objects() node_list = 0; generate_node_list(); - xmargin1 = x = mwindow->theme->preferencesoptions_x; + int xmargin1 = x = mwindow->theme->preferencesoptions_x; y = mwindow->theme->preferencesoptions_y; int y0 = y; - win = add_subwindow(new BC_Title(x, y + 5, _("Cache size (MB):"), MEDIUMFONT, resources->text_default)); + win = add_subwindow(new BC_Title(x, y + ys5, _("Cache size (MB):"), MEDIUMFONT, resources->text_default)); maxw = win->get_w(); int x1 = x + xmargin4; - win = add_subwindow(new BC_Title(x1, y + 5, _("Use HW Device:"))); - x1 += win->get_w() + 5; + win = add_subwindow(new BC_Title(x1, y + ys5, _("Use HW Device:"))); + x1 += win->get_w() + xs5; PrefsUseHWDev *use_hw_dev = new PrefsUseHWDev(pwindow, this, x1, y); use_hw_dev->create_objects(); - int y1 = y += 30; - win = add_subwindow(new BC_Title(x, y + 5, _("Seconds to preroll renders:"))); + int y1 = y += ys30; + win = add_subwindow(new BC_Title(x, y + ys5, _("Seconds to preroll renders:"))); if((curw = win->get_w()) > maxw) maxw = curw; - maxw += x + 5; + maxw += x + xs5; cache_size = new CICacheSize(maxw, y0, pwindow, this); cache_size->create_objects(); - add_subwindow(new BC_Title(x, y + 5, _("Seconds to preroll renders:"))); + add_subwindow(new BC_Title(x, y + ys5, _("Seconds to preroll renders:"))); PrefsRenderPreroll *preroll = new PrefsRenderPreroll(pwindow, this, maxw, y1); preroll->create_objects(); - y += 30; + y += ys30; x1 = x + xmargin4; - BC_Title *smp_title = new BC_Title(x1, y + 5, _("Project SMP cpus:")); + BC_Title *smp_title = new BC_Title(x1, y + ys5, _("Project SMP cpus:")); add_subwindow(smp_title); - x1 += smp_title->get_w() + 5; + x1 += smp_title->get_w() + xs5; PrefsProjectSMP *proj_smp = new PrefsProjectSMP(pwindow, this, x1, y); proj_smp->create_objects(); PrefsForceUniprocessor *force_1cpu = new PrefsForceUniprocessor(pwindow, x, y); add_subwindow(force_1cpu); - y += 30; + y += ys30; // Background rendering - add_subwindow(new BC_Bar(5, y, get_w() - 10)); - y += 5; + add_subwindow(new BC_Bar(xs5, y, get_w() - xs10)); + y += ys5; add_subwindow(new BC_Title(x, y, _("Background Rendering (Video only)"), LARGEFONT, resources->text_default)); - y1 = y += 30; + y1 = y += ys30; win = add_subwindow(new PrefsUseBRender(pwindow, x, y)); - y += win->get_h() + 10; + y += win->get_h() + ys10; win = add_subwindow(new BC_Title(x, y, _("Frames per background rendering job:"))); - y += win->get_h() + 5; + y += win->get_h() + ys5; PrefsBRenderFragment *brender_fragment = new PrefsBRenderFragment(pwindow, this, x + xmargin3, y); brender_fragment->create_objects(); - y += brender_fragment->get_h() + 5; + y += brender_fragment->get_h() + ys5; win = add_subwindow(new BC_Title(x, y, _("Frames to preroll background:"))); - y += win->get_h() + 5; + y += win->get_h() + ys5; PrefsBRenderPreroll *bpreroll = new PrefsBRenderPreroll(pwindow, this, - x + xmargin3, y + 5); + x + xmargin3, y + ys5); bpreroll->create_objects(); - y += bpreroll->get_h() + 20; + y += bpreroll->get_h() + ys20; x += xmargin4; add_subwindow(new BC_Title(x, y1, _("Output for background rendering:"))); - y1 += 20; + y1 += ys20; brender_tools = new FormatTools(mwindow, this, pwindow->thread->preferences->brender_asset); brender_tools->create_objects(x, y1, @@ -148,46 +149,46 @@ void PerformancePrefs::create_objects() // Renderfarm - add_subwindow(new BC_Bar(5, y, get_w() - 10)); - y += 5; + add_subwindow(new BC_Bar(xs5, y, get_w() - xs10)); + y += ys5; add_subwindow(new BC_Title(x, y, _("Render Farm"), LARGEFONT, resources->text_default)); x1 = get_w() - BC_GenericButton::calculate_w(this, _("Reset rates")) - x; add_subwindow(new PrefsRenderFarmReset(pwindow, this, x1, y)); x1 = x + xmargin4; BC_Title *node_title = new BC_Title(x1, y, _("Nodes:")); add_subwindow(node_title); - x1 += node_title->get_w() + 15; + x1 += node_title->get_w() + xS(15); sprintf(string, _(MASTER_NODE_FRAMERATE_TEXT), pwindow->thread->preferences->local_rate); add_subwindow(master_rate = new BC_Title(x1, y, string)); - add_subwindow(node_list = new PrefsRenderFarmNodes(pwindow, this, x + xmargin4, y+=25)); - add_subwindow(new PrefsRenderFarm(pwindow, x, y+=5)); - add_subwindow(new BC_Title(x, y+=30, _("Hostname:"))); + add_subwindow(node_list = new PrefsRenderFarmNodes(pwindow, this, x + xmargin4, y+=yS(25))); + add_subwindow(new PrefsRenderFarm(pwindow, x, y+=ys5)); + add_subwindow(new BC_Title(x, y+=ys30, _("Hostname:"))); add_subwindow(new BC_Title(x + xmargin3, y, _("Port:"))); - add_subwindow(edit_node = new PrefsRenderFarmEditNode(pwindow, this, x, y+=25)); + add_subwindow(edit_node = new PrefsRenderFarmEditNode(pwindow, this, x, y+=yS(25))); edit_port = new PrefsRenderFarmPort(pwindow, this, x+xmargin3, y); edit_port->create_objects(); - add_subwindow(new PrefsRenderFarmReplaceNode(pwindow, this, x, y+=30)); + add_subwindow(new PrefsRenderFarmReplaceNode(pwindow, this, x, y+=ys30)); add_subwindow(new PrefsRenderFarmNewNode(pwindow, this, x+xmargin2, y)); - add_subwindow(new PrefsRenderFarmSortNodes(pwindow, this, x, y+=30)); + add_subwindow(new PrefsRenderFarmSortNodes(pwindow, this, x, y+=ys30)); add_subwindow(new PrefsRenderFarmDelNode(pwindow, this, x+xmargin2, y)); - add_subwindow(new BC_Title(x, y+=35, _("Client Watchdog Timeout:"))); - renderfarm_watchdog = new PrefsRenderFarmWatchdog(pwindow, this, x+xmargin3, y-5); + add_subwindow(new BC_Title(x, y+=ys35, _("Client Watchdog Timeout:"))); + renderfarm_watchdog = new PrefsRenderFarmWatchdog(pwindow, this, x+xmargin3, y-ys5); renderfarm_watchdog->create_objects(); - add_subwindow(new BC_Title(x, y+=35, _("Total jobs to create:"))); + add_subwindow(new BC_Title(x, y+=ys35, _("Total jobs to create:"))); PrefsRenderFarmJobs *jobs = new PrefsRenderFarmJobs(pwindow, this, - x + xmargin3, y-5); + x + xmargin3, y-ys5); jobs->create_objects(); - y += jobs->get_h() + 5; + y += jobs->get_h() + ys5; win = add_subwindow(new BC_Title(x, y, _("(overridden if new file at each label is checked)"))); -// y += win->get_h() + 5; +// y += win->get_h() + ys5; // add_subwindow(new PrefsRenderFarmVFS(pwindow, this, x, y)); // add_subwindow(new BC_Title(x, y, // _("Filesystem prefix on remote nodes:"))); // add_subwindow(new PrefsRenderFarmMountpoint(pwindow, this, x + xmargin3, y)); -// y += 30; +// y += ys30; } void PerformancePrefs::generate_node_list() @@ -290,7 +291,7 @@ PrefsBRenderFragment::PrefsBRenderFragment(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y) : BC_TumbleTextBox(subwindow, (int64_t)pwindow->thread->preferences->brender_fragment, - (int64_t)1, (int64_t)65535, x, y, 100) + (int64_t)1, (int64_t)65535, x, y, xS(100)) { this->pwindow = pwindow; } @@ -306,7 +307,7 @@ CICacheSize::CICacheSize(int x, int y, (int64_t)pwindow->thread->preferences->cache_size / 0x100000, (int64_t)MIN_CACHE_SIZE / 0x100000, (int64_t)MAX_CACHE_SIZE / 0x100000, - x, y, 100) + x, y, xS(100)) { this->pwindow = pwindow; set_increment(1); @@ -324,7 +325,7 @@ int CICacheSize::handle_event() PrefsUseHWDev::PrefsUseHWDev(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y) - : BC_PopupTextBox(subwindow,0,0,x,y,100,80,LISTBOX_TEXT) + : BC_PopupTextBox(subwindow,0,0,x,y,xS(100),yS(80),LISTBOX_TEXT) { this->pwindow = pwindow; } @@ -357,16 +358,10 @@ int PrefsUseHWDev::handle_event() } PrefsRenderPreroll::PrefsRenderPreroll(PreferencesWindow *pwindow, - PerformancePrefs *subwindow, - int x, - int y) + PerformancePrefs *subwindow, int x, int y) : BC_TumbleTextBox(subwindow, (float)pwindow->thread->preferences->render_preroll, - (float)0, - (float)100, - x, - y, - 100) + 0.f, 100.f, x, y, xS(100)) { this->pwindow = pwindow; set_increment(0.1); @@ -387,11 +382,7 @@ PrefsBRenderPreroll::PrefsBRenderPreroll(PreferencesWindow *pwindow, int y) : BC_TumbleTextBox(subwindow, (int64_t)pwindow->thread->preferences->brender_preroll, - (int64_t)0, - (int64_t)100, - x, - y, - 100) + (int64_t)0, (int64_t)100, x, y, xS(100)) { this->pwindow = pwindow; } @@ -463,11 +454,7 @@ PrefsRenderFarmPort::PrefsRenderFarmPort(PreferencesWindow *pwindow, int y) : BC_TumbleTextBox(subwindow, (int64_t)pwindow->thread->preferences->renderfarm_port, - (int64_t)1, - (int64_t)65535, - x, - y, - 100) + (int64_t)1, (int64_t)65535, x, y, xS(100)) { this->pwindow = pwindow; } @@ -486,11 +473,11 @@ int PrefsRenderFarmPort::handle_event() PrefsRenderFarmNodes::PrefsRenderFarmNodes(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y) - : BC_ListBox(x, y, 340, 230, LISTBOX_TEXT, 0,0,0,1, 0,0, LISTBOX_MULTIPLE) + : BC_ListBox(x, y, xS(340), yS(230), LISTBOX_TEXT, 0,0,0,1, 0,0, LISTBOX_MULTIPLE) { for( int i=0; inodes, titles, widths, PerformancePrefs::TOTAL_COLUMNS, 0, 0, -1, 0, 0); @@ -542,7 +529,7 @@ int PrefsRenderFarmNodes::selection_changed() PrefsRenderFarmEditNode::PrefsRenderFarmEditNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y) - : BC_TextBox(x, y, 240, 1, "") + : BC_TextBox(x, y, xS(240), 1, "") { this->pwindow = pwindow; this->subwindow = subwindow; @@ -687,7 +674,7 @@ PrefsProjectSMP::PrefsProjectSMP(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y) : BC_TumbleTextBox(subwindow, (int64_t)pwindow->thread->preferences->project_smp, - (int64_t)1, (int64_t)100, x, y, 100) + (int64_t)1, (int64_t)100, x, y, xS(100)) { this->pwindow = pwindow; } @@ -707,7 +694,7 @@ PrefsRenderFarmJobs::PrefsRenderFarmJobs(PreferencesWindow *pwindow, int y) : BC_TumbleTextBox(subwindow, (int64_t)pwindow->thread->preferences->renderfarm_job_count, - (int64_t)1, (int64_t)100, x, y, 100) + (int64_t)1, (int64_t)100, x, y, xS(100)) { this->pwindow = pwindow; } @@ -723,7 +710,7 @@ int PrefsRenderFarmJobs::handle_event() PrefsRenderFarmMountpoint::PrefsRenderFarmMountpoint(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y) - : BC_TextBox(x, y, 100, 1, + : BC_TextBox(x, y, xS(100), 1, pwindow->thread->preferences->renderfarm_mountpoint) { this->pwindow = pwindow; @@ -759,7 +746,7 @@ PrefsRenderFarmWatchdog::PrefsRenderFarmWatchdog(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y) : BC_TumbleTextBox(subwindow, (int64_t)pwindow->thread->preferences->renderfarm_watchdog_timeout, - (int64_t)0, (int64_t)1000, x, y, 100) + (int64_t)0, (int64_t)1000, x, y, xS(100)) { this->pwindow = pwindow; set_increment(15); diff --git a/cinelerra-5.1/cinelerra/playbackprefs.C b/cinelerra-5.1/cinelerra/playbackprefs.C index 264566f1..e220aba4 100644 --- a/cinelerra-5.1/cinelerra/playbackprefs.C +++ b/cinelerra-5.1/cinelerra/playbackprefs.C @@ -59,6 +59,8 @@ PlaybackPrefs::~PlaybackPrefs() void PlaybackPrefs::create_objects() { + int xs5 = xS(5), xs10 = xS(10), xs30 = xS(30); + int ys5 = yS(5), ys30 = yS(30); int x, y, x2, y2; char string[BCTEXTLEN]; BC_WindowBase *window; @@ -91,50 +93,46 @@ SET_TRACE menu->add_item(new BC_MenuItem("131072")); menu->add_item(new BC_MenuItem("262144")); - y += menu->get_h() + 5; + y += menu->get_h() + ys5; x2 = x; add_subwindow(title1 = new BC_Title(x2, y, _("Audio offset (sec):"))); - x2 += title1->get_w() + 5; + x2 += title1->get_w() + xs5; audio_offset = new PlaybackAudioOffset(pwindow, this, x2, y); audio_offset->create_objects(); - y += audio_offset->get_h() + 5; + y += audio_offset->get_h() + ys5; SET_TRACE add_subwindow(new PlaybackViewFollows(pwindow, pwindow->thread->edl->session->view_follows_playback, y)); - y += 30; + y += ys30; add_subwindow(new PlaybackSoftwareTimer(pwindow, pwindow->thread->edl->session->playback_software_position, y)); - y += 30; + y += ys30; add_subwindow(new PlaybackRealTime(pwindow, pwindow->thread->edl->session->real_time_playback, y)); - y += 30; + y += ys30; PlaybackMap51_2 *map51_2 = new PlaybackMap51_2(pwindow, this, playback_config->aconfig->map51_2, y); add_subwindow(map51_2); - x2 = map51_2->get_x() + map51_2->get_w() + 15; + x2 = map51_2->get_x() + map51_2->get_w() + xS(15); y2 = y + BC_TextBox::calculate_h(this,MEDIUMFONT,1,1) - get_text_height(MEDIUMFONT); add_subwindow(title2 = new BC_Title(x2, y2, _("Gain:"))); - x2 += title2->get_w() + 8; + x2 += title2->get_w() + xS(8); play_gain = new PlaybackGain(x2, y, pwindow, this); play_gain->create_objects(); - y += 40; + y += yS(40); add_subwindow(new BC_Title(x, y, _("Audio Driver:"))); - audio_device = new ADevicePrefs(x + 100, y, pwindow, + audio_device = new ADevicePrefs(x + xS(100), y, pwindow, this, playback_config->aconfig, 0, MODEPLAY); audio_device->initialize(0); - SET_TRACE - - - // Video - y += audio_device->get_h(0) + margin; + y += audio_device->get_h(0) + margin; SET_TRACE add_subwindow(new BC_Bar(x, y, get_w() - x * 2)); - y += 5; + y += ys5; SET_TRACE add_subwindow(title1 = new BC_Title(x, y, _("Video Out"), LARGEFONT)); @@ -142,7 +140,7 @@ SET_TRACE SET_TRACE add_subwindow(window = new VideoEveryFrame(pwindow, this, x, y)); - int x1 = x + window->get_w() + 30; + int x1 = x + window->get_w() + xs30; const char *txt = _("Framerate achieved:"); int y1 = y + (window->get_h() - BC_Title::calculate_h(this, txt)) / 2; add_subwindow(title1 = new BC_Title(x1, y1, txt)); @@ -152,17 +150,17 @@ SET_TRACE y += window->get_h() + 2*margin; // add_subwindow(asynchronous = new VideoAsynchronous(pwindow, x, y)); -// y += asynchronous->get_h() + 10; +// y += asynchronous->get_h() + ys10; SET_TRACE - add_subwindow(title1 = new BC_Title(x, y, _("Scaling equation: Enlarge / Reduce "))); + add_subwindow(title1 = new BC_Title(x, y, _("Scaling equation: Enlarge / Reduce "))); VScalingEquation *vscaling_equation = - new VScalingEquation(x + title1->get_w() + 65, y, + new VScalingEquation(x + title1->get_w() + xS(65), y, &pwindow->thread->edl->session->interpolation_type); add_subwindow(vscaling_equation); vscaling_equation->create_objects(); SET_TRACE - y += 35; + y += yS(35); add_subwindow(title1 = new BC_Title(x, y, _("DVD Subtitle to display:"))); PlaybackSubtitleNumber *subtitle_number; @@ -170,7 +168,7 @@ SET_TRACE subtitle_number = new PlaybackSubtitleNumber(x1, y, pwindow, this); subtitle_number->create_objects(); - x2 = x + title1->get_w() + 10 + subtitle_number->get_w() + 85; + x2 = x + title1->get_w() + xs10 + subtitle_number->get_w() + xS(85); PlaybackSubtitle *subtitle_toggle; x1 += subtitle_number->get_w() + margin; add_subwindow(subtitle_toggle = new PlaybackSubtitle(x2, y, pwindow, this)); @@ -183,17 +181,17 @@ SET_TRACE add_subwindow(title1=new BC_Title(x2, y2, _("TOC Program No:"), MEDIUMFONT)); PlaybackProgramNumber *program_number; program_number = new PlaybackProgramNumber( - x2 + title1->get_w() + 10, y2, pwindow, this); + x2 + title1->get_w() + xs10, y2, pwindow, this); program_number->create_objects(); add_subwindow(interpolate_raw = new PlaybackInterpolateRaw( x, y, pwindow, this)); y += interpolate_raw->get_h() + margin; - add_subwindow(white_balance_raw = new PlaybackWhiteBalanceRaw(x, y, + add_subwindow(white_balance_raw = new PlaybackWhiteBalanceRaw(x, y, pwindow, this)); - if(!pwindow->thread->edl->session->interpolate_raw) - white_balance_raw->disable(); + if(!pwindow->thread->edl->session->interpolate_raw) + white_balance_raw->disable(); y += white_balance_raw->get_h() + margin; add_subwindow(vdevice_title = new BC_Title(x, y, _("Video Driver:"))); @@ -218,7 +216,7 @@ int PlaybackPrefs::draw_framerate(int flush) PlaybackAudioOffset::PlaybackAudioOffset(PreferencesWindow *pwindow, PlaybackPrefs *playback, int x, int y) : BC_TumbleTextBox(playback, playback->playback_config->aconfig->audio_offset, - -10.0, 10.0, x, y, 100) + -10.0, 10.0, x, y, xS(100)) { this->pwindow = pwindow; this->playback = playback; @@ -237,7 +235,7 @@ int PlaybackAudioOffset::handle_event() PlaybackModuleFragment::PlaybackModuleFragment(int x, int y, PreferencesWindow *pwindow, PlaybackPrefs *playback, char *text) - : BC_PopupMenu(x, y, 100, text, 1) + : BC_PopupMenu(x, y, xS(100), text, 1) { this->pwindow = pwindow; this->playback = playback; @@ -251,7 +249,7 @@ int PlaybackModuleFragment::handle_event() PlaybackViewFollows::PlaybackViewFollows(PreferencesWindow *pwindow, int value, int y) - : BC_CheckBox(10, y, value, _("View follows playback")) + : BC_CheckBox(xS(10), y, value, _("View follows playback")) { this->pwindow = pwindow; } @@ -264,7 +262,7 @@ int PlaybackViewFollows::handle_event() PlaybackSoftwareTimer::PlaybackSoftwareTimer(PreferencesWindow *pwindow, int value, int y) - : BC_CheckBox(10, y, value, _("Disable hardware synchronization")) + : BC_CheckBox(xS(10), y, value, _("Disable hardware synchronization")) { this->pwindow = pwindow; } @@ -277,7 +275,7 @@ int PlaybackSoftwareTimer::handle_event() PlaybackRealTime::PlaybackRealTime(PreferencesWindow *pwindow, int value, int y) - : BC_CheckBox(10, y, value, _("Audio playback in real time priority (root only)")) + : BC_CheckBox(xS(10), y, value, _("Audio playback in real time priority (root only)")) { this->pwindow = pwindow; } @@ -291,7 +289,7 @@ int PlaybackRealTime::handle_event() PlaybackMap51_2::PlaybackMap51_2(PreferencesWindow *pwindow, PlaybackPrefs *playback_prefs, int value, int y) - : BC_CheckBox(10, y, value, _("Map 5.1->2")) + : BC_CheckBox(xS(10), y, value, _("Map 5.1->2")) { this->pwindow = pwindow; this->playback_prefs = playback_prefs; @@ -306,9 +304,7 @@ int PlaybackMap51_2::handle_event() PlaybackInterpolateRaw::PlaybackInterpolateRaw( int x, int y, PreferencesWindow *pwindow, PlaybackPrefs *playback) - : BC_CheckBox(x, - y, - pwindow->thread->edl->session->interpolate_raw, + : BC_CheckBox(x, y, pwindow->thread->edl->session->interpolate_raw, _("Interpolate CR2 images")) { this->pwindow = pwindow; @@ -331,8 +327,7 @@ int PlaybackInterpolateRaw::handle_event() PlaybackWhiteBalanceRaw::PlaybackWhiteBalanceRaw( int x, int y, PreferencesWindow *pwindow, PlaybackPrefs *playback) - : BC_CheckBox(x, - y, + : BC_CheckBox(x, y, pwindow->thread->edl->session->interpolate_raw && pwindow->thread->edl->session->white_balance_raw, _("White balance CR2 images")) @@ -358,7 +353,7 @@ int PlaybackWhiteBalanceRaw::handle_event() // if(!pwindow->thread->edl->session->video_every_frame) // disable(); // } -// +// // int VideoAsynchronous::handle_event() // { // pwindow->thread->edl->session->video_asynchronous = get_value(); @@ -409,7 +404,7 @@ int PlaybackSubtitle::handle_event() PlaybackSubtitleNumber::PlaybackSubtitleNumber(int x, int y, PreferencesWindow *pwindow, PlaybackPrefs *playback) : BC_TumbleTextBox(playback, pwindow->thread->edl->session->subtitle_number, - 0, 31, x, y, 50) + 0, 31, x, y, xS(50)) { this->pwindow = pwindow; this->playback = playback; @@ -443,7 +438,7 @@ PlaybackProgramNumber::PlaybackProgramNumber(int x, int y, PreferencesWindow *pwindow, PlaybackPrefs *playback) : BC_TumbleTextBox(playback, pwindow->thread->edl->session->program_no, - 0, 31, x, y, 50) + 0, 31, x, y, xS(50)) { this->pwindow = pwindow; this->playback = playback; @@ -459,7 +454,7 @@ PlaybackGain::PlaybackGain(int x, int y, PreferencesWindow *pwindow, PlaybackPrefs *playback) : BC_TumbleTextBox(playback, pwindow->thread->edl->session->playback_config->aconfig->play_gain, - 0.0001f, 10000.0f, x, y, 72) + 0.0001f, 10000.0f, x, y, xS(72)) { this->pwindow = pwindow; this->set_increment(0.1); diff --git a/cinelerra-5.1/cinelerra/pluginaclientlad.C b/cinelerra-5.1/cinelerra/pluginaclientlad.C index 15ff05ed..f6ee07ca 100644 --- a/cinelerra-5.1/cinelerra/pluginaclientlad.C +++ b/cinelerra-5.1/cinelerra/pluginaclientlad.C @@ -179,11 +179,7 @@ int PluginACLientToggle::handle_event() PluginACLientILinear::PluginACLientILinear(PluginAClientLAD *plugin, - int x, - int y, - LADSPA_Data *output, - int min, - int max) + int x, int y, LADSPA_Data *output, int min, int max) : BC_IPot(x, y, (int)(*output), min, max) { this->plugin = plugin; @@ -199,11 +195,7 @@ int PluginACLientILinear::handle_event() PluginACLientFLinear::PluginACLientFLinear(PluginAClientLAD *plugin, - int x, - int y, - LADSPA_Data *output, - float min, - float max) + int x, int y, LADSPA_Data *output, float min, float max) : BC_FPot(x, y, *output, min, max) { this->plugin = plugin; @@ -242,8 +234,8 @@ int PluginACLientFreq::handle_event() PluginAClientWindow::PluginAClientWindow(PluginAClientLAD *plugin) - : PluginClientWindow(plugin, 500, plugin->config.total_ports * 30 + 60, - 500, plugin->config.total_ports * 30 + 60, 0) + : PluginClientWindow(plugin, xS(500), plugin->config.total_ports * yS(30) + yS(60), + xS(500), plugin->config.total_ports * yS(30) + yS(60), 0) { this->plugin = plugin; } @@ -258,10 +250,8 @@ void PluginAClientWindow::create_objects() PluginServer *server = plugin->server; char string[BCTEXTLEN]; int current_port = 0; - int x = 10; - int y = 10; - int x2 = 300; - int x3 = 335; + int x = xS(10), y = yS(10); + int x2 = xS(300), x3 = xS(335); int title_vmargin = 5; int max_w = 0; const LADSPA_Descriptor *lad_desc = server->lad_descriptor; @@ -274,8 +264,8 @@ void PluginAClientWindow::create_objects() if(w > max_w) max_w = w; } - x2 = max_w + 20; - x3 = max_w + 55; + x2 = max_w + xS(20); + x3 = max_w + xS(55); for(int i = 0; i < port_count; i++) { if( !LADSPA_IS_PORT_INPUT(port_desc[i]) ) continue; if( !LADSPA_IS_PORT_CONTROL(port_desc[i]) ) continue; @@ -331,14 +321,14 @@ void PluginAClientWindow::create_objects() break; } } current_port++; - y += 30; + y += yS(30); //printf("PluginAClientWindow::create_objects 2\n"); } - y += 10; + y += yS(10); sprintf(string, _("Author: %s"), lad_desc->Maker); add_subwindow(new BC_Title(x, y, string)); - y += 20; + y += yS(20); sprintf(string, _("License: %s"), lad_desc->Copyright); add_subwindow(new BC_Title(x, y, string)); show_window(1); diff --git a/cinelerra-5.1/cinelerra/pluginclient.C b/cinelerra-5.1/cinelerra/pluginclient.C index 726bd00f..5d7018c1 100644 --- a/cinelerra-5.1/cinelerra/pluginclient.C +++ b/cinelerra-5.1/cinelerra/pluginclient.C @@ -146,21 +146,15 @@ PluginClientFrame::~PluginClientFrame() PluginClientWindow::PluginClientWindow(PluginClient *client, int w, int h, int min_w, int min_h, int allow_resize) : BC_Window(client->gui_string, - client->window_x /* - w / 2 */, - client->window_y /* - h / 2 */, - (int)(w*get_resources()->font_scale+0.5), (int)(h*get_resources()->font_scale+0.5), - (int)(min_w*get_resources()->font_scale+0.5), (int)(min_h*get_resources()->font_scale+0.5), - allow_resize, 0, 1) + client->window_x /* - w / 2 */, client->window_y /* - h / 2 */, + w, h, min_w, min_h, allow_resize, 0, 1) { this->client = client; } PluginClientWindow::PluginClientWindow(const char *title, int x, int y, int w, int h, int min_w, int min_h, int allow_resize) - : BC_Window(title, x, y, - (int)(w*get_resources()->font_scale+0.5), (int)(h*get_resources()->font_scale+0.5), - (int)(min_w*get_resources()->font_scale+0.5), (int)(min_h*get_resources()->font_scale+0.5), - allow_resize, 0, 1) + : BC_Window(title, x, y, w, h, min_w, min_h, allow_resize, 0, 1) { this->client = 0; } diff --git a/cinelerra-5.1/cinelerra/plugindialog.C b/cinelerra-5.1/cinelerra/plugindialog.C index 006cf40e..8e08d2f1 100644 --- a/cinelerra-5.1/cinelerra/plugindialog.C +++ b/cinelerra-5.1/cinelerra/plugindialog.C @@ -128,16 +128,10 @@ PluginDialog::PluginDialog(MWindow *mwindow, const char *window_title, int x, int y) - : BC_Window(window_title, - x, - y, + : BC_Window(window_title, x, y, mwindow->session->plugindialog_w, mwindow->session->plugindialog_h, - 510, - 415, - 1, - 0, - 1) + xS(510), yS(415), 1, 0, 1) { this->mwindow = mwindow; this->thread = thread; @@ -165,6 +159,8 @@ PluginDialog::~PluginDialog() void PluginDialog::create_objects() { + int xs10 = xS(10); + int ys10 = yS(10), ys20 = yS(20); // int use_default = 1; mwindow->theme->get_plugindialog_sizes(); lock_window("PluginDialog::create_objects"); @@ -204,18 +200,14 @@ void PluginDialog::create_objects() module_data.append(new BC_ListBoxItem(track->title)); } - - - - // Create widgets add_subwindow(standalone_title = new BC_Title(mwindow->theme->plugindialog_new_x, - mwindow->theme->plugindialog_new_y - 20, + mwindow->theme->plugindialog_new_y - ys20, _("Plugins:"))); int x1 = mwindow->theme->plugindialog_new_x, y1 = mwindow->theme->plugindialog_new_y; int w1 = mwindow->theme->plugindialog_new_w, h1 = mwindow->theme->plugindialog_new_h; add_subwindow(search_text = new PluginDialogSearchText(this, x1, y1, w1)); - int dy = search_text->get_h() + 10; + int dy = search_text->get_h() + ys10; y1 += dy; h1 -= dy; load_plugin_list(0); @@ -235,7 +227,7 @@ void PluginDialog::create_objects() // add_subwindow(shared_title = new BC_Title(mwindow->theme->plugindialog_shared_x, - mwindow->theme->plugindialog_shared_y - 20, + mwindow->theme->plugindialog_shared_y - ys20, _("Shared effects:"))); add_subwindow(shared_list = new PluginDialogShared(this, &shared_data, @@ -256,7 +248,7 @@ void PluginDialog::create_objects() // add_subwindow(module_title = new BC_Title(mwindow->theme->plugindialog_module_x, - mwindow->theme->plugindialog_module_y - 20, + mwindow->theme->plugindialog_module_y - ys20, _("Shared tracks:"))); add_subwindow(module_list = new PluginDialogModules(this, &module_data, @@ -286,13 +278,10 @@ void PluginDialog::create_objects() if(thread->is_mainmenu) add_subwindow(single_standalone = new PluginDialogSingle(this, - mwindow->theme->plugindialog_new_x + BC_OKButton::calculate_w() + 10, - mwindow->theme->plugindialog_new_y + - mwindow->theme->plugindialog_new_h + + mwindow->theme->plugindialog_new_x + BC_OKButton::calculate_w() + xs10, + mwindow->theme->plugindialog_new_y + mwindow->theme->plugindialog_new_h + get_text_height(MEDIUMFONT))); - - add_subwindow(ok_btn = new BC_OKButton(this)); add_subwindow(can_btn = new BC_CancelButton(this)); int aw = PluginDialogApply::calculate_w(this, _("Apply")); @@ -310,17 +299,17 @@ void PluginDialog::create_objects() int PluginDialog::resize_event(int w, int h) { + int ys10 = yS(10), ys20 = yS(20); mwindow->session->plugindialog_w = w; mwindow->session->plugindialog_h = h; mwindow->theme->get_plugindialog_sizes(); - standalone_title->reposition_window(mwindow->theme->plugindialog_new_x, - mwindow->theme->plugindialog_new_y - 20); + mwindow->theme->plugindialog_new_y - ys20); int x1 = mwindow->theme->plugindialog_new_x, y1 = mwindow->theme->plugindialog_new_y; int w1 = mwindow->theme->plugindialog_new_w, h1 = mwindow->theme->plugindialog_new_h; search_text->reposition_window(x1, y1, w1); - int dy = search_text->get_h() + 10; + int dy = search_text->get_h() + ys10; y1 += dy; h1 -= dy; standalone_list->reposition_window(x1, y1, w1, h1); @@ -332,7 +321,7 @@ int PluginDialog::resize_event(int w, int h) // mwindow->theme->plugindialog_newattach_y); shared_title->reposition_window(mwindow->theme->plugindialog_shared_x, - mwindow->theme->plugindialog_shared_y - 20); + mwindow->theme->plugindialog_shared_y - ys20); shared_list->reposition_window(mwindow->theme->plugindialog_shared_x, mwindow->theme->plugindialog_shared_y, mwindow->theme->plugindialog_shared_w, @@ -349,7 +338,7 @@ int PluginDialog::resize_event(int w, int h) module_title->reposition_window(mwindow->theme->plugindialog_module_x, - mwindow->theme->plugindialog_module_y - 20); + mwindow->theme->plugindialog_module_y - ys20); module_list->reposition_window(mwindow->theme->plugindialog_module_x, mwindow->theme->plugindialog_module_y, mwindow->theme->plugindialog_module_w, @@ -364,7 +353,7 @@ int PluginDialog::resize_event(int w, int h) if(single_standalone) single_standalone->reposition_window( - mwindow->theme->plugindialog_new_x + BC_OKButton::calculate_w() + 10, + mwindow->theme->plugindialog_new_x + BC_OKButton::calculate_w() + ys10, mwindow->theme->plugindialog_new_y + mwindow->theme->plugindialog_new_h + get_text_height(MEDIUMFONT)); @@ -500,7 +489,7 @@ int PluginDialogApply::handle_event() // // PluginDialogTextBox::PluginDialogTextBox(PluginDialog *dialog, char *text, int x, int y) -// : BC_TextBox(x, y, 200, 1, text) +// : BC_TextBox(x, y, xS(200), 1, text) // { // this->dialog = dialog; // } @@ -527,16 +516,6 @@ int PluginDialogApply::handle_event() - - - - - - - - - - PluginDialogNew::PluginDialogNew(PluginDialog *dialog, ArrayList *standalone_data, int x, int y, int w, int h) @@ -599,26 +578,10 @@ int PluginDialogNew::selection_changed() // } - - - - - - - - PluginDialogShared::PluginDialogShared(PluginDialog *dialog, ArrayList *shared_data, - int x, - int y, - int w, - int h) - : BC_ListBox(x, - y, - w, - h, - LISTBOX_TEXT, - shared_data) + int x, int y, int w, int h) + : BC_ListBox(x, y, w, h, LISTBOX_TEXT, shared_data) { this->dialog = dialog; } @@ -690,16 +653,8 @@ int PluginDialogShared::selection_changed() PluginDialogModules::PluginDialogModules(PluginDialog *dialog, ArrayList *module_data, - int x, - int y, - int w, - int h) - : BC_ListBox(x, - y, - w, - h, - LISTBOX_TEXT, - module_data) + int x, int y, int w, int h) + : BC_ListBox(x, y, w, h, LISTBOX_TEXT, module_data) { this->dialog = dialog; } @@ -754,9 +709,7 @@ int PluginDialogSearchText::handle_event() } PluginDialogSingle::PluginDialogSingle(PluginDialog *dialog, int x, int y) - : BC_CheckBox(x, - y, - dialog->thread->single_standalone, + : BC_CheckBox(x, y, dialog->thread->single_standalone, _("Attach single standalone and share others")) { this->dialog = dialog; @@ -802,15 +755,3 @@ int PluginDialogSingle::handle_event() // } // - - - - - - - - - - - - diff --git a/cinelerra-5.1/cinelerra/pluginfclient.C b/cinelerra-5.1/cinelerra/pluginfclient.C index fb0329df..03ad7e25 100644 --- a/cinelerra-5.1/cinelerra/pluginfclient.C +++ b/cinelerra-5.1/cinelerra/pluginfclient.C @@ -285,7 +285,7 @@ int PluginFClientPot::handle_event() } PluginFClientSlider::PluginFClientSlider(PluginFClientWindow *fwin, int x, int y) - : BC_FSlider(x, y, 0, fwin->get_w()-x-20, fwin->get_w()-x-20, 0.f, 0.f, 0.f) + : BC_FSlider(x, y, 0, fwin->get_w()-x-xS(20), fwin->get_w()-x-xS(20), 0.f, 0.f, 0.f) { this->fwin = fwin; } @@ -522,7 +522,7 @@ const char *PluginFClient_Opt::tip() int PluginFClient_OptPanel::update() { const char *cols[] = { "option", "value", }; - const int col1_w = 150; + const int col1_w = xS(150); int wids[] = { col1_w, get_w()-col1_w }; BC_ListBox::update(&items[0], &cols[0], &wids[0], sizeof(items)/sizeof(items[0]), get_xposition(), get_yposition(), get_highlighted_item()); @@ -531,7 +531,7 @@ int PluginFClient_OptPanel::update() PluginFClientWindow::PluginFClientWindow(PluginFClient *ffmpeg) - : PluginClientWindow(ffmpeg->plugin, 600, 300, 600, 300, 1) + : PluginClientWindow(ffmpeg->plugin, xS(600), yS(300), xS(600), yS(300), 1) { this->ffmpeg = ffmpeg; this->selected = 0; @@ -543,41 +543,42 @@ PluginFClientWindow::~PluginFClientWindow() void PluginFClientWindow::create_objects() { + int xs8 = xS(8), xs10 = xS(10), ys10 = yS(10); char string[BCTEXTLEN]; BC_Title *title; - int x = 10, y = 10; + int x = xs10, y = ys10; const char *descr = ffmpeg->config.ffilt->description(); if( !descr ) descr = ffmpeg->config.ffilt->filter_name(); add_subwindow(title = new BC_Title(x, y, descr)); - y += title->get_h() + 10; + y += title->get_h() + ys10; int x0 = x; sprintf(string, _("Type: ")); add_subwindow(title = new BC_Title(x0, y, string)); - x0 += title->get_w() + 8; + x0 += title->get_w() + xs8; add_subwindow(type = new BC_Title(x0, y, (char *)"")); - x0 = x + 150; + x0 = x + xS(150); sprintf(string, _("Range: ")); add_subwindow(title = new BC_Title(x0, y, string)); - x0 += title->get_w() + 8; + x0 += title->get_w() + xs8; add_subwindow(range = new BC_Title(x0, y, (char *)"")); - int x1 = get_w() - BC_GenericButton::calculate_w(this, _("Reset")) - 8; + int x1 = get_w() - BC_GenericButton::calculate_w(this, _("Reset")) - xs8; add_subwindow(reset = new PluginFClientReset(this, x1, y)); - y += title->get_h() + 10; + y += title->get_h() + ys10; x0 = x; - add_subwindow(units = new PluginFClientUnits(this, x0, y, 120)); - x0 += units->get_w() + 8; - x1 = get_w() - BC_GenericButton::calculate_w(this, _("Apply")) - 8; + add_subwindow(units = new PluginFClientUnits(this, x0, y, xS(120))); + x0 += units->get_w() + xs8; + x1 = get_w() - BC_GenericButton::calculate_w(this, _("Apply")) - xs8; add_subwindow(apply = new PluginFClientApply(this, x1, y)); - add_subwindow(text = new PluginFClientText(this, x0, y, x1-x0 - 8)); - y += title->get_h() + 10; + add_subwindow(text = new PluginFClientText(this, x0, y, x1-x0 - xs8)); + y += title->get_h() + ys10; add_subwindow(pot = new PluginFClientPot(this, x, y)); - x1 = x + pot->get_w() + 10; - add_subwindow(slider = new PluginFClientSlider(this, x1, y+10)); - y += pot->get_h() + 10; + x1 = x + pot->get_w() + xs10; + add_subwindow(slider = new PluginFClientSlider(this, x1, y+ys10)); + y += pot->get_h() + ys10; panel_x = x; panel_y = y; - panel_w = get_w()-10 - panel_x; - panel_h = get_h()-10 - panel_y; + panel_w = get_w()-xs10 - panel_x; + panel_h = get_h()-ys10 - panel_y; panel = new PluginFClient_OptPanel(this, panel_x, panel_y, panel_w, panel_h); add_subwindow(panel); panel->create_objects(); @@ -593,21 +594,22 @@ void PluginFClientWindow::draw() int PluginFClientWindow::resize_event(int w, int h) { - int x = get_w() - BC_GenericButton::calculate_w(this, _("Reset")) - 8; + int xs8 = xS(8), xs10 = xS(10), ys10 = yS(10); + int x = get_w() - BC_GenericButton::calculate_w(this, _("Reset")) - xs8; int y = reset->get_y(); reset->reposition_window(x, y); - int x1 = get_w() - BC_GenericButton::calculate_w(this, _("Apply")) - 8; + int x1 = get_w() - BC_GenericButton::calculate_w(this, _("Apply")) - xs8; int y1 = units->get_y(); apply->reposition_window(x1, y1); - int x0 = units->get_x() + units->get_w() + 8; + int x0 = units->get_x() + units->get_w() + xs8; int y0 = units->get_y(); - text->reposition_window(x0,y0, x1-x0-8); - x1 = pot->get_x() + pot->get_w() + 10; - int w1 = w - slider->get_x() - 20; + text->reposition_window(x0,y0, x1-x0-xs8); + x1 = pot->get_x() + pot->get_w() + xs10; + int w1 = w - slider->get_x() - xS(20); slider->set_pointer_motion_range(w1); slider->reposition_window(x1, slider->get_y(), w1, slider->get_h()); - panel_w = get_w()-10 - panel_x; - panel_h = get_h()-10 - panel_y; + panel_w = get_w()-xs10 - panel_x; + panel_h = get_h()-ys10 - panel_y; panel->reposition_window(panel_x,panel_y, panel_w, panel_h); return 1; } diff --git a/cinelerra-5.1/cinelerra/pluginlv2gui.C b/cinelerra-5.1/cinelerra/pluginlv2gui.C index cbd5b67f..05696836 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2gui.C +++ b/cinelerra-5.1/cinelerra/pluginlv2gui.C @@ -151,7 +151,7 @@ void PluginLV2Client_OptPanel::update() vals.append(opt->item_value); } const char *cols[] = { "option", "value", }; - const int col1_w = 150; + const int col1_w = xS(150); int wids[] = { col1_w, get_w()-col1_w }; BC_ListBox::update(&items[0], &cols[0], &wids[0], sizeof(items)/sizeof(items[0]), get_xposition(), get_yposition(), get_highlighted_item()); @@ -174,7 +174,7 @@ int PluginLV2ClientPot::handle_event() } PluginLV2ClientSlider::PluginLV2ClientSlider(PluginLV2ClientWindow *gui, int x, int y) - : BC_FSlider(x, y, 0, gui->get_w()-x-20, gui->get_w()-x-20, 0.f, 0.f, 0.f) + : BC_FSlider(x, y, 0, gui->get_w()-x-xS(20), gui->get_w()-x-xS(20), 0.f, 0.f, 0.f) { this->gui = gui; } @@ -190,7 +190,7 @@ int PluginLV2ClientSlider::handle_event() } PluginLV2ClientWindow::PluginLV2ClientWindow(PluginLV2Client *client) - : PluginClientWindow(client, 500, 300, 500, 300, 1) + : PluginClientWindow(client, xS(500), yS(300), xS(500), yS(300), 1) { this->client = client; selected = 0; @@ -211,31 +211,32 @@ PluginLV2ClientWindow::~PluginLV2ClientWindow() void PluginLV2ClientWindow::create_objects() { BC_Title *title; - int x = 10, y = 10, x1; + int xs8 = xS(8), xs10 = xS(10), ys10 = yS(10); + int x = xs10, y = ys10, x1; add_subwindow(title = new BC_Title(x, y, client->title)); - x1 = get_w() - BC_GenericButton::calculate_w(this, _("UI")) - 8; + x1 = get_w() - BC_GenericButton::calculate_w(this, _("UI")) - xs8; add_subwindow(client_ui = new PluginLV2ClientUI(this, x1, y)); - y += title->get_h() + 10; + y += title->get_h() + ys10; add_subwindow(varbl = new BC_Title(x, y, "")); - add_subwindow(range = new BC_Title(x+160, y, "")); - x1 = get_w() - BC_GenericButton::calculate_w(this, _("Reset")) - 8; + add_subwindow(range = new BC_Title(x+xS(160), y, "")); + x1 = get_w() - BC_GenericButton::calculate_w(this, _("Reset")) - xs8; add_subwindow(reset = new PluginLV2ClientReset(this, x1, y)); - y += title->get_h() + 10; - x1 = get_w() - BC_GenericButton::calculate_w(this, _("Apply")) - 8; + y += title->get_h() + ys10; + x1 = get_w() - BC_GenericButton::calculate_w(this, _("Apply")) - xs8; add_subwindow(apply = new PluginLV2ClientApply(this, x1, y)); - add_subwindow(text = new PluginLV2ClientText(this, x, y, x1-x - 8)); - y += title->get_h() + 10; + add_subwindow(text = new PluginLV2ClientText(this, x, y, x1-x - xs8)); + y += title->get_h() + ys10; add_subwindow(pot = new PluginLV2ClientPot(this, x, y)); - x1 = x + pot->get_w() + 10; - add_subwindow(slider = new PluginLV2ClientSlider(this, x1, y+10)); - y += pot->get_h() + 10; + x1 = x + pot->get_w() + xs10; + add_subwindow(slider = new PluginLV2ClientSlider(this, x1, y+ys10)); + y += pot->get_h() + ys10; client->load_configuration(); client->config.update(); int panel_x = x, panel_y = y; - int panel_w = get_w()-10 - panel_x; - int panel_h = get_h()-10 - panel_y; + int panel_w = get_w()-xs10 - panel_x; + int panel_h = get_h()-ys10 - panel_y; panel = new PluginLV2Client_OptPanel(this, panel_x, panel_y, panel_w, panel_h); add_subwindow(panel); panel->update(); @@ -251,19 +252,20 @@ void PluginLV2ClientWindow::create_objects() int PluginLV2ClientWindow::resize_event(int w, int h) { int x1; - x1 = w - client_ui->get_w() - 8; + int xs8 = xS(8), xs10 = xS(10), ys10 = yS(10); + x1 = w - client_ui->get_w() - xs8; client_ui->reposition_window(x1, client_ui->get_y()); - x1 = w - reset->get_w() - 8; + x1 = w - reset->get_w() - xs8; reset->reposition_window(x1, reset->get_y()); - x1 = w - apply->get_w() - 8; + x1 = w - apply->get_w() - xs8; apply->reposition_window(x1, apply->get_y()); - text->reposition_window(text->get_x(), text->get_y(), x1-text->get_x() - 8); - x1 = pot->get_x() + pot->get_w() + 10; - int w1 = w - slider->get_x() - 20; + text->reposition_window(text->get_x(), text->get_y(), x1-text->get_x() - xs8); + x1 = pot->get_x() + pot->get_w() + xs10; + int w1 = w - slider->get_x() - xS(20); slider->set_pointer_motion_range(w1); slider->reposition_window(x1, slider->get_y(), w1, slider->get_h()); int panel_x = panel->get_x(), panel_y = panel->get_y(); - panel->reposition_window(panel_x, panel_y, w-10-panel_x, h-10-panel_y); + panel->reposition_window(panel_x, panel_y, w-xs10-panel_x, h-ys10-panel_y); return 1; } diff --git a/cinelerra-5.1/cinelerra/pluginprefs.C b/cinelerra-5.1/cinelerra/pluginprefs.C index 6e09c208..2a3f7878 100644 --- a/cinelerra-5.1/cinelerra/pluginprefs.C +++ b/cinelerra-5.1/cinelerra/pluginprefs.C @@ -46,7 +46,9 @@ PluginPrefs::~PluginPrefs() void PluginPrefs::create_objects() { char string[1024]; - int x = 5, y = 5; + int xs5 = xS(5), xs10 = xS(10), xs20 = xS(20), xs30 = xS(30); + int ys5 = yS(5), ys10 = yS(10), ys20 = yS(20), ys30 = yS(30); + int x = xs5, y = ys5; // add_border(get_resources()->get_bg_shadow1(), // get_resources()->get_bg_shadow2(), @@ -55,32 +57,24 @@ void PluginPrefs::create_objects() // get_resources()->get_bg_light1()); add_subwindow(new BC_Title(x, y, _("Plugin Set"), LARGEFONT, BLACK)); - y += 35; + y += ys35; add_subwindow(new BC_Title(x, y, _("Look for global plugins here"), MEDIUMFONT, BLACK)); - y += 20; - add_subwindow(ipathtext = new PluginGlobalPathText(x, y, pwindow, pwindow->thread->preferences->global_plugin_dir)); - add_subwindow(ipath = new BrowseButton(mwindow, - this, - ipathtext, - 215, - y, - pwindow->thread->preferences->global_plugin_dir, - _("Global Plugin Path"), - _("Select the directory for plugins"), + y += ys20; + add_subwindow(ipathtext = new PluginGlobalPathText(x, y, + pwindow, pwindow->thread->preferences->global_plugin_dir)); + add_subwindow(ipath = new BrowseButton(mwindow, this, ipathtext, + xS(215), y, pwindow->thread->preferences->global_plugin_dir, + _("Global Plugin Path"), _("Select the directory for plugins"), 1)); y += 35; add_subwindow(new BC_Title(x, y, _("Look for personal plugins here"), MEDIUMFONT, BLACK)); y += 20; - add_subwindow(lpathtext = new PluginLocalPathText(x, y, pwindow, pwindow->thread->preferences->local_plugin_dir)); - add_subwindow(lpath = new BrowseButton(mwindow, - this, - lpathtext, - 215, - y, - pwindow->thread->preferences->local_plugin_dir, - _("Personal Plugin Path"), - _("Select the directory for plugins"), + add_subwindow(lpathtext = new PluginLocalPathText(x, y, + pwindow, pwindow->thread->preferences->local_plugin_dir)); + add_subwindow(lpath = new BrowseButton(mwindow, this, lpathtext, + xS(215), y, pwindow->thread->preferences->local_plugin_dir, + _("Personal Plugin Path"), _("Select the directory for plugins"), 1)); } @@ -89,7 +83,7 @@ void PluginPrefs::create_objects() PluginGlobalPathText::PluginGlobalPathText(int x, int y, PreferencesWindow *pwindow, char *text) - : BC_TextBox(x, y, 200, 1, text) + : BC_TextBox(x, y, xS(200), 1, text) { this->pwindow = pwindow; } @@ -106,7 +100,7 @@ int PluginGlobalPathText::handle_event() PluginLocalPathText::PluginLocalPathText(int x, int y, PreferencesWindow *pwindow, char *text) - : BC_TextBox(x, y, 200, 1, text) + : BC_TextBox(x, y, xs(200), 1, text) { this->pwindow = pwindow; } diff --git a/cinelerra-5.1/cinelerra/preferencesthread.C b/cinelerra-5.1/cinelerra/preferencesthread.C index 73d8d5d4..2e908926 100644 --- a/cinelerra-5.1/cinelerra/preferencesthread.C +++ b/cinelerra-5.1/cinelerra/preferencesthread.C @@ -64,8 +64,8 @@ -#define WIDTH 860 -#define HEIGHT 700 +#define WIDTH xS(860) +#define HEIGHT yS(700) PreferencesMenuitem::PreferencesMenuitem(MWindow *mwindow) @@ -125,7 +125,7 @@ BC_Window* PreferencesThread::new_gui() //int need_new_indexes = 0; rerender = 0; - mwindow->gui->lock_window("NewThread::new_gui"); + mwindow->gui->lock_window("NewThread::new_gui"); int scr_x = mwindow->gui->get_screen_x(0, -1); int scr_w = mwindow->gui->get_screen_w(0, -1); int scr_h = mwindow->gui->get_screen_h(0, -1); @@ -406,12 +406,6 @@ SET_TRACE } - - - - - - PreferencesWindow::PreferencesWindow(MWindow *mwindow, PreferencesThread *thread, int x, int y, int w, int h) : BC_Window(_(PROGRAM_NAME ": Preferences"), x,y, w,h,w,h, 1) @@ -586,15 +580,6 @@ int PreferencesWindow::set_current_dialog(int number) } - - - - - - - - - PreferencesButton::PreferencesButton(MWindow *mwindow, PreferencesThread *thread, int x, @@ -616,19 +601,11 @@ int PreferencesButton::handle_event() } - - - - - - - PreferencesDialog::PreferencesDialog(MWindow *mwindow, PreferencesWindow *pwindow) - : BC_SubWindow(10, - 40, - pwindow->get_w() - 20, - pwindow->get_h() - BC_GenericButton::calculate_h() - 10 - 40) + : BC_SubWindow(xS(10), yS(40), + pwindow->get_w() - xS(20), + pwindow->get_h() - BC_GenericButton::calculate_h() - yS(10 + 40)) { this->pwindow = pwindow; this->mwindow = mwindow; @@ -639,14 +616,12 @@ PreferencesDialog::~PreferencesDialog() { } -// ============================== category window - - +// ============================== category window PreferencesApply::PreferencesApply(MWindow *mwindow, PreferencesThread *thread) : BC_GenericButton(thread->window->get_w() / 2 - BC_GenericButton::calculate_w(thread->window, _("Apply")) / 2, - thread->window->get_h() - BC_GenericButton::calculate_h() - 10, + thread->window->get_h() - BC_GenericButton::calculate_h() - yS(10), _("Apply")) { this->mwindow = mwindow; @@ -660,16 +635,14 @@ int PreferencesApply::handle_event() } int PreferencesApply::resize_event(int w, int h) { - reposition_window(w/2 - get_w()/2, h-get_h()-10); + reposition_window(w/2 - get_w()/2, h-get_h()-yS(10)); return 1; } - - PreferencesOK::PreferencesOK(MWindow *mwindow, PreferencesThread *thread) - : BC_GenericButton(10, - thread->window->get_h() - BC_GenericButton::calculate_h() - 10, + : BC_GenericButton(xS(10), + thread->window->get_h() - BC_GenericButton::calculate_h() - yS(10), _("OK")) { this->mwindow = mwindow; @@ -691,16 +664,15 @@ int PreferencesOK::handle_event() } int PreferencesOK::resize_event(int w, int h) { - reposition_window(10, h-get_h()-10); + reposition_window(xS(10), h-get_h()-yS(10)); return 1; } - PreferencesCancel::PreferencesCancel(MWindow *mwindow, PreferencesThread *thread) - : BC_GenericButton(thread->window->get_w() - BC_GenericButton::calculate_w(thread->window, _("Cancel")) - 10, - thread->window->get_h() - BC_GenericButton::calculate_h() - 10, - _("Cancel")) + : BC_GenericButton(thread->window->get_w() - BC_GenericButton::calculate_w(thread->window, _("Cancel")) - xS(10), + thread->window->get_h() - BC_GenericButton::calculate_h() - yS(10), + _("Cancel")) { this->mwindow = mwindow; this->thread = thread; @@ -721,27 +693,16 @@ int PreferencesCancel::handle_event() } int PreferencesCancel::resize_event(int w, int h) { - reposition_window(w-get_w()-10, h-get_h()-10); + reposition_window(w-get_w()-xS(10), h-get_h()-yS(10)); return 1; } - - - - - - - - PreferencesCategory::PreferencesCategory(MWindow *mwindow, PreferencesThread *thread, int x, int y) : BC_PopupTextBox(thread->window, &thread->window->categories, thread->category_to_text(thread->current_dialog), - x, - y, - 200, - 150) + x, y, xS(200), yS(150)) { this->mwindow = mwindow; this->thread = thread; diff --git a/cinelerra-5.1/cinelerra/presetsgui.C.sav b/cinelerra-5.1/cinelerra/presetsgui.C.sav index b97621a8..48abf86f 100644 --- a/cinelerra-5.1/cinelerra/presetsgui.C.sav +++ b/cinelerra-5.1/cinelerra/presetsgui.C.sav @@ -415,15 +415,10 @@ PresetsWindow::PresetsWindow(MWindow *mwindow, int y, char *title_string) : BC_Window(title_string, - x, - y, + x, y, mwindow->session->presetdialog_w, mwindow->session->presetdialog_h, - 320, - 240, - 1, - 0, - 1) + xS(320), yS(240), 1, 0, 1) { this->mwindow = mwindow; this->thread = thread; diff --git a/cinelerra-5.1/cinelerra/presetsgui.C.sav1 b/cinelerra-5.1/cinelerra/presetsgui.C.sav1 index b3ad7ed8..43c4c39e 100644 --- a/cinelerra-5.1/cinelerra/presetsgui.C.sav1 +++ b/cinelerra-5.1/cinelerra/presetsgui.C.sav1 @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #if 0 @@ -102,14 +102,14 @@ void PresetsThread::start_window(Plugin *plugin) BC_Window* PresetsThread::new_gui() { mwindow->gui->lock_window("PresetsThread::new_gui"); - int x = mwindow->gui->get_abs_cursor_x(0) - + int x = mwindow->gui->get_abs_cursor_x(0) - mwindow->session->plugindialog_w / 2; - int y = mwindow->gui->get_abs_cursor_y(0) - + int y = mwindow->gui->get_abs_cursor_y(0) - mwindow->session->plugindialog_h / 2; - PresetsWindow *window = new PresetsWindow(mwindow, - this, - x, + PresetsWindow *window = new PresetsWindow(mwindow, + this, + x, y, window_title); @@ -150,7 +150,7 @@ void PresetsThread::save_preset(char *title) EDL *edl = mwindow->edl; Track *track = plugin->track; KeyFrame *keyframe = plugin->get_prev_keyframe( - track->to_units(edl->local_session->get_selectionstart(1), 0), + track->to_units(edl->local_session->get_selectionstart(1), 0), PLAY_FORWARD); // Send to database @@ -215,7 +215,7 @@ void PresetsThread::apply_preset(char *title) KeyFrame *keyframe = plugin->get_keyframe(); presets_db->load_preset(plugin_title, title, keyframe); mwindow->save_backup(); - mwindow->undo->update_undo_after(_("apply preset"), LOAD_AUTOMATION); + mwindow->undo->update_undo_after(_("apply preset"), LOAD_AUTOMATION); mwindow->update_plugin_guis(); mwindow->gui->canvas->draw_overlays(); @@ -235,11 +235,11 @@ PresetsList::PresetsList(PresetsThread *thread, PresetsWindow *window, int x, int y, - int w, + int w, int h) - : BC_ListBox(x, - y, - w, + : BC_ListBox(x, + y, + w, h, LISTBOX_TEXT, thread->data) @@ -275,10 +275,10 @@ PresetsText::PresetsText(PresetsThread *thread, int x, int y, int w) - : BC_TextBox(x, - y, - w, - 1, + : BC_TextBox(x, + y, + w, + 1, "") { this->thread = thread; @@ -382,7 +382,7 @@ int PresetsOK::keypress_event() if(get_keypress() == RETURN) { printf("PresetsOK::keypress_event %d\n", __LINE__); - if(thread->presets_db->preset_exists(thread->plugin_title, + if(thread->presets_db->preset_exists(thread->plugin_title, window->title_text->get_text())) { printf("PresetsOK::keypress_event %d\n", __LINE__); @@ -413,16 +413,11 @@ PresetsWindow::PresetsWindow(MWindow *mwindow, int x, int y, char *title_string) - : BC_Window(title_string, - x, - y, - mwindow->session->presetdialog_w, - mwindow->session->presetdialog_h, - 320, - 240, - 1, - 0, - 1) + : BC_Window(title_string, + x, y, + mwindow->session->presetdialog_w, + mwindow->session->presetdialog_h, + xS(320), yS(240), 1, 0, 1) { this->mwindow = mwindow; this->thread = thread; @@ -442,7 +437,7 @@ void PresetsWindow::create_objects() this, theme->presets_list_x, theme->presets_list_y, - theme->presets_list_w, + theme->presets_list_w, theme->presets_list_h)); add_subwindow(title2 = new BC_Title(theme->presets_text_x, theme->presets_text_y - BC_Title::calculate_h(this, "P") - theme->widget_border, @@ -485,7 +480,7 @@ int PresetsWindow::resize_event(int w, int h) theme->presets_text_y - BC_Title::calculate_h(this, "P") - theme->widget_border); list->reposition_window(theme->presets_list_x, theme->presets_list_y, - theme->presets_list_w, + theme->presets_list_w, theme->presets_list_h); title_text->reposition_window(theme->presets_text_x, theme->presets_text_y, diff --git a/cinelerra-5.1/cinelerra/probeprefs.C b/cinelerra-5.1/cinelerra/probeprefs.C index 57472372..47460c7e 100644 --- a/cinelerra-5.1/cinelerra/probeprefs.C +++ b/cinelerra-5.1/cinelerra/probeprefs.C @@ -50,7 +50,7 @@ void FileProbeDialog::handle_close_event(int result) ProbeEditWindow::ProbeEditWindow(FileProbeDialog *pb_dialog, int x, int y) - : BC_Window(_(PROGRAM_NAME ": Probes"), x, y, 300, 200, 300, 200, 0, 0, 1) + : BC_Window(_(PROGRAM_NAME ": Probes"), x, y, xS(300), yS(200), xS(300), yS(200), 0, 0, 1) { this->pb_dialog = pb_dialog; probe_list = 0; @@ -69,6 +69,7 @@ ProbeEditWindow::~ProbeEditWindow() void ProbeEditWindow::create_objects() { + int xs10 = xS(10), ys10 = yS(10); lock_window("ProbeEditWindow::create_objects"); pb_enabled = new BC_Pixmap(this, BC_WindowBase::get_resources()->listbox_up, @@ -80,14 +81,14 @@ void ProbeEditWindow::create_objects() for( int i=0; ifile_probes.size(); ++i ) { probe_items.append(new ProbePrefItem(this, preferences->file_probes[i])); } - int x = 10, y = 10; + int x = xs10, y = ys10; add_subwindow(probe_list = new ProbePrefList(this, x, y)); y += probe_list->get_h(); int x1 = x, y1 = y; add_subwindow(probe_up_button = new ProbeUpButton(this, x1, y1)); - x1 += probe_up_button->get_w() + 10; + x1 += probe_up_button->get_w() + xs10; add_subwindow(probe_down_button = new ProbeDownButton(this, x1, y1)); - x1 += probe_down_button->get_w() + 10; + x1 += probe_down_button->get_w() + xs10; add_subwindow(probe_enabled = new ProbeEnabled(this, x1, y1)); probe_enabled->disable(); @@ -232,8 +233,9 @@ void ProbePrefItem::set_armed(int armed) } ProbePrefList::ProbePrefList(ProbeEditWindow *pb_window, int x, int y) - : BC_ListBox(x, y, pb_window->get_w()-x-10, pb_window->get_h()-y-80, LISTBOX_ICON_LIST, - (ArrayList*) &pb_window->probe_items, 0, 0) + : BC_ListBox(x, y, pb_window->get_w()-x-xS(10), pb_window->get_h()-y-yS(80), + LISTBOX_ICON_LIST, (ArrayList*) &pb_window->probe_items, + 0, 0) { this->pb_window = pb_window; } diff --git a/cinelerra-5.1/cinelerra/proxy.C b/cinelerra-5.1/cinelerra/proxy.C index a0f5fa72..94b51270 100644 --- a/cinelerra-5.1/cinelerra/proxy.C +++ b/cinelerra-5.1/cinelerra/proxy.C @@ -47,8 +47,8 @@ #include "transportque.h" #include "vrender.h" -#define WIDTH 400 -#define HEIGHT 330 +#define WIDTH xS(400) +#define HEIGHT yS(330) #define MAX_SCALE 16 ProxyMenuItem::ProxyMenuItem(MWindow *mwindow) @@ -388,7 +388,7 @@ void ProxyWindow::create_objects() } int x = margin; - int y = margin+10; + int y = margin+yS(10); add_subwindow(use_scaler = new ProxyUseScaler(this, x, y)); y += use_scaler->get_h() + margin; @@ -396,7 +396,7 @@ void ProxyWindow::create_objects() add_subwindow(text = new BC_Title(x, y, _("Scale factor:"))); x += text->get_w() + margin; - int popupmenu_w = BC_PopupMenu::calculate_w(get_text_width(MEDIUMFONT, dialog->size_text[0])+15); + int popupmenu_w = BC_PopupMenu::calculate_w(get_text_width(MEDIUMFONT, dialog->size_text[0])+xS(15)); add_subwindow(scale_factor = new ProxyMenu(mwindow, this, x, y, popupmenu_w, "")); scale_factor->update_sizes(); x += scale_factor->get_w() + margin; @@ -417,7 +417,7 @@ void ProxyWindow::create_objects() add_subwindow(active_scale = new BC_Title(x, y, "")); y += active_scale->get_h() + margin; - x = margin; y += 25; + x = margin; y += yS(25); format_tools = new ProxyFormatTools(mwindow, this, dialog->asset); format_tools->create_objects(x, y, 0, 1, 0, 0, 0, 1, 0, 1, // skip the path 0, 0); diff --git a/cinelerra-5.1/cinelerra/question.C b/cinelerra-5.1/cinelerra/question.C index 43130fca..e89b9c0f 100644 --- a/cinelerra-5.1/cinelerra/question.C +++ b/cinelerra-5.1/cinelerra/question.C @@ -27,15 +27,14 @@ #include "ctype.h" -#define WIDTH 375 -#define HEIGHT 160 +#define WIDTH xS(375) +#define HEIGHT yS(160) QuestionWindow::QuestionWindow(MWindow *mwindow) : BC_Window(_(PROGRAM_NAME ": Question"), mwindow->gui->get_abs_cursor_x(1) - WIDTH / 2, mwindow->gui->get_abs_cursor_y(1) - HEIGHT / 2, - WIDTH, - HEIGHT) + WIDTH, HEIGHT) { this->mwindow = mwindow; } @@ -47,13 +46,13 @@ QuestionWindow::~QuestionWindow() void QuestionWindow::create_objects(const char *string, int use_cancel) { lock_window("QuestionWindow::create_objects"); - int x = 10, y = 10; - add_subwindow(new BC_Title(10, 10, string)); - y += 30; + int x = xS(10), y = yS(10); + add_subwindow(new BC_Title(x, y, string)); + y += yS(30); add_subwindow(new QuestionYesButton(mwindow, this, x, y)); x += get_w() / 2; add_subwindow(new QuestionNoButton(mwindow, this, x, y)); - x = get_w() - 100; + x = get_w() - xS(100); if(use_cancel) add_subwindow(new BC_CancelButton(x, y)); unlock_window(); } diff --git a/cinelerra-5.1/cinelerra/recconfirmdelete.C b/cinelerra-5.1/cinelerra/recconfirmdelete.C index 987b7717..1ffbbc10 100644 --- a/cinelerra-5.1/cinelerra/recconfirmdelete.C +++ b/cinelerra-5.1/cinelerra/recconfirmdelete.C @@ -32,9 +32,9 @@ RecConfirmDelete::RecConfirmDelete(MWindow *mwindow) : BC_Window(_(PROGRAM_NAME ": Confirm"), - mwindow->gui->get_abs_cursor_x(1), + mwindow->gui->get_abs_cursor_x(1), mwindow->gui->get_abs_cursor_y(1), - 320, 100) + xS(320), yS(100)) { } @@ -46,12 +46,12 @@ void RecConfirmDelete::create_objects(char *string) { lock_window("RecConfirmDelete::create_objects"); char string2[256]; - int x = 10, y = 10; + int x = xS(10), y = yS(10); sprintf(string2, _("Delete this file and %s?"), string); add_subwindow(new BC_Title(x, y, string2)); - y += 30; + y += yS(30); add_subwindow(new BC_OKButton(x, y)); - x = get_w() - 100; + x = get_w() - xS(100); add_subwindow(new BC_CancelButton(x, y)); unlock_window(); } diff --git a/cinelerra-5.1/cinelerra/recordgui.C b/cinelerra-5.1/cinelerra/recordgui.C index 8386cfc6..1f5b3921 100644 --- a/cinelerra-5.1/cinelerra/recordgui.C +++ b/cinelerra-5.1/cinelerra/recordgui.C @@ -60,9 +60,9 @@ RecordGUI::RecordGUI(MWindow *mwindow, Record *record) : BC_Window(_(PROGRAM_NAME ": Recording"), - mwindow->session->rwindow_x, mwindow->session->rwindow_y, + mwindow->session->rwindow_x, mwindow->session->rwindow_y, mwindow->session->rwindow_w, mwindow->session->rwindow_h, - 10, 10, 1, 0, 1) + xS(10), yS(10), 1, 0, 1) { this->mwindow = mwindow; this->record = record; @@ -72,7 +72,7 @@ RecordGUI::RecordGUI(MWindow *mwindow, Record *record) prev_label_title = 0; frames_behind = 0; frames_dropped = 0; - framerate = 0; + framerate = 0; samples_clipped = 0; cron_status = 0; batch_bay = 0; @@ -131,6 +131,8 @@ RecordGUI::~RecordGUI() void RecordGUI::create_objects() { + int xs5 = xS(5), xs10 = xS(10), xs20 = xS(20), xs30 = xS(30); + int ys5 = yS(5), ys10 = yS(10); char string[BCTEXTLEN]; flash_color = RED; Asset *asset = record->default_asset; @@ -143,12 +145,12 @@ void RecordGUI::create_objects() //printf("RecordGUI::create_objects 1\n"); mwindow->theme->draw_rwindow_bg(this); - int x = 10; - int y = 10; + int x = xs10; + int y = ys10; int x1 = 0; BC_Title *title; int pad = max(BC_TextBox::calculate_h(this, MEDIUMFONT, 1, 1), - BC_Title::calculate_h(this, "X")) + 5; + BC_Title::calculate_h(this, "X")) + ys5; int button_y = 0; // Current batch @@ -176,8 +178,8 @@ void RecordGUI::create_objects() int x2 = 0; - y = 10; - x = x1 + 20; + y = ys10; + x = x1 + xs20; add_subwindow(batch_path = new RecordPath(this, x, y)); add_subwindow(batch_browse = new BrowseButton(mwindow->theme, this, @@ -202,7 +204,7 @@ void RecordGUI::create_objects() batch_source->create_objects(); x2 = max(x2, batch_source->get_w()); y += pad; - batch_mode = new RecordGUIModeMenu(this, x, y, 200, ""); + batch_mode = new RecordGUIModeMenu(this, x, y, xS(200), ""); batch_mode->create_objects(); x2 = max(x2, batch_mode->get_w()); y += pad; @@ -215,10 +217,10 @@ void RecordGUI::create_objects() // Compression settings - x = x2 + x1 + 30; - y = 10; + x = x2 + x1 + xs30; + y = ys10; int x3 = 0; - pad = BC_Title::calculate_h(this, "X") + 5; + pad = BC_Title::calculate_h(this, "X") + ys5; add_subwindow(title = new BC_Title(x, y, _("Format:"))); x3 = max(title->get_w(), x3); y += pad; @@ -260,8 +262,8 @@ void RecordGUI::create_objects() y += pad; button_y = max(y, button_y); - y = 10; - x = x3 + x2 + x1 + 40; + y = ys10; + x = x3 + x2 + x1 + xS(40); add_subwindow(new BC_Title(x, y, File::formattostr(asset->format), @@ -321,16 +323,16 @@ void RecordGUI::create_objects() _("None"), MEDIUMFONT, mwindow->theme->recordgui_variable_color)); - y += pad + 10; + y += pad + ys10; button_y = max(y, button_y); // Buttons - x = 10; + x = xs10; y = button_y; add_subwindow(title = new BC_Title(x,y, _("Batches:"))); int y_max = y + title->get_h(); x1 = x; - x += title->get_w() + 5; + x += title->get_w() + xs5; add_subwindow(activate_batch = new RecordGUIActivateBatch(this, x, y)); x += activate_batch->get_w(); y_max = max(y_max, y + activate_batch->get_h()); @@ -343,10 +345,10 @@ void RecordGUI::create_objects() add_subwindow(label_button = new RecordGUILabel(this, x, y)); y_max = max(y_max, y + label_button->get_h()); - int y1 = y_max, y2 = y1 + 5; + int y1 = y_max, y2 = y1 + ys5; add_subwindow(title = new BC_Title(x1,y2, _("Cron:"))); y_max = max(y_max, y2 + title->get_h()); - x1 += title->get_w() + 5; + x1 += title->get_w() + xs5; add_subwindow(cron_status = new BC_Title(x1,y2, _("Idle"), MEDIUMFONT, mwindow->theme->recordgui_variable_color)); y_max = max(y_max, y2 + cron_status->get_h()); @@ -357,9 +359,9 @@ void RecordGUI::create_objects() add_subwindow(clrlbls_button = new RecordGUIClearLabels(this, x4, y1)); y_max = max(y_max, y1 + clrlbls_button->get_h()); - x = x1 = 10; + x = x1 = xs10; y = y_max + pad; - y1 = y + pad + 5; + y1 = y + pad + ys5; fill_frames = 0; monitor_video = 0; @@ -368,37 +370,37 @@ void RecordGUI::create_objects() if(asset->video_data) { add_subwindow(drop_frames = new RecordGUIDropFrames(this, x, y)); add_subwindow(fill_frames = new RecordGUIFillFrames(this, x, y1)); - x += drop_frames->get_w() + 5; x1 = x; + x += drop_frames->get_w() + xs5; x1 = x; add_subwindow(monitor_video = new RecordGUIMonitorVideo(this, x, y)); - x += monitor_video->get_w() + 5; + x += monitor_video->get_w() + xs5; } if(asset->audio_data) { add_subwindow(monitor_audio = new RecordGUIMonitorAudio(this, x, y)); - x += monitor_audio->get_w() + 5; + x += monitor_audio->get_w() + xs5; add_subwindow(meter_audio = new RecordGUIAudioMeters(this, x, y)); - x += meter_audio->get_w() + 5; + x += meter_audio->get_w() + xs5; } add_subwindow(power_off = new RecordGUIPowerOff(this, x1, y1)); - x1 += power_off->get_w() + 10; + x1 += power_off->get_w() + xs10; add_subwindow(commercial_check = new RecordGUICommCheck(this, x1, y1)); // Batches - x = 10; - y += 5; + x = xs10; + y += ys5; if( fill_frames ) y = y1 + fill_frames->get_h(); else if( monitor_audio ) y += monitor_audio->get_h(); int bottom_margin = max(BC_OKButton::calculate_h(), - LoadMode::calculate_h(this, mwindow->theme)) + 5; + LoadMode::calculate_h(this, mwindow->theme)) + ys5; add_subwindow(batch_bay = new RecordGUIBatches(this, x, y, - get_w() - 20, get_h() - y - bottom_margin - 10)); - y += batch_bay->get_h() + 5; + get_w() - xs20, get_h() - y - bottom_margin - ys10)); + y += batch_bay->get_h() + ys5; record->record_batches.gui = batch_bay; batch_bay->update_batches(-1); @@ -407,7 +409,7 @@ void RecordGUI::create_objects() load_mode = new LoadMode(mwindow, this, get_w() / 2 - loadmode_w / 2, y, &record->load_mode); load_mode->create_objects(); - y += load_mode->get_h() + 5; + y += load_mode->get_h() + ys5; add_subwindow(new RecordGUIOK(this)); @@ -463,6 +465,7 @@ int RecordGUI::translation_event() int RecordGUI::resize_event(int w, int h) { + int xs20 = xS(20), ys10 = yS(10); // Recompute batch list based on previous extents int bottom_margin = mwindow->session->rwindow_h - batch_bay->get_y() - @@ -476,10 +479,10 @@ int RecordGUI::resize_event(int w, int h) mwindow->theme->draw_rwindow_bg(this); int new_h = mwindow->session->rwindow_h - bottom_margin - batch_bay->get_y(); - if(new_h < 10) new_h = 10; + if(new_h < ys10) new_h = ys10; batch_bay->reposition_window(batch_bay->get_x(), batch_bay->get_y(), - mwindow->session->rwindow_w - 20, + mwindow->session->rwindow_w - xs20, mwindow->session->rwindow_h - bottom_margin - batch_bay->get_y()); load_mode->reposition_window(mwindow->session->rwindow_w / 2 - @@ -558,8 +561,8 @@ int RecordGUIBatches::selection_changed() RecordGUISave::RecordGUISave(RecordGUI *gui) - : BC_Button(10, - gui->get_h() - BC_WindowBase::get_resources()->ok_images[0]->get_h() - 10, + : BC_Button(xS(10), + gui->get_h() - BC_WindowBase::get_resources()->ok_images[0]->get_h() - yS(10), BC_WindowBase::get_resources()->ok_images) { set_tooltip(_("Save the recording and quit.")); @@ -1292,7 +1295,7 @@ int RecordGUIModeTextBox::handle_event() RecordGUIModeListBox::RecordGUIModeListBox(RecordGUIModeMenu *mode_menu) : BC_ListBox(mode_menu->textbox->get_x() + mode_menu->textbox->get_w(), - mode_menu->textbox->get_y(), 100, 50, LISTBOX_TEXT, + mode_menu->textbox->get_y(), xS(100), yS(50), LISTBOX_TEXT, &mode_menu->modes, 0, 0, 1, 0, 1) { this->mode_menu = mode_menu; @@ -1555,7 +1558,7 @@ void RecordGUIFlash::run() RecordGUIDCOffset::RecordGUIDCOffset(MWindow *mwindow, int y) - : BC_Button(230, y, mwindow->theme->calibrate_data) + : BC_Button(xS(230), y, mwindow->theme->calibrate_data) { } @@ -1569,7 +1572,7 @@ int RecordGUIDCOffset::handle_event() int RecordGUIDCOffset::keypress_event() { return 0; } RecordGUIDCOffsetText::RecordGUIDCOffsetText(char *text, int y, int number) - : BC_TextBox(30, y+1, 67, 1, text, 0) + : BC_TextBox(xS(30), y+yS(1), xS(67), 1, text, 0) { this->number = number; } @@ -1584,7 +1587,7 @@ int RecordGUIDCOffsetText::handle_event() } RecordGUIReset::RecordGUIReset(MWindow *mwindow, RecordGUI *gui, int y) - : BC_Button(400, y, mwindow->theme->over_button) + : BC_Button(xS(400), y, mwindow->theme->over_button) { this->gui = gui; } RecordGUIReset::~RecordGUIReset() @@ -1597,7 +1600,7 @@ int RecordGUIReset::handle_event() } RecordGUIResetTranslation::RecordGUIResetTranslation(MWindow *mwindow, RecordGUI *gui, int y) - : BC_Button(250, y, mwindow->theme->reset_data) + : BC_Button(xS(250), y, mwindow->theme->reset_data) { this->gui = gui; } diff --git a/cinelerra-5.1/cinelerra/recordmonitor.C b/cinelerra-5.1/cinelerra/recordmonitor.C index 2fb3a098..d8302adc 100644 --- a/cinelerra-5.1/cinelerra/recordmonitor.C +++ b/cinelerra-5.1/cinelerra/recordmonitor.C @@ -77,7 +77,7 @@ RecordMonitor::~RecordMonitor() void RecordMonitor::create_objects() { - int min_w = 150; + int min_w = xS(150); if( !record->default_asset->video_data ) min_w = MeterPanel::get_meters_width(mwindow->theme, @@ -169,12 +169,12 @@ int RecordMonitor::get_canvas_height() int RecordMonitor::get_channel_x() { // return 240; - return 5; + return xS(5); } int RecordMonitor::get_channel_y() { - return 2; + return yS(2); } void RecordMonitor::stop_playback() @@ -236,7 +236,7 @@ RecordMonitorGUI::RecordMonitorGUI(MWindow *mwindow, mwindow->session->rmonitor_y, mwindow->session->rmonitor_w, mwindow->session->rmonitor_h, - min_w, 50, 1, 1, 1, -1, + min_w, yS(50), 1, 1, 1, -1, mwindow->get_cwindow_display()) { //printf("%d %d\n", mwindow->session->rmonitor_w, mwindow->theme->rmonitor_meter_x); @@ -325,7 +325,7 @@ void RecordMonitorGUI::create_objects() add_subwindow(avc1394transport_timecode = new BC_Title(avc1394_transport->x_end, - mwindow->theme->rmonitor_tx_y + 10, + mwindow->theme->rmonitor_tx_y + yS(10), "00:00:00:00", MEDIUM_7SEGMENT, BLACK)); @@ -345,8 +345,8 @@ void RecordMonitorGUI::create_objects() background_done = 1; } - mwindow->theme->rmonitor_canvas_w = MAX(10, mwindow->theme->rmonitor_canvas_w); - mwindow->theme->rmonitor_canvas_h = MAX(10, mwindow->theme->rmonitor_canvas_h); + mwindow->theme->rmonitor_canvas_w = MAX(xS(10), mwindow->theme->rmonitor_canvas_w); + mwindow->theme->rmonitor_canvas_h = MAX(yS(10), mwindow->theme->rmonitor_canvas_h); canvas = new RecordMonitorCanvas(mwindow, this, record, mwindow->theme->rmonitor_canvas_x, mwindow->theme->rmonitor_canvas_y, @@ -358,7 +358,7 @@ void RecordMonitorGUI::create_objects() #ifdef HAVE_DVB if( driver == CAPTURE_DVB ) { int ssw = SignalStatus::calculate_w(this); - signal_status = new SignalStatus(this, get_w()-ssw-3, 0); + signal_status = new SignalStatus(this, get_w()-ssw-xS(3), 0); add_subwindow(signal_status); signal_status->create_objects(); } diff --git a/cinelerra-5.1/cinelerra/recordprefs.C b/cinelerra-5.1/cinelerra/recordprefs.C index 318cbfb4..6c671ba2 100644 --- a/cinelerra-5.1/cinelerra/recordprefs.C +++ b/cinelerra-5.1/cinelerra/recordprefs.C @@ -54,6 +54,8 @@ RecordPrefs::~RecordPrefs() void RecordPrefs::create_objects() { + int xs5 = xS(5), xs10 = xS(10), xs30 = xS(30); + int ys5 = yS(5), ys27 = yS(27), ys30 = yS(30); int x, y, x1, x2; char string[BCTEXTLEN]; BC_Resources *resources = BC_WindowBase::get_resources(); @@ -86,7 +88,7 @@ void RecordPrefs::create_objects() 0); // Supply file formats for background rendering realtime_toc = new RecordRealtimeTOC(mwindow, pwindow, - x0+400, y0, pwindow->thread->edl->session->record_realtime_toc); + x0+xS(400), y0, pwindow->thread->edl->session->record_realtime_toc); add_subwindow(realtime_toc); // Audio hardware @@ -102,17 +104,14 @@ void RecordPrefs::create_objects() add_subwindow(new BC_Title(x, y, _("Record Driver:"), MEDIUMFONT, resources->text_default)); - audio_in_device = new ADevicePrefs(x + 110, y, pwindow, this, 0, + audio_in_device = new ADevicePrefs(x + xS(110), y, pwindow, this, 0, pwindow->thread->edl->session->aconfig_in, MODERECORD); audio_in_device->initialize(1); y += audio_in_device->get_h(1) + margin; int pad = RecordWriteLength::calculate_h(this, - MEDIUMFONT, - 1, - 1) + - mwindow->theme->widget_border; + MEDIUMFONT, 1, 1) + mwindow->theme->widget_border; add_subwindow(title0 = new BC_Title(x, y, _("Samples read from device:"))); add_subwindow(title1 = new BC_Title(x, y + pad, _("Samples to write to disk:"))); add_subwindow(title2 = new BC_Title(x, y + pad * 2, _("Sample rate for recording:"))); @@ -124,11 +123,7 @@ void RecordPrefs::create_objects() sprintf(string, "%ld", (long)pwindow->thread->edl->session->record_fragment_size); RecordFragment *menu; - add_subwindow(menu = new RecordFragment(x2, - y, - pwindow, - this, - string)); + add_subwindow(menu = new RecordFragment(x2, y, pwindow, this, string)); y += menu->get_h() + mwindow->theme->widget_border; menu->add_item(new BC_MenuItem("1024")); menu->add_item(new BC_MenuItem("2048")); @@ -144,10 +139,7 @@ void RecordPrefs::create_objects() add_subwindow(textbox = new RecordWriteLength(mwindow, pwindow, x2, y, string)); y += textbox->get_h() + mwindow->theme->widget_border; add_subwindow(textbox = new RecordSampleRate(pwindow, x2, y)); - add_subwindow(new SampleRatePulldown(mwindow, - textbox, - x2 + textbox->get_w(), - y)); + add_subwindow(new SampleRatePulldown(mwindow, textbox, x2 + textbox->get_w(), y)); y += textbox->get_h() + mwindow->theme->widget_border; RecordChannels *channels = new RecordChannels(pwindow, this, x2, y); @@ -158,22 +150,22 @@ void RecordPrefs::create_objects() pwindow->thread->edl->session->aconfig_in->map51_2); add_subwindow(record_map51_2); - x2 = x + record_map51_2->get_w() + 30; + x2 = x + record_map51_2->get_w() + xs30; int y2 = y + BC_TextBox::calculate_h(this,MEDIUMFONT,1,1) - get_text_height(MEDIUMFONT); add_subwindow(title = new BC_Title(x2, y2, _("Gain:"))); - x2 += title->get_w() + 8; + x2 += title->get_w() + xS(8); RecordGain *rec_gain = new RecordGain(pwindow, this, x2, y); rec_gain->create_objects(); - x2 += rec_gain->get_w() + 30; + x2 += rec_gain->get_w() + xs30; add_subwindow(new RecordRealTime(mwindow, pwindow, x2, y, pwindow->thread->edl->session->real_time_record)); - y += 30; - x = 5; + y += ys30; + x = xs5; // Video hardware - add_subwindow(new BC_Bar(5, y, get_w() - 10)); + add_subwindow(new BC_Bar(xs5, y, get_w() - xs10)); y += margin; add_subwindow(title1 = new BC_Title(x, y, _("Video In"), LARGEFONT, @@ -193,7 +185,7 @@ void RecordPrefs::create_objects() add_subwindow(textbox = new VideoWriteLength(pwindow, string, x1, y)); x1 += textbox->get_w() + margin; add_subwindow(new CaptureLengthTumbler(pwindow, textbox, x1, y)); - y += 27; + y += ys27; add_subwindow(title1 = new BC_Title(x, y, _("Frames to buffer in device:"))); x1 = x + title1->get_w() + margin; @@ -201,21 +193,21 @@ void RecordPrefs::create_objects() add_subwindow(textbox = new VideoCaptureLength(pwindow, string, x1, y)); x1 += textbox->get_w() + margin; add_subwindow(new CaptureLengthTumbler(pwindow, textbox, x1, y)); - y += 27; + y += ys27; x1 = x; add_subwindow(new BC_Title(x1, y, _("Positioning:"))); - x1 += 120; - add_subwindow(textbox = new BC_TextBox(x1, y, 200, 1, "")); + x1 += xS(120); + add_subwindow(textbox = new BC_TextBox(x1, y, xS(200), 1, "")); RecordPositioning *positioning = new RecordPositioning(pwindow,textbox); add_subwindow(positioning); positioning->create_objects(); - y += positioning->get_h() + 5; + y += positioning->get_h() + ys5; add_subwindow(new RecordSyncDrives(pwindow, pwindow->thread->edl->session->record_sync_drives, x, y)); - y += 35; + y += yS(35); BC_TextBox *w_text, *h_text; add_subwindow(title1 = new BC_Title(x, y, _("Size of captured frame:"))); @@ -226,10 +218,10 @@ void RecordPrefs::create_objects() x += title1->get_w() + margin; add_subwindow(h_text = new RecordH(pwindow, x, y)); x += h_text->get_w() + margin; - FrameSizePulldown *tumbler; - add_subwindow(tumbler = new FrameSizePulldown(mwindow->theme, + FrameSizePulldown *frame_sizes; + add_subwindow(frame_sizes = new FrameSizePulldown(mwindow->theme, w_text, h_text, x, y)); - y += tumbler->get_h() + margin; + y += frame_sizes->get_h() + margin; x = mwindow->theme->preferencesoptions_x; add_subwindow(title1 = new BC_Title(x, y, _("Frame rate for recording:"))); @@ -252,19 +244,12 @@ int RecordPrefs::show_window(int flush) } - - - RecordFragment::RecordFragment(int x, int y, PreferencesWindow *pwindow, RecordPrefs *record, char *text) - : BC_PopupMenu(x, - y, - 100, - text, - 1) + : BC_PopupMenu(x, y, xS(100), text, 1) { this->pwindow = pwindow; this->record = record; @@ -277,13 +262,8 @@ int RecordFragment::handle_event() } - - - - - RecordWriteLength::RecordWriteLength(MWindow *mwindow, PreferencesWindow *pwindow, int x, int y, char *text) - : BC_TextBox(x, y, 100, 1, text) + : BC_TextBox(x, y, xS(100), 1, text) { this->pwindow = pwindow; } @@ -325,7 +305,7 @@ int RecordMap51_2::handle_event() RecordSampleRate::RecordSampleRate(PreferencesWindow *pwindow, int x, int y) - : BC_TextBox(x, y, 70, 1, pwindow->thread->edl->session->aconfig_in->in_samplerate) + : BC_TextBox(x, y, xS(70), 1, pwindow->thread->edl->session->aconfig_in->in_samplerate) { this->pwindow = pwindow; } @@ -362,7 +342,7 @@ int RecordRealtimeTOC::handle_event() RecordW::RecordW(PreferencesWindow *pwindow, int x, int y) - : BC_TextBox(x, y, 70, 1, pwindow->thread->edl->session->vconfig_in->w) + : BC_TextBox(x, y, xS(70), 1, pwindow->thread->edl->session->vconfig_in->w) { this->pwindow = pwindow; } @@ -373,7 +353,7 @@ int RecordW::handle_event() } RecordH::RecordH(PreferencesWindow *pwindow, int x, int y) - : BC_TextBox(x, y, 70, 1, pwindow->thread->edl->session->vconfig_in->h) + : BC_TextBox(x, y, xS(70), 1, pwindow->thread->edl->session->vconfig_in->h) { this->pwindow = pwindow; } @@ -384,7 +364,7 @@ int RecordH::handle_event() } RecordFrameRate::RecordFrameRate(PreferencesWindow *pwindow, int x, int y) - : BC_TextBox(x, y, 140, 1, pwindow->thread->edl->session->vconfig_in->in_framerate) + : BC_TextBox(x, y, xS(140), 1, pwindow->thread->edl->session->vconfig_in->in_framerate) { this->pwindow = pwindow; } @@ -399,7 +379,7 @@ int RecordFrameRate::handle_event() RecordChannels::RecordChannels(PreferencesWindow *pwindow, BC_SubWindow *gui, int x, int y) : BC_TumbleTextBox(gui, pwindow->thread->edl->session->aconfig_in->channels, - 1, MAX_CHANNELS, x, y, 100) + 1, MAX_CHANNELS, x, y, xS(100)) { this->pwindow = pwindow; } @@ -413,7 +393,7 @@ int RecordChannels::handle_event() RecordGain::RecordGain(PreferencesWindow *pwindow, BC_SubWindow *gui, int x, int y) : BC_TumbleTextBox(gui, pwindow->thread->edl->session->aconfig_in->rec_gain, - 0.0001f, 10000.0f, x, y, 72) + 0.0001f, 10000.0f, x, y, xS(72)) { this->pwindow = pwindow; this->set_increment(0.1); @@ -428,7 +408,7 @@ int RecordGain::handle_event() VideoWriteLength::VideoWriteLength(PreferencesWindow *pwindow, char *text, int x, int y) - : BC_TextBox(x, y, 100, 1, text) + : BC_TextBox(x, y, xS(100), 1, text) { this->pwindow = pwindow; } @@ -441,7 +421,7 @@ int VideoWriteLength::handle_event() VideoCaptureLength::VideoCaptureLength(PreferencesWindow *pwindow, char *text, int x, int y) - : BC_TextBox(x, y, 100, 1, text) + : BC_TextBox(x, y, xS(100), 1, text) { this->pwindow = pwindow; } @@ -484,7 +464,7 @@ int CaptureLengthTumbler::handle_down_event() RecordPositioning::RecordPositioning(PreferencesWindow *pwindow, BC_TextBox *textbox) : BC_ListBox(textbox->get_x() + textbox->get_w(), textbox->get_y(), - 200, 100, LISTBOX_TEXT, &position_type, 0, 0, 1, 0, 1) + xS(200), yS(100), LISTBOX_TEXT, &position_type, 0, 0, 1, 0, 1) { this->pwindow = pwindow; this->textbox = textbox; diff --git a/cinelerra-5.1/cinelerra/recordtransport.C b/cinelerra-5.1/cinelerra/recordtransport.C index 7f2b59da..2b19e8d4 100644 --- a/cinelerra-5.1/cinelerra/recordtransport.C +++ b/cinelerra-5.1/cinelerra/recordtransport.C @@ -77,7 +77,7 @@ void RecordTransport::create_objects() x += end_button->get_w(); x_end = max(x, x_end); y_end = max(y + end_button->get_h(), y_end); #endif - x_end += 10; y_end += 10; + x_end += xS(10); y_end += yS(10); } void RecordTransport::reposition_window(int x, int y) @@ -112,7 +112,7 @@ void RecordTransport::reposition_window(int x, int y) x += end_button->get_w(); x_end = max(x, x_end); y_end = max(y + end_button->get_h(), y_end); #endif - x_end += 10; y_end += 10; + x_end += xS(10); y_end += yS(10); } int RecordTransport::get_h() diff --git a/cinelerra-5.1/cinelerra/recordwindow.C b/cinelerra-5.1/cinelerra/recordwindow.C index 87ad8cc6..0e372f69 100644 --- a/cinelerra-5.1/cinelerra/recordwindow.C +++ b/cinelerra-5.1/cinelerra/recordwindow.C @@ -44,10 +44,11 @@ RecordWindow::~RecordWindow() void RecordWindow::create_objects() { + int x = xS(5), y = yS(5); lock_window("RecordWindow::create_objects"); - add_subwindow(new BC_Title(5, 5, _("Select a file to record to:"))); + add_subwindow(new BC_Title(x, y, _("Select a file to record to:"))); - int x = 5, y = 25; + y = yS(25); format_tools = new FormatTools(mwindow, this, record->default_asset); format_tools->create_objects(x, y, 1, 1, 1, 1, 1, 1, /* record->fixed_compression */ 0, @@ -55,7 +56,7 @@ void RecordWindow::create_objects() // Not the same as creating a new file at each label. // Load mode is now located in the RecordGUI - x = 10; +// x = xS(10); // loadmode = new LoadMode(this, x, y, &record->load_mode, 1); // loadmode->create_objects(); @@ -67,9 +68,14 @@ void RecordWindow::create_objects() RecordToTracks::RecordToTracks(Record *record, int default_) - : BC_CheckBox(200, 270, default_) { this->record = record; } + : BC_CheckBox(xS(200), yS(270), default_) +{ + this->record = record; +} RecordToTracks::~RecordToTracks() -{} +{ +} + int RecordToTracks::handle_event() { record->to_tracks = get_value(); diff --git a/cinelerra-5.1/cinelerra/recordwindow.h b/cinelerra-5.1/cinelerra/recordwindow.h index 1452c0e0..7c4d1b62 100644 --- a/cinelerra-5.1/cinelerra/recordwindow.h +++ b/cinelerra-5.1/cinelerra/recordwindow.h @@ -32,8 +32,8 @@ // Dialog for record file format. -#define RECORD_WINDOW_WIDTH 410 -#define RECORD_WINDOW_HEIGHT 360 +#define RECORD_WINDOW_WIDTH xS(410) +#define RECORD_WINDOW_HEIGHT yS(360) class RecordWindow : public BC_Window diff --git a/cinelerra-5.1/cinelerra/reindex.C b/cinelerra-5.1/cinelerra/reindex.C index 27864c12..bd782859 100644 --- a/cinelerra-5.1/cinelerra/reindex.C +++ b/cinelerra-5.1/cinelerra/reindex.C @@ -68,7 +68,7 @@ void ReIndex::run() } ReIndexWindow::ReIndexWindow(char *display = "") - : BC_Window(display, MEGREY, _(PROGRAM_NAME ": Redraw Indexes"), 340, 140, 340, 140) + : BC_Window(display, MEGREY, _(PROGRAM_NAME ": Redraw Indexes"), xS(340), yS(140), xS(340), yS(140) { } @@ -84,14 +84,14 @@ ReIndexWindow::create_objects() BC_SubWindow *subwindow; add_subwindow(subwindow = new BC_SubWindow(0, 0, w, h, MEGREY)); - subwindow->add_subwindow(new BC_Title(5, 5, _("Redraw all indexes for the current project?"))); + subwindow->add_subwindow(new BC_Title(xS(5), yS(5), _("Redraw all indexes for the current project?"))); subwindow->add_subwindow(ok = new ReIndexOkButton(this)); subwindow->add_subwindow(cancel = new ReIndexCancelButton(this)); unlock_window(); } ReIndexOkButton::ReIndexOkButton(ReIndexWindow *window) - : BC_Button(5, 80, _("Yes")) + : BC_Button(xS(5), yS(80), _("Yes")) { this->window = window; } @@ -108,7 +108,7 @@ ReIndexOkButton::keypress_event() } ReIndexCancelButton::ReIndexCancelButton(ReIndexWindow *window) - : BC_Button(140, 80, _("No")) + : BC_Button(xS(140), yS(80), _("No")) { this->window = window; } diff --git a/cinelerra-5.1/cinelerra/remotecontrol.C b/cinelerra-5.1/cinelerra/remotecontrol.C index 704a7fb6..bb61eb27 100644 --- a/cinelerra-5.1/cinelerra/remotecontrol.C +++ b/cinelerra-5.1/cinelerra/remotecontrol.C @@ -9,7 +9,7 @@ RemoteWindow::RemoteWindow(RemoteControl *remote_control) : BC_Window(_(PROGRAM_NAME ": RemoteWindow"), - 0, 0, 16, 16, -1, -1, 1, 0, 1) + 0, 0, xS(16), yS(16), -1, -1, 1, 0, 1) { this->remote_control = remote_control; } @@ -102,7 +102,8 @@ void RemoteControl::fill_color(int color) } RemoteGUI::RemoteGUI(BC_WindowBase *wdw, RemoteControl *remote_control) - : BC_Popup(wdw, remote_control->mwindow_gui->mwindow->session->mwindow_x,0,16,16, -1, 1) + : BC_Popup(wdw, remote_control->mwindow_gui->mwindow->session->mwindow_x,0, + xS(16),yS(16), -1, 1) { this->remote_control = remote_control; } diff --git a/cinelerra-5.1/cinelerra/render.C b/cinelerra-5.1/cinelerra/render.C index 653ec559..015bebd5 100644 --- a/cinelerra-5.1/cinelerra/render.C +++ b/cinelerra-5.1/cinelerra/render.C @@ -965,8 +965,8 @@ void RenderThread::run() } -#define WIDTH 480 -#define HEIGHT 480 +#define WIDTH xS(480) +#define HEIGHT yS(480) RenderWindow::RenderWindow(MWindow *mwindow, @@ -1009,13 +1009,15 @@ void RenderWindow::load_profile(int profile_slot) void RenderWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs20 = xS(20); + int ys10 = yS(10), ys20 = yS(20), ys25 = yS(25), ys30 = yS(30); + int x = xs10, y = ys10; lock_window("RenderWindow::create_objects"); add_subwindow(file_format = new BC_Title(x, y, (render->use_labels ? _("Select the first file to render to:") : _("Select a file to render to:")))); - y += 25; + y += ys25; render_format = new RenderFormat(mwindow, this, asset); render_format->create_objects(x, y, @@ -1028,36 +1030,36 @@ void RenderWindow::create_objects() if( is_image ) render->range_type = RANGE_1FRAME; - int x1 = x + title->get_w() + 20, y1 = y; + int x1 = x + title->get_w() + xs20, y1 = y; add_subwindow(rangeproject = new RenderRangeProject(this, render->range_type == RANGE_PROJECT, x1, y)); int x2 = x1 + rangeproject->get_w(); - y += 20; + y += ys20; add_subwindow(rangeselection = new RenderRangeSelection(this, render->range_type == RANGE_SELECTION, x1, y)); int x3 = x1 + rangeselection->get_w(); if( x2 < x3 ) x2 = x3; - y += 20; + y += ys20; add_subwindow(rangeinout = new RenderRangeInOut(this, render->range_type == RANGE_INOUT, x1, y)); x3 = x1 + rangeinout->get_w(); if( x2 < x3 ) x2 = x3; - y += 20; + y += ys20; add_subwindow(range1frame = new RenderRange1Frame(this, render->range_type == RANGE_1FRAME, x1, y)); x3 = x1 + range1frame->get_w(); if( x2 < x3 ) x2 = x3; - y += 30; + y += ys30; if( is_image ) enable_render_range(0); - x1 = x2 + 20; + x1 = x2 + xs20; render->beep = mwindow->edl->session->render_beep; add_subwindow(beep_on_done = new RenderBeepOnDone(this, x1, y1)); renderprofile = new RenderProfile(mwindow, this, x, y, 1); renderprofile->create_objects(); - y += 70; + y += yS(70); loadmode = new LoadMode(mwindow, this, x, y, &render->load_mode); loadmode->create_objects(); diff --git a/cinelerra-5.1/cinelerra/renderfarm.C b/cinelerra-5.1/cinelerra/renderfarm.C index 074f0461..9194bf9d 100644 --- a/cinelerra-5.1/cinelerra/renderfarm.C +++ b/cinelerra-5.1/cinelerra/renderfarm.C @@ -492,13 +492,7 @@ void RenderFarmServerThread::send_asset() // The asset must be sent in two segments. // One segment is stored in the EDL and contains decoding information. // One segment is stored in the asset and contains encoding information. - server->default_asset->save_defaults(&defaults, - 0, - 1, - 1, - 1, - 1, - 1); + server->default_asset->save_defaults(&defaults, 0, 1, 1, 1, 1, 1); defaults.save_string(string1); FileXML file; server->default_asset->write(&file, 0, 0); diff --git a/cinelerra-5.1/cinelerra/renderfarmclient.C b/cinelerra-5.1/cinelerra/renderfarmclient.C index b12b5225..17b34511 100644 --- a/cinelerra-5.1/cinelerra/renderfarmclient.C +++ b/cinelerra-5.1/cinelerra/renderfarmclient.C @@ -425,13 +425,7 @@ void RenderFarmClientThread::read_asset(int socket_fd, Asset *asset) BC_Hash defaults; defaults.load_string((char*)string1); - asset->load_defaults(&defaults, - 0, - 1, - 1, - 1, - 1, - 1); + asset->load_defaults(&defaults, 0, 1, 1, 1, 1, 1); //printf("RenderFarmClientThread::read_asset %d\n", __LINE__); //asset->dump(); diff --git a/cinelerra-5.1/cinelerra/renderprofiles.C b/cinelerra-5.1/cinelerra/renderprofiles.C index 26d195ca..86162bbb 100644 --- a/cinelerra-5.1/cinelerra/renderprofiles.C +++ b/cinelerra-5.1/cinelerra/renderprofiles.C @@ -31,7 +31,7 @@ #include "errorbox.h" #include "mwindowgui.h" -#define LISTWIDTH 200 +#define LISTWIDTH xS(200) RenderProfileItem::RenderProfileItem(const char *text, int value) : BC_ListBoxItem(text) @@ -83,33 +83,20 @@ int RenderProfile::create_objects() { int x = this->x, y = this->y; const char *default_text = ""; - rwindow->add_subwindow(new BC_Title(x, - y, - _("RenderProfile:"))); - + rwindow->add_subwindow(new BC_Title(x, y, _("RenderProfile:"))); int old_y = y; rwindow->add_subwindow(title = new BC_Title(x, y, _("Render profile:"))); - y += 25; - rwindow->add_subwindow(textbox = new BC_TextBox(x, - y, - LISTWIDTH, - 1, - default_text)); + y += yS(25); + rwindow->add_subwindow(textbox = new BC_TextBox(x, y, LISTWIDTH, 1, default_text)); x += textbox->get_w(); rwindow->add_subwindow(listbox = new RenderProfileListBox(rwindow, this, x, y)); y = old_y; - x += listbox->get_w() + 10; - rwindow->add_subwindow(saveprofile = new SaveRenderProfileButton(this, - x, - y)); - y += 25; - rwindow->add_subwindow(deleteprofile = new DeleteRenderProfileButton(this, - x, - y)); - - + x += listbox->get_w() + xS(10); + rwindow->add_subwindow(saveprofile = new SaveRenderProfileButton(this, x, y)); + y += yS(25); + rwindow->add_subwindow(deleteprofile = new DeleteRenderProfileButton(this, x, y)); return 0; } @@ -137,7 +124,7 @@ int RenderProfile::reposition_window(int x, int y) this->x = x; this->y = y; title->reposition_window(x, y); - y += 20; + y += yS(20); textbox->reposition_window(x, y); x += textbox->get_w(); listbox->reposition_window(x, @@ -148,20 +135,10 @@ int RenderProfile::reposition_window(int x, int y) RenderProfileListBox::RenderProfileListBox(BC_WindowBase *window, - RenderProfile *renderprofile, - int x, - int y) - : BC_ListBox(x, - y, - LISTWIDTH, - 150, - LISTBOX_TEXT, + RenderProfile *renderprofile, int x, int y) + : BC_ListBox(x, y, LISTWIDTH, yS(150), LISTBOX_TEXT, (ArrayList*)&renderprofile->profiles, - 0, - 0, - 1, - 0, - 1) + 0, 0, 1, 0, 1) { this->window = window; this->renderprofile = renderprofile; @@ -300,12 +277,6 @@ int DeleteRenderProfileButton::handle_event() profile->textbox->update(""); } - - return 1; } - - - - diff --git a/cinelerra-5.1/cinelerra/resizetrackthread.C b/cinelerra-5.1/cinelerra/resizetrackthread.C index c929c64b..eb6f295a 100644 --- a/cinelerra-5.1/cinelerra/resizetrackthread.C +++ b/cinelerra-5.1/cinelerra/resizetrackthread.C @@ -96,18 +96,13 @@ void ResizeVTrackThread::run() #endif } - - +#define RSZ_W xS(320) +#define RSZ_H yS(120) ResizeVTrackWindow::ResizeVTrackWindow(MWindow *mwindow, - ResizeVTrackThread *thread, - int x, - int y) - : BC_Window(_(PROGRAM_NAME ": Resize Track"), - x - 320 / 2, y - get_resources()->ok_images[0]->get_h() + 100 / 2, - 400, get_resources()->ok_images[0]->get_h() + 100, - 400, get_resources()->ok_images[0]->get_h() + 100, - 0, 0, 1) + ResizeVTrackThread *thread, int x, int y) + : BC_Window(_(PROGRAM_NAME ": Resize Track"), x-RSZ_W/2, y-RSZ_H/2, + RSZ_W, RSZ_H, RSZ_W, RSZ_H, 0, 0, 1) { this->mwindow = mwindow; this->thread = thread; @@ -119,27 +114,29 @@ ResizeVTrackWindow::~ResizeVTrackWindow() void ResizeVTrackWindow::create_objects() { + int xs5 = xS(5), xs10 = xS(10); + int ys10 = yS(10); lock_window("ResizeVTrackWindow::create_objects"); - int x = 10, y = 10; + int x = xs10, y = ys10; BC_Title *size_title = new BC_Title(x, y, _("Size:")); add_subwindow(size_title); int x1 = x + size_title->get_w(); - int y1 = y + size_title->get_h() + 10; + int y1 = y + size_title->get_h() + ys10; BC_Title *scale_title = new BC_Title(x, y1, _("Scale:")); add_subwindow(scale_title); int x2 = x + scale_title->get_w(); if( x2 > x1 ) x1 = x2; - x1 += 10; + x1 += ys10; add_subwindow(w = new ResizeVTrackWidth(this, thread, x1, y)); - x2 = x1 + w->get_w() + 5; + x2 = x1 + w->get_w() + xs5; BC_Title *xy = new BC_Title(x2, y, _("x")); add_subwindow(xy); - int x3 = x2 + xy->get_w() + 5; + int x3 = x2 + xy->get_w() + xs5; add_subwindow(h = new ResizeVTrackHeight(this, thread, x3, y)); - x = x3 + h->get_w() + 5; + x = x3 + h->get_w() + xs5; FrameSizePulldown *pulldown; add_subwindow(pulldown = new FrameSizePulldown(mwindow->theme, w, h, x, y)); - x += pulldown->get_w() + 5; + x += pulldown->get_w() + xs5; add_subwindow(new ResizeVTrackSwap(this, thread, x, y)); add_subwindow(w_scale = new ResizeVTrackScaleW(this, thread, x1, y1)); @@ -213,7 +210,7 @@ ResizeVTrackWidth::ResizeVTrackWidth(ResizeVTrackWindow *gui, ResizeVTrackThread *thread, int x, int y) - : BC_TextBox(x, y, 90, 1, thread->w) + : BC_TextBox(x, y, xS(90), 1, thread->w) { this->gui = gui; this->thread = thread; @@ -229,7 +226,7 @@ ResizeVTrackHeight::ResizeVTrackHeight(ResizeVTrackWindow *gui, ResizeVTrackThread *thread, int x, int y) - : BC_TextBox(x, y, 90, 1, thread->h) + : BC_TextBox(x, y, xS(90), 1, thread->h) { this->gui = gui; this->thread = thread; @@ -246,7 +243,7 @@ ResizeVTrackScaleW::ResizeVTrackScaleW(ResizeVTrackWindow *gui, ResizeVTrackThread *thread, int x, int y) - : BC_TextBox(x, y, 90, 1, (float)thread->w_scale) + : BC_TextBox(x, y, xS(90), 1, (float)thread->w_scale) { this->gui = gui; this->thread = thread; @@ -262,7 +259,7 @@ ResizeVTrackScaleH::ResizeVTrackScaleH(ResizeVTrackWindow *gui, ResizeVTrackThread *thread, int x, int y) - : BC_TextBox(x, y, 90, 1, (float)thread->h_scale) + : BC_TextBox(x, y, xS(90), 1, (float)thread->h_scale) { this->gui = gui; this->thread = thread; diff --git a/cinelerra-5.1/cinelerra/resourcepixmap.C b/cinelerra-5.1/cinelerra/resourcepixmap.C index 8c874bb9..c65d1b95 100644 --- a/cinelerra-5.1/cinelerra/resourcepixmap.C +++ b/cinelerra-5.1/cinelerra/resourcepixmap.C @@ -293,7 +293,7 @@ void ResourcePixmap::draw_title(TrackCanvas *canvas, // coords relative to pixmap int64_t total_x = edit_x - pixmap_x, total_w = edit_w; int64_t x = total_x, w = total_w; - int left_margin = 10; + int left_margin = xS(10); if( x < 0 ) { w -= -x; x = 0; } if( w > pixmap_w ) w -= w - pixmap_w; @@ -316,7 +316,7 @@ void ResourcePixmap::draw_title(TrackCanvas *canvas, text_x = MAX(left_margin, text_x); //printf("ResourcePixmap::draw_title 1 %d\n", text_x); canvas->draw_text(text_x, // 2, - canvas->get_text_ascent(mwindow->theme->title_font) + 2, + canvas->get_text_ascent(mwindow->theme->title_font) + yS(2), title, strlen(title), this); } @@ -664,7 +664,7 @@ void ResourcePixmap::draw_subttl_resource(TrackCanvas *canvas, Edit *edit, int x { SEdit *sedit = (SEdit *)edit; char *text = sedit->get_text(); - if( !*text || w < 10 ) return; + if( !*text || w < xS(10) ) return; int center_pixel = canvas->resource_h() / 2; if( edit->track->show_titles() ) center_pixel += mwindow->theme->get_image("title_bg_data")->get_h(); @@ -678,7 +678,7 @@ void ResourcePixmap::draw_subttl_resource(TrackCanvas *canvas, Edit *edit, int x canvas->set_color(color); int ch = canvas->get_text_height(font); int hh = canvas->get_text_height(font,text) + ch/2; - int y1 = y_max - hh - 10; + int y1 = y_max - hh - yS(10); if( y1 < 0 ) y1 = 0; canvas->draw_text(x1, y1, text, -1, this); } diff --git a/cinelerra-5.1/cinelerra/savefile.C b/cinelerra-5.1/cinelerra/savefile.C index ffd9aef6..552f2d35 100644 --- a/cinelerra-5.1/cinelerra/savefile.C +++ b/cinelerra-5.1/cinelerra/savefile.C @@ -39,13 +39,6 @@ #include - - - - - - - SaveBackup::SaveBackup(MWindow *mwindow) : BC_MenuItem(_("Save backup"), "b", 'b') { @@ -59,15 +52,6 @@ int SaveBackup::handle_event() } - - - - - - - - - Save::Save(MWindow *mwindow) : BC_MenuItem(_("Save"), "s", 's') { this->mwindow = mwindow; @@ -252,7 +236,7 @@ int SaveProjectModeItem::handle_event() } SaveProjectMode::SaveProjectMode(SaveProjectWindow *gui, int x, int y) - : BC_PopupMenu(x, y, 100, "") + : BC_PopupMenu(x, y, xS(100), "") { this->gui = gui; save_modes[SAVE_PROJECT_COPY] = _("Copy"); @@ -298,7 +282,7 @@ SaveProjectWindow::SaveProjectWindow(MWindow *mwindow, const char *dir_path, mwindow->gui->get_abs_cursor_x(1), mwindow->gui->get_abs_cursor_y(1) - BC_WindowBase::get_resources()->filebox_h / 2, - 540, 220, 540, 220, 0) + xS(540), yS(220), xS(540), yS(220), 0) { this->mwindow = mwindow; strcpy(this->dir_path, dir_path); @@ -312,26 +296,28 @@ SaveProjectWindow::~SaveProjectWindow() void SaveProjectWindow::create_objects() { - int x = 20, y = 20, x1 = get_w()-80; + int xs10 = xS(10), xs20 = xS(20); + int ys10 = yS(10), ys20 = yS(20); + int x = xs20, y = ys20, x1 = get_w()-xS(80); BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Project Directory:"))); - y += title->get_h() + 10; + y += title->get_h() + ys10; add_subwindow(textbox = new SaveProjectTextBox(this, x, y, x1-x)); - x1 += 10; + x1 += xs10; add_subwindow(recent_project = new BC_RecentList("RECENT_PROJECT", - mwindow->defaults, textbox, 10, x1, y, 300, 100)); + mwindow->defaults, textbox, 10, x1, y, xS(300), yS(100))); recent_project->load_items("RECENT_PROJECT"); - x1 += recent_project->get_w() + 10; + x1 += recent_project->get_w() + xs10; add_subwindow(browse_button = new BrowseButton(mwindow->theme, this, - textbox, x1, y-5, "", "", "", 1)); - y += textbox->get_h() + 20; + textbox, x1, y-yS(5), "", "", "", 1)); + y += textbox->get_h() + ys20; add_subwindow(mode_popup = new SaveProjectMode(this, x, y)); mode_popup->create_objects(); - y += mode_popup->get_h() + 10; + y += mode_popup->get_h() + ys10; x1 = x; BC_CheckBox *overwrite_files, *reload_project; add_subwindow(overwrite_files = new BC_CheckBox(x1, y, &overwrite, _("Overwrite files"))); - x1 += overwrite_files->get_w() + 20; + x1 += overwrite_files->get_w() + xs20; add_subwindow(reload_project = new BC_CheckBox(x1, y, &reload, _("Reload project"))); add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); diff --git a/cinelerra-5.1/cinelerra/scale.C b/cinelerra-5.1/cinelerra/scale.C index b963bb93..8c7b49c9 100644 --- a/cinelerra-5.1/cinelerra/scale.C +++ b/cinelerra-5.1/cinelerra/scale.C @@ -194,7 +194,7 @@ int ScaleThread::update_aspect(ScaleWindow *window) ScaleWindow::ScaleWindow(ScaleThread *thread) - : BC_Window(_(PROGRAM_NAME ": Scale"), 370, 260, 0, 0) + : BC_Window(_(PROGRAM_NAME ": Scale"), xS(370), yS(260), 0, 0) { this->thread = thread; } ScaleWindow::~ScaleWindow() @@ -203,118 +203,97 @@ ScaleWindow::~ScaleWindow() void ScaleWindow::create_objects() { + int xs5 = xS(5), xs10 = xS(10), xs20 = xS(20), xs30 = xS(30), xs200 = xS(200); + int ys5 = yS(5), ys10 = yS(10), ys20 = yS(20), ys30 = yS(30); lock_window("ScaleWindow::create_objects"); - int x = 10, y = 10; + int x = xs10, y = ys10; + int x0 = x, x1 = x + xS(70), x2 = x1 = xS(110), x3 = x = xS(70); add_subwindow(new BC_Title(x, y, _("New camera size:"))); - add_subwindow(new BC_Title(x + 200, y, _("New projector size:"))); - y += 30; - add_subwindow(new BC_Title(x, y, _("Width:"))); - x += 70; - add_subwindow(dimension[0] = new ScaleSizeText(x, y, thread, &(thread->dimension[0]))); - x += 110; - add_subwindow(new BC_Title(x, y, _("Width:"))); - x += 70; - add_subwindow(dimension[2] = new ScaleSizeText(x, y, thread, &(thread->dimension[2]))); - - y += 30; - x = 10; - add_subwindow(new BC_Title(x, y, _("Height:"))); - x += 70; - add_subwindow(dimension[1] = new ScaleSizeText(x, y, thread, &(thread->dimension[1]))); - x += 110; - add_subwindow(new BC_Title(x, y, _("Height:"))); - x += 70; - add_subwindow(dimension[3] = new ScaleSizeText(x, y, thread, &(thread->dimension[3]))); - - y += 30; - x = 10; - add_subwindow(new BC_Title(x, y, _("W Ratio:"))); - x += 70; - add_subwindow(ratio[0] = new ScaleRatioText(x, y, thread, &(thread->ratio[0]))); - x += 110; - add_subwindow(new BC_Title(x, y, _("W Ratio:"))); - x += 70; - add_subwindow(ratio[2] = new ScaleRatioText(x, y, thread, &(thread->ratio[2]))); - - y += 30; - x = 10; - add_subwindow(new BC_Title(x, y, _("H Ratio:"))); - x += 70; - add_subwindow(ratio[1] = new ScaleRatioText(x, y, thread, &(thread->ratio[1]))); - x += 110; - add_subwindow(new BC_Title(x, y, _("H Ratio:"))); - x += 70; - add_subwindow(ratio[3] = new ScaleRatioText(x, y, thread, &(thread->ratio[3]))); - -// y += 30; -// x = 10; -// add_subwindow(new BC_Title(x, y, "X Offset:")); -// x += 70; -// add_subwindow(offsets[0] = new ScaleOffsetText(x, y, thread, &(thread->offsets[0]))); -// x += 110; -// add_subwindow(new BC_Title(x, y, "X Offset:")); -// x += 70; -// add_subwindow(offsets[2] = new ScaleOffsetText(x, y, thread, &(thread->offsets[2]))); + add_subwindow(new BC_Title(x + xs200, y, _("New projector size:"))); + y += ys30; + add_subwindow(new BC_Title(x0, y, _("Width:"))); + add_subwindow(dimension[0] = new ScaleSizeText(x1, y, thread, &(thread->dimension[0]))); + add_subwindow(new BC_Title(x2, y, _("Width:"))); + add_subwindow(dimension[2] = new ScaleSizeText(x3, y, thread, &(thread->dimension[2]))); + + y += ys30; + add_subwindow(new BC_Title(x0, y, _("Height:"))); + add_subwindow(dimension[1] = new ScaleSizeText(x1, y, thread, &(thread->dimension[1]))); + add_subwindow(new BC_Title(x2, y, _("Height:"))); + add_subwindow(dimension[3] = new ScaleSizeText(x3, y, thread, &(thread->dimension[3]))); + + y += ys30; + add_subwindow(new BC_Title(x0, y, _("W Ratio:"))); + add_subwindow(ratio[0] = new ScaleRatioText(x1, y, thread, &(thread->ratio[0]))); + add_subwindow(new BC_Title(x2, y, _("W Ratio:"))); + add_subwindow(ratio[2] = new ScaleRatioText(x3, y, thread, &(thread->ratio[2]))); + + y += ys30; + add_subwindow(new BC_Title(x0, y, _("H Ratio:"))); + add_subwindow(ratio[1] = new ScaleRatioText(x1, y, thread, &(thread->ratio[1]))); + add_subwindow(new BC_Title(x2, y, _("H Ratio:"))); + add_subwindow(ratio[3] = new ScaleRatioText(x3, y, thread, &(thread->ratio[3]))); + +// y += ys30; +// add_subwindow(new BC_Title(x0, y, "X Offset:")); +// add_subwindow(offsets[0] = new ScaleOffsetText(x1, y, thread, &(thread->offsets[0]))); +// add_subwindow(new BC_Title(x2, y, "X Offset:")); +// add_subwindow(offsets[2] = new ScaleOffsetText(x3, y, thread, &(thread->offsets[2]))); // -// y += 30; -// x = 10; -// add_subwindow(new BC_Title(x, y, "Y Offset:")); -// x += 70; -// add_subwindow(offsets[1] = new ScaleOffsetText(x, y, thread, &(thread->offsets[1]))); -// x += 110; -// add_subwindow(new BC_Title(x, y, "Y Offset:")); -// x += 70; -// add_subwindow(offsets[3] = new ScaleOffsetText(x, y, thread, &(thread->offsets[3]))); - - x = 10; - y += 30; +// y += ys30; +// add_subwindow(new BC_Title(x0, y, "Y Offset:")); +// add_subwindow(offsets[1] = new ScaleOffsetText(x1, y, thread, &(thread->offsets[1]))); +// add_subwindow(new BC_Title(x2, y, "Y Offset:")); +// add_subwindow(offsets[3] = new ScaleOffsetText(x3, y, thread, &(thread->offsets[3]))); + + y += ys30; add_subwindow(new BC_Title(x, y, _("Aspect ratio:"))); - x += 100; + x += xS(100); char string[1024]; sprintf(string, "%.0f", thread->aspect_w); add_subwindow(aspect_w = new ScaleAspectW(x, y, thread, &(thread->aspect_w), string)); - x += 55; + x += xS(55); add_subwindow(new BC_Title(x, y, ":")); - x += 10; + x += xs10; sprintf(string, "%.0f", thread->aspect_h); add_subwindow(aspect_h = new ScaleAspectH(x, y, thread, &(thread->aspect_h), string)); - x += 60; + x += xS(60); add_subwindow(new ScaleAspectAuto(x, y + 5, thread)); - y += 30; -// x = 40; + y += ys30; +// x = xS(40); // add_subwindow(new BC_Title(x, y, _("Camera position:"))); -// x += 200; +// x += xs200; // add_subwindow(new BC_Title(x, y, _("Projector position:"))); // ScalePosition *position; -// x = 60; -// y += 25; +// x = xS(60); +// y += yS(25); // add_subwindow(position1 = new ScalePosition(x, y, thread, this, // &(thread->orig_dimension[0]), &(thread->dimension[0]), &(thread->offsets[0]))); // position1->draw(); -// x += 200; +// x += xs200; // add_subwindow(position2 = new ScalePosition(x, y, thread, this, // &(thread->orig_dimension[2]), &(thread->dimension[2]), &(thread->offsets[2]))); // position2->draw(); -// y += 110; - x = 10; +// y += yS(110); + x = xs10; add_subwindow(new ScaleConstrain(x, y, thread)); - x += 200; + x += xs200; add_subwindow(new ScaleData(x, y, thread)); - y += 30; - x = 50; + y += ys30; + x = xS(50); add_subwindow(new BC_OKButton(x, y)); - x += 200; + x += xs200; add_subwindow(new BC_CancelButton(x, y)); unlock_window(); } ScaleSizeText::ScaleSizeText(int x, int y, ScaleThread *thread, int *output) - : BC_TextBox(x, y, 100, 1, *output) + : BC_TextBox(x, y, xS(100), 1, *output) { this->thread = thread; this->output = output; @@ -323,8 +302,7 @@ ScaleSizeText::~ScaleSizeText() {} int ScaleSizeText::handle_event() { *output = atol(get_text()); - *output /= 2; - *output *= 2; + *output /= 2; *output *= 2; if(*output <= 0) *output = 2; if(*output > 10000) *output = 10000; *output *= -1; @@ -332,7 +310,7 @@ int ScaleSizeText::handle_event() } ScaleOffsetText::ScaleOffsetText(int x, int y, ScaleThread *thread, int *output) - : BC_TextBox(x, y, 100, 1, *output) + : BC_TextBox(x, y, xs(100), 1, *output) { this->thread = thread; this->output = output; } ScaleOffsetText::~ScaleOffsetText() {} int ScaleOffsetText::handle_event() @@ -345,7 +323,7 @@ int ScaleOffsetText::handle_event() } ScaleRatioText::ScaleRatioText(int x, int y, ScaleThread *thread, float *output) - : BC_TextBox(x, y, 100, 1, *output) + : BC_TextBox(x, y, xS(100), 1, *output) { this->thread = thread; this->output = output; } ScaleRatioText::~ScaleRatioText() {} int ScaleRatioText::handle_event() @@ -399,7 +377,7 @@ int ScaleAspectAuto::handle_event() ScaleAspectW::ScaleAspectW(int x, int y, ScaleThread *thread, float *output, char *string) - : BC_TextBox(x, y, 50, 1, string) + : BC_TextBox(x, y, xS(50), 1, string) { this->output = output; this->thread = thread; @@ -415,7 +393,7 @@ int ScaleAspectW::handle_event() ScaleAspectH::ScaleAspectH(int x, int y, ScaleThread *thread, float *output, char *string) - : BC_TextBox(x, y, 50, 1, string) + : BC_TextBox(x, y, xS(50), 1, string) { this->output = output; this->thread = thread; diff --git a/cinelerra-5.1/cinelerra/scopewindow.C b/cinelerra-5.1/cinelerra/scopewindow.C index 4713b95d..4bbd34fa 100644 --- a/cinelerra-5.1/cinelerra/scopewindow.C +++ b/cinelerra-5.1/cinelerra/scopewindow.C @@ -737,11 +737,12 @@ void ScopeGUI::allocate_bitmaps() // wave_h, // vector_w, // vector_h); - w = MAX(wave_w, 16); - h = MAX(wave_h, 16); + int xs16 = xS(16), ys16 = yS(16); + w = MAX(wave_w, xs16); + h = MAX(wave_h, ys16); waveform_bitmap = new_bitmap(w, h); - w = MAX(vector_w, 16); - h = MAX(vector_h, 16); + w = MAX(vector_w, xs16); + h = MAX(vector_h, ys16); vector_bitmap = new_bitmap(w, h); } diff --git a/cinelerra-5.1/cinelerra/scopewindow.h b/cinelerra-5.1/cinelerra/scopewindow.h index 820c3d58..3c645521 100644 --- a/cinelerra-5.1/cinelerra/scopewindow.h +++ b/cinelerra-5.1/cinelerra/scopewindow.h @@ -43,8 +43,8 @@ #define HISTOGRAM_MAX 110 #define FLOAT_MAX 1.1 -#define MIN_SCOPE_W 320 -#define MIN_SCOPE_H 320 +#define MIN_SCOPE_W xS(640) +#define MIN_SCOPE_H yS(320) diff --git a/cinelerra-5.1/cinelerra/setformat.C b/cinelerra-5.1/cinelerra/setformat.C index 67366aa1..ba894a86 100644 --- a/cinelerra-5.1/cinelerra/setformat.C +++ b/cinelerra-5.1/cinelerra/setformat.C @@ -271,13 +271,6 @@ void SetFormatThread::update_aspect() } - - - - - - - SetFormatWindow::SetFormatWindow(MWindow *mwindow, SetFormatThread *thread, int x, int y) : BC_Window(_(PROGRAM_NAME ": Set Format"), x, y, @@ -296,7 +289,7 @@ SetFormatWindow::~SetFormatWindow() void SetFormatWindow::create_objects() { lock_window("SetFormatWindow::create_objects"); - int x = 10, y = mwindow->theme->setformat_y1; + int x = xS(10), y = mwindow->theme->setformat_y1; BC_TextBox *textbox; BC_Title *title; mwindow->theme->draw_setformat_bg(this); @@ -417,17 +410,10 @@ void SetFormatWindow::create_objects() y, _("Color model:"))); x = mwindow->theme->setformat_x4; - add_subwindow(textbox = new BC_TextBox(x, - y, - 100, - 1, - "")); + add_subwindow(textbox = new BC_TextBox(x, y, xS(100), 1, "")); x += textbox->get_w(); - add_subwindow(color_model = new ColormodelPulldown(mwindow, - textbox, - &thread->new_settings->session->color_model, - x, - y)); + add_subwindow(color_model = new ColormodelPulldown(mwindow, textbox, + &thread->new_settings->session->color_model, x, y)); y += mwindow->theme->setformat_margin; add_subwindow(new BC_Title(mwindow->theme->setformat_x3, @@ -435,13 +421,11 @@ void SetFormatWindow::create_objects() _("Aspect ratio:"))); y += mwindow->theme->setformat_margin; x = mwindow->theme->setformat_x3; - add_subwindow(aspect_w = new ScaleAspectText(x, - y, - thread, + add_subwindow(aspect_w = new ScaleAspectText(x, y, thread, &(thread->new_settings->session->aspect_w))); - x += aspect_w->get_w() + 5; + x += aspect_w->get_w() + xS(5); add_subwindow(new BC_Title(x, y, ":")); - x += 10; + x += xS(10); add_subwindow(aspect_h = new ScaleAspectText(x, y, thread, @@ -452,7 +436,7 @@ void SetFormatWindow::create_objects() aspect_h, x, y)); - x += 30; + x += xS(30); add_subwindow(auto_aspect = new ScaleAspectAuto(x, y, thread)); y += mwindow->theme->setformat_margin; @@ -460,27 +444,20 @@ void SetFormatWindow::create_objects() add_subwindow(new BC_Title(mwindow->theme->setformat_x3, y, _("Interlace mode:"))); - add_subwindow(textbox = new BC_TextBox(mwindow->theme->setformat_x4, - y, - 140, - 1, - "")); + add_subwindow(textbox = new BC_TextBox(mwindow->theme->setformat_x4, y, + xS(140), 1, "")); add_subwindow(interlace_pulldown = new InterlacemodePulldown(mwindow, - textbox, - &(thread->new_settings->session->interlace_mode), + textbox, &(thread->new_settings->session->interlace_mode), (ArrayList*)&mwindow->interlace_project_modes, - mwindow->theme->setformat_x4 + textbox->get_w(), - y)); + mwindow->theme->setformat_x4 + textbox->get_w(), y)); y += mwindow->theme->setformat_margin; - BC_OKTextButton *ok; BC_CancelTextButton *cancel; add_subwindow(ok = new BC_OKTextButton(this)); add_subwindow(cancel = new BC_CancelTextButton(this)); add_subwindow(new SetFormatApply((ok->get_x() + cancel->get_x()) / 2, - ok->get_y(), - thread)); + ok->get_y(), thread)); flash(); show_window(); unlock_window(); @@ -519,7 +496,7 @@ EDL* SetFormatPresets::get_edl() SetSampleRateTextBox::SetSampleRateTextBox(SetFormatThread *thread, int x, int y) - : BC_TextBox(x, y, 100, 1, (int64_t)thread->new_settings->session->sample_rate) + : BC_TextBox(x, y, xS(100), 1, (int64_t)thread->new_settings->session->sample_rate) { this->thread = thread; } @@ -530,7 +507,7 @@ int SetSampleRateTextBox::handle_event() } SetChannelsTextBox::SetChannelsTextBox(SetFormatThread *thread, int x, int y) - : BC_TextBox(x, y, 100, 1, thread->new_settings->session->audio_channels) + : BC_TextBox(x, y, xS(100), 1, thread->new_settings->session->audio_channels) { this->thread = thread; } @@ -612,10 +589,7 @@ int SetChannelsCanvas::draw(int angle) for(int i = 0; i < thread->new_settings->session->audio_channels; i++) { get_dimensions(thread->new_settings->session->achannel_positions[i], - x, - y, - w, - h); + x, y, w, h); double rotate_angle = thread->new_settings->session->achannel_positions[i]; rotate_angle = -rotate_angle; while(rotate_angle < 0) rotate_angle += 360; @@ -644,19 +618,16 @@ int SetChannelsCanvas::draw(int angle) } int SetChannelsCanvas::get_dimensions(int channel_position, - int &x, - int &y, - int &w, - int &h) -{ -#define MARGIN 10 - int real_w = this->get_w() - box_r * 2 - MARGIN; - int real_h = this->get_h() - box_r * 2 - MARGIN; + int &x, int &y, int &w, int &h) +{ + int xs10 = xS(10), ys10 = yS(10); + int real_w = this->get_w() - box_r * 2 - xs10; + int real_h = this->get_h() - box_r * 2 - ys10; float corrected_position = channel_position; if(corrected_position < 0) corrected_position += 360; Units::polar_to_xy((float)corrected_position, real_w / 2, x, y); - x += real_w / 2 + MARGIN / 2; - y += real_h / 2 + MARGIN / 2; + x += real_w / 2 + xs10 / 2; + y += real_h / 2 + ys10 / 2; w = box_r * 2; h = box_r * 2; return 0; @@ -723,7 +694,7 @@ int SetChannelsCanvas::cursor_motion_event() SetFrameRateTextBox::SetFrameRateTextBox(SetFormatThread *thread, int x, int y) - : BC_TextBox(x, y, 100, 1, (float)thread->new_settings->session->frame_rate) + : BC_TextBox(x, y, xS(100), 1, (float)thread->new_settings->session->frame_rate) { this->thread = thread; } @@ -737,7 +708,7 @@ int SetFrameRateTextBox::handle_event() // // SetVChannels::SetVChannels(SetFormatThread *thread, int x, int y) -// : BC_TextBox(x, y, 100, 1, thread->channels) +// : BC_TextBox(x, y, xS(100), 1, thread->channels) // { // this->thread = thread; // } @@ -751,7 +722,7 @@ int SetFrameRateTextBox::handle_event() ScaleSizeText::ScaleSizeText(int x, int y, SetFormatThread *thread, int *output) - : BC_TextBox(x, y, 100, 1, *output) + : BC_TextBox(x, y, xS(100), 1, *output) { this->thread = thread; this->output = output; @@ -762,8 +733,7 @@ ScaleSizeText::~ScaleSizeText() int ScaleSizeText::handle_event() { *output = atol(get_text()); - *output /= 2; - *output *= 2; + *output /= 2; *output *= 2; if(*output <= 0) *output = 2; if(*output > 10000) *output = 10000; *output *= -1; @@ -777,7 +747,7 @@ ScaleRatioText::ScaleRatioText(int x, int y, SetFormatThread *thread, float *output) - : BC_TextBox(x, y, 100, 1, *output) + : BC_TextBox(x, y, xS(100), 1, *output) { this->thread = thread; this->output = output; @@ -815,7 +785,7 @@ int ScaleAspectAuto::handle_event() } ScaleAspectText::ScaleAspectText(int x, int y, SetFormatThread *thread, float *output) - : BC_TextBox(x, y, 70, 1, *output) + : BC_TextBox(x, y, xS(70), 1, *output) { this->output = output; this->thread = thread; diff --git a/cinelerra-5.1/cinelerra/shbtnprefs.C b/cinelerra-5.1/cinelerra/shbtnprefs.C index 679d16f4..e8e44b0b 100644 --- a/cinelerra-5.1/cinelerra/shbtnprefs.C +++ b/cinelerra-5.1/cinelerra/shbtnprefs.C @@ -126,7 +126,8 @@ void ShBtnEditDialog::handle_close_event(int result) ShBtnEditWindow::ShBtnEditWindow(ShBtnEditDialog *shbtn_edit, int x, int y) - : BC_Window(_(PROGRAM_NAME ": Shell"), x, y, 300, 200, 300, 200, 0, 0, 1) + : BC_Window(_(PROGRAM_NAME ": Shell"), x, y, + xS(300), yS(200), xS(300), yS(200), 0, 0, 1) { this->shbtn_edit = shbtn_edit; sb_dialog = 0; @@ -217,7 +218,8 @@ ShBtnTextDialog::~ShBtnTextDialog() } ShBtnTextWindow::ShBtnTextWindow(ShBtnEditWindow *sb_window, int x, int y) - : BC_Window(_(PROGRAM_NAME ": Commands"), x, y, 640, 160, 640, 150, 0, 0, 1) + : BC_Window(_(PROGRAM_NAME ": Commands"), x, y, + xS(640), yS(160), xS(640), yS(150), 0, 0, 1) { this->sb_window = sb_window; warn = sb_window->sb_dialog->pref->warn; @@ -245,7 +247,7 @@ int ShBtnErrWarnItem::handle_event() } ShBtnErrWarn::ShBtnErrWarn(ShBtnTextWindow *st_window, int x, int y) - : BC_PopupMenu(x, y, 120, st_window->warn < 0 ? _("Always"): + : BC_PopupMenu(x, y, xS(120), st_window->warn < 0 ? _("Always"): !st_window->warn ? _("Never") : _("On Error")) { this->st_window = st_window; @@ -279,26 +281,26 @@ ShBtnRunScript::~ShBtnRunScript() void ShBtnTextWindow::create_objects() { lock_window("ShBtnTextWindow::create_objects"); - int x = 10, y = 10; - int x1 = 160; + int x = xS(10), y = yS(10); + int x1 = xS(160); BC_Title *title = new BC_Title(x, y, _("Label:")); add_subwindow(title); title = new BC_Title(x1, y, _("Commands:")); add_subwindow(title); - y += title->get_h() + 8; + y += title->get_h() + yS(8); ShBtnPref *pref = sb_window->sb_dialog->pref; - cmd_name = new BC_TextBox(x, y, 140, 1, pref->name); + cmd_name = new BC_TextBox(x, y, xS(140), 1, pref->name); add_subwindow(cmd_name); - cmd_text = new BC_ScrollTextBox(this, x1, y, get_w()-x1-20, 4, pref->commands); + cmd_text = new BC_ScrollTextBox(this, x1, y, get_w()-x1-xS(20), 4, pref->commands); cmd_text->create_objects(); - y += cmd_text->get_h() + 16; + y += cmd_text->get_h() + yS(16); add_subwindow(title = new BC_Title(x1,y, _("OnExit Notify:"))); - x1 += title->get_w() + 10; + x1 += title->get_w() + xS(10); add_subwindow(st_err_warn = new ShBtnErrWarn(this, x1, y)); st_err_warn->create_objects(); - x1 += st_err_warn->get_w() + 20; + x1 += st_err_warn->get_w() + xS(20); add_subwindow(st_run_script = new ShBtnRunScript(this, x1, y)); - y = get_h() - ShBtnTextOK::calculate_h() - 10; + y = get_h() - ShBtnTextOK::calculate_h() - yS(10); add_subwindow(new ShBtnTextOK(this, x, y)); show_window(); unlock_window(); @@ -360,13 +362,13 @@ void ShBtnEditWindow::create_objects() for( int i=0; ishbtn_prefs.size(); ++i ) { shbtn_items.append(new ShBtnPrefItem(preferences->shbtn_prefs[i])); } - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(op_list = new ShBtnPrefList(this, x, y)); - x = 190; + x = xS(190); add_subwindow(add_button = new ShBtnAddButton(this, x, y)); - y += add_button->get_h() + 8; + y += add_button->get_h() + yS(8); add_subwindow(del_button = new ShBtnDelButton(this, x, y)); - y += del_button->get_h() + 8; + y += del_button->get_h() + yS(8); add_subwindow(edit_button = new ShBtnEditButton(this, x, y)); add_subwindow(new BC_OKButton(this)); show_window(); @@ -392,7 +394,7 @@ ShBtnPrefItem::~ShBtnPrefItem() } ShBtnPrefList::ShBtnPrefList(ShBtnEditWindow *sb_window, int x, int y) - : BC_ListBox(x, y, 140, 100, LISTBOX_TEXT, &sb_window->shbtn_items, 0, 0) + : BC_ListBox(x, y, xS(140), yS(100), LISTBOX_TEXT, &sb_window->shbtn_items, 0, 0) { this->sb_window = sb_window; } diff --git a/cinelerra-5.1/cinelerra/splashgui.C b/cinelerra-5.1/cinelerra/splashgui.C index e9e1840a..9b80bdbf 100644 --- a/cinelerra-5.1/cinelerra/splashgui.C +++ b/cinelerra-5.1/cinelerra/splashgui.C @@ -47,8 +47,8 @@ void SplashGUI::create_objects() draw_vframe(bg, 0, 0); flash(); show_window(); - operation = new BC_Title(5, - get_h() - get_text_height(MEDIUMFONT) - 5, + operation = new BC_Title(xS(5), + get_h() - get_text_height(MEDIUMFONT) - yS(5), _("Loading..."), MEDIUMFONT, GREEN); add_subwindow(operation); unlock_window(); diff --git a/cinelerra-5.1/cinelerra/statusbar.C b/cinelerra-5.1/cinelerra/statusbar.C index 13169c87..d27045b6 100644 --- a/cinelerra-5.1/cinelerra/statusbar.C +++ b/cinelerra-5.1/cinelerra/statusbar.C @@ -49,7 +49,7 @@ StatusBar::~StatusBar() void StatusBar::create_objects() { //printf("StatusBar::create_objects 1\n"); - int x = 10; //int y = 5; + int x = xS(10); //int y = 5; //printf("StatusBar::create_objects 1\n"); draw_top_background(get_parent(), 0, 0, get_w(), get_h()); add_subwindow(status_text = new BC_Title(mwindow->theme->mstatus_message_x, @@ -57,7 +57,7 @@ void StatusBar::create_objects() "", MEDIUMFONT, mwindow->theme->message_normal)); - x = get_w() - 290; + x = get_w() - xS(290); // printf("StatusBar::create_objects %d: 0x%08x\n", // __LINE__, mwindow->theme->message_normal); add_subwindow(main_progress = @@ -65,7 +65,7 @@ void StatusBar::create_objects() mwindow->theme->mstatus_progress_y, mwindow->theme->mstatus_progress_w, mwindow->theme->mstatus_progress_w)); - x += main_progress->get_w() + 5; + x += main_progress->get_w() + xS(5); //printf("StatusBar::create_objects 1\n"); add_subwindow(main_progress_cancel = new StatusBarCancel(mwindow, @@ -78,9 +78,7 @@ void StatusBar::create_objects() void StatusBar::resize_event() { - int x = 10; //int y = 1; - - + int x = xS(10); //int y = 1; reposition_window(mwindow->theme->mstatus_x, mwindow->theme->mstatus_y, mwindow->theme->mstatus_w, @@ -92,11 +90,11 @@ void StatusBar::resize_event() status_text->reposition_window(mwindow->theme->mstatus_message_x, mwindow->theme->mstatus_message_y); - x = get_w() - 290; + x = get_w() - xS(290); main_progress->reposition_window(mwindow->theme->mstatus_progress_x, mwindow->theme->mstatus_progress_y); - x += main_progress->get_w() + 5; + x += main_progress->get_w() + xS(5); main_progress_cancel->reposition_window(mwindow->theme->mstatus_cancel_x, mwindow->theme->mstatus_cancel_y); @@ -112,7 +110,7 @@ void StatusBar::show_message(const char *text, int msg_color, int box_color) set_color(box_color); int bb = th/4, bh = th - bb*2; draw_box(mx+bb,my+bb, bh,bh); - flash(mx,my, th,th); mx += 5; + flash(mx,my, th,th); mx += xS(5); if( (mx+=th) != tx ) status_text->reposition_window(mx, my); } diff --git a/cinelerra-5.1/cinelerra/swindow.C b/cinelerra-5.1/cinelerra/swindow.C index e7ab36c2..770556c6 100644 --- a/cinelerra-5.1/cinelerra/swindow.C +++ b/cinelerra-5.1/cinelerra/swindow.C @@ -73,7 +73,7 @@ int SWindowCancel::button_press_event() SWindowLoadPath::SWindowLoadPath(SWindowGUI *gui, int x, int y, char *path) - : BC_TextBox(x, y, 200, 1, path) + : BC_TextBox(x, y, xS(200), 1, path) { this->sw_gui = gui; } @@ -140,58 +140,58 @@ int SWindowSaveFile::handle_event() void SWindowGUI::create_objects() { lock_window("SWindowGUI::create_objects"); - int x = 10, y = 10; + int x = xS(10), y = yS(10); BC_Title *title = new BC_Title(x, y, _("Path:")); add_subwindow(title); - int x1 = x + title->get_w() + pad, y1 = y; + int x1 = x + title->get_w() + xpad, y1 = y; load_path = new SWindowLoadPath(this, x1, y1, script_path); add_subwindow(load_path); - x1 += load_path->get_w() + 2*pad; + x1 += load_path->get_w() + 2*xpad; add_subwindow(load_file = new SWindowLoadFile(this, x1, y1)); - x1 += load_file->get_w() + 2*pad; + x1 += load_file->get_w() + 2*xpad; add_subwindow(save_file = new SWindowSaveFile(this, x1, y1)); - y += max(load_path->get_h(), load_file->get_h()) + pad; - x1 = x + pad, y1 = y; + y += max(load_path->get_h(), load_file->get_h()) + ypad; + x1 = x + ypad, y1 = y; BC_Title *title1, *title2; add_subwindow(title1 = new BC_Title(x1, y1, _("File Size:"))); - y += title1->get_h() + pad; + y += title1->get_h() + ypad; int y2 = y; add_subwindow(title2 = new BC_Title(x1, y2, _("Entries:"))); - int x2 = x1 + max(title1->get_w(), title2->get_w()) + pad; + int x2 = x1 + max(title1->get_w(), title2->get_w()) + xpad; add_subwindow(script_filesz = new BC_Title(x2, y1, "0", MEDIUMFONT, YELLOW)); add_subwindow(script_entries = new BC_Title(x2, y2, "0", MEDIUMFONT, YELLOW)); - int x3 = x2 + max(script_entries->get_w()*8, script_filesz->get_w()*8) + pad; + int x3 = x2 + max(script_entries->get_w()*8, script_filesz->get_w()*8) + xpad; add_subwindow(title1 = new BC_Title(x3, y1, _("Lines:"))); add_subwindow(title2 = new BC_Title(x3, y2, _("Texts:"))); - int x4 = x3 + max(title1->get_w(), title2->get_w()) + pad; + int x4 = x3 + max(title1->get_w(), title2->get_w()) + xpad; add_subwindow(script_lines = new BC_Title(x4, y1, "0", MEDIUMFONT, YELLOW)); add_subwindow(script_texts = new BC_Title(x4, y2, "0", MEDIUMFONT, YELLOW)); - int x5 = x4 + max(script_lines->get_w()*8, script_texts->get_w()*8) + 2*pad; + int x5 = x4 + max(script_lines->get_w()*8, script_texts->get_w()*8) + 2*xpad; add_subwindow(prev_script = new ScriptPrev(this, x5, y1)); add_subwindow(next_script = new ScriptNext(this, x5, y2)); - int x6 = x5 + max(prev_script->get_w(), next_script->get_w()) + 2*pad; + int x6 = x5 + max(prev_script->get_w(), next_script->get_w()) + 2*xpad; add_subwindow(paste_script = new ScriptPaste(this, x6, y1)); add_subwindow(clear_script = new ScriptClear(this, x6, y2)); - y += max(title1->get_h(), title2->get_h()) + 2*pad; + y += max(title1->get_h(), title2->get_h()) + 2*ypad; - script_position = new ScriptPosition(this, x, y, 100); + script_position = new ScriptPosition(this, x, y, xS(100)); script_position->create_objects(); - x1 = x + script_position->get_w() + pad; - add_subwindow(script_scroll = new ScriptScroll(this, x1, y, get_w()-x1-pad)); - y += script_scroll->get_h() + 2*pad; - x1 = x + pad; + x1 = x + script_position->get_w() + xpad; + add_subwindow(script_scroll = new ScriptScroll(this, x1, y, get_w()-x1-xpad)); + y += script_scroll->get_h() + 2*ypad; + x1 = x + xpad; blank_line = new char[2]; blank_line[0] = ' '; blank_line[1] = 0; add_subwindow(script_title = new BC_Title(x1, y, _("Script Text:"))); - y += script_title->get_h() + pad; + y += script_title->get_h() + ypad; int rows = (ok_y - y - BC_Title::calculate_h(this,_("Line Text:")) - - 4*pad) / text_rowsz - 4; - int w1 = get_w() - x1 - pad; + 4*ypad) / text_rowsz - 4; + int w1 = get_w() - x1 - xpad; script_entry = new ScriptEntry(this, x1, y, w1, rows, blank_line); script_entry->create_objects(); - y += script_entry->get_h() + pad; + y += script_entry->get_h() + ypad; add_subwindow(line_title = new BC_Title(x1, y, _("Line Text:"))); - y += line_title->get_h() + pad; + y += line_title->get_h() + ypad; line_entry = new ScriptEntry(this, x1, y, w1, 4); line_entry->create_objects(); ok = new SWindowOK(this, ok_x, ok_y); @@ -236,22 +236,23 @@ void SWindowGUI::load() } SWindowGUI::SWindowGUI(SWindow *swindow, int x, int y, int w, int h) - : BC_Window(_(PROGRAM_NAME ": Subtitle"), x, y, w, h, 600, 500, + : BC_Window(_(PROGRAM_NAME ": Subtitle"), x, y, w, h, xS(600), yS(500), 1, 0, 0 , -1, swindow->mwindow->get_cwindow_display()) { this->swindow = swindow; - pad = 8; + xpad = xS(8); + ypad = yS(8); ok = 0; ok_w = BC_OKButton::calculate_w(); ok_h = BC_OKButton::calculate_h(); - ok_x = 10; - ok_y = h - ok_h - 10; + ok_x = xS(10); + ok_y = h - ok_h - yS(10); cancel = 0; cancel_w = BC_CancelButton::calculate_w(); cancel_h = BC_CancelButton::calculate_h(); - cancel_x = w - cancel_w - 10, - cancel_y = h - cancel_h - 10; + cancel_x = w - cancel_w - xS(10); + cancel_y = h - cancel_h - yS(10); load_path = 0; load_file = 0; @@ -305,29 +306,29 @@ int SWindowGUI::resize_event(int w, int h) swindow->mwindow->session->swindow_w = w; swindow->mwindow->session->swindow_h = h; - ok_x = 10; - ok_y = h - ok_h - 10; + ok_x = xS(10); + ok_y = h - ok_h - yS(10); ok->reposition_window(ok_x, ok_y); - cancel_x = w - cancel_w - 10, - cancel_y = h - cancel_h - 10; + cancel_x = w - cancel_w - xS(10); + cancel_y = h - cancel_h - yS(10); cancel->reposition_window(cancel_x, cancel_y); int x = script_position->get_x(); int y = script_position->get_y(); int hh = script_position->get_h(); int ww = script_position->get_w(); - int x1 = x + ww + pad; - int w1 = w - x1 - pad; + int x1 = x + ww + xpad; + int w1 = w - x1 - xpad; script_scroll->reposition_window(x1, y, w1); - y += hh + 2*pad; + y += hh + 2*ypad; script_title->reposition_window(x, y); - y += script_title->get_h() + pad; - w1 = w - x - pad; - int rows = (ok_y - y - line_title->get_h() - 4*pad) / text_rowsz - 4; + y += script_title->get_h() + ypad; + w1 = w - x - xpad; + int rows = (ok_y - y - line_title->get_h() - 4*ypad) / text_rowsz - 4; script_entry->reposition_window(x, y, w1, rows); - y += script_entry->get_h() + 2*pad; + y += script_entry->get_h() + 2*ypad; line_title->reposition_window(x, y); - y += line_title->get_h() + pad; + y += line_title->get_h() + ypad; line_entry->reposition_window(x, y, w1, 4); return 0; } @@ -924,8 +925,8 @@ void SWindow::run() int y = mwindow->session->swindow_y; int w = mwindow->session->swindow_w; int h = mwindow->session->swindow_h; - if( w < 600 ) w = 600; - if( h < 500 ) h = 500; + if( w < xS(600) ) w = xS(600); + if( h < yS(500) ) h = yS(500); int scr_x = mwindow->gui->get_screen_x(1, -1); int scr_w = mwindow->gui->get_screen_w(1, -1); if( x < scr_x ) x = scr_x; diff --git a/cinelerra-5.1/cinelerra/swindow.h b/cinelerra-5.1/cinelerra/swindow.h index 04e08b55..019e71d0 100644 --- a/cinelerra-5.1/cinelerra/swindow.h +++ b/cinelerra-5.1/cinelerra/swindow.h @@ -203,7 +203,7 @@ public: ScriptEntry *script_entry; ScriptEntry *line_entry; ScriptScroll *script_scroll; - int pad; + int xpad, ypad; char *blank_line; char script_path[BCTEXTLEN]; diff --git a/cinelerra-5.1/cinelerra/testwindow.C b/cinelerra-5.1/cinelerra/testwindow.C index 62f623b2..122103f7 100644 --- a/cinelerra-5.1/cinelerra/testwindow.C +++ b/cinelerra-5.1/cinelerra/testwindow.C @@ -5,7 +5,7 @@ TestWindowGUI:: TestWindowGUI() - : BC_Window("test", 100,100, 100,100, 100,100) + : BC_Window("test", xS(100),yS(100), xS(100),yS(100), xS(100),yS(100)) { in_motion = 0; last_x = last_y = -1; set_bg_color(BLACK); diff --git a/cinelerra-5.1/cinelerra/theme.C b/cinelerra-5.1/cinelerra/theme.C index 4141f08f..fb3ff4df 100644 --- a/cinelerra-5.1/cinelerra/theme.C +++ b/cinelerra-5.1/cinelerra/theme.C @@ -62,14 +62,14 @@ new VFrame(default_data.get_w(), default_data.get_h(), BC_RGBA8888) Theme::Theme() : BC_Theme() { - window_border = 10; - widget_border = 5; + window_border = xS(10); + widget_border = xS(5); this->mwindow = 0; theme_title = _(DEFAULT_THEME); last_image = 0; mtransport_margin = 0; toggle_margin = 0; - control_pixels = 50; + control_pixels = xS(50); timebar_cursor_color = RED; BC_WindowBase::get_resources()->bg_color = BLOND; @@ -77,14 +77,14 @@ Theme::Theme() BC_WindowBase::get_resources()->button_highlighted = 0xffe000; BC_WindowBase::get_resources()->recursive_resizing = 0; audio_color = BLACK; - fade_h = 22; + fade_h = yS(22); inout_highlight_color = GREEN; - meter_h = 17; - mode_h = 30; - pan_h = 32; - pan_x = 50; - play_h = 22; - title_h = 23; + meter_h = yS(17); + mode_h = yS(30); + pan_h = yS(32); + pan_x = xS(50); + play_h = yS(22); + title_h = yS(23); clock_bg_color = BLACK; clock_fg_color = GREEN; assetedit_color = YELLOW; @@ -93,8 +93,8 @@ Theme::Theme() preferences_category_overlap = 0; - loadmode_w = 350; - czoom_w = 110; + loadmode_w = xS(350); + czoom_w = xS(110); #include "data/about_bg_png.h" about_bg = new VFramePng(about_bg_png); @@ -600,18 +600,18 @@ void Theme::build_toggle(VFrame** &data, void Theme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) { mbuttons_x = 0; - mbuttons_y = gui->menu_h() + 1; - mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_p_toggle[0]->get_w()+2); + mbuttons_y = gui->menu_h() + yS(1); + mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_p_toggle[0]->get_w()+xS(2)); mbuttons_h = get_image("mbutton_bg")->get_h(); - mclock_x = window_border - 5; - mclock_y = mbuttons_y - 1 + mbuttons_h; - mclock_w = get_image("clock_bg")->get_w() - 20; + mclock_x = window_border - xS(5); + mclock_y = mbuttons_y-1 + mbuttons_h; + mclock_w = get_image("clock_bg")->get_w() - xS(20); mclock_h = get_image("clock_bg")->get_h(); mtimebar_x = get_image("patchbay_bg")->get_w(); mtimebar_y = mbuttons_y - 1 + mbuttons_h; mtimebar_w = w - mtimebar_x; mtimebar_h = get_image("timebar_bg")->get_h(); - mzoom_h = 25; + mzoom_h = yS(25); mzoom_x = 0; mzoom_y = h - get_image("statusbar")->get_h(); mzoom_w = w; @@ -619,15 +619,15 @@ void Theme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) mstatus_y = mzoom_y + mzoom_h; mstatus_w = w; mstatus_h = h - mstatus_y; - mstatus_message_x = 10; - mstatus_message_y = 5; - mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 240; - mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h() - 3; - mstatus_progress_w = 230; + mstatus_message_x = xS(10); + mstatus_message_y = yS(5); + mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - xS(240); + mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h() - yS(3); + mstatus_progress_w = xS(230); mstatus_cancel_x = mstatus_w - statusbar_cancel_data[0]->get_w(); mstatus_cancel_y = mstatus_h - statusbar_cancel_data[0]->get_h(); mcanvas_x = 0; - mcanvas_y = mbuttons_y - 1 + mbuttons_h; + mcanvas_y = mbuttons_y-1 + mbuttons_h; mcanvas_w = w; mcanvas_h = mzoom_y - mtimebar_y; control_pixels = (mcanvas_w * control_pixels) / 1000; @@ -648,15 +648,8 @@ void Theme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) } void Theme::get_pane_sizes(MWindowGUI *gui, - int *view_x, - int *view_y, - int *view_w, - int *view_h, - int number, - int x, - int y, - int w, - int h) + int *view_x, int *view_y, int *view_w, int *view_h, + int number, int x, int y, int w, int h) { *view_x = x; *view_y = y; @@ -711,9 +704,9 @@ void Theme::get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls) int zoom_w = ZoomPanel::calculate_w(czoom_w); int status_w = get_image("cwindow_active")->get_w(); // Space between buttons & status icon - int division_w = 24; + int division_w = xS(24); - ctimebar_h = 16; + ctimebar_h = yS(16); if(cwindow_controls) { @@ -755,9 +748,9 @@ SET_TRACE czoom_x = ctransport_x + transport_w + widget_border; czoom_y = ctransport_y + widget_border; - cstatus_x = 426; + cstatus_x = xS(426); cstatus_y = mwindow->session->cwindow_h - - get_image("cwindow_active")->get_h() - 30; + get_image("cwindow_active")->get_h() - yS(30); } else { @@ -782,22 +775,15 @@ SET_TRACE } - ccomposite_x = 0; - ccomposite_y = 5; + ccomposite_x = xS(0); + ccomposite_y = yS(5); ccomposite_w = get_image("cpanel_bg")->get_w(); ccomposite_h = mwindow->session->cwindow_h - buttons_h; - - - - - - ccanvas_x = ccomposite_x + ccomposite_w; ccanvas_y = 0; ccanvas_h = ccomposite_h; - ccanvas_w = cmeter_x - ccanvas_x - widget_border; SET_TRACE } @@ -810,10 +796,10 @@ SET_TRACE ccomposite_w = get_image("cpanel_bg")->get_w(); ccomposite_h = mwindow->session->cwindow_h - get_image("cbuttons_left")->get_h(); - cedit_x = 10; - cedit_y = mwindow->session->cwindow_h + 17; - ctransport_x = 10; - ctransport_y = cedit_y + 40; + cedit_x = xS(10); + cedit_y = mwindow->session->cwindow_h + yS(17); + ctransport_x = xS(10); + ctransport_y = cedit_y + yS(40); ccanvas_x = 0; ccanvas_y = 0; ccanvas_w = mwindow->session->cwindow_w; @@ -934,10 +920,10 @@ void Theme::get_vwindow_sizes(VWindowGUI *gui) int edit_w = EditPanel::calculate_w(mwindow, 0, 10); int transport_w = PlayTransport::get_transport_width(mwindow) + toggle_margin; // Space between buttons & time - int division_w = 30; - vtime_w = 150; - vtimebar_h = 16; - int vtime_border = 15; + int division_w = xS(30); + vtime_w = xS(150); + vtimebar_h = yS(16); + int vtime_border = xS(15); vmeter_y = widget_border; vmeter_h = mwindow->session->vwindow_h - cmeter_y - widget_border; @@ -977,9 +963,9 @@ void Theme::get_vwindow_sizes(VWindowGUI *gui) get_image_set("autokeyframe")[0]->get_h() - widget_border; - vdivision_x = 280; - vtime_x = vedit_x + 20; //vdivision_x; - vtime_y = vedit_y + 30; //+ 20; + vdivision_x = xS(280); + vtime_x = vedit_x + xS(20); //vdivision_x; + vtime_y = vedit_y + yS(30); //+ yS(20); } else { @@ -1024,10 +1010,10 @@ void Theme::get_awindow_sizes(AWindowGUI *gui) afolders_w = mwindow->session->afolders_w; afolders_h = mwindow->session->awindow_h - afolders_y; adivider_x = afolders_x + afolders_w; - adivider_y = 0; - adivider_w = 5; + adivider_y = xS(0); + adivider_w = yS(5); adivider_h = afolders_h; - alist_x = afolders_x + afolders_w + 5; + alist_x = afolders_x + afolders_w + xS(5); alist_y = afolders_y; alist_w = mwindow->session->awindow_w - alist_x; alist_h = afolders_h; @@ -1040,14 +1026,14 @@ void Theme::get_rmonitor_sizes(int do_audio, int do_avc, int audio_channels) { - int x = 10; - int y = 3; + int x = xS(10); + int y = yS(3); if(do_avc) { - rmonitor_canvas_y = 30; - rmonitor_tx_x = 10; + rmonitor_canvas_y = yS(30); + rmonitor_tx_x = xS(10); rmonitor_tx_y = 0; } else @@ -1060,16 +1046,16 @@ void Theme::get_rmonitor_sizes(int do_audio, if(do_channel) { - y = 5; + y = yS(5); rmonitor_channel_x = x; - rmonitor_channel_y = 5; - x += 280; - rmonitor_canvas_y = 35; + rmonitor_channel_y = yS(5); + x += xS(280); + rmonitor_canvas_y = yS(35); } if(do_interlace) { - y = 4; + y = yS(4); rmonitor_interlace_x = x; rmonitor_interlace_y = y; } @@ -1089,8 +1075,8 @@ void Theme::get_rmonitor_sizes(int do_audio, rmonitor_meter_w = mwindow->session->rmonitor_w - widget_border * 2; } - rmonitor_meter_y = 40; - rmonitor_meter_h = mwindow->session->rmonitor_h - 10 - rmonitor_meter_y; + rmonitor_meter_y = yS(40); + rmonitor_meter_h = mwindow->session->rmonitor_h - yS(10) - rmonitor_meter_y; } else { @@ -1099,13 +1085,13 @@ void Theme::get_rmonitor_sizes(int do_audio, rmonitor_canvas_x = 0; rmonitor_canvas_w = rmonitor_meter_x - rmonitor_canvas_x; - if(do_audio) rmonitor_canvas_w -= 10; + if(do_audio) rmonitor_canvas_w -= xS(10); rmonitor_canvas_h = mwindow->session->rmonitor_h - rmonitor_canvas_y; if(!do_video && do_audio) { - rmonitor_meter_y -= 30; - rmonitor_meter_h += 30; + rmonitor_meter_y -= yS(30); + rmonitor_meter_h += yS(30); } } @@ -1118,14 +1104,16 @@ void Theme::get_batchrender_sizes(BatchRenderGUI *gui, int w, int h) { - batchrender_x1 = 10; - batchrender_x2 = 300; - batchrender_x3 = 400; + batchrender_x1 = xS(10); + batchrender_x2 = xS(300); + batchrender_x3 = xS(400); } void Theme::get_plugindialog_sizes() { - int x = 10, y = 30; + int xs10 = xS(10), ys10 = yS(10); + int xs20 = xS(20), ys100 = yS(100); + int x = xs10, y = yS(30); plugindialog_new_x = x; plugindialog_new_y = y; plugindialog_shared_x = mwindow->session->plugindialog_w / 3; @@ -1133,19 +1121,19 @@ void Theme::get_plugindialog_sizes() plugindialog_module_x = mwindow->session->plugindialog_w * 2 / 3; plugindialog_module_y = y; - plugindialog_new_w = plugindialog_shared_x - plugindialog_new_x - 10; - plugindialog_new_h = mwindow->session->plugindialog_h - 100; - plugindialog_shared_w = plugindialog_module_x - plugindialog_shared_x - 10; - plugindialog_shared_h = mwindow->session->plugindialog_h - 100; - plugindialog_module_w = mwindow->session->plugindialog_w - plugindialog_module_x - 10; - plugindialog_module_h = mwindow->session->plugindialog_h - 100; - - plugindialog_newattach_x = plugindialog_new_x + 20; - plugindialog_newattach_y = plugindialog_new_y + plugindialog_new_h + 10; - plugindialog_sharedattach_x = plugindialog_shared_x + 20; - plugindialog_sharedattach_y = plugindialog_shared_y + plugindialog_shared_h + 10; - plugindialog_moduleattach_x = plugindialog_module_x + 20; - plugindialog_moduleattach_y = plugindialog_module_y + plugindialog_module_h + 10; + plugindialog_new_w = plugindialog_shared_x - plugindialog_new_x - xs10; + plugindialog_new_h = mwindow->session->plugindialog_h - ys100; + plugindialog_shared_w = plugindialog_module_x - plugindialog_shared_x - xs10; + plugindialog_shared_h = mwindow->session->plugindialog_h - ys100; + plugindialog_module_w = mwindow->session->plugindialog_w - plugindialog_module_x - xs10; + plugindialog_module_h = mwindow->session->plugindialog_h - ys100; + + plugindialog_newattach_x = plugindialog_new_x + xs20; + plugindialog_newattach_y = plugindialog_new_y + plugindialog_new_h + ys10; + plugindialog_sharedattach_x = plugindialog_shared_x + xs20; + plugindialog_sharedattach_y = plugindialog_shared_y + plugindialog_shared_h + ys10; + plugindialog_moduleattach_x = plugindialog_module_x + xs20; + plugindialog_moduleattach_y = plugindialog_module_y + plugindialog_module_h + ys10; } // void Theme::get_presetdialog_sizes(PresetsWindow *gui) @@ -1291,26 +1279,26 @@ void Theme::get_menueffect_sizes(int use_list) { if(use_list) { - menueffect_list_x = 10; - menueffect_list_y = 10; - menueffect_list_w = mwindow->session->menueffect_w - 400; + menueffect_list_x = xS(10); + menueffect_list_y = yS(10); + menueffect_list_w = mwindow->session->menueffect_w - xS(400); menueffect_list_h = mwindow->session->menueffect_h - menueffect_list_y - - BC_OKButton::calculate_h() - 10; + BC_OKButton::calculate_h() - yS(10); } else { menueffect_list_x = 0; - menueffect_list_y = 10; + menueffect_list_y = yS(10); menueffect_list_w = 0; menueffect_list_h = 0; } - menueffect_file_x = menueffect_list_x + menueffect_list_w + 10; - menueffect_file_y = 10; + menueffect_file_x = menueffect_list_x + menueffect_list_w + xS(10); + menueffect_file_y = yS(10); menueffect_tools_x = menueffect_file_x; - menueffect_tools_y = menueffect_file_y + 20; + menueffect_tools_y = menueffect_file_y + yS(20); } void Theme::get_preferences_sizes() diff --git a/cinelerra-5.1/cinelerra/timebar.C b/cinelerra-5.1/cinelerra/timebar.C index 44e32172..7dfc7c01 100644 --- a/cinelerra-5.1/cinelerra/timebar.C +++ b/cinelerra-5.1/cinelerra/timebar.C @@ -277,20 +277,16 @@ void TimeBar::update_labels() // Create new label if( output >= labels.total ) { LabelGUI *new_label; - add_subwindow(new_label = - new LabelGUI(mwindow, - this, - pixel, - LabelGUI::get_y(mwindow, this), + add_subwindow(new_label = new LabelGUI(mwindow, this, + pixel, LabelGUI::get_y(mwindow, this), current->position)); new_label->set_cursor(INHERIT_CURSOR, 0, 0); new_label->set_tooltip(current->textstr); new_label->label = current; labels.append(new_label); } - else // Reposition old label - { + else { LabelGUI *gui = labels.values[output]; if( gui->pixel != pixel ) { gui->pixel = pixel; @@ -362,7 +358,7 @@ void TimeBar::draw_inout_highlight() CLAMP(in_x, 0, get_w()); CLAMP(out_x, 0, get_w()); set_color(mwindow->theme->inout_highlight_color); - int lw = 5; + int lw = xS(5); set_line_width(lw); set_inverse(); draw_line(in_x, get_h()-2*lw, out_x, get_h()-2*lw); @@ -537,14 +533,10 @@ EDL* TimeBar::get_edl() void TimeBar::draw_range() { - - //printf("TimeBar::draw_range %d %p\n", __LINE__, get_edl()); if( has_preview() && get_edl() ) { int x1, x2; get_preview_pixels(x1, x2); - -//printf("TimeBar::draw_range %f %d %d\n", edl_length, x1, x2); draw_3segmenth(0, 0, x1, mwindow->theme->timebar_view_data); draw_top_background(get_parent(), x1, 0, x2 - x1, get_h()); draw_3segmenth(x2, 0, get_w() - x2, mwindow->theme->timebar_view_data); @@ -941,8 +933,6 @@ int TimeBar::select_region(double position) } - - int TimeBar::delete_arrows() { return 0; diff --git a/cinelerra-5.1/cinelerra/tipwindow.C b/cinelerra-5.1/cinelerra/tipwindow.C index e367964f..df0e6f6f 100644 --- a/cinelerra-5.1/cinelerra/tipwindow.C +++ b/cinelerra-5.1/cinelerra/tipwindow.C @@ -117,7 +117,7 @@ void TipWindow::prev_tip() TipWindowGUI::TipWindowGUI(MWindow *mwindow, TipWindow *thread, int x, int y) : BC_Window(_(PROGRAM_NAME ": Tip of the day"), x, y, - 640, 100, 640, 100, 0, 0, 1) + xS(640), yS(100), xS(640), yS(100), 0, 0, 1) { this->mwindow = mwindow; this->thread = thread; @@ -126,20 +126,21 @@ TipWindowGUI::TipWindowGUI(MWindow *mwindow, TipWindow *thread, int x, int y) void TipWindowGUI::create_objects() { lock_window("TipWindowGUI::create_objects"); - int x = 10, y = 10; + int xs10 = xS(10), ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; add_subwindow(tip_text = new BC_Title(x, y, thread->get_current_tip(1))); - y = get_h() - 30; + y = get_h() - ys30; BC_CheckBox *checkbox; add_subwindow(checkbox = new TipDisable(mwindow, this, x, y)); BC_Button *button; - y = get_h() - TipClose::calculate_h(mwindow) - 10; - x = get_w() - TipClose::calculate_w(mwindow) - 10; + y = get_h() - TipClose::calculate_h(mwindow) - ys10; + x = get_w() - TipClose::calculate_w(mwindow) - xs10; add_subwindow(button = new TipClose(mwindow, this, x, y)); - x -= TipNext::calculate_w(mwindow) + 10; + x -= TipNext::calculate_w(mwindow) + xs10; add_subwindow(button = new TipNext(mwindow, this, x, y)); - x -= TipPrev::calculate_w(mwindow) + 10; + x -= TipPrev::calculate_w(mwindow) + xs10; add_subwindow(button = new TipPrev(mwindow, this, x, y)); - x += button->get_w() + 10; + x += button->get_w() + xs10; show_window(); raise_window(); diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index 771b88e7..f89bdab5 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -1315,29 +1315,22 @@ void TrackCanvas::draw_highlight_rectangle(int x, int y, int w, int h) if (x + w <= 0) { - draw_triangle_left(0, y + h /6, h * 2/3, h * 2/3, BLACK, GREEN, YELLOW, RED, BLUE); + draw_triangle_left(0, y + h /6, + h * 2/3, h * 2/3, BLACK, GREEN, YELLOW, RED, BLUE); return; } else if (x >= get_w()) { - draw_triangle_right(get_w() - h * 2/3, y + h /6, h * 2/3, h * 2/3, BLACK, GREEN, YELLOW, RED, BLUE); + draw_triangle_right(get_w() - h * 2/3, y + h /6, + h * 2/3, h * 2/3, BLACK, GREEN, YELLOW, RED, BLUE); return; } // Fix bug in heroines & cvs version as of 22.8.2005: // If we grab when zoomed in and zoom out while dragging, when edit gets really narrow strange things start happening if (w >= 0 && w < 3) {x -= w /2; w = 3;}; - if(x < -10) - { - w += x - -10; - x = -10; - } - - if(y < -10) - { - h += y - -10; - y = -10; - } + if(x < -10) { w += x - -10; x = -10; } + if(y < -10) { h += y - -10; y = -10; } w = MIN(w, get_w() + 20); h = MIN(h, get_h() + 20); @@ -1393,16 +1386,8 @@ void TrackCanvas::draw_highlight_insertion(int x, int y, int w, int h) // Fix bug in heroines & cvs version as of 22.8.2005: // If we grab when zoomed in and zoom out while dragging, when edit gets really narrow strange things start happening if (w >= 0 && w < 3) {x -= w /2; w = 3;}; - if(x < -10) - { - w += x - -10; - x = -10; - } - if(y < -10) - { - h += y - -10; - y = -10; - } + if(x < -10) { w += x - -10; x = -10; } + if(y < -10) { h += y - -10; y = -10; } w = MIN(w, get_w() + 20); h = MIN(h, get_h() + 20); set_color(mwindow->preferences->highlight_inverse); @@ -1443,7 +1428,7 @@ void TrackCanvas::get_handle_coords(Edit *edit, int64_t &x, int64_t &y, int64_t void TrackCanvas::get_transition_coords(Edit *edit, int64_t &x, int64_t &y, int64_t &w, int64_t &h) { - int transition_w = 30, transition_h = 30; + int transition_w = xS(30), transition_h = yS(30); int has_titles = edit->track->show_titles(); int has_assets = edit->track->show_assets(); double title_bg_h = mwindow->theme->get_image("title_bg_data")->get_h(); @@ -1801,7 +1786,7 @@ void TrackCanvas::draw_plugins() toggle_x = MIN(get_w() - right_margin, toggle_x); // On toggle - toggle_x -= PluginOn::calculate_w(mwindow) + 10; + toggle_x -= PluginOn::calculate_w(mwindow) + xS(10); if(toggle_x > min_x) { if(current_on >= plugin_on_toggles.total) @@ -1821,7 +1806,7 @@ void TrackCanvas::draw_plugins() if(plugin->plugin_type == PLUGIN_STANDALONE) { // Show - toggle_x -= PluginShow::calculate_w(mwindow) + 10; + toggle_x -= PluginShow::calculate_w(mwindow) + xS(10); if(toggle_x > min_x) { if(current_show >= plugin_show_toggles.total) @@ -1836,7 +1821,7 @@ void TrackCanvas::draw_plugins() } current_show++; } - toggle_x -= PluginPresetEdit::calculate_w(mwindow) + 10; + toggle_x -= PluginPresetEdit::calculate_w(mwindow) + xS(10); if(toggle_x > min_x) { if(current_preset >= preset_edit_buttons.total) @@ -1991,19 +1976,19 @@ void TrackCanvas::draw_drag_handle() edit_dimensions(edit, x, y, w, h); if( y+h < 0 || y >= get_h() ) continue; int edge_x = !drag_handle ? x : x + w; - int edge_y = y + h/2, k = 10; + int edge_y = y + h/2, xs10 = xS(10), ys10 = yS(10); if( edge_x >= 0 && edge_x < get_w() ) { if( !can_drag ) { - draw_line(edge_x-k,edge_y-k, edge_x+k,edge_y+k); - draw_line(edge_x-k,edge_y+k, edge_x+k,edge_y-k); + draw_line(edge_x-xs10,edge_y-ys10, edge_x+xs10,edge_y+ys10); + draw_line(edge_x-xs10,edge_y+ys10, edge_x+xs10,edge_y-ys10); } else if( !drag_handle ) { - draw_line(edge_x+k,edge_y-k, edge_x,edge_y); - draw_line(edge_x+k,edge_y+k, edge_x,edge_y); + draw_line(edge_x+xs10,edge_y-ys10, edge_x,edge_y); + draw_line(edge_x+xs10,edge_y+ys10, edge_x,edge_y); } else { - draw_line(edge_x,edge_y, edge_x-k,edge_y-k); - draw_line(edge_x,edge_y, edge_x-k,edge_y+k); + draw_line(edge_x,edge_y, edge_x-xs10,edge_y-ys10); + draw_line(edge_x,edge_y, edge_x-xs10,edge_y+ys10); } } edge_x += delta; @@ -3688,8 +3673,8 @@ int TrackCanvas::draw_hairline(Auto *auto_keyframe, int color, int show) } if( show ) { int font = MEDIUMFONT; - int tw = get_text_width(font, text) + TOOLTIP_MARGIN * 2; - int th = get_text_height(font, text) + TOOLTIP_MARGIN * 2; + int tw = get_text_width(font, text) + xS(TOOLTIP_MARGIN) * 2; + int th = get_text_height(font, text) + yS(TOOLTIP_MARGIN) * 2; set_color(get_resources()->tooltip_bg_color); ax += HANDLE_W/2; ay += center_pixel + HANDLE_W/2; @@ -3697,8 +3682,8 @@ int TrackCanvas::draw_hairline(Auto *auto_keyframe, int color, int show) set_color(BLACK); draw_rectangle(ax, ay, tw, th); set_font(font); - ax += TOOLTIP_MARGIN; - ay += TOOLTIP_MARGIN + get_text_ascent(font); + ax += xS(TOOLTIP_MARGIN); + ay += yS(TOOLTIP_MARGIN) + get_text_ascent(font); draw_text(ax, ay, text); } return 0; @@ -3709,13 +3694,7 @@ void TrackCanvas::draw_overlays() int new_cursor, update_cursor, rerender; // Move background pixmap to foreground pixmap - draw_pixmap(background_pixmap, - 0, - 0, - get_w(), - get_h(), - 0, - 0); + draw_pixmap(background_pixmap, 0, 0, get_w(), get_h(), 0, 0); // In/Out points draw_inout_points(); diff --git a/cinelerra-5.1/cinelerra/trackcanvas.inc b/cinelerra-5.1/cinelerra/trackcanvas.inc index 96c6c8c5..6898b163 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.inc +++ b/cinelerra-5.1/cinelerra/trackcanvas.inc @@ -24,8 +24,8 @@ class TrackCanvas; -#define HANDLE_W 8 -#define HANDLE_H 8 +#define HANDLE_W xS(8) +#define HANDLE_H yS(8) // draw mode: // NO_DRAW used in MWindowGUI/TimelinePane update to disable canvas update diff --git a/cinelerra-5.1/cinelerra/trackpopup.C b/cinelerra-5.1/cinelerra/trackpopup.C index f6f0e315..e914bf74 100644 --- a/cinelerra-5.1/cinelerra/trackpopup.C +++ b/cinelerra-5.1/cinelerra/trackpopup.C @@ -279,12 +279,15 @@ TrackPopupUserTitle::~TrackPopupUserTitle() delete dialog_thread; } +#define TTW_W xS(300) +#define TTW_H yS(130) + int TrackPopupUserTitle::handle_event() { if( popup->edit ) { dialog_thread->close_window(); - int wx = mwindow->gui->get_abs_cursor_x(0) - 400 / 2; - int wy = mwindow->gui->get_abs_cursor_y(0) - 500 / 2; + int wx = mwindow->gui->get_abs_cursor_x(0) - TTW_W / 2; + int wy = mwindow->gui->get_abs_cursor_y(0) - TTW_H / 2; dialog_thread->start(wx, wy); } return 1; @@ -350,7 +353,7 @@ void TrackUserTitleDialogThread::handle_done_event(int result) TrackPopupUserTitleWindow::TrackPopupUserTitleWindow(MWindow *mwindow, TrackPopup *popup, int wx, int wy) : BC_Window(_(PROGRAM_NAME ": Set edit title"), wx, wy, - 300, 130, 300, 130, 0, 0, 1) + TTW_W, TTW_H, TTW_W, TTW_H, 0, 0, 1) { this->mwindow = mwindow; this->popup = popup; @@ -364,9 +367,9 @@ TrackPopupUserTitleWindow::~TrackPopupUserTitleWindow() void TrackPopupUserTitleWindow::create_objects() { lock_window("TrackPopupUserTitleWindow::create_objects"); - int x = 10, y = 10, x1; + int x = xS(10), y = yS(10), x1; BC_Title *title = new BC_Title(x1=x, y, _("User title:")); - add_subwindow(title); x1 += title->get_w() + 10; + add_subwindow(title); x1 += title->get_w() + xS(10); title_text = new TrackPopupUserTitleText(this, mwindow, x1, y, new_text); add_subwindow(title_text); @@ -382,7 +385,7 @@ void TrackPopupUserTitleWindow::create_objects() TrackPopupUserTitleText::TrackPopupUserTitleText(TrackPopupUserTitleWindow *window, MWindow *mwindow, int x, int y, const char *text) - : BC_TextBox(x, y, window->get_w()-x-15, 1, text) + : BC_TextBox(x, y, window->get_w()-x-xS(15), 1, text) { this->window = window; this->mwindow = mwindow; @@ -451,9 +454,9 @@ TrackTitleColorPicker::~TrackTitleColorPicker() } void TrackTitleColorPicker::create_objects(ColorWindow *gui) { - int y = gui->get_h() - BC_CancelButton::calculate_h() + 10; - int x = gui->get_w() - BC_CancelButton::calculate_w() - 10; - x -= BC_GenericButton::calculate_w(gui, _("default")) + 15; + int y = gui->get_h() - BC_CancelButton::calculate_h() + yS(10); + int x = gui->get_w() - BC_CancelButton::calculate_w() - xS(10); + x -= BC_GenericButton::calculate_w(gui, _("default")) + xS(15); gui->add_subwindow(new TrackTitleColorDefault(this, x, y)); } @@ -488,6 +491,9 @@ void TrackTitleColorPicker::handle_done_event(int result) } +#define TPW_W xS(300) +#define TPW_H yS(220) + TrackPopupShow::TrackPopupShow(MWindow *mwindow, TrackPopup *popup) : BC_MenuItem(_("Show edit")) { @@ -505,8 +511,8 @@ int TrackPopupShow::handle_event() { if( popup->edit ) { dialog_thread->close_window(); - int wx = mwindow->gui->get_abs_cursor_x(0) - 400 / 2; - int wy = mwindow->gui->get_abs_cursor_y(0) - 500 / 2; + int wx = mwindow->gui->get_abs_cursor_x(0) - TPW_W / 2; + int wy = mwindow->gui->get_abs_cursor_y(0) - TPW_H / 2; dialog_thread->start(wx, wy); } return 1; @@ -545,7 +551,7 @@ void TrackShowDialogThread::handle_close_event(int result) TrackPopupShowWindow::TrackPopupShowWindow(MWindow *mwindow, TrackPopup *popup, int wx, int wy) : BC_Window(_(PROGRAM_NAME ": Show edit"), wx, wy, - 300, 220, 300, 220, 0, 0, 1) + TPW_W, TPW_H, TPW_W, TPW_H, 0, 0, 1) { this->mwindow = mwindow; this->popup = popup; @@ -558,15 +564,15 @@ TrackPopupShowWindow::~TrackPopupShowWindow() void TrackPopupShowWindow::create_objects() { lock_window("TrackPopupShowWindow::create_objects"); - int x = 10, y = 10; + int x = xS(10), y = yS(10); BC_Title *title; char text[BCTEXTLEN]; Edit *edit = popup->edit; Track *track = edit->track; sprintf(text, _("Track %d:"), mwindow->edl->tracks->number_of(track)+1); add_subwindow(title = new BC_Title(x, y, text)); - int x1 = x + title->get_w() + 10; - int tw = get_w() - x1 - 20; + int x1 = x + title->get_w() + xS(10); + int tw = get_w() - x1 - xS(20); truncate_text(text, track->title, tw); add_subwindow(new BC_Title(x1, y, text)); y += title->get_h() + 5; @@ -598,7 +604,7 @@ void TrackPopupShowWindow::create_objects() time_format, sample_rate, frame_rate, frames_per_foot), Units::totext(text_length, length, time_format, sample_rate, frame_rate, frames_per_foot)); - show_text = new TrackPopupShowText(this, mwindow, x+15, y+10, text); + show_text = new TrackPopupShowText(this, mwindow, x+xS(15), y+yS(10), text); add_subwindow(show_text); add_tool(new BC_OKButton(this)); @@ -610,7 +616,7 @@ void TrackPopupShowWindow::create_objects() TrackPopupShowText::TrackPopupShowText(TrackPopupShowWindow *window, MWindow *mwindow, int x, int y, const char *text) - : BC_TextBox(x, y, 250, 4, text) + : BC_TextBox(x, y, xS(250), 4, text) { this->window = window; this->mwindow = mwindow; diff --git a/cinelerra-5.1/cinelerra/transitionpopup.C b/cinelerra-5.1/cinelerra/transitionpopup.C index 115a2f1d..ff19113b 100644 --- a/cinelerra-5.1/cinelerra/transitionpopup.C +++ b/cinelerra-5.1/cinelerra/transitionpopup.C @@ -53,11 +53,14 @@ void TransitionLengthThread::start(Transition *transition, double length) BC_DialogThread::start(); } +#define TLW_W xS(300) +#define TLW_H yS(100) + BC_Window* TransitionLengthThread::new_gui() { BC_DisplayInfo display_info; - int x = display_info.get_abs_cursor_x() - 150; - int y = display_info.get_abs_cursor_y() - 50; + int x = display_info.get_abs_cursor_x() - TLW_W / 2; + int y = display_info.get_abs_cursor_y() - TLW_H / 2; TransitionLengthDialog *gui = new TransitionLengthDialog(mwindow, this, x, y); gui->create_objects(); return gui; @@ -120,7 +123,7 @@ int TransitionUnitsItem::handle_event() } TransitionUnitsPopup::TransitionUnitsPopup(TransitionLengthDialog *gui, int x, int y) - : BC_PopupMenu(x, y, 120, "", 1) + : BC_PopupMenu(x, y, xS(120), "", 1) { this->gui = gui; units = TIME_SECONDS; @@ -145,7 +148,7 @@ void TransitionUnitsPopup::create_objects() TransitionLengthDialog::TransitionLengthDialog(MWindow *mwindow, TransitionLengthThread *thread, int x, int y) : BC_Window(_(PROGRAM_NAME ": Transition length"), x, y, - 300, 100, -1, -1, 0, 0, 1) + TLW_W, TLW_H, -1, -1, 0, 0, 1) { this->mwindow = mwindow; this->thread = thread; @@ -159,9 +162,9 @@ TransitionLengthDialog::~TransitionLengthDialog() void TransitionLengthDialog::create_objects() { lock_window("TransitionLengthDialog::create_objects"); - add_subwindow(units_popup = new TransitionUnitsPopup(this, 10, 10)); + add_subwindow(units_popup = new TransitionUnitsPopup(this, xS(10), yS(10))); units_popup->create_objects(); - text = new TransitionLengthText(mwindow, this, 160, 10); + text = new TransitionLengthText(mwindow, this, xS(160), yS(10)); text->create_objects(); text->set_precision(3); text->set_increment(0.1); @@ -181,7 +184,7 @@ int TransitionLengthDialog::close_event() TransitionLengthText::TransitionLengthText(MWindow *mwindow, TransitionLengthDialog *gui, int x, int y) : BC_TumbleTextBox(gui, (float)gui->thread->new_length, - 0.f, 100.f, x, y, 100) + 0.f, 100.f, x, y, xS(100)) { this->mwindow = mwindow; this->gui = gui; diff --git a/cinelerra-5.1/cinelerra/vdeviceprefs.C b/cinelerra-5.1/cinelerra/vdeviceprefs.C index d20c0587..fbd96978 100644 --- a/cinelerra-5.1/cinelerra/vdeviceprefs.C +++ b/cinelerra-5.1/cinelerra/vdeviceprefs.C @@ -120,11 +120,8 @@ int VDevicePrefs::initialize(int creation) if(!menu) { - dialog->add_subwindow(menu = new VDriverMenu(x, - y + 10, - this, - (mode == MODERECORD), - driver)); + dialog->add_subwindow(menu = new VDriverMenu(x, y + yS(10), + this, (mode == MODERECORD), driver)); menu->create_objects(); } @@ -211,23 +208,23 @@ int VDevicePrefs::get_h() void VDevicePrefs::create_dvb_objs() { - int x1 = x + menu->get_w() + 30; - int y1 = y + 10; + int x1 = x + menu->get_w() + xS(30); + int y1 = y + yS(10); char *output_char = in_config->dvb_in_adapter; - int y2 = y1 - BC_Title::calculate_h(dialog, _("DVB Adapter:"), MEDIUMFONT) - 5; + int y2 = y1 - BC_Title::calculate_h(dialog, _("DVB Adapter:"), MEDIUMFONT) - yS(5); BC_Resources *resources = BC_WindowBase::get_resources(); dvb_adapter_title = new BC_Title(x1, y2, _("DVB Adapter:"), MEDIUMFONT, resources->text_default); dialog->add_subwindow(dvb_adapter_title); dialog->add_subwindow(device_text = new VDeviceTextBox(x1, y1, output_char)); - int x2 = x1 + device_text->get_w() + 5; + int x2 = x1 + device_text->get_w() + xS(5); device_title = new BC_Title(x2, y2, _("dev:"), MEDIUMFONT, resources->text_default); dialog->add_subwindow(device_title); int *output_int = &in_config->dvb_in_device; - dvb_adapter_device = new VDeviceTumbleBox(this, x2, y1, output_int, 0, 9, 20); + dvb_adapter_device = new VDeviceTumbleBox(this, x2, y1, output_int, 0, 9, xS(20)); dvb_adapter_device->create_objects(); - x1 += 64; y1 += device_text->get_h() + 5; + x1 += xS(64); y1 += device_text->get_h() + yS(5); follow_video_config = new BC_CheckBox(x1, y1, &in_config->follow_video, _("Follow video config")); dialog->add_subwindow(follow_video_config); @@ -235,9 +232,10 @@ void VDevicePrefs::create_dvb_objs() int VDevicePrefs::create_firewire_objs() { + int xs5 = xS(5), ys20 = yS(20); int *output_int = 0; char *output_char = 0; - int x1 = x + menu->get_w() + 5; + int x1 = x + menu->get_w() + xS(5); BC_Resources *resources = BC_WindowBase::get_resources(); // Firewire path @@ -259,8 +257,8 @@ int VDevicePrefs::create_firewire_objs() if(output_char) { dialog->add_subwindow(device_title = new BC_Title(x1, y, _("Device Path:"), MEDIUMFONT, resources->text_default)); - dialog->add_subwindow(firewire_path = new VDeviceTextBox(x1, y + 20, output_char)); - x1 += firewire_path->get_w() + 5; + dialog->add_subwindow(firewire_path = new VDeviceTextBox(x1, y + ys20, output_char)); + x1 += firewire_path->get_w() + xs5; } // Firewire port @@ -277,8 +275,8 @@ int VDevicePrefs::create_firewire_objs() break; } dialog->add_subwindow(port_title = new BC_Title(x1, y, _("Port:"), MEDIUMFONT, resources->text_default)); - dialog->add_subwindow(firewire_port = new VDeviceIntBox(x1, y + 20, output_int)); - x1 += firewire_port->get_w() + 5; + dialog->add_subwindow(firewire_port = new VDeviceIntBox(x1, y + ys20, output_int)); + x1 += firewire_port->get_w() + xs5; // Firewire channel switch(mode) @@ -295,8 +293,8 @@ int VDevicePrefs::create_firewire_objs() } dialog->add_subwindow(channel_title = new BC_Title(x1, y, _("Channel:"), MEDIUMFONT, resources->text_default)); - dialog->add_subwindow(firewire_channel = new VDeviceIntBox(x1, y + 20, output_int)); - x1 += firewire_channel->get_w() + 5; + dialog->add_subwindow(firewire_channel = new VDeviceIntBox(x1, y + ys20, output_int)); + x1 += firewire_channel->get_w() + xs5; // Firewire syt @@ -318,7 +316,7 @@ int VDevicePrefs::create_firewire_objs() if(output_int) { dialog->add_subwindow(syt_title = new BC_Title(x1, y, _("Syt Offset:"), MEDIUMFONT, resources->text_default)); - dialog->add_subwindow(firewire_syt = new VDeviceIntBox(x1, y + 20, output_int)); + dialog->add_subwindow(firewire_syt = new VDeviceIntBox(x1, y + ys20, output_int)); } return 0; @@ -326,28 +324,30 @@ int VDevicePrefs::create_firewire_objs() int VDevicePrefs::create_v4l2_objs() { + int xs5 = xS(5), ys20 = yS(20); char *output_char; BC_Resources *resources = BC_WindowBase::get_resources(); - int x1 = x + menu->get_w() + 5; + int x1 = x + menu->get_w() + xs5; output_char = pwindow->thread->edl->session->vconfig_in->v4l2_in_device; dialog->add_subwindow(device_title = new BC_Title(x1, y, _("Device path:"), MEDIUMFONT, resources->text_default)); - dialog->add_subwindow(device_text = new VDeviceTextBox(x1, y + 20, output_char)); + dialog->add_subwindow(device_text = new VDeviceTextBox(x1, y + ys20, output_char)); return 0; } int VDevicePrefs::create_v4l2jpeg_objs() { + int xs5 = xS(5), ys20 = yS(20); BC_Resources *resources = BC_WindowBase::get_resources(); - int x1 = x + menu->get_w() + 5; + int x1 = x + menu->get_w() + xs5; char *output_char = &pwindow->thread->edl->session->vconfig_in->v4l2jpeg_in_device[0]; dialog->add_subwindow(device_title = new BC_Title(x1, y, _("Device path:"), MEDIUMFONT, resources->text_default)); - dialog->add_subwindow(device_text = new VDeviceTextBox(x1, y + 20, output_char)); - x1 += bmax(device_title->get_w(),device_text->get_w()) + 5; + dialog->add_subwindow(device_text = new VDeviceTextBox(x1, y + ys20, output_char)); + x1 += bmax(device_title->get_w(),device_text->get_w()) + xs5; int *output_int = &pwindow->thread->edl->session->vconfig_in->v4l2jpeg_in_fields; fields_title = new BC_Title(x1, y, _("Fields:"), MEDIUMFONT, resources->text_default); dialog->add_subwindow(fields_title); - device_fields = new VDeviceTumbleBox(this, x1, y + 20, output_int, 1, 2, 20); + device_fields = new VDeviceTumbleBox(this, x1, y + ys20, output_int, 1, 2, xS(20)); device_fields->create_objects(); return 0; } @@ -356,12 +356,12 @@ int VDevicePrefs::create_v4l2mpeg_objs() { char *output_char; BC_Resources *resources = BC_WindowBase::get_resources(); - int x1 = x + menu->get_w() + 5; + int x1 = x + menu->get_w() + xS(5); output_char = pwindow->thread->edl->session->vconfig_in->v4l2mpeg_in_device; dialog->add_subwindow(device_title = new BC_Title(x1, y, _("Device path:"), MEDIUMFONT, resources->text_default)); - int y1 = y + 20; + int y1 = y + yS(20); dialog->add_subwindow(device_text = new VDeviceTextBox(x1, y1, output_char)); - x1 += 64; y1 += device_text->get_h() + 5; + x1 += xS(64); y1 += device_text->get_h() + yS(5); follow_video_config = new BC_CheckBox(x1, y1, &in_config->follow_video, _("Follow video config")); dialog->add_subwindow(follow_video_config); @@ -373,10 +373,10 @@ int VDevicePrefs::create_screencap_objs() { char *output_char; BC_Resources *resources = BC_WindowBase::get_resources(); - int x1 = x + menu->get_w() + 5; + int x1 = x + menu->get_w() + xS(5); output_char = pwindow->thread->edl->session->vconfig_in->screencapture_display; dialog->add_subwindow(device_title = new BC_Title(x1, y, _("Display:"), MEDIUMFONT, resources->text_default)); - dialog->add_subwindow(device_text = new VDeviceTextBox(x1, y + 20, output_char)); + dialog->add_subwindow(device_text = new VDeviceTextBox(x1, y + yS(20), output_char)); return 0; } @@ -395,17 +395,17 @@ int VDevicePrefs::create_x11_objs() x11_display = _("Default B Display:"); break; break; } - int x1 = menu->get_x() + menu->get_w() + 10; + int x1 = menu->get_x() + menu->get_w() + xS(10); int y1 = menu->get_y(); - if( driver == PLAYBACK_X11 ) y1 -= 10; - dialog->add_subwindow(device_title = new BC_Title(x1, y1+4, x11_display, + if( driver == PLAYBACK_X11 ) y1 -= yS(10); + dialog->add_subwindow(device_title = new BC_Title(x1, y1+yS(4), x11_display, MEDIUMFONT, resources->text_default)); - int x2 = x1 + device_title->get_w() + 10, dy = device_title->get_h(); + int x2 = x1 + device_title->get_w() + xS(10), dy = device_title->get_h(); dialog->add_subwindow(device_text = new VDeviceTextBox(x2, y1, output_char)); if( driver == PLAYBACK_X11 ) { int y2 = device_text->get_h(); if( dy < y2 ) dy = y2; - y1 += dy + 5; + y1 += dy + yS(5); use_direct_x11 = new BC_CheckBox(x1, y1, &out_config->use_direct_x11, _("use direct x11 render if possible")); dialog->add_subwindow(use_direct_x11); @@ -416,12 +416,9 @@ int VDevicePrefs::create_x11_objs() -VDriverMenu::VDriverMenu(int x, - int y, - VDevicePrefs *device_prefs, - int do_input, - int *output) - : BC_PopupMenu(x, y, 200, driver_to_string(*output)) +VDriverMenu::VDriverMenu(int x, int y, + VDevicePrefs *device_prefs, int do_input, int *output) + : BC_PopupMenu(x, y, xS(200), driver_to_string(*output)) { this->output = output; this->do_input = do_input; @@ -557,7 +554,7 @@ int VDriverItem::handle_event() VDeviceTextBox::VDeviceTextBox(int x, int y, char *output) - : BC_TextBox(x, y, 200, 1, output) + : BC_TextBox(x, y, xS(200), 1, output) { this->output = output; } @@ -590,7 +587,7 @@ int VDeviceTumbleBox::handle_event() VDeviceIntBox::VDeviceIntBox(int x, int y, int *output) - : BC_TextBox(x, y, 60, 1, *output) + : BC_TextBox(x, y, xS(60), 1, *output) { this->output = output; } @@ -639,7 +636,7 @@ int VScalingItem::handle_event() VScalingEquation::VScalingEquation(int x, int y, int *output) - : BC_PopupMenu(x, y, 240, interpolation_to_string(*output)) + : BC_PopupMenu(x, y, xS(240), interpolation_to_string(*output)) { this->output = output; } diff --git a/cinelerra-5.1/cinelerra/videowindowgui.C b/cinelerra-5.1/cinelerra/videowindowgui.C index 252e5710..351f544d 100644 --- a/cinelerra-5.1/cinelerra/videowindowgui.C +++ b/cinelerra-5.1/cinelerra/videowindowgui.C @@ -28,13 +28,13 @@ -#define CROPHANDLE_W 10 -#define CROPHANDLE_H 10 +#define CROPHANDLE_W xS(10) +#define CROPHANDLE_H yS(10) VideoWindowGUI::VideoWindowGUI(VideoWindow *thread, int w, int h) : BC_Window(_(PROGRAM_NAME ": Video out"), (int)BC_INFINITY, (int)BC_INFINITY, - w, h, 10, 10, 1, 1, 1) + w, h, xS(10), yS(10), 1, 1, 1) { this->thread = thread; } @@ -65,7 +65,7 @@ int VideoWindowGUI::resize_event(int w, int h) // new_h = h; // thread->get_full_sizes(full_w, full_h); // -// if(labs(full_w - new_w) < 50) +// if(labs(full_w - new_w) < xS(50)) // { // new_w = full_w; // new_h = full_h; @@ -73,8 +73,8 @@ int VideoWindowGUI::resize_event(int w, int h) // else // thread->fix_size(new_w, new_h, w, thread->mwindow->get_aspect_ratio()); // -// if(new_w < 10) new_w = 10; -// if(new_h < 10) new_h = 10; +// if(new_w < xS(10)) new_w = xS(10); +// if(new_h < yS(10)) new_h = yS(10); // w = thread->video_window_w = new_w; // h = new_h; // diff --git a/cinelerra-5.1/cinelerra/vpatchgui.C b/cinelerra-5.1/cinelerra/vpatchgui.C index 774ac86b..a2c2ca7c 100644 --- a/cinelerra-5.1/cinelerra/vpatchgui.C +++ b/cinelerra-5.1/cinelerra/vpatchgui.C @@ -109,7 +109,7 @@ int VPatchGUI::update(int x, int y) else if( h >= y2 ) { int64_t v = mwindow->get_float_auto(this, AUTOMATION_FADE)->get_value(); patchbay->add_subwindow(fade = new VFadePatch(this, x1+x, y1+y, - patchbay->get_w() - 10, v)); + patchbay->get_w() - xS(10), v)); } y1 = y2; @@ -130,13 +130,13 @@ int VPatchGUI::update(int x, int y) } } else if( h >= y2 ) { - patchbay->add_subwindow(mix = new VMixPatch(mwindow, this, x1+x, y1+y+5)); + patchbay->add_subwindow(mix = new VMixPatch(mwindow, this, x1+x, y1+y+yS(5))); x1 += mix->get_w(); patchbay->add_subwindow(mode = new VModePatch(mwindow, this, x1+x, y1+y)); mode->create_objects(); x1 += mode->get_w(); patchbay->add_subwindow(nudge = new NudgePatch(mwindow, this, x1+x, y1+y, - patchbay->get_w() - x1-x - 10)); + patchbay->get_w() - x1-x - xS(10))); } y1 = y2; @@ -190,7 +190,7 @@ int VFadePatch::handle_event() } VKeyFadePatch::VKeyFadePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y) - : BC_SubWindow(x,y, 200,20, GWindowGUI::auto_colors[AUTOMATION_FADE]) + : BC_SubWindow(x,y, xS(200),yS(20), GWindowGUI::auto_colors[AUTOMATION_FADE]) { this->mwindow = mwindow; this->patch = patch; @@ -200,7 +200,7 @@ void VKeyFadePatch::create_objects() { int x = 0, y = 0; int64_t v = mwindow->get_float_auto(patch, AUTOMATION_FADE)->get_value(); - add_subwindow(vkey_fade_text = new VKeyFadeText(this, x, y, 64, v)); + add_subwindow(vkey_fade_text = new VKeyFadeText(this, x, y, xS(64), v)); x += vkey_fade_text->get_w(); VFrame **lok_images = mwindow->theme->get_image_set("lok"); int w1 = get_w() - x - lok_images[0]->get_w(); @@ -262,7 +262,7 @@ int VKeyFadeSlider::handle_event() VModePatch::VModePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y) - : BC_PopupMenu(x, y, patch->patchbay->mode_icons[0]->get_w() + 20, + : BC_PopupMenu(x, y, patch->patchbay->mode_icons[0]->get_w() + xS(20), "", 1, mwindow->theme->get_image_set("mode_popup", 0), 0) { this->mwindow = mwindow; diff --git a/cinelerra-5.1/cinelerra/vwindowgui.C b/cinelerra-5.1/cinelerra/vwindowgui.C index 062989a2..892fb050 100644 --- a/cinelerra-5.1/cinelerra/vwindowgui.C +++ b/cinelerra-5.1/cinelerra/vwindowgui.C @@ -68,11 +68,7 @@ VWindowGUI::VWindowGUI(MWindow *mwindow, VWindow *vwindow) mwindow->session->vwindow_y, mwindow->session->vwindow_w, mwindow->session->vwindow_h, - 100, - 100, - 1, - 1, - 0) // Hide it + xS(100), yS(100), 1, 1, 0) // Hide it { this->mwindow = mwindow; this->vwindow = vwindow; @@ -717,13 +713,8 @@ void VWindowEditing::panel_set_labels_follow_edits(int v) {} VWindowSource::VWindowSource(MWindow *mwindow, VWindowGUI *vwindow, int x, int y) - : BC_PopupTextBox(vwindow, - &vwindow->sources, - "", - x, - y, - 200, - 200) + : BC_PopupTextBox(vwindow, &vwindow->sources, "", + x, y, xS(200), yS(200)) { this->mwindow = mwindow; this->vwindow = vwindow; diff --git a/cinelerra-5.1/cinelerra/wwindow.C b/cinelerra-5.1/cinelerra/wwindow.C index cdfa5349..4bb23990 100644 --- a/cinelerra-5.1/cinelerra/wwindow.C +++ b/cinelerra-5.1/cinelerra/wwindow.C @@ -73,7 +73,8 @@ int WWindow::wait_result() } WWindowGUI::WWindowGUI(WWindow *thread, int x, int y) - : BC_Window(_(PROGRAM_NAME ": Warning"), x, y, 640, 100, 640, 100, 0, 0, 1) + : BC_Window(_(PROGRAM_NAME ": Warning"), x, y, + xS(640), yS(100), xS(640), yS(100), 0, 0, 1) { this->thread = thread; } @@ -81,13 +82,13 @@ WWindowGUI::WWindowGUI(WWindow *thread, int x, int y) void WWindowGUI::create_objects() { lock_window("WWindowGUI::create_objects"); - int x = 10, y = 10; - add_subwindow(new BC_TextBox(x, y, get_w()-50, 3, thread->warn_text)); - y = get_h() - 30; + int x = xS(10), y = yS(10); + add_subwindow(new BC_TextBox(x, y, get_w()-xS(50), 3, thread->warn_text)); + y = get_h() - yS(30); if( thread->do_warning ) add_subwindow(new WDisable(this, x, y)); - y = get_h() - BC_CancelButton::calculate_h() - 10; - x = get_w() - BC_CancelButton::calculate_w() - 10; + y = get_h() - BC_CancelButton::calculate_h() - yS(10); + x = get_w() - BC_CancelButton::calculate_w() - xS(10); add_subwindow(new BC_CancelButton(x, y)); show_window(); unlock_window(); diff --git a/cinelerra-5.1/cinelerra/zoombar.C b/cinelerra-5.1/cinelerra/zoombar.C index 51d0df73..60ed04c5 100644 --- a/cinelerra-5.1/cinelerra/zoombar.C +++ b/cinelerra-5.1/cinelerra/zoombar.C @@ -23,6 +23,7 @@ #include "clip.h" #include "edl.h" #include "edlsession.h" +#include "keys.h" #include "language.h" #include "localsession.h" #include "maincursor.h" @@ -58,9 +59,9 @@ ZoomBar::~ZoomBar() void ZoomBar::create_objects() { - int x = 3; - int y = get_h() / 2 - - mwindow->theme->get_image_set("zoombar_menu", 0)[0]->get_h() / 2; + int xs5 = xS(5), xs10 = xS(10); + int x = xS(3), y = get_h()/2 - + mwindow->theme->get_image_set("zoombar_menu", 0)[0]->get_h()/2; draw_top_background(get_parent(), 0, 0, get_w(), get_h()); sample_zoom = new SampleZoomPanel(mwindow, this, x, y); @@ -74,16 +75,16 @@ void ZoomBar::create_objects() track_zoom = new TrackZoomPanel(mwindow, this, x, y); track_zoom->create_objects(); track_zoom->set_tooltip(_("Height of tracks in the timeline")); - x += track_zoom->get_w() + 10; + x += track_zoom->get_w() + xs10; - int wid = 120; + int wid = xS(120); for( int i=AUTOGROUPTYPE_AUDIO_FADE; i<=AUTOGROUPTYPE_Y; ++i ) { int ww = BC_GenericButton::calculate_w(this, AutoTypeMenu::to_text(i)); if( ww > wid ) wid = ww; } add_subwindow(auto_type = new AutoTypeMenu(mwindow, this, x, y, wid)); auto_type->create_objects(); - x += auto_type->get_w() + 10; + x += auto_type->get_w() + xs10; #define DEFAULT_TEXT "000.00 to 000.00" add_subwindow(auto_zoom = new AutoZoom(mwindow, this, x, y, 0)); x += auto_zoom->get_w(); @@ -93,19 +94,19 @@ void ZoomBar::create_objects() x, y, DEFAULT_TEXT)); - x += auto_zoom_text->get_w() + 5; + x += auto_zoom_text->get_w() + xs5; add_subwindow(auto_zoom = new AutoZoom(mwindow, this, x, y, 1)); update_autozoom(); - x += auto_zoom->get_w() + 5; + x += auto_zoom->get_w() + xs5; add_subwindow(from_value = new FromTextBox(mwindow, this, x, y)); - x += from_value->get_w() + 5; + x += from_value->get_w() + xs5; add_subwindow(length_value = new LengthTextBox(mwindow, this, x, y)); - x += length_value->get_w() + 5; + x += length_value->get_w() + xs5; add_subwindow(to_value = new ToTextBox(mwindow, this, x, y)); - x += to_value->get_w() + 5; + x += to_value->get_w() + xs5; add_subwindow(title_alpha_bar = new TitleAlphaBar(mwindow, this, x, y)); - x += title_alpha_bar->get_w() + 5; + x += title_alpha_bar->get_w() + xs5; add_subwindow(title_alpha_text = new TitleAlphaText(mwindow, this, x, y)); update_formatting(from_value); @@ -210,7 +211,7 @@ int ZoomBar::update_clocks() } TitleAlphaBar::TitleAlphaBar(MWindow *mwindow, ZoomBar *zoombar, int x, int y) - : BC_FSlider(x, y, 0, 150, 200, 0, 1.0, mwindow->session->title_bar_alpha, 0) + : BC_FSlider(x, y, 0, xS(150), xS(200), 0, 1.0, mwindow->session->title_bar_alpha, 0) { this->mwindow = mwindow; this->zoombar = zoombar; @@ -229,7 +230,7 @@ int TitleAlphaBar::handle_event() } TitleAlphaText::TitleAlphaText(MWindow *mwindow, ZoomBar *zoombar, int x, int y) - : BC_TextBox(x, y, 48, 1, mwindow->session->title_bar_alpha, 0, MEDIUMFONT, 2) + : BC_TextBox(x, y, xS(48), 1, mwindow->session->title_bar_alpha, 0, MEDIUMFONT, 2) { this->mwindow = mwindow; this->zoombar = zoombar; @@ -349,19 +350,9 @@ int ZoomBar::set_selection(int which_one) } - - - - - - - - - - SampleZoomPanel::SampleZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y) : ZoomPanel(mwindow, zoombar, mwindow->edl->local_session->zoom_sample, - x, y, 130, MIN_ZOOM_TIME, MAX_ZOOM_TIME, ZOOM_TIME) + x, y, xS(130), MIN_ZOOM_TIME, MAX_ZOOM_TIME, ZOOM_TIME) { this->mwindow = mwindow; this->zoombar = zoombar; @@ -375,7 +366,7 @@ int SampleZoomPanel::handle_event() AmpZoomPanel::AmpZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y) : ZoomPanel(mwindow, zoombar, mwindow->edl->local_session->zoom_y, - x, y, 100, MIN_AMP_ZOOM, MAX_AMP_ZOOM, ZOOM_LONG) + x, y, xS(100), MIN_AMP_ZOOM, MAX_AMP_ZOOM, ZOOM_LONG) { this->mwindow = mwindow; this->zoombar = zoombar; @@ -388,7 +379,7 @@ int AmpZoomPanel::handle_event() TrackZoomPanel::TrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y) : ZoomPanel(mwindow, zoombar, mwindow->edl->local_session->zoom_track, - x, y, 90, MIN_TRACK_ZOOM, MAX_TRACK_ZOOM, ZOOM_LONG) + x, y, xS(90), MIN_TRACK_ZOOM, MAX_TRACK_ZOOM, ZOOM_LONG) { this->mwindow = mwindow; this->zoombar = zoombar; @@ -440,7 +431,7 @@ int AutoZoom::handle_down_event() AutoTypeMenu::AutoTypeMenu(MWindow *mwindow, ZoomBar *zoombar, int x, int y, int wid) - : BC_PopupMenu(x, y, wid + 24, + : BC_PopupMenu(x, y, wid + xS(24), to_text(mwindow->edl->local_session->zoombar_showautotype), 1, 0, 12) { this->mwindow = mwindow; @@ -484,12 +475,12 @@ int AutoTypeMenu::from_text(char *text) int AutoTypeMenu::draw_face(int dx, int color) { - BC_PopupMenu::draw_face(dx+8, color); + BC_PopupMenu::draw_face(dx+xS(8), color); color = mwindow->edl->local_session->zoombar_showautocolor; if( color >= 0 ) { set_color(color); int margin = get_margin(); - int mx = margin+8, my = 3*margin/8; + int mx = margin+xS(8), my = 3*margin/8; int bh = get_h() - 2*my; draw_box(mx,my, bh,bh); } @@ -505,7 +496,7 @@ int AutoTypeMenu::handle_event() ZoomTextBox::ZoomTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y, const char *text) - : BC_TextBox(x, y, 130, 1, text) + : BC_TextBox(x, y, xS(130), 1, text) { this->mwindow = mwindow; this->zoombar = zoombar; @@ -565,7 +556,7 @@ int ZoomTextBox::handle_event() FromTextBox::FromTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y) - : BC_TextBox(x, y, 90, 1, "") + : BC_TextBox(x, y, xS(90), 1, "") { this->mwindow = mwindow; this->zoombar = zoombar; @@ -574,7 +565,7 @@ FromTextBox::FromTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y) int FromTextBox::handle_event() { - if(get_keypress() == 13) + if(get_keypress() == NEWLINE) { zoombar->set_selection(SET_FROM); return 1; @@ -601,7 +592,7 @@ int FromTextBox::update_position(double new_position) LengthTextBox::LengthTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y) - : BC_TextBox(x, y, 90, 1, "") + : BC_TextBox(x, y, xS(90), 1, "") { this->mwindow = mwindow; this->zoombar = zoombar; @@ -610,7 +601,7 @@ LengthTextBox::LengthTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y) int LengthTextBox::handle_event() { - if(get_keypress() == 13) + if(get_keypress() == NEWLINE) { zoombar->set_selection(SET_LENGTH); return 1; @@ -635,7 +626,7 @@ int LengthTextBox::update_position(double new_position) ToTextBox::ToTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y) - : BC_TextBox(x, y, 90, 1, "") + : BC_TextBox(x, y, xS(90), 1, "") { this->mwindow = mwindow; this->zoombar = zoombar; @@ -644,7 +635,7 @@ ToTextBox::ToTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y) int ToTextBox::handle_event() { - if(get_keypress() == 13) + if(get_keypress() == NEWLINE) { zoombar->set_selection(SET_TO); return 1; diff --git a/cinelerra-5.1/cinelerra/zwindowgui.C b/cinelerra-5.1/cinelerra/zwindowgui.C index 9657b573..1ffa772d 100644 --- a/cinelerra-5.1/cinelerra/zwindowgui.C +++ b/cinelerra-5.1/cinelerra/zwindowgui.C @@ -39,7 +39,7 @@ ZWindowGUI::ZWindowGUI(MWindow *mwindow, ZWindow *zwindow, Mixer *mixer) : BC_Window(zwindow->title, mixer->x, mixer->y, mixer->w, mixer->h, - 100, 75, 1, 1, 0) + xS(100), yS(75), 1, 1, 0) { this->mwindow = mwindow; this->zwindow = zwindow; @@ -59,7 +59,8 @@ void ZWindowGUI::create_objects() { lock_window("ZWindowGUI::create_objects"); - canvas = new ZWindowCanvas(mwindow, this, 10,10, get_w()-20,get_h()-20); + canvas = new ZWindowCanvas(mwindow, this, + xS(10),yS(10), get_w()-xS(20),get_h()-yS(20)); canvas->create_objects(mwindow->edl); playback_engine = new PlaybackEngine(mwindow, canvas); playback_engine->create_objects(); @@ -71,7 +72,8 @@ void ZWindowGUI::create_objects() int ZWindowGUI::resize_event(int w, int h) { - canvas->reposition_window(0, 10,10, w-20,h-20); + canvas->reposition_window(0, + xS(10),yS(10), w-xS(20),h-yS(20)); zwindow->reposition(get_x(), get_y(), w, h); BC_WindowBase::resize_event(w, h); return 1; diff --git a/cinelerra-5.1/guicast/bcbutton.C b/cinelerra-5.1/guicast/bcbutton.C index 6d0c4349..e4088e55 100644 --- a/cinelerra-5.1/guicast/bcbutton.C +++ b/cinelerra-5.1/guicast/bcbutton.C @@ -254,22 +254,22 @@ int BC_Button::get_status() BC_OKButton::BC_OKButton(int x, int y) : BC_Button(x, y, - BC_WindowBase::get_resources()->ok_images) + BC_WindowBase::get_resources()->ok_images) { } BC_OKButton::BC_OKButton(BC_WindowBase *parent_window, VFrame **images) - : BC_Button(10, - parent_window->get_h() - images[0]->get_h() - 10, - images) + : BC_Button(xS(10), + parent_window->get_h() - images[0]->get_h() - yS(10), + images) { set_tooltip(_("OK")); } BC_OKButton::BC_OKButton(BC_WindowBase *parent_window) - : BC_Button(10, - parent_window->get_h() - BC_WindowBase::get_resources()->ok_images[0]->get_h() - 10, - BC_WindowBase::get_resources()->ok_images) + : BC_Button(xS(10), + parent_window->get_h() - BC_WindowBase::get_resources()->ok_images[0]->get_h() - yS(10), + BC_WindowBase::get_resources()->ok_images) { set_tooltip(_("OK")); } @@ -282,8 +282,8 @@ int BC_OKButton::handle_event() int BC_OKButton::resize_event(int w, int h) { - reposition_window(10, - h - BC_WindowBase::get_resources()->cancel_images[0]->get_h() - 10); + reposition_window(xS(10), + h - BC_WindowBase::get_resources()->cancel_images[0]->get_h() - yS(10)); return 1; } @@ -317,23 +317,23 @@ int BC_OKButton::calculate_w() BC_CancelButton::BC_CancelButton(int x, int y) : BC_Button(x, y, - BC_WindowBase::get_resources()->cancel_images) + BC_WindowBase::get_resources()->cancel_images) { set_tooltip(_("Cancel")); } BC_CancelButton::BC_CancelButton(BC_WindowBase *parent_window) - : BC_Button(parent_window->get_w() - BC_WindowBase::get_resources()->cancel_images[0]->get_w() - 10, - parent_window->get_h() - BC_WindowBase::get_resources()->cancel_images[0]->get_h() - 10, - BC_WindowBase::get_resources()->cancel_images) + : BC_Button(parent_window->get_w() - BC_WindowBase::get_resources()->cancel_images[0]->get_w() - xS(10), + parent_window->get_h() - BC_WindowBase::get_resources()->cancel_images[0]->get_h() - yS(10), + BC_WindowBase::get_resources()->cancel_images) { set_tooltip(_("Cancel")); } BC_CancelButton::BC_CancelButton(BC_WindowBase *parent_window, VFrame **images) - : BC_Button(parent_window->get_w() - images[0]->get_w() - 10, - parent_window->get_h() - images[0]->get_h() - 10, - images) + : BC_Button(parent_window->get_w() - images[0]->get_w() - xS(10), + parent_window->get_h() - images[0]->get_h() - yS(10), + images) { set_tooltip(_("Cancel")); } @@ -346,8 +346,8 @@ int BC_CancelButton::handle_event() int BC_CancelButton::resize_event(int w,int h) { - reposition_window(w - BC_WindowBase::get_resources()->cancel_images[0]->get_w() - 10, - h - BC_WindowBase::get_resources()->cancel_images[0]->get_h() - 10); + reposition_window(w - BC_WindowBase::get_resources()->cancel_images[0]->get_w() - xS(10), + h - BC_WindowBase::get_resources()->cancel_images[0]->get_h() - yS(10)); return 1; } @@ -485,8 +485,8 @@ int BC_GenericButton::draw_face(int flush) BC_OKTextButton::BC_OKTextButton(BC_WindowBase *parent_window) - : BC_GenericButton(10, - parent_window->get_h() - BC_GenericButton::calculate_h() - 10, + : BC_GenericButton(xS(10), + parent_window->get_h() - BC_GenericButton::calculate_h() - yS(10), _("OK")) { this->parent_window = parent_window; @@ -494,8 +494,8 @@ BC_OKTextButton::BC_OKTextButton(BC_WindowBase *parent_window) int BC_OKTextButton::resize_event(int w, int h) { - reposition_window(10, - parent_window->get_h() - BC_GenericButton::calculate_h() - 10); + reposition_window(xS(10), + parent_window->get_h() - BC_GenericButton::calculate_h() - yS(10)); return 1; } @@ -514,8 +514,8 @@ int BC_OKTextButton::keypress_event() BC_CancelTextButton::BC_CancelTextButton(BC_WindowBase *parent_window) - : BC_GenericButton(parent_window->get_w() - BC_GenericButton::calculate_w(parent_window, _("Cancel")) - 10, - parent_window->get_h() - BC_GenericButton::calculate_h() - 10, + : BC_GenericButton(parent_window->get_w() - BC_GenericButton::calculate_w(parent_window, _("Cancel")) - xS(10), + parent_window->get_h() - BC_GenericButton::calculate_h() - yS(10), _("Cancel")) { this->parent_window = parent_window; @@ -523,8 +523,8 @@ BC_CancelTextButton::BC_CancelTextButton(BC_WindowBase *parent_window) int BC_CancelTextButton::resize_event(int w, int h) { - reposition_window(parent_window->get_w() - BC_GenericButton::calculate_w(parent_window, _("Cancel")) - 10, - parent_window->get_h() - BC_GenericButton::calculate_h() - 10); + reposition_window(parent_window->get_w() - BC_GenericButton::calculate_w(parent_window, _("Cancel")) - xS(10), + parent_window->get_h() - BC_GenericButton::calculate_h() - yS(10)); return 1; } diff --git a/cinelerra-5.1/guicast/bcdelete.C b/cinelerra-5.1/guicast/bcdelete.C index 972eff3d..2267f4ee 100644 --- a/cinelerra-5.1/guicast/bcdelete.C +++ b/cinelerra-5.1/guicast/bcdelete.C @@ -25,20 +25,9 @@ #include "language.h" - - - BC_DeleteFile::BC_DeleteFile(BC_FileBox *filebox, int x, int y) : BC_Window(filebox->get_delete_title(), - x, - y, - 320, - 480, - 0, - 0, - 0, - 0, - 1) + x, y, xS(320), yS(480), 0, 0, 0, 0, 1) { this->filebox = filebox; data = 0; @@ -51,7 +40,7 @@ BC_DeleteFile::~BC_DeleteFile() void BC_DeleteFile::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); data = new ArrayList; int i = 1; char *path; @@ -67,15 +56,11 @@ void BC_DeleteFile::create_objects() BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Really delete the following files?"))); - y += title->get_h() + 5; + y += title->get_h() + yS(5); BC_DeleteList *list; - add_subwindow(list = new BC_DeleteList(filebox, - x, - y, - get_w() - x * 2, - get_h() - y - BC_OKButton::calculate_h() - 20, - data)); - y += list->get_h() + 5; + add_subwindow(list = new BC_DeleteList(filebox, x, y, + get_w() - x * 2, get_h() - y - BC_OKButton::calculate_h() - xS(20), data)); + y += list->get_h() + yS(5); add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); show_window(); @@ -83,34 +68,15 @@ void BC_DeleteFile::create_objects() } - - - BC_DeleteList::BC_DeleteList(BC_FileBox *filebox, - int x, - int y, - int w, - int h, + int x, int y, int w, int h, ArrayList *data) - : BC_ListBox(x, - y, - w, - h, - LISTBOX_TEXT, - data) + : BC_ListBox(x, y, w, h, LISTBOX_TEXT, data) { this->filebox = filebox; } - - - - - - - - BC_DeleteThread::BC_DeleteThread(BC_FileBox *filebox) : BC_DialogThread() { @@ -136,10 +102,3 @@ BC_Window* BC_DeleteThread::new_gui() return result; } - - - - - - - diff --git a/cinelerra-5.1/guicast/bcdisplay.C b/cinelerra-5.1/guicast/bcdisplay.C index 39a2b908..b09beb64 100644 --- a/cinelerra-5.1/guicast/bcdisplay.C +++ b/cinelerra-5.1/guicast/bcdisplay.C @@ -122,38 +122,27 @@ void BC_Display::dump_windows() void BC_Display::new_window(BC_WindowBase *window) { -//printf("BC_Display::new_window %d\n", __LINE__); - if(!clipboard) - { + if( !clipboard ) { clipboard = new BC_Clipboard(window); clipboard->start_clipboard(); } -//printf("BC_Display::new_window %d\n", __LINE__); windows.append(window); // dump_windows(); -//printf("BC_Display::new_window %d\n", __LINE__); } void BC_Display::delete_window(BC_WindowBase *window) { -//printf("BC_Display::delete_window %d\n", __LINE__); windows.remove(window); -//printf("BC_Display::delete_window %d\n", __LINE__); } // If the event happened in any subwindow int BC_Display::is_event_win(XEvent *event, BC_WindowBase *window) { Window event_win = event->xany.window; -//printf("BC_Display::is_event_win %d\n", __LINE__); if(event_win == 0 || window->win == event_win) return 1; -//printf("BC_Display::is_event_win %d\n", __LINE__); - for(int i = 0; i < window->subwindows->size(); i++) - { - if(is_event_win(event, window->subwindows->get(i))) - { -//printf("BC_Display::is_event_win %d\n", __LINE__); + for(int i = 0; i < window->subwindows->size(); i++) { + if(is_event_win(event, window->subwindows->get(i))) { return 1; } } @@ -174,79 +163,55 @@ int BC_Display::is_event_win(XEvent *event, BC_WindowBase *window) void BC_Display::loop() { - const int debug = 0; -if(debug) printf("BC_Display::loop %d\n", __LINE__); while(!done) { // If an event is waiting, process it now. -if(debug) printf("BC_Display::loop %d\n", __LINE__); if(get_event_count()) { -if(debug) printf("BC_Display::loop %d\n", __LINE__); handle_event(); -if(debug) printf("BC_Display::loop %d\n", __LINE__); } else // Otherwise, process all compressed events & get the next event. { -if(debug) printf("BC_Display::loop %d\n", __LINE__); lock_display("BC_Display::loop"); for(int i = 0; i < windows.size(); i++) { BC_WindowBase *window = windows.get(i); -if(debug) printf("BC_Display::loop %d %d %d %d\n", -__LINE__, -window->resize_events, -window->motion_events, -window->translation_events); +// printf("BC_Display::loop %d %d %d %d\n", __LINE__, +// window->resize_events, window->motion_events, window->translation_events); if(window->resize_events) window->dispatch_resize_event(window->last_resize_w, window->last_resize_h); if(window->motion_events) window->dispatch_motion_event(); -if(debug) printf("BC_Display::loop %d\n", __LINE__); if(window->translation_events) window->dispatch_translation_event(); } -if(debug) printf("BC_Display::loop %d\n", __LINE__); unlock_display(); -if(debug) printf("BC_Display::loop %d\n", __LINE__); handle_event(); -if(debug) printf("BC_Display::loop %d\n", __LINE__); } } -if(debug) printf("BC_Display::loop %d\n", __LINE__); } void BC_Display::handle_event() { -const int debug = 0; XEvent *event = get_event(); -if(debug) printf("BC_Display::handle_event %d type=%d\n", -__LINE__, -event->type); +// printf("BC_Display::handle_event %d type=%d\n", __LINE__, event->type); lock_display("BC_Display::handle_event"); -if(debug) printf("BC_Display::handle_event %d\n", __LINE__); for(int i = 0; i < windows.size(); i++) { // Test if event was inside window -if(debug) printf("BC_Display::handle_event %d\n", __LINE__); BC_WindowBase *window = windows.get(i); -if(debug) printf("BC_Display::handle_event %d\n", __LINE__); if(is_event_win(event, window)) // Dispatch event window->dispatch_event(event); -if(debug) printf("BC_Display::handle_event %d\n", __LINE__); } -if(debug) printf("BC_Display::handle_event %d\n", __LINE__); unlock_display(); -if(debug) printf("BC_Display::handle_event %d\n", __LINE__); delete event; -if(debug) printf("BC_Display::handle_event %d\n", __LINE__); } // Get pending events for the given window @@ -274,13 +239,9 @@ int BC_Display::get_event_count() XEvent* BC_Display::get_event() { XEvent *result = 0; - while(!done && !result) - { -//printf("BC_Display::get_event %d\n", __LINE__); + while(!done && !result) { event_condition->lock("BC_WindowBase::get_event"); -//printf("BC_Display::get_event %d\n", __LINE__); event_lock->lock("BC_WindowBase::get_event"); -//printf("BC_Display::get_event %d\n", __LINE__); if(common_events.total && !done) { diff --git a/cinelerra-5.1/guicast/bcdisplayinfo.C b/cinelerra-5.1/guicast/bcdisplayinfo.C index 489d1314..fcee2066 100644 --- a/cinelerra-5.1/guicast/bcdisplayinfo.C +++ b/cinelerra-5.1/guicast/bcdisplayinfo.C @@ -114,6 +114,21 @@ int BC_DisplayInfo::xinerama_geometry(int screen, int &x, int &y, int &w, int &h return 0; } +int BC_DisplayInfo::xinerama_big_screen() +{ + int screens = get_xinerama_screens(); + int best = 0, ret = -1; + for( int k=screens; --k>=0; ) { + int w = xinerama_info[k].width, h = xinerama_info[k].height; + int sz = w * h; + if( sz > best ) { + ret = xinerama_info[k].screen_number; + best = sz; + } + } + return ret; +} + static void get_top_coords(Display *display, Window win, int &px,int &py, int &tx,int &ty) { Window *pcwin = 0; unsigned int ncwin = 0; diff --git a/cinelerra-5.1/guicast/bcdisplayinfo.h b/cinelerra-5.1/guicast/bcdisplayinfo.h index 2b7e5187..63c06b98 100644 --- a/cinelerra-5.1/guicast/bcdisplayinfo.h +++ b/cinelerra-5.1/guicast/bcdisplayinfo.h @@ -59,6 +59,7 @@ public: int get_screen() { return scrnum; } int get_xinerama_screens(); int xinerama_geometry(int screen, int &x, int &y, int &w, int &h); + int xinerama_big_screen(); #ifdef HAVE_GL int gl_fb_config(); int gl_probe(Window win); diff --git a/cinelerra-5.1/guicast/bcfilebox.C b/cinelerra-5.1/guicast/bcfilebox.C index 803f2fc4..54e6bbf5 100644 --- a/cinelerra-5.1/guicast/bcfilebox.C +++ b/cinelerra-5.1/guicast/bcfilebox.C @@ -38,13 +38,8 @@ #include - - - - - BC_FileBoxRecent::BC_FileBoxRecent(BC_FileBox *filebox, int x, int y) - : BC_ListBox(x, y, 250, + : BC_ListBox(x, y, xS(250), filebox->get_text_height(MEDIUMFONT) * FILEBOX_HISTORY_SIZE + BC_ScrollBar::get_span(SCROLL_HORIZ) + LISTBOX_MARGIN * 2, LISTBOX_TEXT, &filebox->recent_dirs, @@ -65,15 +60,6 @@ int BC_FileBoxRecent::handle_event() } - - - - - - - - - BC_FileBoxListBox::BC_FileBoxListBox(int x, int y, BC_FileBox *filebox) : BC_ListBox(x, y, filebox->get_listbox_w(), filebox->get_listbox_h(y), filebox->get_display_mode(), filebox->list_column, @@ -174,7 +160,7 @@ int BC_FileBoxListBox::evaluate_query(char *string) BC_FileBoxTextBox::BC_FileBoxTextBox(int x, int y, BC_FileBox *filebox) - : BC_TextBox(x, y, filebox->get_w() - x - 20, 1, + : BC_TextBox(x, y, filebox->get_w() - x - xS(20), 1, filebox->want_directory ? filebox->directory : filebox->filename) { this->filebox = filebox; @@ -224,7 +210,7 @@ int BC_FileBoxDirectoryText::handle_event() BC_FileBoxSearchText::BC_FileBoxSearchText(int x, int y, BC_FileBox *filebox) - : BC_TextBox(x, y, filebox->get_w() - x - 40, 1, "") + : BC_TextBox(x, y, filebox->get_w() - x - xS(40), 1, "") { this->filebox = filebox; } @@ -237,7 +223,7 @@ int BC_FileBoxSearchText::handle_event() BC_FileBoxFilterText::BC_FileBoxFilterText(int x, int y, BC_FileBox *filebox) - : BC_TextBox(x, y, filebox->get_w() - x - 50, 1, filebox->get_resources()->filebox_filter) + : BC_TextBox(x, y, filebox->get_w() - x - xS(50), 1, filebox->get_resources()->filebox_filter) { this->filebox = filebox; } @@ -250,7 +236,7 @@ int BC_FileBoxFilterText::handle_event() BC_FileBoxFilterMenu::BC_FileBoxFilterMenu(int x, int y, BC_FileBox *filebox) - : BC_ListBox(x, y, filebox->get_w() - 30, 120, + : BC_ListBox(x, y, filebox->get_w() - xS(30), yS(120), LISTBOX_TEXT, &filebox->filter_list, 0, 0, 1, 0, 1) { this->filebox = filebox; @@ -462,7 +448,7 @@ BC_FileBox::BC_FileBox(int x, int y, const char *init_path, : BC_Window(title, x, y, BC_WindowBase::get_resources()->filebox_w, BC_WindowBase::get_resources()->filebox_h, - 400, 300, 1, 0, 1) + xS(400), yS(300), 1, 0, 1) { fs = new FileSystem; // if(want_directory) @@ -540,8 +526,7 @@ BC_FileBox::BC_FileBox(int x, int y, const char *init_path, if(h_padding == -1) { - h_padding = BC_WindowBase::get_resources()->ok_images[0]->get_h() - - 20; + h_padding = BC_WindowBase::get_resources()->ok_images[0]->get_h() - yS(20); } this->h_padding = h_padding; delete_thread = new BC_DeleteThread(this); @@ -568,10 +553,12 @@ BC_FileBox::~BC_FileBox() void BC_FileBox::create_objects() { + int xs5 = xS(5), xs10 = xS(10), xs20 = xS(20); + int ys5 = yS(5), ys10 = yS(10); lock_window("BC_FileBox::create_objects"); - int x = 10, y = 10; + int x = xs10, y = ys10; BC_Resources *resources = BC_WindowBase::get_resources(); - int directory_title_margin = MAX(20, + int directory_title_margin = MAX(xs20, resources->filebox_text_images[0]->get_h()); // Directories aren't filtered in FileSystem so skip this @@ -597,52 +584,52 @@ void BC_FileBox::create_objects() add_subwindow(new BC_Title(x, y, caption)); - x = get_w() - resources->filebox_icons_images[0]->get_w() - 10; + x = get_w() - resources->filebox_icons_images[0]->get_w() - xs10; add_subwindow(icon_button = new BC_FileBoxIcons(x, y, this)); - x -= resources->filebox_text_images[0]->get_w() + 5; + x -= resources->filebox_text_images[0]->get_w() + xs5; add_subwindow(text_button = new BC_FileBoxText(x, y, this)); - x -= resources->filebox_newfolder_images[0]->get_w() + 5; + x -= resources->filebox_newfolder_images[0]->get_w() + xs5; add_subwindow(folder_button = new BC_FileBoxNewfolder(x, y, this)); - x -= resources->filebox_delete_images[0]->get_w() + 5; + x -= resources->filebox_delete_images[0]->get_w() + xs5; add_subwindow(rename_button = new BC_FileBoxRename(x, y, this)); - x -= resources->filebox_delete_images[0]->get_w() + 5; + x -= resources->filebox_delete_images[0]->get_w() + xs5; add_subwindow(delete_button = new BC_FileBoxDelete(x, y, this)); - x -= resources->filebox_reload_images[0]->get_w() + 5; + x -= resources->filebox_reload_images[0]->get_w() + xs5; add_subwindow(reload_button = new BC_FileBoxReload(x, y, this)); - x -= resources->filebox_updir_images[0]->get_w() + 5; + x -= resources->filebox_updir_images[0]->get_w() + xs5; add_subwindow(updir_button = new BC_FileBoxUpdir(x, y, this)); - x -= resources->filebox_szfmt_images[0]->get_w() + 5; + x -= resources->filebox_szfmt_images[0]->get_w() + xs5; add_subwindow(szfmt_button = new BC_FileBoxSizeFormat(x, y, this)); - x = 10; - y += directory_title_margin + 3; + x = xs10; + y += directory_title_margin + yS(3); add_subwindow(recent_popup = new BC_FileBoxRecent(this, x, y)); BC_Title *dir_title; add_subwindow(dir_title = new BC_Title(x, y, _("Directory:"))); - int x1 = x + dir_title->get_w() + 10, w1 = get_w()-x1 - recent_popup->get_w()-20; + int x1 = x + dir_title->get_w() + xs10, w1 = get_w()-x1 - recent_popup->get_w()-xs20; add_subwindow(directory_title = new BC_FileBoxDirectoryText(x1, y, w1, this)); - x1 += directory_title->get_w() + 8; - recent_popup->reposition_window(x1, y, directory_title->get_w(), 200); + x1 += directory_title->get_w() + xS(8); + recent_popup->reposition_window(x1, y, directory_title->get_w(), yS(200)); - x = 10; - y += directory_title->get_h() + 5; + x = xs10; + y += directory_title->get_h() + ys5; BC_Title *search_title; add_subwindow(search_title = new BC_Title(x, y, _("Search:"))); - x += search_title->get_w() + 10; + x += search_title->get_w() + xs10; add_subwindow(search_text = new BC_FileBoxSearchText(x, y, this)); - x = 10; - y += search_text->get_h() + 5; + x = xs10; + y += search_text->get_h() + ys5; int newest_id = 0, newest = -1; for(int i = 0; i < FILEBOX_HISTORY_SIZE; i++) { @@ -668,19 +655,19 @@ void BC_FileBox::create_objects() listbox = 0; create_listbox(x, y, get_display_mode()); - y += listbox->get_h() + 10; + y += listbox->get_h() + ys10; add_subwindow(file_title = new BC_Title(x, y, _("File:"))); - x1 = x + file_title->get_w() + 10; + x1 = x + file_title->get_w() + xs10; add_subwindow(textbox = new BC_FileBoxTextBox(x1, y, this)); - y += textbox->get_h() + 10; + y += textbox->get_h() + ys10; if(!want_directory) { add_subwindow(filter_title = new BC_Title(x, y, _("Specify filter:"))); - int x1 = x + filter_title->get_w() + 10; + int x1 = x + filter_title->get_w() + xs10; add_subwindow(filter_text = new BC_FileBoxFilterText(x1, y, this)); add_subwindow(filter_popup = new BC_FileBoxFilterMenu(x1 + filter_text->get_w(), y, this)); - y += filter_text->get_h() + 10; + y += filter_text->get_h() + ys10; } y_margin = y; @@ -698,12 +685,12 @@ void BC_FileBox::create_objects() int BC_FileBox::get_listbox_w() { - return get_w() - 20; + return get_w() - xS(20); } int BC_FileBox::get_listbox_h(int y) { - int result = get_h() - y - h_padding - 10; + int result = get_h() - y - h_padding - yS(10); if(want_directory) result -= BC_WindowBase::get_resources()->dirbox_margin; else @@ -734,13 +721,13 @@ int BC_FileBox::resize_event(int w, int h) // cancel_button->reposition_window(w - (get_w() - cancel_button->get_x()), // h - (get_h() - cancel_button->get_y())); if(usethis_button) - usethis_button->reposition_window(w / 2 - 50, + usethis_button->reposition_window(w / 2 - xS(50), h - (get_h() - usethis_button->get_y())); if(filter_popup) filter_popup->reposition_window(w - (get_w() - filter_popup->get_x()), h - (get_h() - filter_popup->get_y()), - w - 30, + w - xS(30), 0); if(filter_title) filter_title->reposition_window(filter_title->get_x(), @@ -751,15 +738,15 @@ int BC_FileBox::resize_event(int w, int h) 1); directory_title->reposition_window( directory_title->get_x(), directory_title->get_y(), - get_w()-directory_title->get_x() - recent_popup->get_w()-20, 1); + get_w()-directory_title->get_x() - recent_popup->get_w()-xS(20), 1); recent_popup->reposition_window( - directory_title->get_x() + directory_title->get_w() + 8, + directory_title->get_x() + directory_title->get_w() + xS(8), directory_title->get_y(), - directory_title->get_w() + recent_popup->get_w(), 200); + directory_title->get_w() + recent_popup->get_w(), xS(200)); search_text->reposition_window( search_text->get_x(), search_text->get_y(), - get_w() - search_text->get_x() - 40, + get_w() - search_text->get_x() - xS(40), 1); file_title->reposition_window(file_title->get_x(), h - (get_h() - file_title->get_y())); @@ -785,8 +772,8 @@ int BC_FileBox::resize_event(int w, int h) get_resources()->filebox_w = get_w(); get_resources()->filebox_h = get_h(); y_margin = filter_text ? - filter_text->get_y() + filter_text->get_h() + 10 : - textbox->get_y() + textbox->get_h() + 10 ; + filter_text->get_y() + filter_text->get_h() + yS(10) : + textbox->get_y() + textbox->get_h() + yS(10) ; flush(); return 1; } diff --git a/cinelerra-5.1/guicast/bclistbox.C b/cinelerra-5.1/guicast/bclistbox.C index a7cb8b87..8ef0ab0b 100644 --- a/cinelerra-5.1/guicast/bclistbox.C +++ b/cinelerra-5.1/guicast/bclistbox.C @@ -1689,17 +1689,16 @@ int BC_ListBox::get_scrollbars() int flush = 0; title_h = get_title_h(); - view_h = popup_h - title_h - 4; - view_w = popup_w - 4; + view_h = popup_h - title_h - yS(4); + view_w = popup_w - xS(4); // Create scrollbars as needed for( int i=0; i<2; ++i ) { if( w_needed > view_w ) { need_xscroll = 1; - view_h = popup_h - - title_h - + view_h = popup_h - title_h - get_resources()->hscroll_data[SCROLL_HANDLE_UP]->get_h() - - 4; + yS(4); } else { need_xscroll = 0; @@ -1709,7 +1708,7 @@ int BC_ListBox::get_scrollbars() need_yscroll = 1; view_w = popup_w - get_resources()->vscroll_data[SCROLL_HANDLE_UP]->get_w() - - 4; + xS(4); } else { need_yscroll = 0; @@ -1768,10 +1767,10 @@ int BC_ListBox::get_scrollbars() } if( !bg_surface || - view_w + 4 != bg_surface->get_w() || - view_h + 4 != bg_surface->get_h() ) { + view_w + xS(4) != bg_surface->get_w() || + view_h + yS(4) != bg_surface->get_h() ) { if( bg_surface ) delete bg_surface; - bg_surface = new BC_Pixmap(gui, view_w + 4, view_h + 4); + bg_surface = new BC_Pixmap(gui, view_w + xS(4), view_h + yS(4)); bg_draw = 1; } @@ -1779,6 +1778,18 @@ int BC_ListBox::get_scrollbars() return 0; } +int BC_ListBox::get_w() +{ + return is_popup ? button_images[0]->get_w() + xS(1) : popup_w; +} +int BC_ListBox::get_h() +{ + return is_popup ? button_images[0]->get_h() + yS(1) : popup_h; +} +int BC_ListBox::gui_tooltip(const char *text) +{ + return is_popup && gui ? gui->show_tooltip(text, gui->get_w(),0, -1,-1) : -1; +} void BC_ListBox::set_drag_scroll(int value) { @@ -1815,18 +1826,18 @@ int BC_ListBox::drag_scroll_event() result = 1; } else - if( get_cursor_y() >= view_h + title_h + 4 ) { - yposition += get_cursor_y() - (view_h + title_h + 4); + if( get_cursor_y() >= view_h + title_h + yS(4) ) { + yposition += get_cursor_y() - (view_h + title_h + yS(4)); result = 1; } - if( get_cursor_x() < 2 ) { - xposition -= 2 - get_cursor_x(); + if( get_cursor_x() < xS(2) ) { + xposition -= xS(2) - get_cursor_x(); result = 1; } else - if( get_cursor_x() >= view_w + 2 ) { - xposition += get_cursor_x() - (view_w + 2); + if( get_cursor_x() >= view_w + xS(2) ) { + xposition += get_cursor_x() - (view_w + xS(2)); result = 1; } @@ -3300,9 +3311,9 @@ int BC_ListBox::drag_stop_event() reposition_item(data, selection_number, top_level->cursor_x - drag_popup->get_w() / 2 - - LISTBOX_MARGIN - 2 + xposition, + LISTBOX_MARGIN - xS(2) + xposition, top_level->cursor_y - drag_popup->get_h() / 2 - - LISTBOX_MARGIN - 2 + yposition); + LISTBOX_MARGIN - yS(2) + yposition); } else // Move rows @@ -3437,8 +3448,8 @@ int BC_ListBox::activate(int take_focus) XTranslateCoordinates(top_level->display, parent_window->win, top_level->rootwin, wx, wy, &abs_x, &abs_y, &xwin); - if( x <= 0 ) x = 2; - if( y <= 0 ) y = 2; + if( x <= 0 ) x = xS(2); + if( y <= 0 ) y = yS(2); return activate(abs_x, abs_y); } @@ -3545,13 +3556,13 @@ int BC_ListBox::keypress_event() break; case LEFT: - xposition -= 10; + xposition -= xS(10); redraw = 1; result = 1; break; case RIGHT: - xposition += 10; + xposition += xS(10); redraw = 1; result = 1; break; diff --git a/cinelerra-5.1/guicast/bclistbox.h b/cinelerra-5.1/guicast/bclistbox.h index 6bdd2c04..e1e991a5 100644 --- a/cinelerra-5.1/guicast/bclistbox.h +++ b/cinelerra-5.1/guicast/bclistbox.h @@ -29,8 +29,6 @@ #include "bctoggle.h" #include "bccolors.h" -#define BCPOPUPLISTBOX_W 25 -#define BCPOPUPLISTBOX_H 25 class BC_ListBoxYScroll; class BC_ListBoxXScroll; @@ -250,11 +248,9 @@ public: int get_title_h(); int get_display_mode(); void set_justify(int value); - int get_w() { return is_popup ? BCPOPUPLISTBOX_W : popup_w; } - int get_h() { return is_popup ? BCPOPUPLISTBOX_H : popup_h; } - int gui_tooltip(const char *text) { - return is_popup && gui ? gui->show_tooltip(text, gui->get_w(),0, -1,-1) : -1; - } + int get_w(); + int get_h(); + int gui_tooltip(const char *text); int get_view_w() { return view_w; } int get_view_h() { return view_h; } int get_row_height() { return row_height; } diff --git a/cinelerra-5.1/guicast/bclistbox.inc b/cinelerra-5.1/guicast/bclistbox.inc index 0073019c..33f3fd86 100644 --- a/cinelerra-5.1/guicast/bclistbox.inc +++ b/cinelerra-5.1/guicast/bclistbox.inc @@ -37,11 +37,11 @@ #define ICON_TOP 1 // White space around text -#define LISTBOX_MARGIN 4 +#define LISTBOX_MARGIN xS(4) // Distance from sides of window -#define LISTBOX_BORDER 2 -#define ICON_MARGIN 2 -#define LISTBOX_INDENT 18 +#define LISTBOX_BORDER xS(2) +#define ICON_MARGIN xS(2) +#define LISTBOX_INDENT xS(18) // Justification for popup listbox #define LISTBOX_LEFT 0 diff --git a/cinelerra-5.1/guicast/bcmenu.C b/cinelerra-5.1/guicast/bcmenu.C index 2092fc8e..d0307c99 100644 --- a/cinelerra-5.1/guicast/bcmenu.C +++ b/cinelerra-5.1/guicast/bcmenu.C @@ -46,11 +46,7 @@ BC_Menu::~BC_Menu() } int BC_Menu::initialize(BC_WindowBase *top_level, - BC_MenuBar *menu_bar, - int x, - int y, - int w, - int h) + BC_MenuBar *menu_bar, int x, int y, int w, int h) { this->x = x; this->y = y; @@ -309,7 +305,7 @@ int BC_Menu::draw_title(int flash, int flush) menu_bar->set_color(resources->menu_title_text); menu_bar->set_font(MEDIUMFONT); - menu_bar->draw_text(x + 10 + text_offset, + menu_bar->draw_text(x + xS(10) + text_offset, h / 2 + menu_bar->get_text_ascent(MEDIUMFONT) / 2 + 1 + text_offset, text); if(flash) menu_bar->flash(flush); diff --git a/cinelerra-5.1/guicast/bcmenubar.C b/cinelerra-5.1/guicast/bcmenubar.C index 908567ec..7d7cc2b2 100644 --- a/cinelerra-5.1/guicast/bcmenubar.C +++ b/cinelerra-5.1/guicast/bcmenubar.C @@ -107,16 +107,16 @@ int BC_MenuBar::add_menu(BC_Menu* menu) // Get dimensions if(menu_titles.total == 0) - x = 2; + x = xS(2); else x = menu_titles.values[menu_titles.total - 1]->x + menu_titles.values[menu_titles.total - 1]->w; - w = get_text_width(MEDIUMFONT, menu->text) + 20; + w = get_text_width(MEDIUMFONT, menu->text) + xS(20); // get pointer menu_titles.append(menu); // initialize and draw - menu->initialize(top_level, this, x, 2, w, get_h() - 4); + menu->initialize(top_level, this, x, yS(2), w, get_h() - yS(4)); return 0; } diff --git a/cinelerra-5.1/guicast/bcmenuitem.C b/cinelerra-5.1/guicast/bcmenuitem.C index 1e9399b1..6653b14f 100644 --- a/cinelerra-5.1/guicast/bcmenuitem.C +++ b/cinelerra-5.1/guicast/bcmenuitem.C @@ -150,7 +150,7 @@ int BC_MenuItem::activate_submenu() &new_y, &tempwin); submenu->popup_menu = menu_popup->popup_menu; - submenu->activate_menu(new_x + 5, new_y, menu_popup->w - 10, h, 0, 0); + submenu->activate_menu(new_x + xS(5), new_y, menu_popup->w - xS(10), h, 0, 0); highlighted = 1; } return 0; @@ -311,13 +311,13 @@ int BC_MenuItem::draw() if(!strcmp(text, "-")) { menu_popup->get_popup()->set_color(DKGREY); - menu_popup->get_popup()->draw_line(5, y + h / 2, menu_popup->get_w() - 5, y + h / 2); + menu_popup->get_popup()->draw_line(xS(5), y + h / 2, menu_popup->get_w() - xS(5), y + h / 2); menu_popup->get_popup()->set_color(LTGREY); - menu_popup->get_popup()->draw_line(5, y + h / 2 + 1, menu_popup->get_w() - 5, y + h / 2 + 1); + menu_popup->get_popup()->draw_line(xS(5), y + h / 2 + 1, menu_popup->get_w() - xS(5), y + h / 2 + 1); } else { - int offset = 0; + int xoffset = 0, yoffset = 0; if(highlighted) { int y = this->y; @@ -351,7 +351,7 @@ int BC_MenuItem::draw() resources->menu_down, resources->menu_light); } - offset = 1; + xoffset = xS(1); yoffset = yS(1); } else // Highlighted @@ -385,23 +385,23 @@ int BC_MenuItem::draw() } if(checked) { -// menu_popup->get_popup()->draw_check(10 + offset, y + 2 + offset); +// menu_popup->get_popup()->draw_check(xS(10) + xoffset, y + 2 + yoffset); menu_popup->get_popup()->draw_pixmap(menu_popup->check, - offset, - y + (this->h - menu_popup->check->get_h()) / 2 + offset); + xoffset, + y + (this->h - menu_popup->check->get_h()) / 2 + yoffset); menu_popup->get_popup()->set_font(MEDIUMFONT); - menu_popup->get_popup()->draw_text(menu_popup->check->get_w() + offset, - y + h - text_line - 2 + offset, + menu_popup->get_popup()->draw_text(menu_popup->check->get_w() + xoffset, + y + h - text_line - 2 + yoffset, text); - menu_popup->get_popup()->draw_text(menu_popup->get_key_x() + offset, - y + h - text_line - 2 + offset, + menu_popup->get_popup()->draw_text(menu_popup->get_key_x() + xoffset, + y + h - text_line - 2 + yoffset, hotkey_text); } else { menu_popup->get_popup()->set_font(MEDIUMFONT); - menu_popup->get_popup()->draw_text(10 + offset, y + h - text_line - 2 + offset, text); - menu_popup->get_popup()->draw_text(menu_popup->get_key_x() + offset, y + h - text_line - 2 + offset, hotkey_text); + menu_popup->get_popup()->draw_text(xS(10) + xoffset, y + h - text_line - 2 + yoffset, text); + menu_popup->get_popup()->draw_text(menu_popup->get_key_x() + xoffset, y + h - text_line - 2 + yoffset, hotkey_text); } } return 0; diff --git a/cinelerra-5.1/guicast/bcmenupopup.C b/cinelerra-5.1/guicast/bcmenupopup.C index 6c4f5fe8..2c72354e 100644 --- a/cinelerra-5.1/guicast/bcmenupopup.C +++ b/cinelerra-5.1/guicast/bcmenupopup.C @@ -289,7 +289,7 @@ int BC_MenuPopup::activate_menu(int x, if(this->y + this->h > top_y1) this->y -= this->h + h; // Bottom justify // Avoid top of menu going out of screen if(this->y < 0) - this->y = 2; + this->y = yS(2); } else { @@ -300,7 +300,7 @@ int BC_MenuPopup::activate_menu(int x, if(this->x + this->w > top_x1) this->x = new_x - this->w; if(this->y + this->h > top_y1) this->y = new_y + h - this->h; } - top_x0 += 2; top_y0 += 2; + top_x0 += xS(2); top_y0 += yS(2); if( this->x < top_x0 ) this->x = top_x0; if( this->y < top_y0 ) this->y = top_y0; @@ -308,16 +308,12 @@ int BC_MenuPopup::activate_menu(int x, if(menu_bar) { popup = new BC_Popup(menu_bar, this->x, this->y, this->w, this->h, - top_level->get_resources()->menu_up, - 1, - menu_bar->bg_pixmap); + top_level->get_resources()->menu_up, 1, menu_bar->bg_pixmap); } else { popup = new BC_Popup(top_level, this->x, this->y, this->w, this->h, - top_level->get_resources()->menu_up, - 1, - 0); + top_level->get_resources()->menu_up, 1, 0); // popup->set_background(top_level->get_resources()->menu_bg); } draw_items(); @@ -377,28 +373,30 @@ int BC_MenuPopup::draw_items() int BC_MenuPopup::get_dimensions() { - int widest_text = 10, widest_key = 10; + int xs10 = xS(10), xs20 = xS(20); + int ys4 = yS(4), ys5 = yS(10); + int widest_text = xs10, widest_key = xs10; int text_w, key_w; int i = 0; // pad for border - h = 2; + h = yS(2); // Set up parameters in each item and get total h. for(i = 0; i < menu_items.total; i++) { - text_w = 10 + top_level->get_text_width(MEDIUMFONT, menu_items.values[i]->text); - if(menu_items.values[i]->checked) text_w += check->get_w() + 1; + text_w = xs10 + top_level->get_text_width(MEDIUMFONT, menu_items.values[i]->text); + if(menu_items.values[i]->checked) text_w += check->get_w() + xS(1); - key_w = 10 + top_level->get_text_width(MEDIUMFONT, menu_items.values[i]->hotkey_text); + key_w = xs10 + top_level->get_text_width(MEDIUMFONT, menu_items.values[i]->hotkey_text); if(text_w > widest_text) widest_text = text_w; if(key_w > widest_key) widest_key = key_w; if(!strcmp(menu_items.values[i]->text, "-")) - menu_items.values[i]->h = 5; + menu_items.values[i]->h = ys5; else { menu_items.values[i]->h = item_bg[0] ? item_bg[0]->get_h() : - top_level->get_text_height(MEDIUMFONT) + 4; + top_level->get_text_height(MEDIUMFONT) + ys4; } menu_items.values[i]->y = h; @@ -406,13 +404,13 @@ int BC_MenuPopup::get_dimensions() menu_items.values[i]->down = 0; h += menu_items.values[i]->h; } - w = widest_text + widest_key + 20; + w = widest_text + widest_key + xs20; w = MAX(w, top_level->get_resources()->min_menu_w); // pad for division - key_x = widest_text + 16; + key_x = widest_text + xS(16); // pad for border - h += 2; + h += yS(2); return 0; } diff --git a/cinelerra-5.1/guicast/bcmeter.C b/cinelerra-5.1/guicast/bcmeter.C index 6ece16f2..e4eb2bd9 100644 --- a/cinelerra-5.1/guicast/bcmeter.C +++ b/cinelerra-5.1/guicast/bcmeter.C @@ -249,8 +249,7 @@ void BC_Meter::get_divisions() { // Create tick mark current_pixel = (pixels - METER_MARGIN * 2 - 2) * - (current - min) / - (max - min) + 2; + (current - min) / (max - min) + 2; tick_pixels.append(current_pixel); // Create titles in selected positions @@ -260,9 +259,7 @@ void BC_Meter::get_divisions() (current - min > 4 && max - current > 4 && !(current % 5))) { int title_pixel = (pixels - - METER_MARGIN * 2) * - (current - min) / - (max - min); + METER_MARGIN * 2) * (current - min) / (max - min); sprintf(string, "%ld", labs(current)); new_string = new char[strlen(string) + 1]; strcpy(new_string, string); @@ -346,11 +343,11 @@ void BC_Meter::draw_titles(int flush) // Tick marks int tick_y = pixels - tick_pixels.values[i] - METER_MARGIN; set_color(get_resources()->meter_font_color); - draw_line(get_title_w() - 10 - 1, tick_y, get_title_w() - 1, tick_y); + draw_line(get_title_w() - xS(10) - 1, tick_y, get_title_w() - 1, tick_y); if(get_resources()->meter_3d) { set_color(BLACK); - draw_line(get_title_w() - 10, tick_y + 1, get_title_w(), tick_y + 1); + draw_line(get_title_w() - xS(10), tick_y + 1, get_title_w(), tick_y + 1); } } @@ -531,12 +528,8 @@ void BC_Meter::draw_face(int flush) draw_pixmap(images[image_number], - x + x1, - get_h() - pixel - in_span, - in_w, - in_span + 1, - in_x, - in_y); + x + x1, get_h() - pixel - in_span, + in_w, in_span + 1, in_x, in_y); } } } @@ -552,25 +545,18 @@ void BC_Meter::draw_face(int flush) if(downmix) { if(orientation == METER_HORIZ) - draw_pixmap(images[METER_DOWNMIX], - 0, - 0); + draw_pixmap(images[METER_DOWNMIX], 0, 0); else - draw_pixmap(images[METER_DOWNMIX], - x, + draw_pixmap(images[METER_DOWNMIX], x, get_h() - images[METER_DOWNMIX]->get_h()-1); } if(over_timer) { if(orientation == METER_HORIZ) - draw_pixmap(images[METER_OVER], - 20, - 2); + draw_pixmap(images[METER_OVER], xS(20), yS(2)); else - draw_pixmap(images[METER_OVER], - x, - get_h() - 100); + draw_pixmap(images[METER_OVER], x, get_h() - yS(100)); over_timer--; } diff --git a/cinelerra-5.1/guicast/bcnewfolder.C b/cinelerra-5.1/guicast/bcnewfolder.C index cc9d4b1b..2d73b49d 100644 --- a/cinelerra-5.1/guicast/bcnewfolder.C +++ b/cinelerra-5.1/guicast/bcnewfolder.C @@ -19,10 +19,11 @@ * */ -#include "condition.h" +#include "bcresources.h" #include "bcfilebox.h" #include "bcnewfolder.h" #include "bctitle.h" +#include "condition.h" #include "filesystem.h" #include "language.h" #include "mutex.h" @@ -30,22 +31,9 @@ #include - - - - - BC_NewFolder::BC_NewFolder(int x, int y, BC_FileBox *filebox) : BC_Window(filebox->get_newfolder_title(), - x, - y, - 320, - 120, - 0, - 0, - 0, - 0, - 1) + x, y, xS(320), yS(120), 0, 0, 0, 0, 1) { } @@ -57,13 +45,13 @@ BC_NewFolder::~BC_NewFolder() void BC_NewFolder::create_objects() { lock_window("BC_NewFolder::create_objects"); - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_tool(new BC_Title(x, y, _("Enter the name of the folder:"))); - y += 20; - add_subwindow(textbox = new BC_TextBox(x, y, 300, 1, _("Untitled"))); - y += 30; + y += yS(20); + add_subwindow(textbox = new BC_TextBox(x, y, xS(300), 1, _("Untitled"))); + y += yS(30); add_subwindow(new BC_OKButton(this)); - x = get_w() - 100; + x = get_w() - xS(100); add_subwindow(new BC_CancelButton(this)); show_window(); unlock_window(); @@ -86,7 +74,7 @@ BC_NewFolderThread::BC_NewFolderThread(BC_FileBox *filebox) BC_NewFolderThread::~BC_NewFolderThread() { - interrupt(); + interrupt(); delete change_lock; delete completion_lock; } diff --git a/cinelerra-5.1/guicast/bcpan.C b/cinelerra-5.1/guicast/bcpan.C index e40910c3..d6da6081 100644 --- a/cinelerra-5.1/guicast/bcpan.C +++ b/cinelerra-5.1/guicast/bcpan.C @@ -91,11 +91,7 @@ int BC_Pan::initialize() BC_SubWindow::initialize(); temp_channel = new VFrame; temp_channel->set_use_shm(0); - temp_channel->reallocate(0, - -1, - 0, - 0, - 0, + temp_channel->reallocate(0, -1, 0, 0, 0, get_resources()->pan_data[PAN_CHANNEL]->get_w(), get_resources()->pan_data[PAN_CHANNEL]->get_h(), get_resources()->pan_data[PAN_CHANNEL]->get_color_model(), @@ -227,14 +223,8 @@ int BC_Pan::activate(int popup_x, int popup_y) active = 0; if (popup_x < 0 || popup_y < 0) { - XTranslateCoordinates(top_level->display, - win, - top_level->rootwin, - 0, - 0, - &x, - &y, - &tempwin); + XTranslateCoordinates(top_level->display, win, + top_level->rootwin, 0, 0, &x, &y, &tempwin); x -= (images[PAN_POPUP]->get_w() - get_w()) / 2; y -= (images[PAN_POPUP]->get_h() - get_h()) / 2; @@ -316,8 +306,8 @@ void BC_Pan::draw_popup() popup->flash(); } -#define PICON_W 6 -#define PICON_H 6 +#define PICON_W xS(6) +#define PICON_H yS(6) void BC_Pan::draw(int flash, int flush) { diff --git a/cinelerra-5.1/guicast/bcpixmap.C b/cinelerra-5.1/guicast/bcpixmap.C index 08491aee..5f5a46a9 100644 --- a/cinelerra-5.1/guicast/bcpixmap.C +++ b/cinelerra-5.1/guicast/bcpixmap.C @@ -78,28 +78,14 @@ BC_Pixmap::BC_Pixmap(BC_WindowBase *parent_window, if(use_opaque()) { opaque_bitmap->write_drawable(opaque_pixmap, - top_level->gc, - 0, - 0, - 0, - 0, - w, - h, - 1); + top_level->gc, 0, 0, 0, 0, w, h, 1); delete opaque_bitmap; } if(use_alpha()) { alpha_bitmap->write_drawable(alpha_pixmap, - copy_gc, - 0, - 0, - icon_offset ? 2 : 0, - icon_offset ? 2 : 0, - w, - h, - 1); + copy_gc, 0, 0, icon_offset ? 2 : 0, icon_offset ? 2 : 0, w, h, 1); delete alpha_bitmap; XFreeGC(top_level->display, copy_gc); @@ -202,20 +188,11 @@ int BC_Pixmap::initialize(BC_WindowBase *parent_window, int w, int h, int mode) gcvalues.function = GXcopy; alpha_pixmap = XCreatePixmap(top_level->display, - top_level->win, - w, - h, - 1); - + top_level->win, w, h, 1); alpha_gc = XCreateGC(top_level->display, - top_level->win, - gcmask, - &gcvalues); - + top_level->win, gcmask, &gcvalues); copy_gc = XCreateGC(top_level->display, - alpha_pixmap, - gcmask, - &gcvalues); + alpha_pixmap, gcmask, &gcvalues); #ifdef HAVE_XFT if(BC_WindowBase::get_resources()->use_xft) @@ -286,24 +263,13 @@ void BC_Pixmap::resize(int w, int h) void BC_Pixmap::copy_area(int x, int y, int w, int h, int x2, int y2) { XCopyArea(top_level->display, - opaque_pixmap, - opaque_pixmap, - top_level->gc, - x, - y, - w, - h, - x2, - y2); + opaque_pixmap, opaque_pixmap, top_level->gc, + x, y, w, h, x2, y2); } int BC_Pixmap::write_drawable(Drawable &pixmap, - int dest_x, - int dest_y, - int dest_w, - int dest_h, - int src_x, - int src_y) + int dest_x, int dest_y, int dest_w, int dest_h, + int src_x, int src_y) { //printf("BC_Pixmap::write_drawable 1\n"); if(dest_w < 0) @@ -322,29 +288,15 @@ int BC_Pixmap::write_drawable(Drawable &pixmap, { XSetClipOrigin(top_level->display, alpha_gc, dest_x - src_x, dest_y - src_y); XCopyArea(top_level->display, - this->opaque_pixmap, - pixmap, - alpha_gc, - src_x, - src_y, - dest_w, - dest_h, - dest_x, - dest_y); + this->opaque_pixmap, pixmap, alpha_gc, + src_x, src_y, dest_w, dest_h, dest_x, dest_y); } else if(use_opaque()) { XCopyArea(top_level->display, - this->opaque_pixmap, - pixmap, - top_level->gc, - src_x, - src_y, - dest_w, - dest_h, - dest_x, - dest_y); + this->opaque_pixmap, pixmap, top_level->gc, + src_x, src_y, dest_w, dest_h, dest_x, dest_y); } //printf("BC_Pixmap::write_drawable 2\n"); @@ -352,91 +304,32 @@ int BC_Pixmap::write_drawable(Drawable &pixmap, } void BC_Pixmap::draw_vframe(VFrame *frame, - int dest_x, - int dest_y, - int dest_w, - int dest_h, - int src_x, - int src_y) + int dest_x, int dest_y, int dest_w, int dest_h, + int src_x, int src_y) { parent_window->draw_vframe(frame, - dest_x, - dest_y, - dest_w, - dest_h, - src_x, - src_y, - 0, - 0, - this); + dest_x, dest_y, dest_w, dest_h, src_x, + src_y, 0, 0, this); } void BC_Pixmap::draw_pixmap(BC_Pixmap *pixmap, - int dest_x, - int dest_y, - int dest_w, - int dest_h, - int src_x, - int src_y) + int dest_x, int dest_y, int dest_w, int dest_h, + int src_x, int src_y) { pixmap->write_drawable(this->opaque_pixmap, - dest_x, - dest_y, - dest_w, - dest_h, - src_x, - src_y); + dest_x, dest_y, dest_w, dest_h, + src_x, src_y); } - - - - - - - - - -int BC_Pixmap::get_w() -{ - return w; -} - -int BC_Pixmap::get_h() -{ - return h; -} - -int BC_Pixmap::get_w_fixed() -{ - return w - 1; -} - -int BC_Pixmap::get_h_fixed() -{ - return h - 1; -} - -Pixmap BC_Pixmap::get_pixmap() -{ - return opaque_pixmap; -} - -Pixmap BC_Pixmap::get_alpha() -{ - return alpha_pixmap; -} - -int BC_Pixmap::use_opaque() -{ - return 1; -} - -int BC_Pixmap::use_alpha() -{ - return mode == PIXMAP_ALPHA; -} +int BC_Pixmap::get_w() { return w; } +int BC_Pixmap::get_h() { return h; } +int BC_Pixmap::get_w_fixed() { return w - 1; } +int BC_Pixmap::get_h_fixed() { return h - 1; } +Pixmap BC_Pixmap::get_pixmap() { return opaque_pixmap; } +Pixmap BC_Pixmap::get_alpha() { return alpha_pixmap; } +int BC_Pixmap::use_opaque() { return 1; } +int BC_Pixmap::use_alpha() { return mode == PIXMAP_ALPHA; } void BC_Pixmap::enable_opengl() diff --git a/cinelerra-5.1/guicast/bcpopupmenu.C b/cinelerra-5.1/guicast/bcpopupmenu.C index ee78dbb3..62a2b403 100644 --- a/cinelerra-5.1/guicast/bcpopupmenu.C +++ b/cinelerra-5.1/guicast/bcpopupmenu.C @@ -37,8 +37,8 @@ #define TOTAL_IMAGES 3 -#define TRIANGLE_W 10 -#define TRIANGLE_H 10 +#define TRIANGLE_W xS(10) +#define TRIANGLE_H yS(10) BC_PopupMenu::BC_PopupMenu(int x, int y, int w, const char *text, @@ -118,8 +118,8 @@ int BC_PopupMenu::initialize() } else { // Move outside window if no title - x = -10; y = -10; - w = 10; h = 10; + x = -TRIANGLE_W; y = -TRIANGLE_H; + w = TRIANGLE_W; h = TRIANGLE_H; } BC_SubWindow::initialize(); @@ -293,7 +293,7 @@ int BC_PopupMenu::menu_activate() w, h, 0, 1); } else - menu_popup->activate_menu(x+3, y+3, w, h, 0, 1); + menu_popup->activate_menu(x+xS(3), y+yS(3), w, h, 0, 1); popup_down = 1; if( use_title ) draw_title(1); } diff --git a/cinelerra-5.1/guicast/bcpot.C b/cinelerra-5.1/guicast/bcpot.C index 60807911..b979f915 100644 --- a/cinelerra-5.1/guicast/bcpot.C +++ b/cinelerra-5.1/guicast/bcpot.C @@ -141,8 +141,8 @@ int BC_Pot::angle_to_coords(int &x1, int &y1, int &x2, int &y2, float angle) y1 = resources->pot_y1; if(status == POT_DN) { - x1 += resources->pot_offset; - y1 += resources->pot_offset; + x1 += xS(resources->pot_offset); + y1 += yS(resources->pot_offset); } while(angle < 0) angle += 360; @@ -406,21 +406,8 @@ int BC_Pot::cursor_motion_event() } - - - - - - - - - -BC_FPot::BC_FPot(int x, - int y, - float value, - float minvalue, - float maxvalue, - VFrame **data) +BC_FPot::BC_FPot(int x, int y, + float value, float minvalue, float maxvalue, VFrame **data) : BC_Pot(x, y, data) { this->value = value; @@ -505,18 +492,8 @@ void BC_FPot::update(float value, float minvalue, float maxvalue) } - - - - - - -BC_IPot::BC_IPot(int x, - int y, - int64_t value, - int64_t minvalue, - int64_t maxvalue, - VFrame **data) +BC_IPot::BC_IPot(int x, int y, + int64_t value, int64_t minvalue, int64_t maxvalue, VFrame **data) : BC_Pot(x, y, data) { this->value = value; @@ -594,14 +571,7 @@ void BC_IPot::update(int64_t value, int64_t minvalue, int64_t maxvalue) } - - - - -BC_QPot::BC_QPot(int x, - int y, - int64_t value, - VFrame **data) +BC_QPot::BC_QPot(int x, int y, int64_t value, VFrame **data) : BC_Pot(x, y, data) { this->value = Freq::fromfreq(value); @@ -667,18 +637,8 @@ void BC_QPot::update(int64_t value) } - - - - - - -BC_PercentagePot::BC_PercentagePot(int x, - int y, - float value, - float minvalue, - float maxvalue, - VFrame **data) +BC_PercentagePot::BC_PercentagePot(int x, int y, + float value, float minvalue, float maxvalue, VFrame **data) : BC_Pot(x, y, data) { this->value = value; @@ -742,10 +702,3 @@ void BC_PercentagePot::update(float value) } } - - - - - - - diff --git a/cinelerra-5.1/guicast/bcprogressbox.C b/cinelerra-5.1/guicast/bcprogressbox.C index fde95804..1fe29fda 100644 --- a/cinelerra-5.1/guicast/bcprogressbox.C +++ b/cinelerra-5.1/guicast/bcprogressbox.C @@ -116,13 +116,8 @@ void BC_ProgressBox::unlock_window() BC_ProgressWindow::BC_ProgressWindow(int x, int y) : BC_Window(_("Progress"), - x, - y, - 340, - 100 + get_resources()->ok_images[0]->get_h(), - 0, - 0, - 0) + x, y, xS(340), yS(100) + get_resources()->ok_images[0]->get_h(), + 0, 0, 0) { } @@ -132,13 +127,13 @@ BC_ProgressWindow::~BC_ProgressWindow() int BC_ProgressWindow::create_objects(const char *text, int64_t length) { - int x = 10, y = 10; + int x = xS(10), y = yS(10); lock_window("BC_ProgressWindow::create_objects"); // Recalculate width based on text if(text) { int text_w = get_text_width(MEDIUMFONT, text); - int new_w = text_w + x + 10, scr_w = get_screen_w(0, -1); + int new_w = text_w + x + xS(10), scr_w = get_screen_w(0, -1); if(new_w > scr_w) new_w = scr_w; if(new_w > get_w()) { resize_window(new_w, get_h()); @@ -147,14 +142,11 @@ int BC_ProgressWindow::create_objects(const char *text, int64_t length) this->text = text; add_tool(caption = new BC_Title(x, y, text)); - y += caption->get_h() + 20; - add_tool(bar = new BC_ProgressBar(x, y, get_w() - 20, length)); + y += caption->get_h() + yS(20); + add_tool(bar = new BC_ProgressBar(x, y, get_w() - xS(20), length)); add_tool(new BC_CancelButton(this)); show_window(1); unlock_window(); return 0; } - - - diff --git a/cinelerra-5.1/guicast/bcrename.C b/cinelerra-5.1/guicast/bcrename.C index 836856da..58da34b4 100644 --- a/cinelerra-5.1/guicast/bcrename.C +++ b/cinelerra-5.1/guicast/bcrename.C @@ -22,6 +22,7 @@ #include "condition.h" #include "bcfilebox.h" #include "bcrename.h" +#include "bcresources.h" #include "bctitle.h" #include "filesystem.h" #include "language.h" @@ -31,22 +32,9 @@ #include - - - - - BC_Rename::BC_Rename(BC_RenameThread *thread, int x, int y, BC_FileBox *filebox) : BC_Window(filebox->get_rename_title(), - x, - y, - 320, - 120, - 0, - 0, - 0, - 0, - 1) + x, y, xS(320), yS(120), 0, 0, 0, 0, 1) { this->thread = thread; } @@ -58,14 +46,14 @@ BC_Rename::~BC_Rename() void BC_Rename::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); lock_window("BC_Rename::create_objects"); add_tool(new BC_Title(x, y, _("Enter a new name for the file:"))); - y += 20; - add_subwindow(textbox = new BC_TextBox(x, y, 300, 1, thread->orig_name)); - y += 30; + y += yS(20); + add_subwindow(textbox = new BC_TextBox(x, y, xS(300), 1, thread->orig_name)); + y += yS(30); add_subwindow(new BC_OKButton(this)); - x = get_w() - 100; + x = get_w() - xS(100); add_subwindow(new BC_CancelButton(this)); show_window(); unlock_window(); @@ -88,7 +76,7 @@ BC_RenameThread::BC_RenameThread(BC_FileBox *filebox) BC_RenameThread::~BC_RenameThread() { - interrupt(); + interrupt(); delete change_lock; delete completion_lock; } diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C index 16f53f97..2683bd20 100644 --- a/cinelerra-5.1/guicast/bcresources.C +++ b/cinelerra-5.1/guicast/bcresources.C @@ -366,8 +366,23 @@ BC_Resources::BC_Resources() { synchronous = 0; vframe_shm = 0; - double default_scale = 1.0; // display_size/1000.; - char *env = getenv("BC_FONT_DEBUG"); + double default_scale = 1; + char *env = getenv("BC_SCALE"); + if( !env ) { + BC_DisplayInfo info; + int wx, wy, ww, wh; + int cins = info.xinerama_big_screen(); + if( !info.xinerama_geometry(cins, wx, wy, ww, wh) ) { + x_scale = ww / 1920.; + y_scale = wh / 1080.; + default_scale = bmin(x_scale, y_scale); + } + } + else { + if( (default_scale = atof(env)) <= 0 ) default_scale = 1; + x_scale = y_scale = default_scale; + } + env = getenv("BC_FONT_DEBUG"); font_debug = env ? atoi(env) : 0; env = getenv("BC_FONT_SCALE"); font_scale = env ? atof(env) : default_scale; @@ -732,7 +747,7 @@ new_vframes(10,default_vscroll_data, listbox_title_overlap = 0; listbox_title_margin = 0; listbox_title_color = BLACK; - listbox_title_hotspot = 5; + listbox_title_hotspot = xS(5); listbox_border1 = DKGREY; listbox_border2_hi = RED; @@ -748,7 +763,7 @@ new_vframes(10,default_vscroll_data, pan_data = 0; pan_text_color = YELLOW; - generic_button_margin = 15; + generic_button_margin = xS(15); draw_clock_background=1; use_shm = -1; @@ -800,9 +815,9 @@ new_vframes(10,default_vscroll_data, popupmenu_images = 0; - popupmenu_margin = 10; + popupmenu_margin = xS(10); popupmenu_btnup = 1; - popupmenu_triangle_margin = 10; + popupmenu_triangle_margin = xS(10); min_menu_w = 0; menu_title_text = BLACK; @@ -841,24 +856,24 @@ new_vframes(10,default_vscroll_data, tooltips_enabled = 1; textbox_focus_policy = 0; - filebox_margin = 110; - dirbox_margin = 90; + filebox_margin = yS(110); + dirbox_margin = yS(90); filebox_mode = LISTBOX_TEXT; sprintf(filebox_filter, "*"); - filebox_w = 640; - filebox_h = 480; + filebox_w = xS(640); + filebox_h = yS(480); filebox_columntype[0] = FILEBOX_NAME; filebox_columntype[1] = FILEBOX_SIZE; filebox_columntype[2] = FILEBOX_DATE; filebox_columntype[3] = FILEBOX_EXTENSION; - filebox_columnwidth[0] = 200; - filebox_columnwidth[1] = 100; - filebox_columnwidth[2] = 100; - filebox_columnwidth[3] = 100; + filebox_columnwidth[0] = xS(200); + filebox_columnwidth[1] = xS(100); + filebox_columnwidth[2] = xS(100); + filebox_columnwidth[3] = xS(100); dirbox_columntype[0] = FILEBOX_NAME; dirbox_columntype[1] = FILEBOX_DATE; - dirbox_columnwidth[0] = 200; - dirbox_columnwidth[1] = 100; + dirbox_columnwidth[0] = xS(200); + dirbox_columnwidth[1] = xS(100); filebox_text_images = default_filebox_text_images; filebox_icons_images = default_filebox_icons_images; @@ -880,8 +895,8 @@ new_vframes(10,default_vscroll_data, pot_images = default_pot_images; pot_offset = 2; - pot_x1 = pot_images[0]->get_w() / 2 - pot_offset; - pot_y1 = pot_images[0]->get_h() / 2 - pot_offset; + pot_x1 = pot_images[0]->get_w() / 2 - xS(pot_offset); + pot_y1 = pot_images[0]->get_h() / 2 - yS(pot_offset); pot_r = pot_x1; pot_needle_color = BLACK; @@ -891,7 +906,7 @@ new_vframes(10,default_vscroll_data, ymeter_images = 0; meter_font = SMALLFONT_3D; meter_font_color = RED; - meter_title_w = 20; + meter_title_w = xS(20); meter_3d = 1; medium_7segment = default_medium_7segment; @@ -907,11 +922,8 @@ new_vframes(10,default_vscroll_data, use_xft = 0; #endif - - drag_radius = 10; + drag_radius = xS(10); recursive_resizing = 1; - - } void BC_Resources::del_vframes(VFrame *vframes[], int n) diff --git a/cinelerra-5.1/guicast/bcresources.h b/cinelerra-5.1/guicast/bcresources.h index 369d196c..888ab4ed 100644 --- a/cinelerra-5.1/guicast/bcresources.h +++ b/cinelerra-5.1/guicast/bcresources.h @@ -308,6 +308,7 @@ public: int directory_color; int file_color; double font_scale, icon_scale; + double x_scale, y_scale; // fonts static const char *small_font, *small_font2; static const char *medium_font, *medium_font2; diff --git a/cinelerra-5.1/guicast/bcscrollbar.C b/cinelerra-5.1/guicast/bcscrollbar.C index a148bc30..481bda09 100644 --- a/cinelerra-5.1/guicast/bcscrollbar.C +++ b/cinelerra-5.1/guicast/bcscrollbar.C @@ -144,7 +144,7 @@ void BC_ScrollBar::draw(int flush) //printf("BC_ScrollBar::draw 1 %d %d\n", selection_status, highlight_status == SCROLL_BACKARROW); // Too small to draw anything - if(get_w() < get_arrow_pixels() * 2 + 5) + if(get_w() < get_arrow_pixels() * 2 + xS(5)) { draw_3segmenth(0, 0, @@ -244,7 +244,7 @@ void BC_ScrollBar::draw(int flush) case SCROLL_VERT: // Too small to draw anything - if(get_h() < get_arrow_pixels() * 2 + 5) + if(get_h() < get_arrow_pixels() * 2 + yS(5)) { draw_3segmentv(0, 0, diff --git a/cinelerra-5.1/guicast/bcslider.C b/cinelerra-5.1/guicast/bcslider.C index 882e5c9c..f8b53fe0 100644 --- a/cinelerra-5.1/guicast/bcslider.C +++ b/cinelerra-5.1/guicast/bcslider.C @@ -35,14 +35,8 @@ -BC_Slider::BC_Slider(int x, - int y, - int pixels, - int pointer_motion_range, - VFrame **images, - int show_number, - int vertical, - int use_caption) +BC_Slider::BC_Slider(int x, int y, int pixels, int pointer_motion_range, VFrame **images, + int show_number, int vertical, int use_caption) : BC_SubWindow(x, y, 0, 0, -1) { this->images = images; @@ -66,8 +60,7 @@ BC_Slider::BC_Slider(int x, BC_Slider::~BC_Slider() { - for(int i = 0; i < SLIDER_IMAGES; i++) - { + for(int i = 0; i < SLIDER_IMAGES; i++) { if(pixmaps[i]) delete pixmaps[i]; } if(pixmaps) delete [] pixmaps; @@ -75,8 +68,7 @@ BC_Slider::~BC_Slider() int BC_Slider::initialize() { - if(!images) - { + if(!images) { this->images = vertical ? BC_WindowBase::get_resources()->vertical_slider_data : BC_WindowBase::get_resources()->horizontal_slider_data; @@ -84,8 +76,7 @@ int BC_Slider::initialize() set_images(images); - if(vertical) - { + if(vertical) { w = images[SLIDER_BG_UP]->get_w(); h = pixels; } @@ -175,7 +166,7 @@ void BC_Slider::show_value_tooltip() //printf("BC_Slider::show_value_tooltip %s\n", get_caption()); set_tooltip(get_caption()); keypress_tooltip_timer = 2000; - show_tooltip(50); + show_tooltip(xS(50)); } @@ -399,28 +390,10 @@ void BC_Slider::set_pointer_motion_range(int value) } - - - -BC_ISlider::BC_ISlider(int x, - int y, - int vertical, - int pixels, - int pointer_motion_range, - int64_t minvalue, - int64_t maxvalue, - int64_t value, - int use_caption, - VFrame **data, - int *output) - : BC_Slider(x, - y, - pixels, - pointer_motion_range, - data, - 1, - vertical, - use_caption) +BC_ISlider::BC_ISlider(int x, int y, int vertical, int pixels, int pointer_motion_range, + int64_t minvalue, int64_t maxvalue, int64_t value, int use_caption, + VFrame **data, int *output) + : BC_Slider(x, y, pixels, pointer_motion_range, data, 1, vertical, use_caption) { this->minvalue = minvalue; this->maxvalue = maxvalue; @@ -572,30 +545,10 @@ int BC_ISlider::handle_event() } - - - - - - -BC_FSlider::BC_FSlider(int x, - int y, - int vertical, - int pixels, - int pointer_motion_range, - float minvalue, - float maxvalue, - float value, - int use_caption, +BC_FSlider::BC_FSlider(int x, int y, int vertical, int pixels, int pointer_motion_range, + float minvalue, float maxvalue, float value, int use_caption, VFrame **data) - : BC_Slider(x, - y, - pixels, - pointer_motion_range, - data, - 1, - vertical, - use_caption) + : BC_Slider(x, y, pixels, pointer_motion_range, data, 1, vertical, use_caption) { this->minvalue = minvalue; this->maxvalue = maxvalue; @@ -734,12 +687,7 @@ int BC_FSlider::update_selection(int cursor_x, int cursor_y) if(value < minvalue) value = minvalue; button_pixel = value_to_pixel(); // printf("BC_FSlider::update_selection 1 %d %d %d %d %f %f\n", -// pointer_motion_range, -// min_pixel, -// max_pixel, -// cursor_x, -// precision, -// value); +// pointer_motion_range, min_pixel, max_pixel, cursor_x, precision, value); if(old_value != value) { @@ -760,26 +708,10 @@ void BC_FSlider::set_pagination(float small_change, float big_change) } -BC_PercentageSlider::BC_PercentageSlider(int x, - int y, - int vertical, - int pixels, - int pointer_motion_range, - float minvalue, - float maxvalue, - float value, - int use_caption, - VFrame **data) - : BC_FSlider(x, - y, - vertical, - pixels, - pointer_motion_range, - minvalue, - maxvalue, - value, - use_caption, - data) +BC_PercentageSlider::BC_PercentageSlider(int x, int y, int vertical, int pixels, int pointer_motion_range, + float minvalue, float maxvalue, float value, int use_caption, + VFrame **data) + : BC_FSlider(x, y, vertical, pixels, pointer_motion_range, minvalue, maxvalue, value, use_caption, data) { } diff --git a/cinelerra-5.1/guicast/bcsubwindow.C b/cinelerra-5.1/guicast/bcsubwindow.C index 40c5e2f6..867b8589 100644 --- a/cinelerra-5.1/guicast/bcsubwindow.C +++ b/cinelerra-5.1/guicast/bcsubwindow.C @@ -25,10 +25,8 @@ BC_SubWindow::BC_SubWindow(int x, int y, int w, int h, int bg_color) { - this->x = x; - this->y = y; - this->w = w; - this->h = h; + this->x = x; this->y = y; + this->w = w; this->h = h; this->bg_color = bg_color; //printf("BC_SubWindow::BC_SubWindow 1\n"); } @@ -47,10 +45,6 @@ int BC_SubWindow::initialize() } - - - - BC_SubWindowList::BC_SubWindowList() : ArrayList() { diff --git a/cinelerra-5.1/guicast/bcsynchronous.C b/cinelerra-5.1/guicast/bcsynchronous.C index 9e49bf56..4c64b66f 100644 --- a/cinelerra-5.1/guicast/bcsynchronous.C +++ b/cinelerra-5.1/guicast/bcsynchronous.C @@ -557,9 +557,3 @@ BC_WindowBase* BC_Synchronous::get_window() return current_window; } - - - - - - diff --git a/cinelerra-5.1/guicast/bctextbox.C b/cinelerra-5.1/guicast/bctextbox.C index b871692c..128d514b 100644 --- a/cinelerra-5.1/guicast/bctextbox.C +++ b/cinelerra-5.1/guicast/bctextbox.C @@ -2861,12 +2861,8 @@ void BC_TumbleTextBox::reposition_window(int x, int y) this->x = x; this->y = y; - textbox->reposition_window(x, - y, - text_w, - 1); - tumbler->reposition_window(x + textbox->get_w(), - y); + textbox->reposition_window(x, y, text_w, 1); + tumbler->reposition_window(x + textbox->get_w(), y); // if(flush) parent_window->flush(); } diff --git a/cinelerra-5.1/guicast/bctitle.C b/cinelerra-5.1/guicast/bctitle.C index 57d1e093..1bda6e35 100644 --- a/cinelerra-5.1/guicast/bctitle.C +++ b/cinelerra-5.1/guicast/bctitle.C @@ -193,7 +193,7 @@ void BC_Title::get_size(BC_WindowBase *gui, int font, const char *text, int fixe } h *= gui->get_text_height(font); - w += 5; + w += xS(5); if(fixed_w > 0) w = fixed_w; } diff --git a/cinelerra-5.1/guicast/bctoggle.C b/cinelerra-5.1/guicast/bctoggle.C index 01832bd4..fdc963b6 100644 --- a/cinelerra-5.1/guicast/bctoggle.C +++ b/cinelerra-5.1/guicast/bctoggle.C @@ -90,7 +90,7 @@ void BC_Toggle::calculate_extents(BC_WindowBase *gui, *h = frame->get_h(); *toggle_x = 0; *toggle_y = 0; - *text_x = *w + 5; + *text_x = *w + xS(5); *text_y = 0; *text_w = 0; *text_h = 0; diff --git a/cinelerra-5.1/guicast/bctumble.C b/cinelerra-5.1/guicast/bctumble.C index e95f8abb..1a807d4d 100644 --- a/cinelerra-5.1/guicast/bctumble.C +++ b/cinelerra-5.1/guicast/bctumble.C @@ -113,13 +113,7 @@ int BC_Tumbler::set_images(VFrame **data) int BC_Tumbler::draw_face(int flush) { draw_top_background(parent_window, 0, 0, w, h); - pixmap->draw_pixmap(images[status], - 0, - 0, - w, - h, - 0, - 0); + pixmap->draw_pixmap(images[status], 0, 0, w, h, 0, 0); flash(flush); return 0; } @@ -259,8 +253,6 @@ int BC_Tumbler::cursor_motion_event() } - - BC_ITumbler::BC_ITumbler(BC_TextBox *textbox, int64_t min, int64_t max, int x, int y) : BC_Tumbler(x, y) { @@ -307,14 +299,6 @@ void BC_ITumbler::set_boundaries(int64_t min, int64_t max) } - - - - - - - - BC_FTumbler::BC_FTumbler(BC_TextBox *textbox, float min, float max, diff --git a/cinelerra-5.1/guicast/bcwindow.C b/cinelerra-5.1/guicast/bcwindow.C index 66686686..cc7d82ba 100644 --- a/cinelerra-5.1/guicast/bcwindow.C +++ b/cinelerra-5.1/guicast/bcwindow.C @@ -20,6 +20,7 @@ */ #include "bcdisplayinfo.h" +#include "bcresources.h" #include "bcwindow.h" #include diff --git a/cinelerra-5.1/guicast/bcwindow.h b/cinelerra-5.1/guicast/bcwindow.h index 2fec0ccc..29637d39 100644 --- a/cinelerra-5.1/guicast/bcwindow.h +++ b/cinelerra-5.1/guicast/bcwindow.h @@ -40,5 +40,4 @@ public: private: }; - #endif diff --git a/cinelerra-5.1/guicast/bcwindowbase.C b/cinelerra-5.1/guicast/bcwindowbase.C index 93b3d455..ad25943b 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.C +++ b/cinelerra-5.1/guicast/bcwindowbase.C @@ -69,17 +69,8 @@ BC_ResizeCall::BC_ResizeCall(int w, int h) } - - - - - int BC_WindowBase::shm_completion_event = -1; - - - BC_Resources BC_WindowBase::resources; - Window XGroupLeader = 0; Mutex BC_KeyboardHandlerLock::keyboard_listener_mutex("keyboard_listener",0); @@ -2092,15 +2083,8 @@ int BC_WindowBase::init_colors() char *data = 0; XImage *ximage; ximage = XCreateImage(top_level->display, - top_level->vis, - top_level->default_depth, - ZPixmap, - 0, - data, - 16, - 16, - 8, - 0); + top_level->vis, top_level->default_depth, + ZPixmap, 0, data, 16, 16, 8, 0); bits_per_pixel = ximage->bits_per_pixel; XDestroyImage(ximage); @@ -3880,13 +3864,13 @@ int BC_WindowBase::get_abs_cursor_y(int lock_window) void BC_WindowBase::get_pop_cursor(int &px, int &py, int lock_window) { - int margin = 100; + int xmargin = xS(100), ymargin = yS(100); get_abs_cursor(px, py, lock_window); - if( px < margin ) px = margin; - if( py < margin ) py = margin; - int wd = get_screen_w(lock_window,-1) - margin; + if( px < xmargin ) px = xmargin; + if( py < ymargin ) py = ymargin; + int wd = get_screen_w(lock_window,-1) - xmargin; if( px > wd ) px = wd; - int ht = get_screen_h(lock_window,-1) - margin; + int ht = get_screen_h(lock_window,-1) - ymargin; if( py > ht ) py = ht; } int BC_WindowBase::get_pop_cursor_x(int lock_window) @@ -4147,21 +4131,15 @@ int BC_WindowBase::reposition_window(int x, int y, int w, int h) { // KDE shifts window right and down. // FVWM leaves window alone and adds border around it. - XMoveResizeWindow(top_level->display, - win, + XMoveResizeWindow(top_level->display, win, x - BC_DisplayInfo::auto_reposition_x, y - BC_DisplayInfo::auto_reposition_y, - this->w, - this->h); + this->w, this->h); } else { - XMoveResizeWindow(top_level->display, - win, - x, - y, - this->w, - this->h); + XMoveResizeWindow(top_level->display, win, x, y, + this->w, this->h); } if(resize) @@ -4381,12 +4359,8 @@ int BC_WindowBase::save_defaults(BC_Hash *defaults) // For some reason XTranslateCoordinates can take a long time to return. // We work around this by only calling it when the event windows are different. -void BC_WindowBase::translate_coordinates(Window src_w, - Window dest_w, - int src_x, - int src_y, - int *dest_x_return, - int *dest_y_return) +void BC_WindowBase::translate_coordinates(Window src_w, Window dest_w, + int src_x, int src_y, int *dest_x_return, int *dest_y_return) { Window tempwin = 0; //Timer timer; @@ -4398,14 +4372,8 @@ void BC_WindowBase::translate_coordinates(Window src_w, } else { - XTranslateCoordinates(top_level->display, - src_w, - dest_w, - src_x, - src_y, - dest_x_return, - dest_y_return, - &tempwin); + XTranslateCoordinates(top_level->display, src_w, dest_w, + src_x, src_y, dest_x_return, dest_y_return, &tempwin); //printf("BC_WindowBase::translate_coordinates 1 %lld\n", timer.get_difference()); } } @@ -4421,10 +4389,6 @@ void BC_WindowBase::get_win_coordinates(int abs_x, int abs_y, int *x, int *y) } - - - - #ifdef HAVE_LIBXXF86VM void BC_WindowBase::closest_vm(int *vm, int *width, int *height) { diff --git a/cinelerra-5.1/guicast/bcwindowbase.h b/cinelerra-5.1/guicast/bcwindowbase.h index f231c6d2..a3901098 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.h +++ b/cinelerra-5.1/guicast/bcwindowbase.h @@ -97,7 +97,9 @@ #include #endif - +// scaled x,y unit +#define xS(v) (BC_WindowBase::get_resources()->x_scale*(v)) +#define yS(v) (BC_WindowBase::get_resources()->y_scale*(v)) #ifdef HAVE_GL //typedef void* GLXContext; diff --git a/cinelerra-5.1/guicast/bcwindowdraw.C b/cinelerra-5.1/guicast/bcwindowdraw.C index 76a47a73..7164bab7 100644 --- a/cinelerra-5.1/guicast/bcwindowdraw.C +++ b/cinelerra-5.1/guicast/bcwindowdraw.C @@ -178,12 +178,7 @@ void BC_WindowBase::draw_utf8_text(int x, int y, if(top_level->get_xft_struct(top_level->current_font)) { - draw_xft_text(x, - y, - text, - length, - pixmap, - 1); + draw_xft_text(x, y, text, length, pixmap, 1); return; } BT @@ -195,22 +190,15 @@ void BC_WindowBase::draw_utf8_text(int x, int y, { XmbDrawString(top_level->display, pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap, - top_level->get_curr_fontset(), - top_level->gc, - x, - y, - &text[j], - i - j); + top_level->get_curr_fontset(), top_level->gc, + x, y, &text[j], i - j); } else { XDrawString(top_level->display, pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap, top_level->gc, - x, - y, - &text[j], - i - j); + x, y, &text[j], i - j); } j = i + 1; @@ -595,7 +583,7 @@ void BC_WindowBase::draw_colored_box(int x, int y, int w, int h, int down, int h void BC_WindowBase::draw_border(char *text, int x, int y, int w, int h) { - int left_indent = 20; + int left_indent = xS(20); int lx, ly, ux, uy; h--; w--; @@ -611,16 +599,16 @@ void BC_WindowBase::draw_border(char *text, int x, int y, int w, int h) } set_color(top_level->get_resources()->button_shadow); - draw_line(x, y, x + left_indent - 5, y); + draw_line(x, y, x + left_indent - xS(5), y); draw_line(x, y, x, uy); - draw_line(x + left_indent + 5 + get_text_width(MEDIUMFONT, text), y, ux, y); + draw_line(x + left_indent + xS(5) + get_text_width(MEDIUMFONT, text), y, ux, y); draw_line(x, y, x, uy); draw_line(ux, ly, ux, uy); draw_line(lx, uy, ux, uy); set_color(top_level->get_resources()->button_light); - draw_line(lx, ly, x + left_indent - 5 - 1, ly); + draw_line(lx, ly, x + left_indent - xS(5) - 1, ly); draw_line(lx, ly, lx, uy - 1); - draw_line(x + left_indent + 5 + get_text_width(MEDIUMFONT, text), ly, ux - 1, ly); + draw_line(x + left_indent + xS(5) + get_text_width(MEDIUMFONT, text), ly, ux - 1, ly); draw_line(lx, ly, lx, uy - 1); draw_line(x + w, y, x + w, y + h); draw_line(x, y + h, x + w, y + h); @@ -638,13 +626,8 @@ void BC_WindowBase::draw_triangle_down_flat(int x, int y, int w, int h) point[1].x = x3; point[1].y = y1; point[2].x = x1; point[2].y = y1; - XFillPolygon(top_level->display, - pixmap->opaque_pixmap, - top_level->gc, - (XPoint *)point, - 3, - Nonconvex, - CoordModeOrigin); + XFillPolygon(top_level->display, pixmap->opaque_pixmap, top_level->gc, + (XPoint *)point, 3, Nonconvex, CoordModeOrigin); draw_line(x1,y1, x3,y1); } @@ -662,13 +645,8 @@ void BC_WindowBase::draw_triangle_up(int x, int y, int w, int h, point[1].y = y2; point[2].x = x1; point[2].y = y2; set_color(middle); - XFillPolygon(top_level->display, - pixmap->opaque_pixmap, - top_level->gc, - (XPoint *)point, - 3, - Nonconvex, - CoordModeOrigin); + XFillPolygon(top_level->display, pixmap->opaque_pixmap, top_level->gc, + (XPoint *)point, 3, Nonconvex, CoordModeOrigin); // bottom and top right set_color(shadow1); @@ -797,14 +775,16 @@ void BC_WindowBase::draw_triangle_right(int x, int y, int w, int h, void BC_WindowBase::draw_check(int x, int y) { - const int w = 15, h = 15; - draw_line(x + 3, y + h / 2 + 0, x + 6, y + h / 2 + 2); - draw_line(x + 3, y + h / 2 + 1, x + 6, y + h / 2 + 3); - draw_line(x + 6, y + h / 2 + 2, x + w - 4, y + h / 2 - 3); - draw_line(x + 3, y + h / 2 + 2, x + 6, y + h / 2 + 4); - draw_line(x + 6, y + h / 2 + 2, x + w - 4, y + h / 2 - 3); - draw_line(x + 6, y + h / 2 + 3, x + w - 4, y + h / 2 - 2); - draw_line(x + 6, y + h / 2 + 4, x + w - 4, y + h / 2 - 1); + int xs3 = xS(3), xs4 = xS(4), xs6 = xS(6); + int ys1 = yS(1), ys2 = yS(2), ys3 = yS(3), ys4 = yS(4); + const int w = xS(15), h = yS(15), yh2 = y + h/2; + draw_line(x + xs3, yh2 + 0, x + xs6, yh2 + ys2); + draw_line(x + xs3, yh2 + ys1, x + xs6, yh2 + ys3); + draw_line(x + xs6, yh2 + ys2, x + w - xs4, yh2 - ys3); + draw_line(x + xs3, yh2 + ys2, x + xs6, yh2 + ys4); + draw_line(x + xs6, yh2 + ys2, x + w - xs4, yh2 - ys3); + draw_line(x + xs6, yh2 + ys3, x + w - xs4, yh2 - ys2); + draw_line(x + xs6, yh2 + ys4, x + w - xs4, yh2 - ys1); } void BC_WindowBase::draw_tiles(BC_Pixmap *tile, int origin_x, int origin_y, int x, int y, int w, int h) @@ -987,15 +967,8 @@ void BC_WindowBase::slide_right(int distance) if(distance < w) { XCopyArea(top_level->display, - pixmap->opaque_pixmap, - pixmap->opaque_pixmap, - top_level->gc, - 0, - 0, - w - distance, - h, - distance, - 0); + pixmap->opaque_pixmap, pixmap->opaque_pixmap, top_level->gc, + 0, 0, w - distance, h, distance, 0); } } @@ -1004,23 +977,11 @@ void BC_WindowBase::slide_up(int distance) if(distance < h) { XCopyArea(top_level->display, - pixmap->opaque_pixmap, - pixmap->opaque_pixmap, - top_level->gc, - 0, - distance, - w, - h - distance, - 0, - 0); + pixmap->opaque_pixmap, pixmap->opaque_pixmap, top_level->gc, + 0, distance, w, h - distance, 0, 0); set_color(bg_color); - XFillRectangle(top_level->display, - pixmap->opaque_pixmap, - top_level->gc, - 0, - h - distance, - w, - distance); + XFillRectangle(top_level->display, pixmap->opaque_pixmap, top_level->gc, + 0, h - distance, w, distance); } } @@ -1029,35 +990,19 @@ void BC_WindowBase::slide_down(int distance) if(distance < h) { XCopyArea(top_level->display, - pixmap->opaque_pixmap, - pixmap->opaque_pixmap, - top_level->gc, - 0, - 0, - w, - h - distance, - 0, - distance); + pixmap->opaque_pixmap, pixmap->opaque_pixmap, top_level->gc, + 0, 0, w, h - distance, 0, distance); set_color(bg_color); XFillRectangle(top_level->display, - pixmap->opaque_pixmap, - top_level->gc, - 0, - 0, - w, - distance); + pixmap->opaque_pixmap, top_level->gc, + 0, 0, w, distance); } } // 3 segments in separate pixmaps. Obsolete. -void BC_WindowBase::draw_3segment(int x, - int y, - int w, - int h, - BC_Pixmap *left_image, - BC_Pixmap *mid_image, - BC_Pixmap *right_image, - BC_Pixmap *pixmap) +void BC_WindowBase::draw_3segment(int x, int y, int w, int h, + BC_Pixmap *left_image, BC_Pixmap *mid_image, + BC_Pixmap *right_image, BC_Pixmap *pixmap) { if(w <= 0 || h <= 0) return; int left_boundary = left_image->get_w_fixed(); @@ -1089,25 +1034,14 @@ void BC_WindowBase::draw_3segment(int x, if(i + output_w > w) output_w = w - i; image->write_drawable(pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap, - x + i, - y, - output_w, - h, - 0, - 0); - + x + i, y, output_w, h, 0, 0); i += output_w; } } // 3 segments in separate vframes. Obsolete. -void BC_WindowBase::draw_3segment(int x, - int y, - int w, - int h, - VFrame *left_image, - VFrame *mid_image, - VFrame *right_image, - BC_Pixmap *pixmap) +void BC_WindowBase::draw_3segment(int x, int y, int w, int h, + VFrame *left_image, VFrame *mid_image, + VFrame *right_image, BC_Pixmap *pixmap) { if(w <= 0 || h <= 0) return; int left_boundary = left_image->get_w_fixed(); @@ -1141,16 +1075,8 @@ void BC_WindowBase::draw_3segment(int x, if(i + output_w > w) output_w = w - i; if(image) - draw_vframe(image, - x + i, - y, - output_w, - h, - 0, - 0, - 0, - 0, - pixmap); + draw_vframe(image, x + i, y, output_w, h, + 0, 0, 0, 0, pixmap); if(output_w == 0) break; i += output_w; @@ -1171,19 +1097,10 @@ void BC_WindowBase::draw_3segment(int x, // |-------------------|----------------------|------------------| -void BC_WindowBase::draw_3segmenth(int x, - int y, - int w, - VFrame *image, - BC_Pixmap *pixmap) +void BC_WindowBase::draw_3segmenth(int x, int y, int w, + VFrame *image, BC_Pixmap *pixmap) { - draw_3segmenth(x, - y, - w, - x, - w, - image, - pixmap); + draw_3segmenth(x, y, w, x, w, image, pixmap); } void BC_WindowBase::draw_3segmenth(int x, int y, int w, @@ -1353,56 +1270,23 @@ void BC_WindowBase::draw_3segmenth(int x, int y, int w, int total_x, int total_w //printf("BC_WindowBase::draw_3segment 2 left_out_x=%d left_out_w=%d center_out_x=%d center_out_w=%d right_out_x=%d right_out_w=%d\n", // left_out_x, left_out_w, center_out_x, center_out_w, right_out_x, right_out_w); if(left_out_w > 0) - { - draw_pixmap(src, - left_out_x, - y, - left_out_w, - src->get_h(), - left_in_x, - 0, - dst); - } + draw_pixmap(src, left_out_x, y, left_out_w, src->get_h(), left_in_x, 0, dst); if(right_out_w > 0) - { - draw_pixmap(src, - right_out_x, - y, - right_out_w, - src->get_h(), - right_in_x, - 0, - dst); - } + draw_pixmap(src, right_out_x, y, right_out_w, src->get_h(), right_in_x, 0, dst); - for(int pixel = center_out_x; - pixel < center_out_x + center_out_w; - pixel += half_src) - { + for( int pixel = center_out_x; pixel < center_out_x + center_out_w; pixel += half_src) { int fragment_w = half_src; if(fragment_w + pixel > center_out_x + center_out_w) fragment_w = (center_out_x + center_out_w) - pixel; - //printf("BC_WindowBase::draw_3segment 2 pixel=%d fragment_w=%d\n", pixel, fragment_w); - draw_pixmap(src, - pixel, - y, - fragment_w, - src->get_h(), - quarter_src, - 0, - dst); + draw_pixmap(src, pixel, y, fragment_w, src->get_h(), quarter_src, 0, dst); } } -void BC_WindowBase::draw_3segmenth(int x, - int y, - int w, - BC_Pixmap *src, - BC_Pixmap *dst) +void BC_WindowBase::draw_3segmenth(int x, int y, int w, BC_Pixmap *src, BC_Pixmap *dst) { if(w <= 0) return; int third_image = src->get_w() / 3; @@ -1439,61 +1323,23 @@ void BC_WindowBase::draw_3segmenth(int x, //printf("BC_WindowBase::draw_3segment 2 left_out_x=%d left_out_w=%d center_out_x=%d center_out_w=%d right_out_x=%d right_out_w=%d\n", // left_out_x, left_out_w, center_out_x, center_out_w, right_out_x, right_out_w); if(left_out_w > 0) - { - draw_pixmap(src, - left_out_x, - y, - left_out_w, - src->get_h(), - left_in_x, - 0, - dst); - } + draw_pixmap(src, left_out_x, y, left_out_w, src->get_h(), left_in_x, 0, dst); if(right_out_w > 0) - { - draw_pixmap(src, - right_out_x, - y, - right_out_w, - src->get_h(), - right_in_x, - 0, - dst); - } + draw_pixmap(src, right_out_x, y, right_out_w, src->get_h(), right_in_x, 0, dst); - for(int pixel = left_out_x + left_out_w; - pixel < right_out_x; - pixel += third_image) - { + for(int pixel = left_out_x + left_out_w; pixel < right_out_x; pixel += third_image) { int fragment_w = third_image; if(fragment_w + pixel > right_out_x) fragment_w = right_out_x - pixel; //printf("BC_WindowBase::draw_3segment 2 pixel=%d fragment_w=%d\n", pixel, fragment_w); - draw_pixmap(src, - pixel, - y, - fragment_w, - src->get_h(), - third_image, - 0, - dst); + draw_pixmap(src, pixel, y, fragment_w, src->get_h(), third_image, 0, dst); } } - - - - - - -void BC_WindowBase::draw_3segmentv(int x, - int y, - int h, - VFrame *src, - BC_Pixmap *dst) +void BC_WindowBase::draw_3segmentv(int x, int y, int h, VFrame *src, BC_Pixmap *dst) { if(h <= 0) return; int third_image = src->get_h() / 3; @@ -1541,32 +1387,16 @@ void BC_WindowBase::draw_3segmentv(int x, if(left_out_h > 0) { - draw_bitmap(temp_bitmap, - 0, - x, - left_out_y, - src->get_w(), - left_out_h, - 0, - left_in_y, - -1, - -1, - dst); + draw_bitmap(temp_bitmap, 0, x, left_out_y, + src->get_w(), left_out_h, 0, left_in_y, + -1, -1, dst); } if(right_out_h > 0) { - draw_bitmap(temp_bitmap, - 0, - x, - right_out_y, - src->get_w(), - right_out_h, - 0, - right_in_y, - -1, - -1, - dst); + draw_bitmap(temp_bitmap, 0, x, right_out_y, + src->get_w(), right_out_h, 0, right_in_y, + -1, -1, dst); } for(int pixel = left_out_y + left_out_h; @@ -1578,17 +1408,9 @@ void BC_WindowBase::draw_3segmentv(int x, fragment_h = right_out_y - pixel; //printf("BC_WindowBase::draw_3segment 2 pixel=%d fragment_w=%d\n", pixel, fragment_w); - draw_bitmap(temp_bitmap, - 0, - x, - pixel, - src->get_w(), - fragment_h, - 0, - third_image, - -1, - -1, - dst); + draw_bitmap(temp_bitmap, 0, x, pixel, + src->get_w(), fragment_h, 0, third_image, + -1, -1, dst); } } @@ -1629,56 +1451,27 @@ void BC_WindowBase::draw_3segmentv(int x, } if(left_out_h > 0) - { - draw_pixmap(src, - x, - left_out_y, - src->get_w(), - left_out_h, - 0, - left_in_y, - dst); - } + draw_pixmap(src, x, left_out_y, src->get_w(), left_out_h, + 0, left_in_y, dst); if(right_out_h > 0) - { - draw_pixmap(src, - x, - right_out_y, - src->get_w(), - right_out_h, - 0, - right_in_y, - dst); - } + draw_pixmap(src, x, right_out_y, src->get_w(), right_out_h, + 0, right_in_y, dst); - for(int pixel = left_out_y + left_out_h; - pixel < right_out_y; - pixel += third_image) - { + for(int pixel = left_out_y + left_out_h; pixel < right_out_y; pixel += third_image) { int fragment_h = third_image; if(fragment_h + pixel > right_out_y) fragment_h = right_out_y - pixel; //printf("BC_WindowBase::draw_3segment 2 pixel=%d fragment_w=%d\n", pixel, fragment_w); - draw_pixmap(src, - x, - pixel, - src->get_w(), - fragment_h, - 0, - third_image, - dst); + draw_pixmap(src, x, pixel, src->get_w(), fragment_h, + 0, third_image, dst); } } -void BC_WindowBase::draw_9segment(int x, - int y, - int w, - int h, - BC_Pixmap *src, - BC_Pixmap *dst) +void BC_WindowBase::draw_9segment(int x, int y, int w, int h, + BC_Pixmap *src, BC_Pixmap *dst) { if(w <= 0 || h <= 0) return; @@ -1707,48 +1500,21 @@ void BC_WindowBase::draw_9segment(int x, //int in_y4 = src->get_h(); // Segment 1 - draw_pixmap(src, - x + out_x1, - y + out_y1, - out_x2 - out_x1, - out_y2 - out_y1, - in_x1, - in_y1, - dst); - + draw_pixmap(src, x + out_x1, y + out_y1, out_x2 - out_x1, out_y2 - out_y1, + in_x1, in_y1, dst); // Segment 2 * n - for(int i = out_x2; i < out_x3; i += in_x3 - in_x2) - { - if(out_x3 - i > 0) - { + for(int i = out_x2; i < out_x3; i += in_x3 - in_x2) { + if(out_x3 - i > 0) { int w = MIN(in_x3 - in_x2, out_x3 - i); - draw_pixmap(src, - x + i, - y + out_y1, - w, - out_y2 - out_y1, - in_x2, - in_y1, - dst); + draw_pixmap(src, x + i, y + out_y1, w, out_y2 - out_y1, + in_x2, in_y1, dst); } } - - - - // Segment 3 - draw_pixmap(src, - x + out_x3, - y + out_y1, - out_x4 - out_x3, - out_y2 - out_y1, - in_x3, - in_y1, - dst); - - + draw_pixmap(src, x + out_x3, y + out_y1, out_x4 - out_x3, out_y2 - out_y1, + in_x3, in_y1, dst); // Segment 4 * n for(int i = out_y2; i < out_y3; i += in_y3 - in_y2) @@ -1756,18 +1522,11 @@ void BC_WindowBase::draw_9segment(int x, if(out_y3 - i > 0) { int h = MIN(in_y3 - in_y2, out_y3 - i); - draw_pixmap(src, - x + out_x1, - y + i, - out_x2 - out_x1, - h, - in_x1, - in_y2, - dst); + draw_pixmap(src, x + out_x1, y + i, out_x2 - out_x1, h, + in_x1, in_y2, dst); } } - // Segment 5 * n * n for(int i = out_y2; i < out_y3; i += in_y3 - in_y2 /* in_y_third */) { @@ -1780,14 +1539,8 @@ void BC_WindowBase::draw_9segment(int x, { int w = MIN(in_x3 - in_x2 /* in_x_third */, out_x3 - j); if(out_x3 - j > 0) - draw_pixmap(src, - x + j, - y + i, - w, - h, - in_x2, - in_y2, - dst); + draw_pixmap(src, x + j, y + i, w, h, + in_x2, in_y2, dst); } } } @@ -1798,30 +1551,14 @@ void BC_WindowBase::draw_9segment(int x, if(out_y3 - i > 0) { int h = MIN(in_y3 - in_y2, out_y3 - i); - draw_pixmap(src, - x + out_x3, - y + i, - out_x4 - out_x3, - h, - in_x3, - in_y2, - dst); + draw_pixmap(src, x + out_x3, y + i, out_x4 - out_x3, h, + in_x3, in_y2, dst); } } - - - // Segment 7 - draw_pixmap(src, - x + out_x1, - y + out_y3, - out_x2 - out_x1, - out_y4 - out_y3, - in_x1, - in_y3, - dst); - + draw_pixmap(src, x + out_x1, y + out_y3, out_x2 - out_x1, out_y4 - out_y3, + in_x1, in_y3, dst); // Segment 8 * n for(int i = out_x2; i < out_x3; i += in_x3 - in_x2) @@ -1829,28 +1566,14 @@ void BC_WindowBase::draw_9segment(int x, if(out_x3 - i > 0) { int w = MIN(in_x3 - in_y2, out_x3 - i); - draw_pixmap(src, - x + i, - y + out_y3, - w, - out_y4 - out_y3, - in_x2, - in_y3, - dst); + draw_pixmap(src, x + i, y + out_y3, w, out_y4 - out_y3, + in_x2, in_y3, dst); } } - - // Segment 9 - draw_pixmap(src, - x + out_x3, - y + out_y3, - out_x4 - out_x3, - out_y4 - out_y3, - in_x3, - in_y3, - dst); + draw_pixmap(src, x + out_x3, y + out_y3, out_x4 - out_x3, out_y4 - out_y3, + in_x3, in_y3, dst); } diff --git a/cinelerra-5.1/guicast/errorbox.C b/cinelerra-5.1/guicast/errorbox.C index 91504d23..420c3223 100644 --- a/cinelerra-5.1/guicast/errorbox.C +++ b/cinelerra-5.1/guicast/errorbox.C @@ -33,17 +33,13 @@ ErrorBox::~ErrorBox() void ErrorBox::create_objects(const char *text) { lock_window("ErrorBox::create_objects"); - int x = 10, y = 10; + int x = xS(10), y = yS(10); - add_subwindow(new BC_Title(get_w() / 2, - y, - text, - MEDIUMFONT, - get_resources()->default_text_color, - 1)); - x = get_w() / 2 - 30; - y = get_h() - 50; - add_tool(new BC_OKButton(x, y)); + add_subwindow(new BC_Title(get_w() / 2, y, text, + MEDIUMFONT, get_resources()->default_text_color, 1)); + x = get_w()/2 - xS(30); + y = get_h() - yS(50); + add_subwindow(new BC_OKButton(x, y)); show_window(1); unlock_window(); } diff --git a/cinelerra-5.1/guicast/rotateframe.C b/cinelerra-5.1/guicast/rotateframe.C index 63bca1b0..1246264b 100644 --- a/cinelerra-5.1/guicast/rotateframe.C +++ b/cinelerra-5.1/guicast/rotateframe.C @@ -81,8 +81,8 @@ void RotateFrame::rotate(VFrame *output, if(angle != 0) { - if(angle == 90 || angle == 180 || angle == 270) - rotate_rightangle(input, + if(angle == 90 || angle == 180 || angle == 270) + rotate_rightangle(input, output, (int)angle); else @@ -101,22 +101,15 @@ void RotateFrame::rotate(VFrame *output, this->last_angle = angle; } -int RotateFrame::get_rightdimensions(VFrame *frame, - int &diameter, - int &in_x1, - int &in_y1, - int &in_x2, - int &in_y2, - int &out_x1, - int &out_y1, - int &out_x2, - int &out_y2) +int RotateFrame::get_rightdimensions(VFrame *frame, int &diameter, + int &in_x1, int &in_y1, int &in_x2, int &in_y2, + int &out_x1, int &out_y1, int &out_x2, int &out_y2) { - diameter = frame->get_w() < frame->get_h() ? frame->get_w() : frame->get_h(); - out_x1 = in_x1 = frame->get_w() / 2 - diameter / 2; - out_x2 = in_x2 = in_x1 + diameter - 1; - out_y1 = in_y1 = frame->get_h() / 2 - diameter / 2; - out_y2 = in_y2 = in_y1 + diameter - 1; + diameter = frame->get_w() < frame->get_h() ? frame->get_w() : frame->get_h(); + out_x1 = in_x1 = frame->get_w() / 2 - diameter / 2; + out_x2 = in_x2 = in_x1 + diameter - 1; + out_y1 = in_y1 = frame->get_h() / 2 - diameter / 2; + out_y2 = in_y2 = in_y1 + diameter - 1; return 0; } @@ -129,107 +122,75 @@ int RotateFrame::get_rightdimensions(VFrame *frame, int height = output->get_h(); \ int width = output->get_w(); \ \ - switch(angle) \ - { \ + switch(angle) { \ case 90: \ - get_rightdimensions(input, \ - diameter, \ - in_x1, \ - in_y1, \ - in_x2, \ - in_y2, \ - out_x1, \ - out_y1, \ - out_x2, \ - out_y2); \ - while(in_x2 > in_x1) \ - { \ - diameter = in_x2 - in_x1; \ - for(int i = 0; i < diameter; i++) \ - { \ - type temp_pixel[components]; \ + get_rightdimensions(input, diameter, \ + in_x1, in_y1, in_x2, in_y2, \ + out_x1, out_y1, out_x2, out_y2); \ + while(in_x2 > in_x1) { \ + diameter = in_x2 - in_x1; \ + for(int i = 0; i < diameter; i++) { \ + type temp_pixel[components]; \ for(int j = 0; j < components; j++) \ { \ temp_pixel[j] = input_rows[in_y1 + i][in_x2 * components + j]; \ - \ - output_rows[in_y1 + i][in_x2 * components + j] = input_rows[in_y1][(in_x1 + i) * components + j]; \ - output_rows[in_y1][(in_x1 + i) * components + j] = input_rows[in_y2 - i][in_x1 * components + j]; \ - output_rows[in_y2 - i][in_x1 * components + j] = input_rows[in_y2][(in_x2 - i) * components + j]; \ - output_rows[in_y2][(in_x2 - i) * components + j] = temp_pixel[j]; \ + output_rows[in_y1 + i][in_x2 * components + j] = input_rows[in_y1][(in_x1 + i) * components + j]; \ + output_rows[in_y1][(in_x1 + i) * components + j] = input_rows[in_y2 - i][in_x1 * components + j]; \ + output_rows[in_y2 - i][in_x1 * components + j] = input_rows[in_y2][(in_x2 - i) * components + j]; \ + output_rows[in_y2][(in_x2 - i) * components + j] = temp_pixel[j]; \ } \ - } \ + } \ \ - in_x2--; \ - in_x1++; \ - in_y2--; \ - in_y1++; \ - } \ + in_x2--; in_x1++; in_y2--; in_y1++; \ + } \ break; \ \ - case 180: \ - for(int i = 0, j = height - 1; i < j; i++, j--) \ - { \ - for(int k = 0, l = width - 1; k < width; k++, l--) \ - { \ - type temp_pixel[components]; \ - for(int m = 0; m < components; m++) \ - { \ - temp_pixel[m] = input_rows[j][k * components + m]; \ - output_rows[j][k * components + m] = input_rows[i][l * components + m]; \ - output_rows[i][l * components + m] = temp_pixel[m]; \ + case 180: \ + for(int i = 0, j = height - 1; i < j; i++, j--) { \ + for(int k = 0, l = width - 1; k < width; k++, l--) { \ + type temp_pixel[components]; \ + for(int m = 0; m < components; m++) { \ + temp_pixel[m] = input_rows[j][k * components + m]; \ + output_rows[j][k * components + m] = input_rows[i][l * components + m]; \ + output_rows[i][l * components + m] = temp_pixel[m]; \ } \ - } \ - } \ + } \ + } \ break; \ \ case 270: \ - get_rightdimensions(input, \ - diameter, \ - in_x1, \ - in_y1, \ - in_x2, \ - in_y2, \ - out_x1, \ - out_y1, \ - out_x2, \ - out_y2); \ + get_rightdimensions(input, diameter, \ + in_x1, in_y1, in_x2, in_y2, \ + out_x1, out_y1, out_x2, out_y2); \ \ - while(in_x2 > in_x1) \ - { \ - diameter = in_x2 - in_x1; \ - for(int i = 0; i < diameter; i++) \ - { \ - type temp_pixel[components]; \ - for(int j = 0; j < components; j++) \ - { \ - temp_pixel[j] = input_rows[in_y1 + i][in_x1 * components + j]; \ - output_rows[in_y1 + i][in_x1 * components + j] = input_rows[in_y1][(in_x2 - i) * components + j]; \ - output_rows[in_y1][(in_x2 - i) * components + j] = input_rows[in_y2 - i][in_x2 * components + j]; \ - output_rows[in_y2 - i][in_x2 * components + j] = input_rows[in_y2][(in_x1 + i) * components + j]; \ - output_rows[in_y2][(in_x1 + i) * components + j] = temp_pixel[j]; \ + while(in_x2 > in_x1) { \ + diameter = in_x2 - in_x1; \ + for(int i = 0; i < diameter; i++) { \ + type temp_pixel[components]; \ + for(int j = 0; j < components; j++) { \ + temp_pixel[j] = input_rows[in_y1 + i][in_x1 * components + j]; \ + output_rows[in_y1 + i][in_x1 * components + j] = input_rows[in_y1][(in_x2 - i) * components + j]; \ + output_rows[in_y1][(in_x2 - i) * components + j] = input_rows[in_y2 - i][in_x2 * components + j]; \ + output_rows[in_y2 - i][in_x2 * components + j] = input_rows[in_y2][(in_x1 + i) * components + j]; \ + output_rows[in_y2][(in_x1 + i) * components + j] = temp_pixel[j]; \ } \ - } \ + } \ \ - in_x2--; \ - in_x1++; \ - in_y2--; \ - in_y1++; \ - } \ + in_x2--; in_x1++; in_y2--; in_y1++; \ + } \ break; \ } \ } -int RotateFrame::rotate_rightangle(VFrame *input, - VFrame *output, - int angle) +int RotateFrame::rotate_rightangle(VFrame *input, VFrame *output, int angle) { int in_x1 = 0; - int in_y1 = 0; - int in_x2 = input->get_w(); - int in_y2 = input->get_h(); + int in_y1 = 0; + int in_x2 = input->get_w(); + int in_y2 = input->get_h(); int out_x1, out_y1, out_x2, out_y2; - int diameter; + int diameter; output->clear_frame(); switch(output->get_color_model()) diff --git a/cinelerra-5.1/guicast/test.C b/cinelerra-5.1/guicast/test.C index dc71db3f..f29033e1 100644 --- a/cinelerra-5.1/guicast/test.C +++ b/cinelerra-5.1/guicast/test.C @@ -119,16 +119,8 @@ void thread_fork() class TestWindow : public BC_Window { public: - TestWindow() : BC_Window("test", - 0, - 0, - 320, - 240, - -1, - -1, - 0, - 0, - 1) + TestWindow() : BC_Window("test", 0, 0, 320, 240, + -1, -1, 0, 0, 1) { current_cursor = 0; test_keypress = 1; @@ -169,15 +161,7 @@ int main(int argc, char *argv[]) int angles[] = { 180, 0 }; float values[] = { 1, 0 }; - window.add_tool(new BC_Pan(10, - 120, - 100, - 1, - 2, - angles, - -1, - -1, - values)); + window.add_tool(new BC_Pan(10, 120, 100, 1, 2, angles, -1, -1, values)); window.add_tool(new BC_TextBox(10, 10, 200, 5, _("Mary Egbert\nhad a little lamb."))); BC_Title *title; window.add_tool(title = new BC_Title(10, 210, _("Hello world"))); diff --git a/cinelerra-5.1/guicast/test2.C b/cinelerra-5.1/guicast/test2.C index fd22fc60..555b4c90 100644 --- a/cinelerra-5.1/guicast/test2.C +++ b/cinelerra-5.1/guicast/test2.C @@ -26,18 +26,9 @@ class TestWindow : public BC_Window { public: - TestWindow() : BC_Window("test", - 0, - 0, - 640, - 480) - { - } + TestWindow() : BC_Window("test", 0, 0, 640, 480) {} }; - - - typedef struct { struct timeval start_time; diff --git a/cinelerra-5.1/guicast/test3.C b/cinelerra-5.1/guicast/test3.C index 5433f55a..d8f30152 100644 --- a/cinelerra-5.1/guicast/test3.C +++ b/cinelerra-5.1/guicast/test3.C @@ -28,13 +28,7 @@ class TestWindow : public BC_Window { public: - TestWindow() : BC_Window("Test", - 0, - 0, - 320, - 240) - { - }; + TestWindow() : BC_Window("Test", 0, 0, 320, 240) {}; void create_objects() { diff --git a/cinelerra-5.1/guicast/vframe.C b/cinelerra-5.1/guicast/vframe.C index 4c1aa390..a4a76cc4 100644 --- a/cinelerra-5.1/guicast/vframe.C +++ b/cinelerra-5.1/guicast/vframe.C @@ -73,11 +73,6 @@ VFrameScene::~VFrameScene() } - - - - - //static BCCounter counter; VFramePng::VFramePng(unsigned char *png_data, double s) diff --git a/cinelerra-5.1/guicast/vframe3d.C b/cinelerra-5.1/guicast/vframe3d.C index ed47a40e..90d75d7b 100644 --- a/cinelerra-5.1/guicast/vframe3d.C +++ b/cinelerra-5.1/guicast/vframe3d.C @@ -76,15 +76,6 @@ int VFrame::get_texture_components() } - - - - - - - - - void VFrame::to_texture() { #ifdef HAVE_GL diff --git a/cinelerra-5.1/opencv_build b/cinelerra-5.1/opencv_build index caacceeb..91950aaf 100644 --- a/cinelerra-5.1/opencv_build +++ b/cinelerra-5.1/opencv_build @@ -83,6 +83,7 @@ $(opencv)/build: $(opencv).src -DCMAKE_INSTALL_PREFIX=/usr/local \ -DOPENCV_EXTRA_MODULES_PATH="$(opencv)_contrib/modules/" +LFLAGS += -llapack -lcblas LFLAGS += -Wl,--start-group LFLAGS += $(shell find $(opencv_prefix)/lib* -name "libopencv_*.a" 2> /dev/null) #opencv4 breaks SIFT/SURF findobj @@ -103,6 +104,7 @@ $(opencv)/build: $(opencv).src -DCMAKE_INSTALL_PREFIX=/usr/local \ -DOPENCV_EXTRA_MODULES_PATH="$(opencv)_contrib/modules/" +LFLAGS += -llapack -lcblas SYSLIB := $(lastword $(wildcard /usr/lib /usrlib32 /usr/lib64)) CVLIBS := $(dir (shell find $(opencv_prefix) -name libopencv_core.a)) LFLAGS += -L$(CVLIBS) $(patsubst $(CVLIBS)/lib%.so,-l%,$(wildcard $(CVLIBS)/libopencv_*.so)) diff --git a/cinelerra-5.1/plugins/1080to480/1080to480.C b/cinelerra-5.1/plugins/1080to480/1080to480.C index 6b522295..590d732f 100644 --- a/cinelerra-5.1/plugins/1080to480/1080to480.C +++ b/cinelerra-5.1/plugins/1080to480/1080to480.C @@ -72,7 +72,7 @@ void _1080to480Config::interpolate(_1080to480Config &prev, _1080to480Window::_1080to480Window(_1080to480Main *client) - : PluginClientWindow(client, 200, 100, 0, 0, 1) + : PluginClientWindow(client, xS(200), yS(100), 0, 0, 1) { this->client = client; } @@ -84,10 +84,10 @@ _1080to480Window::~_1080to480Window() void _1080to480Window::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_tool(odd_first = new _1080to480Option(client, this, 1, x, y, _("Odd field first"))); - y += 25; + y += yS(25); add_tool(even_first = new _1080to480Option(client, this, 0, x, y, _("Even field first"))); show_window(); diff --git a/cinelerra-5.1/plugins/1080to540/1080to540.C b/cinelerra-5.1/plugins/1080to540/1080to540.C index ecf9a0f8..76cbeb0a 100644 --- a/cinelerra-5.1/plugins/1080to540/1080to540.C +++ b/cinelerra-5.1/plugins/1080to540/1080to540.C @@ -73,10 +73,10 @@ void _1080to540Config::interpolate(_1080to540Config &prev, _1080to540Window::_1080to540Window(_1080to540Main *client) : PluginClientWindow(client, - 200, - 100, - 200, - 100, + xS(200), + yS(100), + xS(200), + yS(100), 0) { this->client = client; @@ -89,10 +89,10 @@ _1080to540Window::~_1080to540Window() void _1080to540Window::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_tool(odd_first = new _1080to540Option(client, this, 1, x, y, _("Odd field first"))); - y += 25; + y += yS(25); add_tool(even_first = new _1080to540Option(client, this, 0, x, y, _("Even field first"))); show_window(); diff --git a/cinelerra-5.1/plugins/720to480/720to480.C b/cinelerra-5.1/plugins/720to480/720to480.C index c1af6c27..6d62e873 100644 --- a/cinelerra-5.1/plugins/720to480/720to480.C +++ b/cinelerra-5.1/plugins/720to480/720to480.C @@ -52,16 +52,7 @@ _720to480Config::_720to480Config() _720to480Window::_720to480Window(_720to480Main *client, int x, int y) - : BC_Window(client->gui_string, - x, - y, - 230, - 150, - 230, - 150, - 0, - 0, - 1) + : BC_Window(client->gui_string, x, y, xS(230), yS(150), xS(230), yS(150), 0, 0, 1) { this->client = client; } @@ -73,15 +64,16 @@ _720to480Window::~_720to480Window() void _720to480Window::create_objects() { - int x = 10, y = 10; + lock_window("720to480Window::create_objects"); + int x = xS(10), y = yS(10); add_tool(odd_first = new _720to480Order(client, this, 1, x, y, _("Odd field first"))); - y += 25; + y += yS(25); add_tool(even_first = new _720to480Order(client, this, 0, x, y, _("Even field first"))); -// y += 25; +// y += yS(25); // add_tool(forward = new _720to480Direction(client, this, FORWARD, x, y, _("Downsample"))); -// y += 25; +// y += yS(25); // add_tool(reverse = new _720to480Direction(client, this, REVERSE, x, y, _("Upsample"))); // add_subwindow(new BC_OKButton(this)); @@ -89,6 +81,7 @@ void _720to480Window::create_objects() show_window(); flush(); + unlock_window(); } int _720to480Window::close_event() diff --git a/cinelerra-5.1/plugins/C41/c41.C b/cinelerra-5.1/plugins/C41/c41.C index b16f0145..f0cbd948 100644 --- a/cinelerra-5.1/plugins/C41/c41.C +++ b/cinelerra-5.1/plugins/C41/c41.C @@ -38,7 +38,7 @@ C41Config::C41Config() fix_min_r = fix_min_g = fix_min_b = fix_light = 0.; fix_gamma_g = fix_gamma_b = fix_coef1 = fix_coef2 = 0.; min_col = max_col = min_row = max_row = 0; - window_w = 500; window_h = 510; + window_w = xS(500); window_h = yS(510); } void C41Config::copy_from(C41Config &src) @@ -123,7 +123,7 @@ int C41Enable::handle_event() // C41TextBox C41TextBox::C41TextBox(C41Effect *plugin, float *value, int x, int y) - : BC_TextBox(x, y, 160, 1, *value) + : BC_TextBox(x, y, xS(160), 1, *value) { this->plugin = plugin; this->boxValue = value; @@ -187,7 +187,7 @@ int C41BoxButton::handle_event() C41Slider::C41Slider(C41Effect *plugin, int *output, int x, int y, int is_row) - : BC_ISlider(x, y, 0, 200, 200, 0, is_row ? + : BC_ISlider(x, y, 0, xS(200), yS(200), 0, is_row ? plugin->get_edl()->session->output_h : plugin->get_edl()->session->output_w , *output) { @@ -210,7 +210,7 @@ int C41Slider::update(int v) EDLSession *session = plugin->get_edl()->session; int max = is_row ? session->output_h : session->output_w; bclamp(v, 0, max); - if( this->max != max ) return BC_ISlider::update(200, v, 0, this->max = max); + if( this->max != max ) return BC_ISlider::update(xS(200), v, 0, this->max = max); if( v != get_value() ) return BC_ISlider::update(v); return 1; } @@ -226,147 +226,149 @@ LOAD_CONFIGURATION_MACRO(C41Effect, C41Config) C41Window::C41Window(C41Effect *plugin) : PluginClientWindow(plugin, plugin->config.window_w, plugin->config.window_h, - 500, 510, 1) + xS(500), yS(510), 1) { } void C41Window::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs20 = xS(20), xs40 = xS(40), xs80 = xS(80); + int ys10 = yS(10), ys20 = yS(20), ys25 = yS(25), ys30 = yS(30), ys40 = yS(40), ys60 = yS(60); + int x = xs10, y = ys10; C41Effect *plugin = (C41Effect *)client; add_subwindow(active = new C41Enable(plugin, &plugin->config.active, x, y, _("Activate processing"))); - y += 40; + y += ys40; add_subwindow(compute_magic = new C41Enable(plugin, &plugin->config.compute_magic, x, y, _("Compute negfix values"))); - y += 20; + y += ys20; - add_subwindow(new BC_Title(x + 20, y, _("(uncheck for faster rendering)"))); - y += 40; + add_subwindow(new BC_Title(x + xs20, y, _("(uncheck for faster rendering)"))); + y += ys40; add_subwindow(new BC_Title(x, y, _("Computed negfix values:"))); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Min/Max R:"))); - add_subwindow(min_r = new BC_Title(x + 80, y, "0.0000 / 0.0000")); - y += 30; + add_subwindow(min_r = new BC_Title(x + xs80, y, "0.0000 / 0.0000")); + y += ys30; add_subwindow(new BC_Title(x, y, _("Min/Max G:"))); - add_subwindow(min_g = new BC_Title(x + 80, y, "0.0000 / 0.0000")); - y += 30; + add_subwindow(min_g = new BC_Title(x + xs80, y, "0.0000 / 0.0000")); + y += ys30; add_subwindow(new BC_Title(x, y, _("Min/Max B:"))); - add_subwindow(min_b = new BC_Title(x + 80, y, "0.0000 / 0.0000")); - y += 30; + add_subwindow(min_b = new BC_Title(x + xs80, y, "0.0000 / 0.0000")); + y += ys30; add_subwindow(new BC_Title(x, y, _("Light:"))); - add_subwindow(light = new BC_Title(x + 80, y, "0.0000")); - y += 30; + add_subwindow(light = new BC_Title(x + xs80, y, "0.0000")); + y += ys30; add_subwindow(new BC_Title(x, y, _("Gamma G:"))); - add_subwindow(gamma_g = new BC_Title(x + 80, y, "0.0000")); - y += 30; + add_subwindow(gamma_g = new BC_Title(x + xs80, y, "0.0000")); + y += ys30; add_subwindow(new BC_Title(x, y, _("Gamma B:"))); - add_subwindow(gamma_b = new BC_Title(x + 80, y, "0.0000")); - y += 30; + add_subwindow(gamma_b = new BC_Title(x + xs80, y, "0.0000")); + y += ys30; add_subwindow(new BC_Title(x, y, _("Contrast:"))); - add_subwindow(coef1 = new BC_Title(x + 80, y, "0.0000")); - y += 30; + add_subwindow(coef1 = new BC_Title(x + xs80, y, "0.0000")); + y += ys30; add_subwindow(new BC_Title(x, y, _("Brightness:"))); - add_subwindow(coef2 = new BC_Title(x + 80, y, "0.0000")); - y += 30; + add_subwindow(coef2 = new BC_Title(x + xs80, y, "0.0000")); + y += ys30; add_subwindow(lock = new C41Button(plugin, this, x, y)); - y += 30; + y += ys30; #define BOX_COL 120 add_subwindow(new BC_Title(x, y, _("Box col:"))); - add_subwindow(box_col_min = new BC_Title(x + 80, y, "0")); + add_subwindow(box_col_min = new BC_Title(x + xs80, y, "0")); add_subwindow(box_col_max = new BC_Title(x + BOX_COL, y, "0")); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Box row:"))); - add_subwindow(box_row_min = new BC_Title(x + 80, y, "0")); + add_subwindow(box_row_min = new BC_Title(x + xs80, y, "0")); add_subwindow(box_row_max = new BC_Title(x + BOX_COL, y, "0")); - y += 30; + y += ys30; add_subwindow(boxlock = new C41BoxButton(plugin, this, x, y)); - y = 10; - x = 250; + y = ys10; + x = xS(250); add_subwindow(show_box = new C41Enable(plugin, &plugin->config.show_box, x, y, _("Show active area"))); - y += 40; + y += ys40; add_subwindow(postproc = new C41Enable(plugin, &plugin->config.postproc, x, y, _("Postprocess"))); - y += 60; + y += ys60; add_subwindow(new BC_Title(x, y, _("negfix values to apply:"))); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Min R:"))); add_subwindow(fix_min_r = new C41TextBox(plugin, - &plugin->config.fix_min_r, x + 80, y)); - y += 30; + &plugin->config.fix_min_r, x + xs80, y)); + y += ys30; add_subwindow(new BC_Title(x, y, _("Min G:"))); add_subwindow(fix_min_g = new C41TextBox(plugin, - &plugin->config.fix_min_g, x + 80, y)); - y += 30; + &plugin->config.fix_min_g, x + xs80, y)); + y += ys30; add_subwindow(new BC_Title(x, y, _("Min B:"))); add_subwindow(fix_min_b = new C41TextBox(plugin, - &plugin->config.fix_min_b, x + 80, y)); - y += 30; + &plugin->config.fix_min_b, x + xs80, y)); + y += ys30; add_subwindow(new BC_Title(x, y, _("Light:"))); add_subwindow(fix_light = new C41TextBox(plugin, - &plugin->config.fix_light, x + 80, y)); - y += 30; + &plugin->config.fix_light, x + xs80, y)); + y += ys30; add_subwindow(new BC_Title(x, y, _("Gamma G:"))); add_subwindow(fix_gamma_g = new C41TextBox(plugin, - &plugin->config.fix_gamma_g, x + 80, y)); - y += 30; + &plugin->config.fix_gamma_g, x + xs80, y)); + y += ys30; add_subwindow(new BC_Title(x, y, _("Gamma B:"))); add_subwindow(fix_gamma_b = new C41TextBox(plugin, - &plugin->config.fix_gamma_b, x + 80, y)); - y += 30; + &plugin->config.fix_gamma_b, x + xs80, y)); + y += ys30; add_subwindow(new BC_Title(x, y, _("Contrast:"))); add_subwindow(fix_coef1 = new C41TextBox(plugin, - &plugin->config.fix_coef1, x + 80, y)); - y += 30; + &plugin->config.fix_coef1, x + xs80, y)); + y += ys30; add_subwindow(new BC_Title(x, y, _("Brightness:"))); add_subwindow(fix_coef2 = new C41TextBox(plugin, - &plugin->config.fix_coef2, x + 80, y)); - y += 30; + &plugin->config.fix_coef2, x + xs80, y)); + y += ys30; - x += 40; - add_subwindow(new BC_Title(x - 40, y, _("Col:"))); + x += xs40; + add_subwindow(new BC_Title(x - xs40, y, _("Col:"))); add_subwindow(min_col = new C41Slider(plugin, &plugin->config.min_col, x, y, 0)); - y += 25; + y += ys25; add_subwindow(max_col = new C41Slider(plugin, &plugin->config.max_col, x, y, 0)); - y += 25; + y += ys25; - add_subwindow(new BC_Title(x - 40, y, _("Row:"))); + add_subwindow(new BC_Title(x - xs40, y, _("Row:"))); add_subwindow(min_row = new C41Slider(plugin, &plugin->config.min_row, x, y, 1)); - y += 25; + y += ys25; add_subwindow(max_row = new C41Slider(plugin, &plugin->config.max_row, x, y, 1)); - y += 25; + y += ys25; update_magic(); show_window(1); diff --git a/cinelerra-5.1/plugins/aging/agingwindow.C b/cinelerra-5.1/plugins/aging/agingwindow.C index 9c702d7e..5f4007aa 100644 --- a/cinelerra-5.1/plugins/aging/agingwindow.C +++ b/cinelerra-5.1/plugins/aging/agingwindow.C @@ -24,7 +24,7 @@ #include "language.h" AgingWindow::AgingWindow(AgingMain *plugin) - : PluginClientWindow(plugin, 300, 180, 300, 180, 0) + : PluginClientWindow(plugin, xS(300), yS(180), xS(300), yS(180), 0) { this->plugin = plugin; } @@ -35,30 +35,32 @@ AgingWindow::~AgingWindow() void AgingWindow::create_objects() { - int x = 10, y = 10; + int xs100 = xS(100); + int ys5 = yS(5), ys15 = yS(15), ys180 = yS(180); + int x = xS(10), y = yS(10); BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Aging:"))); - y += title->get_h() + 15; + y += title->get_h() + ys15; add_subwindow(color = new AgingCheckBox(this, x, y, &plugin->config.colorage, _("Grain"))); - y += color->get_h() + 5; + y += color->get_h() + ys5; add_subwindow(scratches = new AgingCheckBox(this, x, y, &plugin->config.scratch, _("Scratch"))); - add_subwindow(scratch_count = new AgingISlider(this, x+100, y, 180, + add_subwindow(scratch_count = new AgingISlider(this, x+xs100, y, ys180, 0,SCRATCH_MAX, &plugin->config.scratch_lines)); - y += scratches->get_h() + 5; + y += scratches->get_h() + ys5; add_subwindow(pits = new AgingCheckBox(this, x, y, &plugin->config.pits, _("Pits"))); - add_subwindow(pit_count = new AgingISlider(this, x+100, y, 180, + add_subwindow(pit_count = new AgingISlider(this, x+xs100, y, ys180, 0,100, &plugin->config.pits_interval)); - y += pits->get_h() + 5; + y += pits->get_h() + ys5; add_subwindow(dust = new AgingCheckBox(this, x, y, &plugin->config.dust, _("Dust"))); - add_subwindow(dust_count = new AgingISlider(this, x+100, y, 180, + add_subwindow(dust_count = new AgingISlider(this, x+xs100, y, ys180, 0,100, &plugin->config.dust_interval)); show_window(1); diff --git a/cinelerra-5.1/plugins/audioscope/audioscope.C b/cinelerra-5.1/plugins/audioscope/audioscope.C index 83ecc734..d6defad9 100644 --- a/cinelerra-5.1/plugins/audioscope/audioscope.C +++ b/cinelerra-5.1/plugins/audioscope/audioscope.C @@ -132,7 +132,7 @@ AudioScopeWindowSize::AudioScopeWindowSize(AudioScope *plugin, char *text) : BC_PopupMenu(x, y, - 80, + xS(80), text) { this->plugin = plugin; @@ -273,7 +273,7 @@ AudioScopeMode::AudioScopeMode(AudioScope *plugin, int y) : BC_PopupMenu(x, y, - 180, + xS(180), mode_to_text(plugin->config.mode)) { this->plugin = plugin; @@ -341,8 +341,8 @@ AudioScopeWindow::AudioScopeWindow(AudioScope *plugin) : PluginClientWindow(plugin, plugin->w, plugin->h, - 320, - 320, + xS(320), + yS(320), 1) { this->plugin = plugin; @@ -632,8 +632,8 @@ AudioScope::AudioScope(PluginServer *server) { reset(); timer = new Timer; - w = 640; - h = 480; + w = xS(640); + h = yS(480); } AudioScope::~AudioScope() diff --git a/cinelerra-5.1/plugins/bandslide/bandslide.C b/cinelerra-5.1/plugins/bandslide/bandslide.C index e122251a..880d5ff9 100644 --- a/cinelerra-5.1/plugins/bandslide/bandslide.C +++ b/cinelerra-5.1/plugins/bandslide/bandslide.C @@ -120,10 +120,10 @@ int BandSlideOut::handle_event() BandSlideWindow::BandSlideWindow(BandSlideMain *plugin) : PluginClientWindow(plugin, - 320, - 100, - 320, - 100, + xS(320), + yS(100), + xS(320), + yS(100), 0) { this->plugin = plugin; @@ -132,24 +132,26 @@ BandSlideWindow::BandSlideWindow(BandSlideMain *plugin) void BandSlideWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs50 = xS(50), xs100 = xS(100); + int ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; add_subwindow(new BC_Title(x, y, _("Bands:"))); - x += 50; + x += xs50; count = new BandSlideCount(plugin, this, x, y); count->create_objects(); - y += 30; - x = 10; + y += ys30; + x = xs10; add_subwindow(new BC_Title(x, y, _("Direction:"))); - x += 100; + x += xs100; add_subwindow(in = new BandSlideIn(plugin, this, x, y)); - x += 100; + x += xs100; add_subwindow(out = new BandSlideOut(plugin, this, x, diff --git a/cinelerra-5.1/plugins/bandwipe/bandwipe.C b/cinelerra-5.1/plugins/bandwipe/bandwipe.C index bda24a90..70f7fb47 100644 --- a/cinelerra-5.1/plugins/bandwipe/bandwipe.C +++ b/cinelerra-5.1/plugins/bandwipe/bandwipe.C @@ -53,7 +53,7 @@ BandWipeCount::BandWipeCount(BandWipeMain *plugin, (int64_t)1000, x, y, - 50) + xS(50)) { this->plugin = plugin; this->window = window; @@ -119,10 +119,10 @@ int BandWipeOut::handle_event() BandWipeWindow::BandWipeWindow(BandWipeMain *plugin) : PluginClientWindow(plugin, - 320, - 50, - 320, - 50, + xS(320), + yS(50), + xS(320), + yS(50), 0) { this->plugin = plugin; @@ -131,23 +131,24 @@ BandWipeWindow::BandWipeWindow(BandWipeMain *plugin) void BandWipeWindow::create_objects() { - int x = 10, y = 10; + int xs50 = xS(50); + int x = xS(10), y = yS(10); add_subwindow(new BC_Title(x, y, _("Bands:"))); - x += 50; + x += xs50; count = new BandWipeCount(plugin, this, x, y); count->create_objects(); -// y += 30; +// y += yS(30); // add_subwindow(new BC_Title(x, y, _("Direction:"))); -// x += 100; +// x += yS(100); // add_subwindow(in = new BandWipeIn(plugin, // this, // x, // y)); -// x += 100; -// x = 10; +// x += xS(100); +// x = xS(10); // add_subwindow(out = new BandWipeOut(plugin, // this, // x, diff --git a/cinelerra-5.1/plugins/bluebanana/bluebananawindow.C b/cinelerra-5.1/plugins/bluebanana/bluebananawindow.C index 10692ce4..99146bc7 100644 --- a/cinelerra-5.1/plugins/bluebanana/bluebananawindow.C +++ b/cinelerra-5.1/plugins/bluebanana/bluebananawindow.C @@ -2034,7 +2034,7 @@ public: // --------------------------------------- Main GUI window -------------------------------------- BluebananaWindow::BluebananaWindow(BluebananaMain *plugin) - : PluginClientWindow(plugin,1000,1000,0,1,1) + : PluginClientWindow(plugin,xS(1000),yS(1000),0,1,1) { do_render=0; windowx = get_x(); diff --git a/cinelerra-5.1/plugins/blur/blurwindow.C b/cinelerra-5.1/plugins/blur/blurwindow.C index b8c4b5db..f5a534c9 100644 --- a/cinelerra-5.1/plugins/blur/blurwindow.C +++ b/cinelerra-5.1/plugins/blur/blurwindow.C @@ -31,10 +31,10 @@ BlurWindow::BlurWindow(BlurMain *client) : PluginClientWindow(client, - 200, - 360, - 200, - 360, + xS(200), + yS(360), + xS(200), + yS(360), 0) { this->client = client; @@ -47,30 +47,32 @@ BlurWindow::~BlurWindow() void BlurWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys35 = yS(35), ys40 = yS(40); + int x = xs10, y = ys10; BC_Title *title; add_subwindow(new BC_Title(x, y, _("Blur"))); - y += 20; + y += ys20; add_subwindow(horizontal = new BlurHorizontal(client, this, x, y)); - y += 30; + y += ys30; add_subwindow(vertical = new BlurVertical(client, this, x, y)); - y += 35; + y += ys35; add_subwindow(title = new BC_Title(x, y, _("Radius:"))); - y += title->get_h() + 10; + y += title->get_h() + ys10; add_subwindow(radius = new BlurRadius(client, this, x, y)); - add_subwindow(radius_text = new BlurRadiusText(client, this, x + radius->get_w() + 10, y, 100)); - y += radius->get_h() + 10; + add_subwindow(radius_text = new BlurRadiusText(client, this, x + radius->get_w() + xs10, y, 100)); + y += radius->get_h() + ys10; add_subwindow(a_key = new BlurAKey(client, x, y)); - y += 30; + y += ys30; add_subwindow(a = new BlurA(client, x, y)); - y += 30; + y += ys30; add_subwindow(r = new BlurR(client, x, y)); - y += 30; + y += ys30; add_subwindow(g = new BlurG(client, x, y)); - y += 30; + y += ys30; add_subwindow(b = new BlurB(client, x, y)); - y += 40; + y += ys40; add_subwindow(reset = new BlurReset(client, this, x, y)); show_window(); diff --git a/cinelerra-5.1/plugins/blurzoom/blurzoomwindow.C b/cinelerra-5.1/plugins/blurzoom/blurzoomwindow.C index 0cbe1734..e344ccbe 100644 --- a/cinelerra-5.1/plugins/blurzoom/blurzoomwindow.C +++ b/cinelerra-5.1/plugins/blurzoom/blurzoomwindow.C @@ -32,10 +32,10 @@ BlurZoomWindow::BlurZoomWindow(BlurZoomMain *client) : PluginClientWindow(client, - 300, - 170, - 300, - 170, + xS(300), + yS(170), + xS(300), + yS(170), 0) { this->client = client; diff --git a/cinelerra-5.1/plugins/brightness/brightnesswindow.C b/cinelerra-5.1/plugins/brightness/brightnesswindow.C index b127e275..2552e20e 100644 --- a/cinelerra-5.1/plugins/brightness/brightnesswindow.C +++ b/cinelerra-5.1/plugins/brightness/brightnesswindow.C @@ -33,7 +33,7 @@ BrightnessWindow::BrightnessWindow(BrightnessMain *client) - : PluginClientWindow(client, 370, 155, 370, 155, 0) + : PluginClientWindow(client, xS(370), yS(155), xS(370), yS(155), 0) { this->client = client; } @@ -44,20 +44,22 @@ BrightnessWindow::~BrightnessWindow() void BrightnessWindow::create_objects() { - int x = 10, y = 10, x1 = x + 90; - int x2 = 0; int clrBtn_w = 50; + int xs10 = xS(10); + int ys10 = yS(10), ys25 = yS(25), ys30 = yS(30), ys35 = yS(35); + int x = xs10, y = ys10, x1 = x + xS(90); + int x2 = 0; int clrBtn_w = xS(50); add_tool(new BC_Title(x, y, _("Brightness/Contrast"))); - y += 25; + y += ys25; add_tool(new BC_Title(x, y,_("Brightness:"))); add_tool(brightness = new BrightnessSlider(client, &(client->config.brightness), x1, y, 1)); - x2 = x1 + brightness->get_w() + 10; + x2 = x1 + brightness->get_w() + xs10; add_subwindow(brightnessClr = new BrightnessSliderClr(client, this, x2, y, clrBtn_w, 1)); - y += 25; + y += ys25; add_tool(new BC_Title(x, y, _("Contrast:"))); add_tool(contrast = new BrightnessSlider(client, &(client->config.contrast), @@ -66,12 +68,12 @@ void BrightnessWindow::create_objects() 0)); add_subwindow(contrastClr = new BrightnessSliderClr(client, this, x2, y, clrBtn_w, 0)); - y += 30; + y += ys30; add_tool(luma = new BrightnessLuma(client, x, y)); - y += 35; + y += ys35; add_subwindow(reset = new BrightnessReset(client, this, x, y)); show_window(); @@ -103,8 +105,8 @@ BrightnessSlider::BrightnessSlider(BrightnessMain *client, : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), -100, 100, (int)*output) diff --git a/cinelerra-5.1/plugins/burn/burnwindow.C b/cinelerra-5.1/plugins/burn/burnwindow.C index 4442e82d..9d6a5d70 100644 --- a/cinelerra-5.1/plugins/burn/burnwindow.C +++ b/cinelerra-5.1/plugins/burn/burnwindow.C @@ -34,10 +34,10 @@ BurnWindow::BurnWindow(BurnMain *client) : PluginClientWindow(client, - 300, - 170, - 300, - 170, + xS(300), + yS(170), + xS(300), + yS(170), 0) { this->client = client; @@ -49,7 +49,7 @@ BurnWindow::~BurnWindow() void BurnWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(new BC_Title(x, y, _("BurningTV from EffectTV\n" "Copyright (C) 2001 FUKUCHI Kentarou") diff --git a/cinelerra-5.1/plugins/cdripper/cdripwindow.C b/cinelerra-5.1/plugins/cdripper/cdripwindow.C index 0116664f..28acfeb4 100644 --- a/cinelerra-5.1/plugins/cdripper/cdripwindow.C +++ b/cinelerra-5.1/plugins/cdripper/cdripwindow.C @@ -27,7 +27,7 @@ CDRipWindow::CDRipWindow(CDRipMain *cdripper, int x, int y) : BC_Window(_(PROGRAM_NAME ": CD Ripper"), - x, y, 450, 230, 450, 230, 0, 0, 1) + x, y, xS(450), yS(230), xS(450), yS(230), 0, 0, 1) { this->cdripper = cdripper; } @@ -38,43 +38,45 @@ CDRipWindow::~CDRipWindow() void CDRipWindow::create_objects() { - int y = 10, x = 10; - add_tool(new BC_Title(x, y, _("Select the range to transfer:"))); y += 25; - add_tool(new BC_Title(x, y, _("Track:"))); x += 70; - add_tool(new BC_Title(x, y, _("Min."))); x += 70; - add_tool(new BC_Title(x, y, _("Sec."))); x += 100; - - add_tool(new BC_Title(x, y, _("Track:"))); x += 70; - add_tool(new BC_Title(x, y, _("Min."))); x += 70; - add_tool(new BC_Title(x, y, _("Sec."))); x += 100; - - x = 10; y += 25; + int xs10 = xS(10), xs70 = xS(70), xs100 = xS(100); + int ys10 = yS(10), ys25 = yS(25), ys30 = yS(30), ys35 = yS(35); + int y = ys10, x = xs10; + add_tool(new BC_Title(x, y, _("Select the range to transfer:"))); y += ys25; + add_tool(new BC_Title(x, y, _("Track:"))); x += xs70; + add_tool(new BC_Title(x, y, _("Min."))); x += xs70; + add_tool(new BC_Title(x, y, _("Sec."))); x += xs100; + + add_tool(new BC_Title(x, y, _("Track:"))); x += xs70; + add_tool(new BC_Title(x, y, _("Min."))); x += xs70; + add_tool(new BC_Title(x, y, _("Sec."))); x += xs100; + + x = xs10; y += ys25; add_tool(track1 = new CDRipTextValue(this, &(cdripper->track1), x, y, 50)); - x += 70; + x += xs70; add_tool(min1 = new CDRipTextValue(this, &(cdripper->min1), x, y, 50)); - x += 70; + x += xs70; add_tool(sec1 = new CDRipTextValue(this, &(cdripper->sec1), x, y, 50)); - x += 100; + x += xs100; add_tool(track2 = new CDRipTextValue(this, &(cdripper->track2), x, y, 50)); - x += 70; + x += xs70; add_tool(min2 = new CDRipTextValue(this, &(cdripper->min2), x, y, 50)); - x += 70; + x += xs70; add_tool(sec2 = new CDRipTextValue(this, &(cdripper->sec2), x, y, 50)); - x = 10; y += 30; + x = xs10; y += ys30; add_tool(new BC_Title(x, y, _("From"), LARGEFONT, RED)); - x += 240; + x += xS(240); add_tool(new BC_Title(x, y, _("To"), LARGEFONT, RED)); - x = 10; y += 35; + x = xs10; y += ys35; add_tool(new BC_Title(x, y, _("CD Device:"))); - x += 100; + x += xs100; add_tool(device = new CDRipWindowDevice(this, cdripper->device, x, y, 200)); - x = 10; y += 35; + x = xs10; y += ys35; add_tool(new BC_OKButton(this)); - x += 300; + x += xS(300); add_tool(new BC_CancelButton(this)); show_window(); flush(); diff --git a/cinelerra-5.1/plugins/chromakey/chromakey.C b/cinelerra-5.1/plugins/chromakey/chromakey.C index 525a43a7..6ec5af68 100644 --- a/cinelerra-5.1/plugins/chromakey/chromakey.C +++ b/cinelerra-5.1/plugins/chromakey/chromakey.C @@ -110,10 +110,10 @@ int ChromaKeyConfig::get_color() ChromaKeyWindow::ChromaKeyWindow(ChromaKey *plugin) : PluginClientWindow(plugin, - 320, - 220, - 320, - 220, + xS(320), + yS(220), + xS(320), + yS(220), 0) { this->plugin = plugin; @@ -127,32 +127,34 @@ ChromaKeyWindow::~ChromaKeyWindow() void ChromaKeyWindow::create_objects() { - int x = 10, y = 10, x1 = 100; + int xs10 = xS(10), xs100 = xS(100); + int ys10 = yS(10), ys30 = yS(30), ys50 = yS(50); + int x = xs10, y = ys10, x1 = xS(100); BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Color:"))); - x += title->get_w() + 10; + x += title->get_w() + xs10; add_subwindow(color = new ChromaKeyColor(plugin, this, x, y)); - x += color->get_w() + 10; - add_subwindow(sample = new BC_SubWindow(x, y, 100, 50)); - y += sample->get_h() + 10; - x = 10; + x += color->get_w() + xs10; + add_subwindow(sample = new BC_SubWindow(x, y, xs100, ys50)); + y += sample->get_h() + xs10; + x = xs10; add_subwindow(new BC_Title(x, y, _("Slope:"))); add_subwindow(slope = new ChromaKeySlope(plugin, x1, y)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Threshold:"))); add_subwindow(threshold = new ChromaKeyThreshold(plugin, x1, y)); - y += 30; + y += ys30; add_subwindow(use_value = new ChromaKeyUseValue(plugin, x1, y)); - y += 30; + y += ys30; add_subwindow(use_colorpicker = new ChromaKeyUseColorPicker(plugin, this, x1, y)); - y += use_colorpicker->get_h() + 10; + y += use_colorpicker->get_h() + xs10; add_subwindow(new ChromaKeyReset(plugin, this, x, y)); color_thread = new ChromaKeyColorThread(plugin, this); @@ -216,8 +218,8 @@ ChromaKeyThreshold::ChromaKeyThreshold(ChromaKey *plugin, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (float)0, (float)100, plugin->config.threshold) @@ -237,8 +239,8 @@ ChromaKeySlope::ChromaKeySlope(ChromaKey *plugin, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (float)0, (float)100, plugin->config.slope) diff --git a/cinelerra-5.1/plugins/chromakeyhsv/chromakey.C b/cinelerra-5.1/plugins/chromakeyhsv/chromakey.C index 4b47cc70..ba7dd025 100644 --- a/cinelerra-5.1/plugins/chromakeyhsv/chromakey.C +++ b/cinelerra-5.1/plugins/chromakeyhsv/chromakey.C @@ -156,10 +156,10 @@ ChromaKeyConfig::get_color () ChromaKeyWindow::ChromaKeyWindow (ChromaKeyHSV * plugin) : PluginClientWindow(plugin, - 400, - 450, - 400, - 450, + xS(400), + yS(450), + xS(400), + yS(450), 0) { this->plugin = plugin; @@ -174,32 +174,34 @@ ChromaKeyWindow::~ChromaKeyWindow () void ChromaKeyWindow::create_objects () { - int y = 10, y1, x1 = 0, x2 = 10; - int x = 30; + int xs5 = xS(5), xs10 = xS(10), xs30 = xS(30), xs100 = xS(100), xs240 = xS(240); + int ys5 = yS(5), ys10 = yS(10), ys25 = yS(25), ys50 = yS(50); + int y = ys10, y1, x1 = 0, x2 = xs10; + int x = xs30; BC_Title *title; BC_Bar *bar; - int ymargin = get_text_height(MEDIUMFONT) + 5; - int ymargin2 = get_text_height(MEDIUMFONT) + 10; + int ymargin = get_text_height(MEDIUMFONT) + xs5; + int ymargin2 = get_text_height(MEDIUMFONT) + ys10; add_subwindow (title = new BC_Title (x2, y, _("Color:"))); - add_subwindow (color = new ChromaKeyColor (plugin, this, x, y + 25)); + add_subwindow (color = new ChromaKeyColor (plugin, this, x, y + ys25)); add_subwindow (sample = - new BC_SubWindow (x + color->get_w () + 10, y, 100, 50)); - y += sample->get_h () + 10; + new BC_SubWindow (x + color->get_w () + xs10, y, xs100, ys50)); + y += sample->get_h () + ys10; add_subwindow (use_colorpicker = new ChromaKeyUseColorPicker (plugin, this, x, y)); - y += use_colorpicker->get_h() + 10; + y += use_colorpicker->get_h() + ys10; - add_subwindow (new ChromaKeyReset (plugin, this, x2+240, y)); + add_subwindow (new ChromaKeyReset (plugin, this, x2+xs240, y)); add_subwindow (show_mask = new ChromaKeyShowMask (plugin, x2, y)); - y += show_mask->get_h() + 5; + y += show_mask->get_h() + ys5; add_subwindow(bar = new BC_Bar(x2, y, get_w() - x2 * 2)); - y += bar->get_h() + 5; + y += bar->get_h() + ys5; y1 = y; add_subwindow (new BC_Title (x2, y, _("Key parameters:"))); y += ymargin; @@ -220,7 +222,7 @@ ChromaKeyWindow::create_objects () y += ymargin2; add_subwindow(bar = new BC_Bar(x2, y, get_w() - x2 * 2)); - y += bar->get_h() + 5; + y += bar->get_h() + ys5; add_subwindow (title = new BC_Title (x2, y, _("Mask tweaking:"))); y += ymargin; add_subwindow (title = new BC_Title (x, y, _("In Slope:"))); @@ -236,7 +238,7 @@ ChromaKeyWindow::create_objects () add_subwindow(bar = new BC_Bar(x2, y, get_w() - x2 * 2)); - y += bar->get_h() + 5; + y += bar->get_h() + ys5; add_subwindow (title = new BC_Title (x2, y, _("Spill light control:"))); y += ymargin; add_subwindow (title = new BC_Title (x, y, _("Spill Threshold:"))); @@ -264,7 +266,7 @@ ChromaKeyWindow::create_objects () add_subwindow (min_saturation = new ChromaKeyMinSaturation (plugin, x1, y)); y += ymargin; - y += bar->get_h() + 5; + y += bar->get_h() + ys5; y += ymargin2; add_subwindow (in_slope = new ChromaKeyInSlope (plugin, x1, y)); y += ymargin; @@ -273,7 +275,7 @@ ChromaKeyWindow::create_objects () add_subwindow (alpha_offset = new ChromaKeyAlphaOffset (plugin, x1, y)); y += ymargin; - y += bar->get_h() + 5; + y += bar->get_h() + ys5; y += ymargin2; add_subwindow (spill_threshold = new ChromaKeySpillThreshold (plugin, x1, y)); y += ymargin; @@ -322,7 +324,7 @@ ChromaKeyColor::handle_event () ChromaKeyMinBrightness::ChromaKeyMinBrightness (ChromaKeyHSV * plugin, int x, int y):BC_FSlider (x, y, 0, - 200, 200, (float) 0, (float) 100, plugin->config.min_brightness) + xS(200), yS(200), (float) 0, (float) 100, plugin->config.min_brightness) { this->plugin = plugin; set_precision (0.01); @@ -339,7 +341,7 @@ ChromaKeyMinBrightness::handle_event () ChromaKeyMaxBrightness::ChromaKeyMaxBrightness (ChromaKeyHSV * plugin, int x, int y):BC_FSlider (x, y, 0, - 200, 200, (float) 0, (float) 100, plugin->config.max_brightness) + xS(200), yS(200), (float) 0, (float) 100, plugin->config.max_brightness) { this->plugin = plugin; set_precision (0.01); @@ -356,7 +358,7 @@ ChromaKeyMaxBrightness::handle_event () ChromaKeySaturation::ChromaKeySaturation (ChromaKeyHSV * plugin, int x, int y):BC_FSlider (x, y, - 0, 200, 200, (float) 0, (float) 100, plugin->config.saturation) + 0, xS(200), yS(200), (float) 0, (float) 100, plugin->config.saturation) { this->plugin = plugin; set_precision (0.01); @@ -373,7 +375,7 @@ ChromaKeySaturation::handle_event () ChromaKeyMinSaturation::ChromaKeyMinSaturation (ChromaKeyHSV * plugin, int x, int y):BC_FSlider (x, y, 0, - 200, 200, (float) 0, (float) 100, plugin->config.min_saturation) + xS(200), yS(200), (float) 0, (float) 100, plugin->config.min_saturation) { this->plugin = plugin; set_precision (0.01); @@ -390,7 +392,7 @@ ChromaKeyMinSaturation::handle_event () ChromaKeyTolerance::ChromaKeyTolerance (ChromaKeyHSV * plugin, int x, int y):BC_FSlider (x, y, - 0, 200, 200, (float) 0, (float) 100, plugin->config.tolerance) + 0, xS(200), yS(200), (float) 0, (float) 100, plugin->config.tolerance) { this->plugin = plugin; set_precision (0.01); @@ -408,7 +410,7 @@ ChromaKeyTolerance::handle_event () ChromaKeyInSlope::ChromaKeyInSlope (ChromaKeyHSV * plugin, int x, int y):BC_FSlider (x, y, - 0, 200, 200, (float) 0, (float) 20, plugin->config.in_slope) + 0, xS(200), yS(200), (float) 0, (float) 20, plugin->config.in_slope) { this->plugin = plugin; set_precision (0.01); @@ -425,7 +427,7 @@ ChromaKeyInSlope::handle_event () ChromaKeyOutSlope::ChromaKeyOutSlope (ChromaKeyHSV * plugin, int x, int y):BC_FSlider (x, y, - 0, 200, 200, (float) 0, (float) 20, plugin->config.out_slope) + 0, xS(200), yS(200), (float) 0, (float) 20, plugin->config.out_slope) { this->plugin = plugin; set_precision (0.01); @@ -443,7 +445,7 @@ ChromaKeyOutSlope::handle_event () ChromaKeyAlphaOffset::ChromaKeyAlphaOffset (ChromaKeyHSV * plugin, int x, int y):BC_FSlider (x, y, 0, - 200, 200, (float) -100, (float) 100, plugin->config.alpha_offset) + xS(200), yS(200), (float) -100, (float) 100, plugin->config.alpha_offset) { this->plugin = plugin; set_precision (0.01); @@ -516,7 +518,7 @@ ChromaKeyUseColorPicker::handle_event () ChromaKeySpillThreshold::ChromaKeySpillThreshold (ChromaKeyHSV * plugin, int x, int y):BC_FSlider (x, y, 0, - 200, 200, (float) 0, (float) 100, plugin->config.spill_threshold) + xS(200), yS(200), (float) 0, (float) 100, plugin->config.spill_threshold) { this->plugin = plugin; set_precision (0.01); @@ -532,7 +534,7 @@ ChromaKeySpillThreshold::handle_event () ChromaKeySpillAmount::ChromaKeySpillAmount (ChromaKeyHSV * plugin, int x, int y):BC_FSlider (x, y, - 0, 200, 200, (float) 0, (float) 100, plugin->config.spill_amount) + 0, xS(200), yS(200), (float) 0, (float) 100, plugin->config.spill_amount) { this->plugin = plugin; set_precision (0.01); diff --git a/cinelerra-5.1/plugins/color3way/color3waywindow.C b/cinelerra-5.1/plugins/color3way/color3waywindow.C index 1e188f26..f0d2db4c 100644 --- a/cinelerra-5.1/plugins/color3way/color3waywindow.C +++ b/cinelerra-5.1/plugins/color3way/color3waywindow.C @@ -39,8 +39,8 @@ Color3WayWindow::Color3WayWindow(Color3WayMain *plugin) : PluginClientWindow(plugin, plugin->w, plugin->h, - 680, - 370, + xS(720), + yS(400), 1) { this->plugin = plugin; diff --git a/cinelerra-5.1/plugins/colorbalance/colorbalancewindow.C b/cinelerra-5.1/plugins/colorbalance/colorbalancewindow.C index 56d3c27b..91a8cd10 100644 --- a/cinelerra-5.1/plugins/colorbalance/colorbalancewindow.C +++ b/cinelerra-5.1/plugins/colorbalance/colorbalancewindow.C @@ -35,7 +35,7 @@ ColorBalanceWindow::ColorBalanceWindow(ColorBalanceMain *client) - : PluginClientWindow(client, 400, 210, 400, 210, 0) + : PluginClientWindow(client, xS(400), yS(210), xS(400), yS(210), 0) { this->client = client; } @@ -46,37 +46,39 @@ ColorBalanceWindow::~ColorBalanceWindow() void ColorBalanceWindow::create_objects() { - int x = 10, y = 10; - int clrBtn_w = 50; - int x1 = 400 - clrBtn_w - 10; // (window_width - clrBtn_width - margin_rx) + int xs10 = xS(10), xs70 = xS(70), xs280 = xS(280), xs400 = xS(400); + int ys10 = yS(10), ys15 = yS(15), ys25 = yS(25); + int x = xs10, y = ys10; + int clrBtn_w = xS(50); + int x1 = xs400 - clrBtn_w - xs10; // (window_width - clrBtn_width - margin_rx) add_tool(new BC_Title(x, y, _("Color Balance"))); - y += 25; + y += ys25; add_tool(new BC_Title(x, y, _("Cyan"))); - add_tool(cyan = new ColorBalanceSlider(client, &(client->config.cyan), x + 70, y)); - add_tool(new BC_Title(x + 280, y, _("Red"))); + add_tool(cyan = new ColorBalanceSlider(client, &(client->config.cyan), x + xs70, y)); + add_tool(new BC_Title(x + xs280, y, _("Red"))); add_subwindow(cyanClr = new ColorBalanceSliderClr(client, this, x1, y, clrBtn_w, 1)); - y += 25; + y += ys25; add_tool(new BC_Title(x, y, _("Magenta"))); - add_tool(magenta = new ColorBalanceSlider(client, &(client->config.magenta), x + 70, y)); - add_tool(new BC_Title(x + 280, y, _("Green"))); + add_tool(magenta = new ColorBalanceSlider(client, &(client->config.magenta), x + xs70, y)); + add_tool(new BC_Title(x + xs280, y, _("Green"))); add_subwindow(magentaClr = new ColorBalanceSliderClr(client, this, x1, y, clrBtn_w, 2)); - y += 25; + y += ys25; add_tool(new BC_Title(x, y, _("Yellow"))); - add_tool(yellow = new ColorBalanceSlider(client, &(client->config.yellow), x + 70, y)); - add_tool(new BC_Title(x + 280, y, _("Blue"))); + add_tool(yellow = new ColorBalanceSlider(client, &(client->config.yellow), x + xs70, y)); + add_tool(new BC_Title(x + xs280, y, _("Blue"))); add_subwindow(yellowClr = new ColorBalanceSliderClr(client, this, x1, y, clrBtn_w, 3)); - y += 25; + y += ys25; add_tool(preserve = new ColorBalancePreserve(client, x, y)); - y += preserve->get_h() + 10; + y += preserve->get_h() + ys10; add_tool(lock_params = new ColorBalanceLock(client, x, y)); - y += lock_params->get_h() + 15; + y += lock_params->get_h() + ys15; add_tool(new ColorBalanceReset(client, this, x, y)); - add_tool(new ColorBalanceWhite(client, this, int(400 / 2), y)); + add_tool(new ColorBalanceWhite(client, this, int(xS(400) / 2), y)); show_window(); flush(); @@ -106,7 +108,7 @@ void ColorBalanceWindow::update_gui(int clear) ColorBalanceSlider::ColorBalanceSlider(ColorBalanceMain *client, float *output, int x, int y) - : BC_ISlider(x, y, 0, 200, 200, -1000, 1000, (int)*output) + : BC_ISlider(x, y, 0, xS(200), yS(200), -1000, 1000, (int)*output) { this->client = client; this->output = output; diff --git a/cinelerra-5.1/plugins/compressor/compressor.C b/cinelerra-5.1/plugins/compressor/compressor.C index 25eea16e..486a498e 100644 --- a/cinelerra-5.1/plugins/compressor/compressor.C +++ b/cinelerra-5.1/plugins/compressor/compressor.C @@ -833,10 +833,10 @@ void CompressorConfig::optimize() CompressorWindow::CompressorWindow(CompressorEffect *plugin) : PluginClientWindow(plugin, - 650, - 480, - 650, - 480, + xS(650), + yS(480), + xS(650), + yS(480), 0) { this->plugin = plugin; @@ -844,45 +844,47 @@ CompressorWindow::CompressorWindow(CompressorEffect *plugin) void CompressorWindow::create_objects() { - int x = 35, y = 10; - int control_margin = 130; + int xs10 = xS(10), xs20 = xS(20), xs50 = xS(50), xs110 = xS(110); + int ys20 = yS(20), ys30 = yS(30), ys40 = yS(40), ys60 = yS(60), ys70 = yS(70); + int x = xS(35), y = yS(10); + int control_margin = xS(130); add_subwindow(canvas = new CompressorCanvas(plugin, x, y, - get_w() - x - control_margin - 10, - get_h() - y - 70)); + get_w() - x - control_margin - xs10, + get_h() - y - ys70)); canvas->set_cursor(CROSS_CURSOR, 0, 0); x = get_w() - control_margin; add_subwindow(new BC_Title(x, y, _("Reaction secs:"))); - y += 20; + y += ys20; add_subwindow(reaction = new CompressorReaction(plugin, x, y)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Decay secs:"))); - y += 20; + y += ys20; add_subwindow(decay = new CompressorDecay(plugin, x, y)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Trigger Type:"))); - y += 20; + y += ys20; add_subwindow(input = new CompressorInput(plugin, x, y)); input->create_objects(); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Trigger:"))); - y += 20; + y += ys20; add_subwindow(trigger = new CompressorTrigger(plugin, x, y)); if(plugin->config.input != CompressorConfig::TRIGGER) trigger->disable(); - y += 30; + y += ys30; add_subwindow(smooth = new CompressorSmooth(plugin, x, y)); - y += 60; + y += ys60; add_subwindow(clear = new CompressorClear(plugin, x, y)); - x = 10; - y = get_h() - 40; + x = xs10; + y = get_h() - ys40; add_subwindow(new BC_Title(x, y, _("Point:"))); - x += 50; + x += xs50; add_subwindow(x_text = new CompressorX(plugin, x, y)); - x += 110; + x += xs110; add_subwindow(new BC_Title(x, y, _("x"))); - x += 20; + x += xs20; add_subwindow(y_text = new CompressorY(plugin, x, y)); draw_scales(); @@ -908,8 +910,8 @@ void CompressorWindow::draw_scales() #define DIVISIONS 8 for(int i = 0; i <= DIVISIONS; i++) { - int y = canvas->get_y() + 10 + canvas->get_h() / DIVISIONS * i; - int x = canvas->get_x() - 30; + int y = canvas->get_y() + yS(10) + canvas->get_h() / DIVISIONS * i; + int x = canvas->get_x() - xS(30); char string[BCTEXTLEN]; sprintf(string, "%.0f", (float)i / DIVISIONS * plugin->config.min_db); @@ -922,12 +924,12 @@ void CompressorWindow::draw_scales() y = y1 + (y2 - y1) * j / 10; if(j == 0) { - draw_line(canvas->get_x() - 10, y, canvas->get_x(), y); + draw_line(canvas->get_x() - xS(10), y, canvas->get_x(), y); } else if(i < DIVISIONS) { - draw_line(canvas->get_x() - 5, y, canvas->get_x(), y); + draw_line(canvas->get_x() - xS(5), y, canvas->get_x(), y); } } } @@ -935,8 +937,8 @@ void CompressorWindow::draw_scales() for(int i = 0; i <= DIVISIONS; i++) { - int y = canvas->get_h() + 30; - int x = canvas->get_x() + (canvas->get_w() - 10) / DIVISIONS * i; + int y = canvas->get_h() + yS(30); + int x = canvas->get_x() + (canvas->get_w() - xS(10)) / DIVISIONS * i; char string[BCTEXTLEN]; sprintf(string, "%.0f", (1.0 - (float)i / DIVISIONS) * plugin->config.min_db); @@ -949,12 +951,12 @@ void CompressorWindow::draw_scales() x = x1 + (x2 - x1) * j / 10; if(j == 0) { - draw_line(x, canvas->get_y() + canvas->get_h(), x, canvas->get_y() + canvas->get_h() + 10); + draw_line(x, canvas->get_y() + canvas->get_h(), x, canvas->get_y() + canvas->get_h() + yS(10)); } else if(i < DIVISIONS) { - draw_line(x, canvas->get_y() + canvas->get_h(), x, canvas->get_y() + canvas->get_h() + 5); + draw_line(x, canvas->get_y() + canvas->get_h(), x, canvas->get_y() + canvas->get_h() + yS(5)); } } } @@ -995,7 +997,7 @@ void CompressorWindow::update_textboxes() } } -#define POINT_W 10 +#define POINT_W xS(10) void CompressorWindow::update_canvas() { canvas->clear_box(0, 0, canvas->get_w(), canvas->get_h()); @@ -1192,7 +1194,7 @@ int CompressorCanvas::cursor_motion_event() CompressorReaction::CompressorReaction(CompressorEffect *plugin, int x, int y) - : BC_TextBox(x, y, 100, 1, (float)plugin->config.reaction_len) + : BC_TextBox(x, y, xS(100), 1, (float)plugin->config.reaction_len) { this->plugin = plugin; } @@ -1226,7 +1228,7 @@ int CompressorReaction::button_press_event() } CompressorDecay::CompressorDecay(CompressorEffect *plugin, int x, int y) - : BC_TextBox(x, y, 100, 1, (float)plugin->config.decay_len) + : BC_TextBox(x, y, xS(100), 1, (float)plugin->config.decay_len) { this->plugin = plugin; } @@ -1261,7 +1263,7 @@ int CompressorDecay::button_press_event() CompressorX::CompressorX(CompressorEffect *plugin, int x, int y) - : BC_TextBox(x, y, 100, 1, "") + : BC_TextBox(x, y, xS(100), 1, "") { this->plugin = plugin; } @@ -1280,7 +1282,7 @@ int CompressorX::handle_event() CompressorY::CompressorY(CompressorEffect *plugin, int x, int y) - : BC_TextBox(x, y, 100, 1, "") + : BC_TextBox(x, y, xS(100), 1, "") { this->plugin = plugin; } @@ -1301,7 +1303,7 @@ int CompressorY::handle_event() CompressorTrigger::CompressorTrigger(CompressorEffect *plugin, int x, int y) - : BC_TextBox(x, y, (int64_t)100, (int64_t)1, (int64_t)plugin->config.trigger) + : BC_TextBox(x, y, xS(100), 1, (int64_t)plugin->config.trigger) { this->plugin = plugin; } @@ -1340,7 +1342,7 @@ int CompressorTrigger::button_press_event() CompressorInput::CompressorInput(CompressorEffect *plugin, int x, int y) : BC_PopupMenu(x, y, - 100, + xS(100), CompressorInput::value_to_text(plugin->config.input), 1) { diff --git a/cinelerra-5.1/plugins/crikey/crikeywindow.C b/cinelerra-5.1/plugins/crikey/crikeywindow.C index 179d66e2..4295d6d3 100644 --- a/cinelerra-5.1/plugins/crikey/crikeywindow.C +++ b/cinelerra-5.1/plugins/crikey/crikeywindow.C @@ -36,11 +36,11 @@ #include "theme.h" #include "track.h" -#define COLOR_W 50 -#define COLOR_H 30 +#define COLOR_W xS(50) +#define COLOR_H yS(30) CriKeyNum::CriKeyNum(CriKeyWindow *gui, int x, int y, float output) - : BC_TumbleTextBox(gui, output, -32767.0f, 32767.0f, x, y, 120) + : BC_TumbleTextBox(gui, output, -32767.0f, 32767.0f, x, y, xS(120)) { this->gui = gui; set_increment(1); @@ -90,7 +90,7 @@ int CriKeyDrawModeItem::handle_event() return 1; } CriKeyDrawMode::CriKeyDrawMode(CriKeyWindow *gui, int x, int y) - : BC_PopupMenu(x, y, 100, "", 1) + : BC_PopupMenu(x, y, xS(100), "", 1) { this->gui = gui; draw_modes[DRAW_ALPHA] = _("Alpha"); @@ -115,7 +115,7 @@ void CriKeyDrawMode::update(int mode, int send) CriKeyWindow::CriKeyWindow(CriKey *plugin) - : PluginClientWindow(plugin, 380, 400, 380, 400, 0) + : PluginClientWindow(plugin, xS(380), yS(400), xS(380), yS(400), 0) { this->plugin = plugin; this->title_x = 0; this->point_x = 0; @@ -135,14 +135,16 @@ CriKeyWindow::~CriKeyWindow() void CriKeyWindow::create_objects() { + int xs10 = xS(10), xs32 = xS(32); + int ys5 = yS(5), ys10 = yS(10); int x = 10, y = 10; int margin = plugin->get_theme()->widget_border; BC_Title *title; - add_subwindow(title = new BC_Title(x, y+5, _("Draw mode:"))); - int x1 = x + title->get_w() + 10 + margin; + add_subwindow(title = new BC_Title(x, y+ys5, _("Draw mode:"))); + int x1 = x + title->get_w() + xs10 + margin; add_subwindow(draw_mode = new CriKeyDrawMode(this, x1, y)); draw_mode->create_objects(); - y += draw_mode->get_h() + 10 + margin; + y += draw_mode->get_h() + ys10 + margin; CriKeyPoint *pt = plugin->config.points[plugin->config.selected]; add_subwindow(title_x = new BC_Title(x, y, _("X:"))); @@ -162,7 +164,7 @@ void CriKeyWindow::create_objects() add_subwindow(del_point = new CriKeyDelPoint(this, plugin, x1, y)); x1 += del_point->get_w() + margin; add_subwindow(point_dn = new CriKeyPointDn(this, x1, y)); - y += point_y->get_h() + margin + 10; + y += point_y->get_h() + margin + ys10; add_subwindow(title = new BC_Title(x, y, _("Threshold:"))); y += title->get_h() + margin; add_subwindow(threshold = new CriKeyThreshold(this, x, y, get_w() - x * 2)); @@ -173,14 +175,14 @@ void CriKeyWindow::create_objects() if( !grab(plugin->server->mwindow->cwindow->gui) ) eprintf("drag enabled, but compositor already grabbed\n"); } - x1 = x + drag->get_w() + margin + 32; - add_subwindow(reset = new CriKeyReset(this, plugin, x1, y+3)); + x1 = x + drag->get_w() + margin + xs32; + add_subwindow(reset = new CriKeyReset(this, plugin, x1, y+yS(3))); y += drag->get_h() + margin; add_subwindow(point_list = new CriKeyPointList(this, plugin, x, y)); point_list->update(plugin->config.selected); - y += point_list->get_h() + 10; + y += point_list->get_h() + ys10; add_subwindow(notes = new BC_Title(x, y, _("Right click in composer: create new point\n" "Shift-left click in Enable field:\n" @@ -341,15 +343,15 @@ void CriKeyWindow::done_event(int result) } CriKeyPointList::CriKeyPointList(CriKeyWindow *gui, CriKey *plugin, int x, int y) - : BC_ListBox(x, y, 360, 130, LISTBOX_TEXT) + : BC_ListBox(x, y, xS(360), yS(130), LISTBOX_TEXT) { this->gui = gui; this->plugin = plugin; - titles[PT_E] = _("E"); widths[PT_E] = 50; - titles[PT_X] = _("X"); widths[PT_X] = 90; - titles[PT_Y] = _("Y"); widths[PT_Y] = 90; - titles[PT_T] = _("T"); widths[PT_T] = 70; - titles[PT_TAG] = _("Tag"); widths[PT_TAG] = 50; + titles[PT_E] = _("E"); widths[PT_E] = xS(50); + titles[PT_X] = _("X"); widths[PT_X] = xS(90); + titles[PT_Y] = _("Y"); widths[PT_Y] = xS(90); + titles[PT_T] = _("T"); widths[PT_T] = xS(70); + titles[PT_TAG] = _("Tag"); widths[PT_TAG] = xS(50); } CriKeyPointList::~CriKeyPointList() { @@ -588,7 +590,7 @@ int CriKeyDrag::handle_event() } CriKeyNewPoint::CriKeyNewPoint(CriKeyWindow *gui, CriKey *plugin, int x, int y) - : BC_GenericButton(x, y, 80, _("New")) + : BC_GenericButton(x, y, xS(80), _("New")) { this->gui = gui; this->plugin = plugin; @@ -605,7 +607,7 @@ int CriKeyNewPoint::handle_event() } CriKeyDelPoint::CriKeyDelPoint(CriKeyWindow *gui, CriKey *plugin, int x, int y) - : BC_GenericButton(x, y, 80, C_("Del")) + : BC_GenericButton(x, y, xS(80), C_("Del")) { this->gui = gui; this->plugin = plugin; diff --git a/cinelerra-5.1/plugins/crop/cropwin.C b/cinelerra-5.1/plugins/crop/cropwin.C index 654263b4..21c37dbe 100644 --- a/cinelerra-5.1/plugins/crop/cropwin.C +++ b/cinelerra-5.1/plugins/crop/cropwin.C @@ -44,10 +44,10 @@ CropWin::CropWin(CropMain *client) : PluginClientWindow(client, - 420, - 290, - 420, - 290, + xS(420), + yS(290), + xS(420), + yS(290), 0) { this->client = client; @@ -59,79 +59,81 @@ CropWin::~CropWin() void CropWin::create_objects() { - int x = 10, x1 = 40, x2 = 80, x_middle= (get_w() / 2), x3 = 180; - int y = 10; - int clr_x = get_w()-x - 22; // note: clrBtn_w = 22 + int xs10 = xS(10), xs20 = xS(20), xs200 = xS(200); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(40); + int x2 = xS(80), x3 = xS(180); + int x = xs10, y = ys10; + int clr_x = get_w()-x - xS(22); // note: clrBtn_w = 22 BC_TitleBar *title_bar; BC_Bar *bar; // Crop section - add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, 20, 10, _("Crop"))); - y += 20; + add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xs20, xs10, _("Crop"))); + y += ys20; add_tool(new BC_Title(x, y, _("Left"))); add_tool(new BC_Title((x2-x), y, _("%"))); crop_left_text = new CropLeftText(this, client, (x + x2), y); crop_left_text->create_objects(); - crop_left_slider = new CropLeftSlider(this, client, x3, y, 200); + crop_left_slider = new CropLeftSlider(this, client, x3, y, xs200); add_subwindow(crop_left_slider); clr_x = x3 + crop_left_slider->get_w() + x; add_subwindow(crop_left_clr = new CropEdgesClr(this, client, clr_x, y, RESET_LEFT)); - y += 30; + y += ys30; add_tool(new BC_Title(x, y, _("Top"))); add_tool(new BC_Title((x2-x), y, _("%"))); crop_top_text = new CropTopText(this, client, (x + x2), y); crop_top_text->create_objects(); - crop_top_slider = new CropTopSlider(this, client, x3, y, 200); + crop_top_slider = new CropTopSlider(this, client, x3, y, xs200); add_subwindow(crop_top_slider); add_subwindow(crop_top_clr = new CropEdgesClr(this, client, clr_x, y, RESET_TOP)); - y += 30; + y += ys30; add_tool(new BC_Title(x, y, _("Right"))); add_tool(new BC_Title((x2-x), y, _("%"))); crop_right_text = new CropRightText(this, client, (x + x2), y); crop_right_text->create_objects(); - crop_right_slider = new CropRightSlider(this, client, x3, y, 200); + crop_right_slider = new CropRightSlider(this, client, x3, y, xs200); add_subwindow(crop_right_slider); add_subwindow(crop_right_clr = new CropEdgesClr(this, client, clr_x, y, RESET_RIGHT)); - y += 30; + y += ys30; add_tool(new BC_Title(x, y, _("Bottom"))); add_tool(new BC_Title((x2-x), y, _("%"))); crop_bottom_text = new CropBottomText(this, client, (x + x2), y); crop_bottom_text->create_objects(); - crop_bottom_slider = new CropBottomSlider(this, client, x3, y, 200); + crop_bottom_slider = new CropBottomSlider(this, client, x3, y, xs200); add_subwindow(crop_bottom_slider); add_subwindow(crop_bottom_clr = new CropEdgesClr(this, client, clr_x, y, RESET_BOTTOM)); - y += 40; + y += ys40; // Position section - add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, 20, 10, _("Position"))); - y += 20; + add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xs20, xs10, _("Position"))); + y += ys20; add_tool(new BC_Title(x, y, _("X"))); add_tool(new BC_Title((x2-x), y, _("%"))); crop_position_x_text = new CropPositionXText(this, client, (x + x2), y); crop_position_x_text->create_objects(); - crop_position_x_slider = new CropPositionXSlider(this, client, x3, y, 200); + crop_position_x_slider = new CropPositionXSlider(this, client, x3, y, xs200); add_subwindow(crop_position_x_slider); add_subwindow(crop_position_x_clr = new CropEdgesClr(this, client, clr_x, y, RESET_POSITION_X)); - y += 30; + y += ys30; add_tool(new BC_Title(x, y, _("Y"))); add_tool(new BC_Title((x2-x), y, _("%"))); crop_position_y_text = new CropPositionYText(this, client, (x + x2), y); crop_position_y_text->create_objects(); - crop_position_y_slider = new CropPositionYSlider(this, client, x3, y, 200); + crop_position_y_slider = new CropPositionYSlider(this, client, x3, y, xs200); add_subwindow(crop_position_y_slider); add_subwindow(crop_position_y_clr = new CropEdgesClr(this, client, clr_x, y, RESET_POSITION_Y)); - y += 40; + y += ys40; // Reset section add_subwindow(bar = new BC_Bar(x, y, get_w()-2*x)); - y += 10; + y += ys10; add_tool(reset = new CropReset(client, this, x, y)); show_window(); @@ -197,13 +199,8 @@ CropLeftText::CropLeftText(CropWin *win, CropMain *client, int x, int y) - : BC_TumbleTextBox(win, - client->config.crop_l, - (float)0.00, - (float)100.00, - x, - y, - 60, 2) + : BC_TumbleTextBox(win, client->config.crop_l, + (float)0.00, (float)100.00, x, y, xS(60), 2) { this->win = win; this->client = client; @@ -251,13 +248,8 @@ CropTopText::CropTopText(CropWin *win, CropMain *client, int x, int y) - : BC_TumbleTextBox(win, - client->config.crop_t, - (float)0.00, - (float)100.00, - x, - y, - 60, 2) + : BC_TumbleTextBox(win, client->config.crop_t, + (float)0.00, (float)100.00, x, y, xS(60), 2) { this->win = win; this->client = client; @@ -304,13 +296,8 @@ int CropTopSlider::handle_event() CropRightText::CropRightText(CropWin *win, CropMain *client, int x, int y) - : BC_TumbleTextBox(win, - client->config.crop_r, - (float)0.00, - (float)100.00, - x, - y, - 60, 2) + : BC_TumbleTextBox(win, client->config.crop_r, + (float)0.00, (float)100.00, x, y, xS(60), 2) { this->win = win; this->client = client; @@ -357,13 +344,8 @@ int CropRightSlider::handle_event() CropBottomText::CropBottomText(CropWin *win, CropMain *client, int x, int y) - : BC_TumbleTextBox(win, - client->config.crop_b, - (float)0.00, - (float)100.00, - x, - y, - 60, 2) + : BC_TumbleTextBox(win, client->config.crop_b, + (float)0.00, (float)100.00, x, y, xS(60), 2) { this->win = win; this->client = client; @@ -410,13 +392,8 @@ int CropBottomSlider::handle_event() CropPositionXText::CropPositionXText(CropWin *win, CropMain *client, int x, int y) - : BC_TumbleTextBox(win, - client->config.position_x, - (float)-100.00, - (float)100.00, - x, - y, - 60, 2) + : BC_TumbleTextBox(win, client->config.position_x, + (float)-100.00, (float)100.00, x, y, xS(60), 2) { this->win = win; this->client = client; @@ -463,13 +440,8 @@ int CropPositionXSlider::handle_event() CropPositionYText::CropPositionYText(CropWin *win, CropMain *client, int x, int y) - : BC_TumbleTextBox(win, - client->config.position_y, - (float)-100.00, - (float)100.00, - x, - y, - 60, 2) + : BC_TumbleTextBox(win, client->config.position_y, + (float)-100.00, (float)100.00, x, y, xS(60), 2) { this->win = win; this->client = client; diff --git a/cinelerra-5.1/plugins/decimate/decimate.C b/cinelerra-5.1/plugins/decimate/decimate.C index 5f72ea0c..cd2dd7e7 100644 --- a/cinelerra-5.1/plugins/decimate/decimate.C +++ b/cinelerra-5.1/plugins/decimate/decimate.C @@ -210,10 +210,10 @@ int DecimateConfig::equivalent(DecimateConfig *config) DecimateWindow::DecimateWindow(Decimate *plugin) : PluginClientWindow(plugin, - 210, - 160, - 200, - 160, + xS(210), + yS(160), + xS(200), + yS(160), 0) { this->plugin = plugin; @@ -226,7 +226,8 @@ DecimateWindow::~DecimateWindow() void DecimateWindow::create_objects() { - int x = 10, y = 10; + int ys30 = yS(30); + int x = xS(10), y = yS(10); frame_rates.append(new BC_ListBoxItem("1")); frame_rates.append(new BC_ListBoxItem("5")); @@ -244,24 +245,24 @@ void DecimateWindow::create_objects() BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Input frames per second:"))); - y += 30; + y += ys30; add_subwindow(rate = new DecimateRate(plugin, this, x, y)); add_subwindow(rate_menu = new DecimateRateMenu(plugin, this, - x + rate->get_w() + 5, + x + rate->get_w() + xS(5), y)); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Last frame dropped: "))); add_subwindow(last_dropped = new BC_Title(x + title->get_w() + 5, y, "")); -// y += 30; +// y += ys30; // add_subwindow(difference = new DecimateDifference(plugin, // x, // y)); -// y += 30; +// y += ys30; // add_subwindow(avg_difference = new DecimateAvgDifference(plugin, // x, // y)); @@ -285,10 +286,7 @@ DecimateRate::DecimateRate(Decimate *plugin, DecimateWindow *gui, int x, int y) - : BC_TextBox(x, - y, - 90, - 1, + : BC_TextBox(x, y, xS(90), 1, (float)plugin->config.input_rate) { this->plugin = plugin; @@ -345,8 +343,8 @@ DecimateRateMenu::DecimateRateMenu(Decimate *plugin, int y) : BC_ListBox(x, y, - 100, - 200, + xS(100), + yS(200), LISTBOX_TEXT, &gui->frame_rates, 0, diff --git a/cinelerra-5.1/plugins/deinterlace-cv/deinterwindow-cv.C b/cinelerra-5.1/plugins/deinterlace-cv/deinterwindow-cv.C index d3be67af..068be6de 100644 --- a/cinelerra-5.1/plugins/deinterlace-cv/deinterwindow-cv.C +++ b/cinelerra-5.1/plugins/deinterlace-cv/deinterwindow-cv.C @@ -27,10 +27,10 @@ DeInterlaceWindow::DeInterlaceWindow(DeInterlaceMain *client) : PluginClientWindow(client, - 400, - 200, - 400, - 200, + xS(400), + yS(200), + xS(400), + yS(200), 0) { this->client = client; @@ -44,15 +44,17 @@ DeInterlaceWindow::~DeInterlaceWindow() void DeInterlaceWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys25 = yS(25); + int x = xs10, y = ys10; add_tool(new BC_Title(x, y, _("Select deinterlacing mode"))); - y += 25; + y += ys25; add_tool(mode = new DeInterlaceMode(client, this, x, y)); mode->create_objects(); - y += 25; + y += ys25; optional_controls_x=x; optional_controls_y=y; - y += 125; + y += yS(125); char string[BCTEXTLEN]; get_status_string(string, 0); add_tool(status = new BC_Title(x, y, string)); @@ -85,27 +87,27 @@ int DeInterlaceWindow::set_mode(int mode, int recursive) case DEINTERLACE_KEEP: case DEINTERLACE_BOBWEAVE: add_subwindow(dominance_top = new DeInterlaceDominanceTop(client, this, x, y, _("Keep top field"))); - y+=25; + y+=yS(25); add_subwindow(dominance_bottom = new DeInterlaceDominanceBottom(client, this, x, y, _("Keep bottom field"))); - y+=25; + y+=yS(25); break; case DEINTERLACE_AVG_1F: add_subwindow(dominance_top = new DeInterlaceDominanceTop(client, this, x, y, _("Average top fields"))); - y+=25; + y+=yS(25); add_subwindow(dominance_bottom = new DeInterlaceDominanceBottom(client, this, x, y,_("Average bottom fields"))); - y+=25; + y+=yS(25); break; case DEINTERLACE_SWAP: add_subwindow(dominance_top = new DeInterlaceDominanceTop(client, this, x, y, _("Top field first"))); - y+=25; + y+=yS(25); add_subwindow(dominance_bottom = new DeInterlaceDominanceBottom(client, this, x, y, _("Bottom field first"))); - y+=25; + y+=yS(25); break; case DEINTERLACE_TEMPORALSWAP: add_subwindow(dominance_top = new DeInterlaceDominanceTop(client, this, x, y, _("Top field first"))); - y+=25; + y+=yS(25); add_subwindow(dominance_bottom = new DeInterlaceDominanceBottom(client, this, x, y, _("Bottom field first"))); - y+=25; + y+=yS(25); break; case DEINTERLACE_NONE: case DEINTERLACE_AVG: @@ -123,13 +125,13 @@ int DeInterlaceWindow::set_mode(int mode, int recursive) case DEINTERLACE_AVG_1F: add_subwindow(adaptive = new DeInterlaceAdaptive(client, x, y)); - add_subwindow(threshold = new DeInterlaceThreshold(client, x + 150, y)); - add_subwindow(threshold->title_caption=new BC_Title(x+150, y + 50, _("Threshold"))); + add_subwindow(threshold = new DeInterlaceThreshold(client, x + xS(150), y)); + add_subwindow(threshold->title_caption=new BC_Title(x+xS(150), y + yS(50), _("Threshold"))); adaptive->update(client->config.adaptive?BC_Toggle::TOGGLE_CHECKED:0); break; case DEINTERLACE_BOBWEAVE: - add_subwindow(threshold = new DeInterlaceThreshold(client, x + 150, y)); - add_subwindow(threshold->title_caption=new BC_Title(x+150, y + 50, _("Bob Threshold"))); + add_subwindow(threshold = new DeInterlaceThreshold(client, x + xS(150), y)); + add_subwindow(threshold->title_caption=new BC_Title(x+xS(150), y + yS(50), _("Bob Threshold"))); break; case DEINTERLACE_NONE: case DEINTERLACE_KEEP: @@ -237,7 +239,7 @@ DeInterlaceMode::DeInterlaceMode(DeInterlaceMain*plugin, DeInterlaceWindow *gui, int x, int y) - : BC_PopupMenu(x, y, 200, to_text(plugin->config.mode), 1) + : BC_PopupMenu(x, y, xS(200), to_text(plugin->config.mode), 1) { this->plugin = plugin; this->gui = gui; diff --git a/cinelerra-5.1/plugins/deinterlace/deinterlace.C b/cinelerra-5.1/plugins/deinterlace/deinterlace.C index 7ebf6330..e6a15283 100644 --- a/cinelerra-5.1/plugins/deinterlace/deinterlace.C +++ b/cinelerra-5.1/plugins/deinterlace/deinterlace.C @@ -107,7 +107,7 @@ int DeInterlaceMain::is_realtime() { return 1; } int h = input->get_h(); \ changed_rows = 0; \ \ - type **in_rows = (type**)input->get_rows(); \ + type **in_rows = (type**)input->get_rows(); \ type **out_rows = (type**)temp->get_rows(); \ int max_h = h - 1; \ /* temp_type abs_diff = 0, total = 0; */ \ diff --git a/cinelerra-5.1/plugins/deinterlace/deinterwindow.C b/cinelerra-5.1/plugins/deinterlace/deinterwindow.C index 43f77d17..5304b156 100644 --- a/cinelerra-5.1/plugins/deinterlace/deinterwindow.C +++ b/cinelerra-5.1/plugins/deinterlace/deinterwindow.C @@ -32,10 +32,10 @@ DeInterlaceWindow::DeInterlaceWindow(DeInterlaceMain *client) : PluginClientWindow(client, - 200, - 250, - 200, - 250, + xS(200), + yS(250), + xS(200), + yS(250), 0) { this->client = client; @@ -47,28 +47,30 @@ DeInterlaceWindow::~DeInterlaceWindow() void DeInterlaceWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys25 = yS(25); + int x = xs10, y = ys10; add_tool(new BC_Title(x, y, _("Select lines to keep"))); - y += 25; + y += ys25; add_tool(none = new DeInterlaceOption(client, this, DEINTERLACE_NONE, x, y, _("Do nothing"))); - y += 25; + y += ys25; add_tool(odd_fields = new DeInterlaceOption(client, this, DEINTERLACE_EVEN, x, y, _("Odd lines"))); - y += 25; + y += ys25; add_tool(even_fields = new DeInterlaceOption(client, this, DEINTERLACE_ODD, x, y, _("Even lines"))); - y += 25; + y += ys25; add_tool(average_fields = new DeInterlaceOption(client, this, DEINTERLACE_AVG, x, y, _("Average lines"))); - y += 25; + y += ys25; add_tool(swap_odd_fields = new DeInterlaceOption(client, this, DEINTERLACE_SWAP_ODD, x, y, _("Swap odd fields"))); - y += 25; + y += ys25; add_tool(swap_even_fields = new DeInterlaceOption(client, this, DEINTERLACE_SWAP_EVEN, x, y, _("Swap even fields"))); - y += 25; + y += ys25; add_tool(avg_even = new DeInterlaceOption(client, this, DEINTERLACE_AVG_EVEN, x, y, _("Average even lines"))); // draw_line(170, y + 5, 190, y + 5); // draw_line(190, y + 5, 190, y + 70); // draw_line(150, y + 70, 190, y + 70); - y += 25; - add_tool(avg_odd = new DeInterlaceOption(client, this, DEINTERLACE_AVG_ODD, x, y, _("Average odd lines"))); + y += ys25; + add_tool(avg_odd = new DeInterlaceOption(client, this, DEINTERLACE_AVG_ODD, x, y, _("Average odd lines"))); // draw_line(170, y + 5, 190, y + 5); // y += 30; // add_tool(adaptive = new DeInterlaceAdaptive(client, x, y)); diff --git a/cinelerra-5.1/plugins/delayaudio/delayaudio.C b/cinelerra-5.1/plugins/delayaudio/delayaudio.C index 561b29e1..7fa8af60 100644 --- a/cinelerra-5.1/plugins/delayaudio/delayaudio.C +++ b/cinelerra-5.1/plugins/delayaudio/delayaudio.C @@ -205,7 +205,7 @@ void DelayAudio::update_gui() DelayAudioWindow::DelayAudioWindow(DelayAudio *plugin) - : PluginClientWindow(plugin, 285, 80, 285, 80, 0) + : PluginClientWindow(plugin, xS(285), yS(80), xS(285), yS(80), 0) { this->plugin = plugin; } @@ -216,12 +216,14 @@ DelayAudioWindow::~DelayAudioWindow() void DelayAudioWindow::create_objects() { - add_subwindow(new BC_Title(10, 10, _("Delay seconds:"))); + int xs10 = xS(10); + int ys10 = yS(10), ys40 = yS(40); + add_subwindow(new BC_Title(xs10, ys10, _("Delay seconds:"))); length = new DelayAudioTextBox( plugin, this, - 10, - 40); + xs10, + ys40); length->create_objects(); update_gui(); show_window(); diff --git a/cinelerra-5.1/plugins/delayvideo/delayvideo.C b/cinelerra-5.1/plugins/delayvideo/delayvideo.C index 2ec90f04..3aaa8530 100644 --- a/cinelerra-5.1/plugins/delayvideo/delayvideo.C +++ b/cinelerra-5.1/plugins/delayvideo/delayvideo.C @@ -71,10 +71,10 @@ void DelayVideoConfig::interpolate(DelayVideoConfig &prev, DelayVideoWindow::DelayVideoWindow(DelayVideo *plugin) : PluginClientWindow(plugin, - 210, - 120, - 210, - 120, + xS(210), + yS(120), + xS(210), + yS(120), 0) { this->plugin = plugin; @@ -87,10 +87,12 @@ DelayVideoWindow::~DelayVideoWindow() void DelayVideoWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys20 = yS(20); + int x = xs10, y = ys10; add_subwindow(new BC_Title(x, y, _("Delay seconds:"))); - y += 20; + y += ys20; slider = new DelayVideoSlider(this, plugin, x, y); slider->create_objects(); show_window(); @@ -125,7 +127,7 @@ DelayVideoSlider::DelayVideoSlider(DelayVideoWindow *window, (float)10, x, y, - 150) + xS(150)) { this->plugin = plugin; set_increment(0.1); diff --git a/cinelerra-5.1/plugins/denoise/denoise.C b/cinelerra-5.1/plugins/denoise/denoise.C index 57e0be59..4682740e 100644 --- a/cinelerra-5.1/plugins/denoise/denoise.C +++ b/cinelerra-5.1/plugins/denoise/denoise.C @@ -754,17 +754,19 @@ void DenoiseConfig::interpolate(DenoiseConfig &prev, DenoiseWindow::DenoiseWindow(DenoiseEffect *plugin) - : PluginClientWindow(plugin, 280, 50, 280, 50, 0) + : PluginClientWindow(plugin, xS(280), yS(50), xS(280), yS(50), 0) { this->plugin = plugin; } void DenoiseWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs70 = xS(70); + int ys10 = yS(10); + int x = xs10, y = ys10; add_subwindow(new BC_Title(x, y, _("Level:"))); - x += 70; + x += xs70; add_subwindow(scale = new DenoiseLevel(plugin, x, y)); show_window(); flush(); diff --git a/cinelerra-5.1/plugins/denoisefft/denoisefft.C b/cinelerra-5.1/plugins/denoisefft/denoisefft.C index 21ce0c19..20b99005 100644 --- a/cinelerra-5.1/plugins/denoisefft/denoisefft.C +++ b/cinelerra-5.1/plugins/denoisefft/denoisefft.C @@ -211,7 +211,7 @@ DenoiseFFTSamples::DenoiseFFTSamples(DenoiseFFTEffect *plugin, int x, int y, char *text) - : BC_PopupMenu(x, y, 100, text, 1) + : BC_PopupMenu(x, y, xS(140), text, 1) { this->plugin = plugin; } @@ -227,10 +227,10 @@ int DenoiseFFTSamples::handle_event() DenoiseFFTWindow::DenoiseFFTWindow(DenoiseFFTEffect *plugin) : PluginClientWindow(plugin, - 300, - 130, - 300, - 130, + xS(300), + yS(130), + xS(300), + yS(130), 0) { this->plugin = plugin; @@ -238,19 +238,21 @@ DenoiseFFTWindow::DenoiseFFTWindow(DenoiseFFTEffect *plugin) void DenoiseFFTWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs100 = xS(100), xs130 = xS(130); + int ys10 = yS(10), ys20 = yS(20); + int x = xs10, y = ys10; add_subwindow(new BC_Title(x, y, _("Denoise power:"))); - add_subwindow(level = new DenoiseFFTLevel(plugin, x + 130, y)); - y += level->get_h() + 10; + add_subwindow(level = new DenoiseFFTLevel(plugin, x + xs130, y)); + y += level->get_h() + ys10; add_subwindow(new BC_Title(x, y, _("Number of samples for reference:"))); - y += 20; + y += ys20; add_subwindow(new BC_Title(x, y, _("The keyframe is the start of the reference"))); - y += 20; + y += ys20; char string[BCTEXTLEN]; sprintf(string, "%d\n", plugin->config.samples); - add_subwindow(samples = new DenoiseFFTSamples(plugin, x + 100, y, string)); + add_subwindow(samples = new DenoiseFFTSamples(plugin, x + xs100, y, string)); for(int i = WINDOW_SIZE; i < 0x100000; ) { sprintf(string, "%d", i); diff --git a/cinelerra-5.1/plugins/denoisemjpeg/denoisemjpeg.C b/cinelerra-5.1/plugins/denoisemjpeg/denoisemjpeg.C index 22a5a335..f4476679 100644 --- a/cinelerra-5.1/plugins/denoisemjpeg/denoisemjpeg.C +++ b/cinelerra-5.1/plugins/denoisemjpeg/denoisemjpeg.C @@ -353,7 +353,7 @@ int DenoiseMJPEGDelay::handle_event() DenoiseMJPEGWindow::DenoiseMJPEGWindow(DenoiseMJPEG *plugin) - : PluginClientWindow(plugin, 250, 350, 0, 0, 1) + : PluginClientWindow(plugin, xS(250), yS(350), 0, 0, 1) { this->plugin = plugin; } @@ -361,7 +361,9 @@ DenoiseMJPEGWindow::DenoiseMJPEGWindow(DenoiseMJPEG *plugin) void DenoiseMJPEGWindow::create_objects() { - int x1 = 10, y1 = 20, x2 = 140, x3 = 180, y2 = 10, margin = 30, margin2 = 25; + int xs10 = xS(10), xs25 = xS(25), xs30 = xS(30), xs140 = xS(140), xs180 = xS(180); + int ys10 = yS(10), ys20 = yS(20); + int x1 = xs10, y1 = ys20, x2 = xs140, x3 = xs180, y2 = ys10, margin = xs30, margin2 = xs25; add_subwindow(new BC_Title(x1, y1, _("Search radius:"))); add_subwindow(radius = new DenoiseMJPEGRadius(plugin, x2, y2)); y1 += margin; diff --git a/cinelerra-5.1/plugins/denoiseseltempavg/seltempavgwindow.C b/cinelerra-5.1/plugins/denoiseseltempavg/seltempavgwindow.C index 9a5b1ba6..42c92d70 100644 --- a/cinelerra-5.1/plugins/denoiseseltempavg/seltempavgwindow.C +++ b/cinelerra-5.1/plugins/denoiseseltempavg/seltempavgwindow.C @@ -30,10 +30,10 @@ SelTempAvgWindow::SelTempAvgWindow(SelTempAvgMain *client) : PluginClientWindow(client, - 310, - 540, - 300, - 540, + xS(310), + yS(540), + xS(300), + yS(540), 0) { this->client = client; diff --git a/cinelerra-5.1/plugins/denoisevideo/denoisevideo.C b/cinelerra-5.1/plugins/denoisevideo/denoisevideo.C index fa0bce49..bdcc5558 100644 --- a/cinelerra-5.1/plugins/denoisevideo/denoisevideo.C +++ b/cinelerra-5.1/plugins/denoisevideo/denoisevideo.C @@ -105,8 +105,8 @@ DenoiseVideoFrames::DenoiseVideoFrames(DenoiseVideo *plugin, int x, int y) : BC_ISlider(x, y, 0, - 190, - 200, + xS(190), + yS(200), 1, 256, plugin->config.frames) @@ -234,10 +234,10 @@ int DenoiseVideoCountSame::handle_event() DenoiseVideoWindow::DenoiseVideoWindow(DenoiseVideo *plugin) : PluginClientWindow(plugin, - 250, - 300, - 250, - 300, + xS(250), + yS(300), + xS(250), + yS(300), 0) { this->plugin = plugin; @@ -246,38 +246,40 @@ DenoiseVideoWindow::DenoiseVideoWindow(DenoiseVideo *plugin) void DenoiseVideoWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; BC_Title *title; BC_Bar *bar; add_subwindow(new BC_Title(x, y, _("Frames to accumulate:"))); - y += 20; + y += yS(20); add_subwindow(frames = new DenoiseVideoFrames(plugin, x, y)); - y += frames->get_h() + 5; + y += frames->get_h() + ys5; add_subwindow(title = new BC_Title(x, y, _("Threshold:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; threshold = new DenoiseVideoThreshold(plugin, this, x, y); threshold->create_objects(); - y += threshold->get_h() + 5; + y += threshold->get_h() + ys5; add_subwindow(bar = new BC_Bar(x, y, get_w() - x * 2)); - y += bar->get_h() + 5; + y += bar->get_h() + ys5; add_subwindow(count_changed = new DenoiseVideoCountChanged(plugin, this, x, y)); - y += count_changed->get_h() + 5; + y += count_changed->get_h() + ys5; add_subwindow(count_same = new DenoiseVideoCountSame(plugin, this, x, y)); - y += count_same->get_h() + 5; + y += count_same->get_h() + ys5; add_subwindow(bar = new BC_Bar(x, y, get_w() - x * 2)); - y += bar->get_h() + 5; + y += bar->get_h() + ys5; add_subwindow(do_r = new DenoiseVideoToggle(plugin, this, x, y, &plugin->config.do_r, _("Red"))); - y += 30; + y += ys30; add_subwindow(do_g = new DenoiseVideoToggle(plugin, this, x, y, &plugin->config.do_g, _("Green"))); - y += 30; + y += ys30; add_subwindow(do_b = new DenoiseVideoToggle(plugin, this, x, y, &plugin->config.do_b, _("Blue"))); - y += 30; + y += ys30; add_subwindow(do_a = new DenoiseVideoToggle(plugin, this, x, y, &plugin->config.do_a, _("Alpha"))); show_window(); flush(); diff --git a/cinelerra-5.1/plugins/descratch/descratch.C b/cinelerra-5.1/plugins/descratch/descratch.C index 3d82fdd9..b48c4d0e 100644 --- a/cinelerra-5.1/plugins/descratch/descratch.C +++ b/cinelerra-5.1/plugins/descratch/descratch.C @@ -474,7 +474,7 @@ NEW_WINDOW_MACRO(DeScratchMain, DeScratchWindow) DeScratchWindow::DeScratchWindow(DeScratchMain *plugin) - : PluginClientWindow(plugin, 512, 270, 512, 270, 0) + : PluginClientWindow(plugin, xS(512), yS(270), xS(512), yS(270), 0) { this->plugin = plugin; } @@ -485,7 +485,9 @@ DeScratchWindow::~DeScratchWindow() void DeScratchWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs15 = xS(15), xs16 = xS(16); + int ys10 = yS(10), ys15 = yS(15), ys30 = yS(30); + int x = xs10, y = ys10; plugin->load_configuration(); DeScratchConfig &config = plugin->config; @@ -493,75 +495,75 @@ void DeScratchWindow::create_objects() add_tool(title = new BC_Title(x, y, _("DeScratch:"))); int w1 = DeScratchReset::calculate_w(this, _("Reset")); - add_tool(reset = new DeScratchReset(this, get_w()-w1-15, y)); + add_tool(reset = new DeScratchReset(this, get_w()-w1-xs15, y)); - y += title->get_h() + 15; + y += title->get_h() + ys15; int x1 = x, x2 = get_w()/2; add_tool(title = new BC_Title(x1=x, y, _("threshold:"))); - x1 += title->get_w()+16; - add_tool(threshold = new DeScratchISlider(this, x1, y, x2-x1-10, 0,64, &config.threshold)); + x1 += title->get_w()+xs16; + add_tool(threshold = new DeScratchISlider(this, x1, y, x2-x1-xs10, 0,64, &config.threshold)); add_tool(title = new BC_Title(x1=x2, y, _("asymmetry:"))); - x1 += title->get_w()+16; - add_tool(asymmetry = new DeScratchFSlider(this, x1, y, get_w()-x1-15, 0,100., &config.asymmetry)); - y += threshold->get_h() + 10; + x1 += title->get_w()+xs16; + add_tool(asymmetry = new DeScratchFSlider(this, x1, y, get_w()-x1-xs15, 0,100., &config.asymmetry)); + y += threshold->get_h() + ys10; add_tool(title = new BC_Title(x1=x, y, _("Mode:"))); - x1 += title->get_w()+16; + x1 += title->get_w()+xs16; add_tool(title = new BC_Title(x1, y, _("y:"))); - w1 = title->get_w()+16; + w1 = title->get_w()+xs16; add_tool(y_mode = new DeScratchMode(this, (x1+=w1), y, &config.mode_y)); - y_mode->create_objects(); x1 += y_mode->get_w()+16; + y_mode->create_objects(); x1 += y_mode->get_w()+xs16; add_tool(title = new BC_Title(x1, y, _("u:"))); add_tool(u_mode = new DeScratchMode(this, (x1+=w1), y, &config.mode_u)); - u_mode->create_objects(); x1 += u_mode->get_w()+16; + u_mode->create_objects(); x1 += u_mode->get_w()+xs16; add_tool(title = new BC_Title(x1, y, _("v:"))); add_tool(v_mode = new DeScratchMode(this, (x1+=w1), y, &config.mode_v)); v_mode->create_objects(); - y += y_mode->get_h() + 10; + y += y_mode->get_h() + ys10; add_tool(title = new BC_Title(x1=x, y, _("width:"))); - w1 = title->get_w()+16; x1 += w1; + w1 = title->get_w()+xs16; x1 += w1; add_tool(title = new BC_Title(x1, y, _("min:"))); - x1 += title->get_w()+16; - add_tool(min_width = new DeScratchISlider(this, x1, y, x2-x1-10, 1,16, &config.min_width)); + x1 += title->get_w()+xs16; + add_tool(min_width = new DeScratchISlider(this, x1, y, x2-x1-xs10, 1,16, &config.min_width)); add_tool(title = new BC_Title(x1=x2, y, _("max:"))); - x1 += title->get_w()+16; - add_tool(max_width = new DeScratchISlider(this, x1, y, get_w()-x1-15, 1,16, &config.max_width)); - y += min_width->get_h() + 10; + x1 += title->get_w()+xs16; + add_tool(max_width = new DeScratchISlider(this, x1, y, get_w()-x1-xs15, 1,16, &config.max_width)); + y += min_width->get_h() + ys10; add_tool(title = new BC_Title(x1=x, y, _("len:"))); - w1 = title->get_w()+16; x1 += w1; + w1 = title->get_w()+xs16; x1 += w1; add_tool(title = new BC_Title(x1, y, _("min:"))); - x1 += title->get_w()+16; - add_tool(min_len = new DeScratchFSlider(this, x1, y, x2-x1-10, 0.0,100.0, &config.min_len)); + x1 += title->get_w()+xs16; + add_tool(min_len = new DeScratchFSlider(this, x1, y, x2-x1-xs10, 0.0,100.0, &config.min_len)); add_tool(title = new BC_Title(x1=x2, y, _("max:"))); - x1 += title->get_w()+16; - add_tool(max_len = new DeScratchFSlider(this, x1, y, get_w()-x1-15, 0.0,100.0, &config.max_len)); - y += min_len->get_h() + 10; + x1 += title->get_w()+xs16; + add_tool(max_len = new DeScratchFSlider(this, x1, y, get_w()-x1-xs15, 0.0,100.0, &config.max_len)); + y += min_len->get_h() + ys10; add_tool(title = new BC_Title(x1=x, y, _("len:"))); - w1 = title->get_w()+16; x1 += w1; + w1 = title->get_w()+xs16; x1 += w1; add_tool(title = new BC_Title(x1, y, _("blur:"))); - x1 += title->get_w()+16; - add_tool(blur_len = new DeScratchISlider(this, x1, y, x2-x1-10, 0,8, &config.blur_len)); + x1 += title->get_w()+xs16; + add_tool(blur_len = new DeScratchISlider(this, x1, y, x2-x1-xs10, 0,8, &config.blur_len)); add_tool(title = new BC_Title(x1=x2, y, _("gap:"))); - x1 += title->get_w()+16; - add_tool(gap_len = new DeScratchFSlider(this, x1, y, get_w()-x1-15, 0.0,100.0, &config.gap_len)); - y += blur_len->get_h() + 10; + x1 += title->get_w()+xs16; + add_tool(gap_len = new DeScratchFSlider(this, x1, y, get_w()-x1-xs15, 0.0,100.0, &config.gap_len)); + y += blur_len->get_h() + ys10; add_tool(title = new BC_Title(x1=x, y, _("max angle:"))); - w1 = title->get_w()+16; x1 += w1; - add_tool(max_angle = new DeScratchFSlider(this, x1, y, x2-x1-10, 0.0,15.0, &config.max_angle)); + w1 = title->get_w()+xs16; x1 += w1; + add_tool(max_angle = new DeScratchFSlider(this, x1, y, x2-x1-xs10, 0.0,15.0, &config.max_angle)); add_tool(title = new BC_Title(x1=x2, y, _("fade:"))); - x1 += title->get_w()+16; - add_tool(ffade = new DeScratchFSlider(this, x1, y, get_w()-x1-15, 0.0,100.0, &config.ffade)); - y += max_angle->get_h() + 10; + x1 += title->get_w()+xs16; + add_tool(ffade = new DeScratchFSlider(this, x1, y, get_w()-x1-xs15, 0.0,100.0, &config.ffade)); + y += max_angle->get_h() + ys10; add_tool(title = new BC_Title(x1=x, y, _("border:"))); - x1 += title->get_w()+16; - add_tool(border = new DeScratchISlider(this, x1, y, x2-x1-10, 0,16, &config.border)); + x1 += title->get_w()+xs16; + add_tool(border = new DeScratchISlider(this, x1, y, x2-x1-xs10, 0,16, &config.border)); add_tool(mark = new DeScratchMark(this, x1=x2, y)); - x1 += mark->get_w() + 10; + x1 += mark->get_w() + xs10; add_tool(edge_only = new DeScratchEdgeOnly(this, x1, y)); show_window(); @@ -607,7 +609,7 @@ int DeScratchModeItem::handle_event() } DeScratchMode::DeScratchMode(DeScratchWindow *win, int x, int y, int *value) - : BC_PopupMenu(x, y, 100, "", 1) + : BC_PopupMenu(x, y, xS(100), "", 1) { this->win = win; this->value = value; diff --git a/cinelerra-5.1/plugins/despike/despikewindow.C b/cinelerra-5.1/plugins/despike/despikewindow.C index e5c2b0d3..437a6af9 100644 --- a/cinelerra-5.1/plugins/despike/despikewindow.C +++ b/cinelerra-5.1/plugins/despike/despikewindow.C @@ -33,10 +33,10 @@ DespikeWindow::DespikeWindow(Despike *despike) : PluginClientWindow(despike, - 230, - 110, - 230, - 110, + xS(230), + yS(110), + xS(230), + yS(110), 0) { this->despike = despike; @@ -48,13 +48,15 @@ DespikeWindow::~DespikeWindow() void DespikeWindow::create_objects() { - int x = 10, y = 10; - add_tool(new BC_Title(5, y, _("Maximum level:"))); - y += 20; + int xs5 = xS(5), xs10 = xS(10); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30); + int x = xs10, y = ys10; + add_tool(new BC_Title(xs5, y, _("Maximum level:"))); + y += ys20; add_tool(level = new DespikeLevel(despike, x, y)); - y += 30; - add_tool(new BC_Title(5, y, _("Maximum rate of change:"))); - y += 20; + y += ys30; + add_tool(new BC_Title(xs5, y, _("Maximum rate of change:"))); + y += ys20; add_tool(slope = new DespikeSlope(despike, x, y)); show_window(); flush(); @@ -68,8 +70,8 @@ DespikeLevel::DespikeLevel(Despike *despike, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), INFINITYGAIN, 0, despike->config.level) @@ -87,8 +89,8 @@ DespikeSlope::DespikeSlope(Despike *despike, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), INFINITYGAIN, 0, despike->config.slope) diff --git a/cinelerra-5.1/plugins/diffkey/diffkey.C b/cinelerra-5.1/plugins/diffkey/diffkey.C index e863f593..fb8bc99b 100644 --- a/cinelerra-5.1/plugins/diffkey/diffkey.C +++ b/cinelerra-5.1/plugins/diffkey/diffkey.C @@ -218,7 +218,7 @@ void DiffKeyConfig::interpolate(DiffKeyConfig &prev, DiffKeyThreshold::DiffKeyThreshold(DiffKey *plugin, int x, int y) - : BC_FSlider(x, y, 0, 200, 200, 0, 100, plugin->config.threshold) + : BC_FSlider(x, y, 0, xS(200), yS(200), 0, 100, plugin->config.threshold) { this->plugin = plugin; } @@ -238,7 +238,7 @@ int DiffKeyThreshold::handle_event() DiffKeySlope::DiffKeySlope(DiffKey *plugin, int x, int y) - : BC_FSlider(x, y, 0, 200, 200, 0, 100, plugin->config.slope) + : BC_FSlider(x, y, 0, xS(200), yS(200), 0, 100, plugin->config.slope) { this->plugin = plugin; } @@ -273,10 +273,10 @@ int DiffKeyDoValue::handle_event() DiffKeyGUI::DiffKeyGUI(DiffKey *plugin) : PluginClientWindow(plugin, - 320, - 100, - 320, - 100, + xS(320), + yS(100), + xS(320), + yS(100), 0) { this->plugin = plugin; @@ -289,18 +289,20 @@ DiffKeyGUI::~DiffKeyGUI() void DiffKeyGUI::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10); + int x = xs10, y = ys10; BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Threshold:"))); - x += title->get_w() + 10; + x += title->get_w() + xs10; add_subwindow(threshold = new DiffKeyThreshold(plugin, x, y)); - x = 10; - y += threshold->get_h() + 10; + x = xs10; + y += threshold->get_h() + ys10; add_subwindow(title = new BC_Title(x, y, _("Slope:"))); - x += title->get_w() + 10; + x += title->get_w() + xs10; add_subwindow(slope = new DiffKeySlope(plugin, x, y)); - x = 10; - y += slope->get_h() + 10; + x = xs10; + y += slope->get_h() + ys10; add_subwindow(do_value = new DiffKeyDoValue(plugin, x, y)); diff --git a/cinelerra-5.1/plugins/dot/dotwindow.C b/cinelerra-5.1/plugins/dot/dotwindow.C index 2373da7f..5a4b93bb 100644 --- a/cinelerra-5.1/plugins/dot/dotwindow.C +++ b/cinelerra-5.1/plugins/dot/dotwindow.C @@ -30,10 +30,10 @@ DotWindow::DotWindow(DotMain *client) : PluginClientWindow(client, - 300, - 170, - 300, - 170, + xS(300), + yS(170), + xS(300), + yS(170), 0) { this->client = client; @@ -45,7 +45,7 @@ DotWindow::~DotWindow() void DotWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(new BC_Title(x, y, _("DotTV from EffectTV\n" "Copyright (C) 2001 FUKUCHI Kentarou") diff --git a/cinelerra-5.1/plugins/downsample/downsample.C b/cinelerra-5.1/plugins/downsample/downsample.C index 4ce97317..a31f8585 100644 --- a/cinelerra-5.1/plugins/downsample/downsample.C +++ b/cinelerra-5.1/plugins/downsample/downsample.C @@ -216,10 +216,10 @@ void DownSampleConfig::interpolate(DownSampleConfig &prev, DownSampleWindow::DownSampleWindow(DownSampleMain *plugin) : PluginClientWindow(plugin, - 230, - 380, - 230, - 380, + xS(230), + yS(380), + xS(230), + yS(380), 0) { this->plugin = plugin; @@ -231,68 +231,70 @@ DownSampleWindow::~DownSampleWindow() void DownSampleWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; add_subwindow(new BC_Title(x, y, _("Horizontal"))); - y += 30; + y += ys30; add_subwindow(h = new DownSampleSize(plugin, x, y, &plugin->config.horizontal, 1, 100)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Horizontal offset"))); - y += 30; + y += ys30; add_subwindow(h_x = new DownSampleSize(plugin, x, y, &plugin->config.horizontal_x, 0, 100)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Vertical"))); - y += 30; + y += ys30; add_subwindow(v = new DownSampleSize(plugin, x, y, &plugin->config.vertical, 1, 100)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Vertical offset"))); - y += 30; + y += ys30; add_subwindow(v_y = new DownSampleSize(plugin, x, y, &plugin->config.vertical_y, 0, 100)); - y += 30; + y += ys30; add_subwindow(r = new DownSampleToggle(plugin, x, y, &plugin->config.r, _("Red"))); - y += 30; + y += ys30; add_subwindow(g = new DownSampleToggle(plugin, x, y, &plugin->config.g, _("Green"))); - y += 30; + y += ys30; add_subwindow(b = new DownSampleToggle(plugin, x, y, &plugin->config.b, _("Blue"))); - y += 30; + y += ys30; add_subwindow(a = new DownSampleToggle(plugin, x, y, &plugin->config.a, _("Alpha"))); - y += 30; + y += ys30; show_window(); flush(); @@ -338,7 +340,7 @@ DownSampleSize::DownSampleSize(DownSampleMain *plugin, int *output, int min, int max) - : BC_ISlider(x, y, 0, 200, 200, min, max, *output) + : BC_ISlider(x, y, 0, xS(200), yS(200), min, max, *output) { this->plugin = plugin; this->output = output; diff --git a/cinelerra-5.1/plugins/echo/echo.C b/cinelerra-5.1/plugins/echo/echo.C index ca23bbcf..672272c2 100644 --- a/cinelerra-5.1/plugins/echo/echo.C +++ b/cinelerra-5.1/plugins/echo/echo.C @@ -76,7 +76,7 @@ void EchoConfig::interpolate(EchoConfig &prev, EchoConfig &next, EchoWindow::EchoWindow(Echo *plugin) - : PluginClientWindow(plugin, 250, 100, 250, 100, 0) + : PluginClientWindow(plugin, xS(250), yS(100), xS(250), yS(100), 0) { this->plugin = plugin; } @@ -141,16 +141,18 @@ int EchoOffset::handle_event() void EchoWindow::create_objects() { - int x = 170, y = 10; - add_subwindow(level_title=new EchoTitle(5, y + 10, _("Level: "), + int xs5 = xS(5), xs35 = xS(35); + int ys10 = yS(10), ys25 = yS(25); + int x = xS(170), y = yS(10); + add_subwindow(level_title=new EchoTitle(xs5, y + ys10, _("Level: "), plugin->db.fromdb(plugin->config.level))); - add_subwindow(level = new EchoLevel(this, x, y)); y += 25; - add_subwindow(atten_title=new EchoTitle(5, y + 10, _("Atten: "), + add_subwindow(level = new EchoLevel(this, x, y)); y += ys25; + add_subwindow(atten_title=new EchoTitle(xs5, y + ys10, _("Atten: "), plugin->db.fromdb(plugin->config.atten))); - add_subwindow(atten = new EchoAtten(this, x + 35, y)); y += 25; - add_subwindow(offset_title=new EchoTitle(5, y + 10, _("Offset: "), + add_subwindow(atten = new EchoAtten(this, x + xs35, y)); y += ys25; + add_subwindow(offset_title=new EchoTitle(xs5, y + ys10, _("Offset: "), (int)plugin->config.offset)); - add_subwindow(offset = new EchoOffset(this, x, y)); y += 25; + add_subwindow(offset = new EchoOffset(this, x, y)); y += ys25; show_window(); } diff --git a/cinelerra-5.1/plugins/echocancel/echocancel.C b/cinelerra-5.1/plugins/echocancel/echocancel.C index 379fbe4b..b1c4dcb8 100644 --- a/cinelerra-5.1/plugins/echocancel/echocancel.C +++ b/cinelerra-5.1/plugins/echocancel/echocancel.C @@ -133,7 +133,7 @@ int EchoCancelLevel::handle_event() EchoCancelMode::EchoCancelMode(EchoCancel *plugin, int x, int y) - : BC_PopupMenu(x, y, 120, to_text(plugin->config.mode)) + : BC_PopupMenu(x, y, xS(120), to_text(plugin->config.mode)) { this->plugin = plugin; } @@ -195,7 +195,7 @@ int EchoCancelHistory::handle_event() EchoCancelWindowSize::EchoCancelWindowSize(EchoCancel *plugin, int x, int y, const char *text) - : BC_PopupMenu(x, y, 80, text) + : BC_PopupMenu(x, y, xS(120), text) { this->plugin = plugin; } @@ -410,7 +410,7 @@ void EchoCancelCanvas::draw_overlay() EchoCancelWindow::EchoCancelWindow(EchoCancel *plugin) - : PluginClientWindow(plugin, plugin->w, plugin->h, 320, 320, 1) + : PluginClientWindow(plugin, plugin->w, plugin->h, xS(680), yS(480), 1) { this->plugin = plugin; probe_x = probe_y = -1; @@ -626,8 +626,8 @@ EchoCancel::EchoCancel(PluginServer *server) { reset(); timer = new Timer; - w = 640; - h = 480; + w = xS(640); + h = yS(480); } EchoCancel::~EchoCancel() diff --git a/cinelerra-5.1/plugins/edge/edgewindow.C b/cinelerra-5.1/plugins/edge/edgewindow.C index 926ec53c..0a143a3a 100644 --- a/cinelerra-5.1/plugins/edge/edgewindow.C +++ b/cinelerra-5.1/plugins/edge/edgewindow.C @@ -27,10 +27,10 @@ EdgeWindow::EdgeWindow(Edge *plugin) : PluginClientWindow(plugin, - 320, - 120, - 320, - 120, + xS(320), + yS(120), + xS(320), + yS(120), 0) { this->plugin = plugin; @@ -42,7 +42,7 @@ EdgeWindow::~EdgeWindow() void EdgeWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); int margin = plugin->get_theme()->widget_border; BC_Title *title; diff --git a/cinelerra-5.1/plugins/fieldframe/fieldframe.C b/cinelerra-5.1/plugins/fieldframe/fieldframe.C index 9d0dbb27..58449ff5 100644 --- a/cinelerra-5.1/plugins/fieldframe/fieldframe.C +++ b/cinelerra-5.1/plugins/fieldframe/fieldframe.C @@ -165,10 +165,10 @@ int FieldFrameConfig::equivalent(FieldFrameConfig &src) FieldFrameWindow::FieldFrameWindow(FieldFrame *plugin) : PluginClientWindow(plugin, - 230, - 100, - 230, - 100, + xS(230), + yS(100), + xS(230), + yS(100), 0) { this->plugin = plugin; @@ -176,13 +176,15 @@ FieldFrameWindow::FieldFrameWindow(FieldFrame *plugin) void FieldFrameWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; add_subwindow(top = new FieldFrameTop(plugin, this, x, y)); - y += 30; + y += ys30; add_subwindow(bottom = new FieldFrameBottom(plugin, this, x, y)); -// y += 30; +// y += ys30; // add_subwindow(first = new FieldFrameFirst(plugin, this, x, y)); -// y += 30; +// y += ys30; // add_subwindow(second = new FieldFrameSecond(plugin, this, x, y)); show_window(); diff --git a/cinelerra-5.1/plugins/findobj/findobjwindow.C b/cinelerra-5.1/plugins/findobj/findobjwindow.C index e1ed25c5..f9302a7c 100644 --- a/cinelerra-5.1/plugins/findobj/findobjwindow.C +++ b/cinelerra-5.1/plugins/findobj/findobjwindow.C @@ -34,7 +34,7 @@ FindObjWindow::FindObjWindow(FindObjMain *plugin) - : PluginClientWindow(plugin, 500, 700, 500, 700, 0) + : PluginClientWindow(plugin, xS(500), yS(700), xS(500), yS(700), 0) { this->plugin = plugin; } @@ -45,39 +45,41 @@ FindObjWindow::~FindObjWindow() void FindObjWindow::create_objects() { - int x = 10, y = 10, x1 = x, x2 = get_w()*1/3, x3 = get_w()*2/3; + int xs10 = xS(10), xs15 = xS(15), xs100 = xS(100), xs200 = xS(200); + int ys5 = yS(5), ys10 = yS(10), ys15 = yS(15), ys40 = yS(40); + int x = xs10, y = ys10, x1 = x, x2 = get_w()*1/3, x3 = get_w()*2/3; plugin->load_configuration(); BC_Title *title; add_subwindow(title = new BC_Title(x1, y, _("Mode:"))); add_subwindow(mode = new FindObjMode(plugin, this, - x1 + 100, y)); - add_subwindow(reset = new FindObjReset(plugin, this, get_w()-15, y)); + x1 + xs100, y)); + add_subwindow(reset = new FindObjReset(plugin, this, get_w()-xs15, y)); mode->create_objects(); - y += mode->get_h() + 10; + y += mode->get_h() + ys10; int y0 = y; add_subwindow(title = new BC_Title(x1, y, _("Algorithm:"))); add_subwindow(algorithm = new FindObjAlgorithm(plugin, this, - x1 + 100, y)); + x1 + xs100, y)); algorithm->create_objects(); y += algorithm->get_h() + plugin->get_theme()->widget_border; add_subwindow(use_flann = new FindObjUseFlann(plugin, this, x, y)); - y += use_flann->get_h() + 10; + y += use_flann->get_h() + ys10; int y1 = y; y = y0; add_subwindow(replace_object = new FindObjReplace(plugin, this,x3, y)); - y += replace_object->get_h() + 10; + y += replace_object->get_h() + ys10; add_subwindow(draw_match = new FindObjDrawMatch(plugin, this, x3, y)); - y += draw_match->get_h() + 10; + y += draw_match->get_h() + ys10; add_subwindow(aspect = new FindObjAspect(plugin, this, x3, y)); - y += aspect->get_h() + 10; + y += aspect->get_h() + ys10; add_subwindow(scale = new FindObjScale(plugin, this, x3, y)); - y += scale->get_h() + 10; + y += scale->get_h() + ys10; add_subwindow(rotate = new FindObjRotate(plugin, this, x3, y)); - y += rotate->get_h() + 10; + y += rotate->get_h() + ys10; add_subwindow(translate = new FindObjTranslate(plugin, this, x3, y)); - int x0 = x + 200; y = y1 + 10; + int x0 = x + xs200; y = y1 + ys10; add_subwindow(title = new BC_Title(x, y, _("Output/scene layer:"))); scene_layer = new FindObjLayer(plugin, this, x0, y, &plugin->config.scene_layer); @@ -94,14 +96,14 @@ void FindObjWindow::create_objects() replace_layer = new FindObjLayer(plugin, this, x0, y, &plugin->config.replace_layer); replace_layer->create_objects(); - y += replace_layer->get_h() + plugin->get_theme()->widget_border + 10; + y += replace_layer->get_h() + plugin->get_theme()->widget_border + ys10; - y += 10; - add_subwindow(title = new BC_Title(x+15, y, _("Units: 0 to 100 percent"))); + y += ys10; + add_subwindow(title = new BC_Title(x+xs15, y, _("Units: 0 to 100 percent"))); y += title->get_h(); y1 = y; - add_subwindow(title = new BC_Title(x1, y + 10, _("Scene X:"))); + add_subwindow(title = new BC_Title(x1, y + ys10, _("Scene X:"))); Track *track = plugin->server->plugin->track; int trk_w = track->track_w, trk_h = track->track_h; float drag_w = trk_w * plugin->config.scene_w / 100.; @@ -109,173 +111,173 @@ void FindObjWindow::create_objects() float ctr_x = trk_w * plugin->config.scene_x / 100.; float ctr_y = trk_h * plugin->config.scene_y / 100.; float drag_x = ctr_x - drag_w/2, drag_y = ctr_y - drag_h/2; - drag_scene = new FindObjDragScene(plugin, this, x1+title->get_w()+10, y+5, + drag_scene = new FindObjDragScene(plugin, this, x1+title->get_w()+xs10, y+ys5, drag_x, drag_y, drag_w, drag_h); add_subwindow(drag_scene); drag_scene->create_objects(); - y += title->get_h() + 15; + y += title->get_h() + ys15; add_subwindow(scene_x = new FindObjScanFloat(plugin, this, x1, y, &plugin->config.scene_x)); add_subwindow(scene_x_text = new FindObjScanFloatText(plugin, this, - x1 + scene_x->get_w() + 10, y + 10, &plugin->config.scene_x)); + x1 + scene_x->get_w() + xs10, y + ys10, &plugin->config.scene_x)); scene_x->center_text = scene_x_text; scene_x_text->center = scene_x; - y += 40; - add_subwindow(title = new BC_Title(x1, y + 10, _("Scene Y:"))); - y += title->get_h() + 15; + y += ys40; + add_subwindow(title = new BC_Title(x1, y + ys10, _("Scene Y:"))); + y += title->get_h() + ys15; add_subwindow(scene_y = new FindObjScanFloat(plugin, this, x1, y, &plugin->config.scene_y)); add_subwindow(scene_y_text = new FindObjScanFloatText(plugin, this, - x1 + scene_y->get_w() + 10, y + 10, &plugin->config.scene_y)); + x1 + scene_y->get_w() + xs10, y + ys10, &plugin->config.scene_y)); scene_y->center_text = scene_y_text; scene_y_text->center = scene_y; - y += 40; - add_subwindow(new BC_Title(x1, y + 10, _("Scene W:"))); - y += title->get_h() + 15; + y += ys40; + add_subwindow(new BC_Title(x1, y + ys10, _("Scene W:"))); + y += title->get_h() + ys15; add_subwindow(scene_w = new FindObjScanFloat(plugin, this, x1, y, &plugin->config.scene_w)); add_subwindow(scene_w_text = new FindObjScanFloatText(plugin, this, - x1 + scene_w->get_w() + 10, y + 10, &plugin->config.scene_w)); + x1 + scene_w->get_w() + xs10, y + ys10, &plugin->config.scene_w)); scene_w->center_text = scene_w_text; scene_w_text->center = scene_w; - y += 40; - add_subwindow(title = new BC_Title(x1, y + 10, _("Scene H:"))); - y += title->get_h() + 15; + y += ys40; + add_subwindow(title = new BC_Title(x1, y + ys10, _("Scene H:"))); + y += title->get_h() + ys15; add_subwindow(scene_h = new FindObjScanFloat(plugin, this, x1, y, &plugin->config.scene_h)); add_subwindow(scene_h_text = new FindObjScanFloatText(plugin, this, - x1 + scene_h->get_w() + 10, y + 10, + x1 + scene_h->get_w() + xs10, y + ys10, &plugin->config.scene_h)); scene_h->center_text = scene_h_text; scene_h_text->center = scene_h; y = y1; - add_subwindow(title = new BC_Title(x2, y + 10, _("Object X:"))); + add_subwindow(title = new BC_Title(x2, y + ys10, _("Object X:"))); drag_w = trk_w * plugin->config.object_w / 100.; drag_h = trk_h * plugin->config.object_h / 100.; ctr_x = trk_w * plugin->config.object_x / 100., ctr_y = trk_h * plugin->config.object_y / 100.; drag_x = ctr_x - drag_w/2; drag_y = ctr_y - drag_h/2; - drag_object = new FindObjDragObject(plugin, this, x2+title->get_w()+10, y+5, + drag_object = new FindObjDragObject(plugin, this, x2+title->get_w()+xs10, y+ys5, drag_x, drag_y, drag_w, drag_h); add_subwindow(drag_object); drag_object->create_objects(); - y += title->get_h() + 15; + y += title->get_h() + ys15; add_subwindow(object_x = new FindObjScanFloat(plugin, this, x2, y, &plugin->config.object_x)); add_subwindow(object_x_text = new FindObjScanFloatText(plugin, this, - x2 + object_x->get_w() + 10, y + 10, &plugin->config.object_x)); + x2 + object_x->get_w() + xs10, y + ys10, &plugin->config.object_x)); object_x->center_text = object_x_text; object_x_text->center = object_x; - y += 40; - add_subwindow(title = new BC_Title(x2, y + 10, _("Object Y:"))); - y += title->get_h() + 15; + y += ys40; + add_subwindow(title = new BC_Title(x2, y + ys10, _("Object Y:"))); + y += title->get_h() + ys15; add_subwindow(object_y = new FindObjScanFloat(plugin, this, x2, y, &plugin->config.object_y)); add_subwindow(object_y_text = new FindObjScanFloatText(plugin, this, - x2 + object_y->get_w() + 10, y + 10, &plugin->config.object_y)); + x2 + object_y->get_w() + xs10, y + ys10, &plugin->config.object_y)); object_y->center_text = object_y_text; object_y_text->center = object_y; - y += 40; - add_subwindow(new BC_Title(x2, y + 10, _("Object W:"))); - y += title->get_h() + 15; + y += ys40; + add_subwindow(new BC_Title(x2, y + ys10, _("Object W:"))); + y += title->get_h() + ys15; add_subwindow(object_w = new FindObjScanFloat(plugin, this, x2, y, &plugin->config.object_w)); add_subwindow(object_w_text = new FindObjScanFloatText(plugin, this, - x2 + object_w->get_w() + 10, y + 10, &plugin->config.object_w)); + x2 + object_w->get_w() + xs10, y + ys10, &plugin->config.object_w)); object_w->center_text = object_w_text; object_w_text->center = object_w; - y += 40; - add_subwindow(title = new BC_Title(x2, y + 10, _("Object H:"))); - y += title->get_h() + 15; + y += ys40; + add_subwindow(title = new BC_Title(x2, y + ys10, _("Object H:"))); + y += title->get_h() + ys15; add_subwindow(object_h = new FindObjScanFloat(plugin, this, x2, y, &plugin->config.object_h)); add_subwindow(object_h_text = new FindObjScanFloatText(plugin, this, - x2 + object_h->get_w() + 10, y + 10, + x2 + object_h->get_w() + xs10, y + ys10, &plugin->config.object_h)); object_h->center_text = object_h_text; object_h_text->center = object_h; y = y1; - add_subwindow(title = new BC_Title(x3, y + 10, _("Replace X:"))); + add_subwindow(title = new BC_Title(x3, y + ys10, _("Replace X:"))); drag_w = trk_w * plugin->config.replace_w / 100.; drag_h = trk_h * plugin->config.replace_h / 100.; ctr_x = trk_w * plugin->config.replace_x / 100., ctr_y = trk_h * plugin->config.replace_y / 100.; drag_x = ctr_x - drag_w/2; drag_y = ctr_y - drag_h/2; - drag_replace = new FindObjDragReplace(plugin, this, x3+title->get_w()+10, y+5, + drag_replace = new FindObjDragReplace(plugin, this, x3+title->get_w()+xs10, y+ys5, drag_x, drag_y, drag_w, drag_h); add_subwindow(drag_replace); drag_replace->create_objects(); - y += title->get_h() + 15; + y += title->get_h() + ys15; add_subwindow(replace_x = new FindObjScanFloat(plugin, this, x3, y, &plugin->config.replace_x)); add_subwindow(replace_x_text = new FindObjScanFloatText(plugin, this, - x3 + replace_x->get_w() + 10, y + 10, &plugin->config.replace_x)); + x3 + replace_x->get_w() + xs10, y + ys10, &plugin->config.replace_x)); replace_x->center_text = replace_x_text; replace_x_text->center = replace_x; - y += 40; - add_subwindow(title = new BC_Title(x3, y + 10, _("Replace Y:"))); - y += title->get_h() + 15; + y += ys40; + add_subwindow(title = new BC_Title(x3, y + ys10, _("Replace Y:"))); + y += title->get_h() + ys15; add_subwindow(replace_y = new FindObjScanFloat(plugin, this, x3, y, &plugin->config.replace_y)); add_subwindow(replace_y_text = new FindObjScanFloatText(plugin, this, - x3 + replace_y->get_w() + 10, y + 10, &plugin->config.replace_y)); + x3 + replace_y->get_w() + xs10, y + ys10, &plugin->config.replace_y)); replace_y->center_text = replace_y_text; replace_y_text->center = replace_y; - y += 40; - add_subwindow(new BC_Title(x3, y + 10, _("Replace W:"))); - y += title->get_h() + 15; + y += ys40; + add_subwindow(new BC_Title(x3, y + ys10, _("Replace W:"))); + y += title->get_h() + ys15; add_subwindow(replace_w = new FindObjScanFloat(plugin, this, x3, y, &plugin->config.replace_w)); add_subwindow(replace_w_text = new FindObjScanFloatText(plugin, this, - x3 + replace_w->get_w() + 10, y + 10, &plugin->config.replace_w)); + x3 + replace_w->get_w() + xs10, y + ys10, &plugin->config.replace_w)); replace_w->center_text = replace_w_text; replace_w_text->center = replace_w; - y += 40; - add_subwindow(title = new BC_Title(x3, y + 10, _("Replace H:"))); - y += title->get_h() + 15; + y += ys40; + add_subwindow(title = new BC_Title(x3, y + ys10, _("Replace H:"))); + y += title->get_h() + ys15; add_subwindow(replace_h = new FindObjScanFloat(plugin, this, x3, y, &plugin->config.replace_h)); add_subwindow(replace_h_text = new FindObjScanFloatText(plugin, this, - x3 + replace_h->get_w() + 10, y + 10, + x3 + replace_h->get_w() + xs10, y + ys10, &plugin->config.replace_h)); replace_h->center_text = replace_h_text; replace_h_text->center = replace_h; - y += 40; int y2 = y; - add_subwindow(title = new BC_Title(x3, y + 10, _("Replace DX:"))); - y += title->get_h() + 15; + y += ys40; int y2 = y; + add_subwindow(title = new BC_Title(x3, y + ys10, _("Replace DX:"))); + y += title->get_h() + ys15; add_subwindow(replace_dx = new FindObjScanFloat(plugin, this, x3, y, &plugin->config.replace_dx, -100.f, 100.f)); add_subwindow(replace_dx_text = new FindObjScanFloatText(plugin, this, - x3 + replace_dx->get_w() + 10, y + 10, &plugin->config.replace_dx)); + x3 + replace_dx->get_w() + xs10, y + ys10, &plugin->config.replace_dx)); replace_dx->center_text = replace_dx_text; replace_dx_text->center = replace_dx; - y += 40; - add_subwindow(title = new BC_Title(x3, y + 10, _("Replace DY:"))); - y += title->get_h() + 15; + y += ys40; + add_subwindow(title = new BC_Title(x3, y + ys10, _("Replace DY:"))); + y += title->get_h() + ys15; add_subwindow(replace_dy = new FindObjScanFloat(plugin, this, x3, y, &plugin->config.replace_dy, -100.f, 100.f)); add_subwindow(replace_dy_text = new FindObjScanFloatText(plugin, this, - x3 + replace_dy->get_w() + 10, y + 10, &plugin->config.replace_dy)); + x3 + replace_dy->get_w() + xs10, y + ys10, &plugin->config.replace_dy)); replace_dy->center_text = replace_dy_text; replace_dy_text->center = replace_dy; - y = y2 + 15; + y = y2 + ys15; add_subwindow(draw_keypoints = new FindObjDrawKeypoints(plugin, this, x, y)); y += draw_keypoints->get_h() + plugin->get_theme()->widget_border; add_subwindow(draw_scene_border = new FindObjDrawSceneBorder(plugin, this, x, y)); @@ -285,7 +287,7 @@ void FindObjWindow::create_objects() add_subwindow(draw_replace_border = new FindObjDrawReplaceBorder(plugin, this, x, y)); y += draw_object_border->get_h() + plugin->get_theme()->widget_border; - add_subwindow(title = new BC_Title(x, y + 10, _("Object blend amount:"))); + add_subwindow(title = new BC_Title(x, y + xs10, _("Object blend amount:"))); add_subwindow(blend = new FindObjBlend(plugin, x + title->get_w() + plugin->get_theme()->widget_border, y, &plugin->config.blend)); @@ -417,7 +419,7 @@ void FindObjScanFloat::update(float v) FindObjScanFloatText::FindObjScanFloatText(FindObjMain *plugin, FindObjWindow *gui, int x, int y, float *value) - : BC_TextBox(x, y, 75, 1, *value) + : BC_TextBox(x, y, xS(75), 1, *value) { this->plugin = plugin; this->gui = gui; @@ -742,7 +744,7 @@ int FindObjAlgorithm::calculate_w(FindObjWindow *gui) #ifdef _BRISK result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(ALGORITHM_BRISK))); #endif - return result + 50; + return result + xS(50); } @@ -890,7 +892,7 @@ int FindObjMode::calculate_w(FindObjWindow *gui) int result = 0; for( int mode=MODE_NONE; modeget_text_width(MEDIUMFONT, to_text(mode))); - return result + 50; + return result + xS(50); } @@ -914,7 +916,7 @@ int FindObjLayer::calculate_w(FindObjWindow *gui) { int result = 0; result = gui->get_text_width(MEDIUMFONT, "000"); - return result + 50; + return result + xS(50); } diff --git a/cinelerra-5.1/plugins/flip/flipwindow.C b/cinelerra-5.1/plugins/flip/flipwindow.C index 2103ef60..f22ff418 100644 --- a/cinelerra-5.1/plugins/flip/flipwindow.C +++ b/cinelerra-5.1/plugins/flip/flipwindow.C @@ -30,7 +30,7 @@ FlipWindow::FlipWindow(FlipMain *client) - : PluginClientWindow(client, 250, 100, 250, 100, 0) + : PluginClientWindow(client, xS(250), yS(100), xS(250), yS(100), 0) { this->client = client; } @@ -41,13 +41,13 @@ FlipWindow::~FlipWindow() void FlipWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_tool(flip_vertical = new FlipToggle(client, &(client->config.flip_vertical), _("Vertical"), x, y)); - y += 30; + y += yS(30); add_tool(flip_horizontal = new FlipToggle(client, &(client->config.flip_horizontal), _("Horizontal"), diff --git a/cinelerra-5.1/plugins/flowobj/flowobjwindow.C b/cinelerra-5.1/plugins/flowobj/flowobjwindow.C index eec0ab52..851f06de 100644 --- a/cinelerra-5.1/plugins/flowobj/flowobjwindow.C +++ b/cinelerra-5.1/plugins/flowobj/flowobjwindow.C @@ -26,7 +26,7 @@ #include "theme.h" FlowObjWindow::FlowObjWindow(FlowObj *plugin) - : PluginClientWindow(plugin, 320, 240, 320, 240, 0) + : PluginClientWindow(plugin, xS(320), yS(240), xS(320), yS(240), 0) { this->plugin = plugin; } @@ -37,7 +37,7 @@ FlowObjWindow::~FlowObjWindow() void FlowObjWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); int margin = plugin->get_theme()->widget_border; BC_Title *title; diff --git a/cinelerra-5.1/plugins/framefield/framefield.C b/cinelerra-5.1/plugins/framefield/framefield.C index 314ab2b2..da36db3f 100644 --- a/cinelerra-5.1/plugins/framefield/framefield.C +++ b/cinelerra-5.1/plugins/framefield/framefield.C @@ -187,10 +187,10 @@ int FrameFieldConfig::equivalent(FrameFieldConfig &src) FrameFieldWindow::FrameFieldWindow(FrameField *plugin) : PluginClientWindow(plugin, - 210, - 160, - 200, - 160, + xS(210), + yS(160), + xS(200), + yS(160), 0) { this->plugin = plugin; @@ -198,11 +198,13 @@ FrameFieldWindow::FrameFieldWindow(FrameField *plugin) void FrameFieldWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10); + int x = xs10, y = ys10; add_subwindow(top = new FrameFieldTop(plugin, this, x, y)); - y += top->get_h() + 5; + y += top->get_h() + ys5; add_subwindow(bottom = new FrameFieldBottom(plugin, this, x, y)); - y += bottom->get_h() + 5; + y += bottom->get_h() + ys5; show_window(); flush(); } diff --git a/cinelerra-5.1/plugins/freeverb/freeverb.C b/cinelerra-5.1/plugins/freeverb/freeverb.C index 7527f487..ea365f20 100644 --- a/cinelerra-5.1/plugins/freeverb/freeverb.C +++ b/cinelerra-5.1/plugins/freeverb/freeverb.C @@ -294,10 +294,10 @@ int FreeverbMode::handle_event() FreeverbWindow::FreeverbWindow(FreeverbEffect *plugin) : PluginClientWindow(plugin, - 180, - 250, - 180, - 250, + xS(180), + yS(250), + xS(180), + yS(250), 0) { this->plugin = plugin; @@ -305,7 +305,9 @@ FreeverbWindow::FreeverbWindow(FreeverbEffect *plugin) void FreeverbWindow::create_objects() { - int x1 = 10, x2 = 100, x3 = 135, y1 = 10, y2 = 20, margin = 30; + int xs10 = xS(10), xs100 = xS(100), xs135 = xS(135); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30); + int x1 = xs10, x2 = xs100, x3 = xs135, y1 = ys10, y2 = ys20, margin = ys30; add_subwindow(new BC_Title(x1, y2, _("Gain:"))); add_subwindow(gain = new FreeverbGain(plugin, x3, y1)); diff --git a/cinelerra-5.1/plugins/freezeframe/freezeframe.C b/cinelerra-5.1/plugins/freezeframe/freezeframe.C index 56f46d1f..4a364306 100644 --- a/cinelerra-5.1/plugins/freezeframe/freezeframe.C +++ b/cinelerra-5.1/plugins/freezeframe/freezeframe.C @@ -75,7 +75,7 @@ void FreezeFrameConfig::interpolate(FreezeFrameConfig &prev, FreezeFrameWindow::FreezeFrameWindow(FreezeFrameMain *client) - : PluginClientWindow(client, 260, 100, 260, 100, 0) + : PluginClientWindow(client, xS(260), yS(100), xS(260), yS(100), 0) { this->client = client; } @@ -86,7 +86,7 @@ FreezeFrameWindow::~FreezeFrameWindow() void FreezeFrameWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_tool(enabled = new FreezeFrameToggle(client, &client->config.enabled, x, @@ -94,7 +94,7 @@ void FreezeFrameWindow::create_objects() _("Enabled"))); // Try using extra effect for the line double since it doesn't // change the overhead. -// y += 30; +// y += yS(30); // add_tool(line_double = new FreezeFrameToggle(client, // &client->config.line_double, // x, diff --git a/cinelerra-5.1/plugins/gaborobj/gaborobjwindow.C b/cinelerra-5.1/plugins/gaborobj/gaborobjwindow.C index 4f8ef76e..ea8b2cef 100644 --- a/cinelerra-5.1/plugins/gaborobj/gaborobjwindow.C +++ b/cinelerra-5.1/plugins/gaborobj/gaborobjwindow.C @@ -26,7 +26,7 @@ #include "theme.h" GaborObjWindow::GaborObjWindow(GaborObj *plugin) - : PluginClientWindow(plugin, 320, 240, 320, 240, 0) + : PluginClientWindow(plugin, xS(320), yS(240), xS(320), yS(240), 0) { this->plugin = plugin; } @@ -37,7 +37,7 @@ GaborObjWindow::~GaborObjWindow() void GaborObjWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); BC_Title *title = new BC_Title(x, y, _("GaborObj")); add_subwindow(title); show_window(1); diff --git a/cinelerra-5.1/plugins/gain/gainwindow.C b/cinelerra-5.1/plugins/gain/gainwindow.C index 0010c64e..c61f985a 100644 --- a/cinelerra-5.1/plugins/gain/gainwindow.C +++ b/cinelerra-5.1/plugins/gain/gainwindow.C @@ -35,10 +35,10 @@ GainWindow::GainWindow(Gain *gain) : PluginClientWindow(gain, - 230, - 60, - 230, - 60, + xS(230), + yS(60), + xS(230), + yS(60), 0) { this->gain = gain; @@ -50,9 +50,11 @@ GainWindow::~GainWindow() void GainWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys20 = yS(20); + int x = xs10, y = ys10; add_tool(new BC_Title(5, y, _("Level:"))); - y += 20; + y += ys20; add_tool(level = new GainLevel(gain, x, y)); show_window(); flush(); @@ -69,8 +71,8 @@ GainLevel::GainLevel(Gain *gain, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), INFINITYGAIN, 40, gain->config.level) diff --git a/cinelerra-5.1/plugins/gamma/gammawindow.C b/cinelerra-5.1/plugins/gamma/gammawindow.C index b00d3245..7e7322a6 100644 --- a/cinelerra-5.1/plugins/gamma/gammawindow.C +++ b/cinelerra-5.1/plugins/gamma/gammawindow.C @@ -27,10 +27,10 @@ GammaWindow::GammaWindow(GammaMain *client) : PluginClientWindow(client, - 400, - 380, - 400, - 380, + xS(400), + yS(380), + xS(400), + yS(380), 0) { this->client = client; @@ -38,56 +38,58 @@ GammaWindow::GammaWindow(GammaMain *client) void GammaWindow::create_objects() { - int x = 10, y = 10, x1 = x; + int xs10 = xS(10), xs100 = xS(100), xs110 = xS(110), xs190 = xS(190); + int ys10 = yS(10), ys180 = yS(180); + int x = xs10, y = ys10, x1 = x; add_subwindow(histogram = new BC_SubWindow(x, y, get_w() - x * 2, - get_h() - 180, + get_h() - ys180, WHITE)); - y += histogram->get_h() + 10; + y += histogram->get_h() + ys10; BC_Title *title; add_tool(title = new BC_Title(x, y, _("Maximum:"))); - x += title->get_w() + 10; + x += title->get_w() + xs10; x1 = x; // save x to align the two sliders add_tool(max_slider = new MaxSlider(client, this, x, y, - 190)); - x += max_slider->get_w() + 10; + xs190)); + x += max_slider->get_w() + xs10; add_tool(max_text = new MaxText(client, this, x, y, - 100)); - y += max_text->get_h() + 10; - x = 10; + xs100)); + y += max_text->get_h() + ys10; + x = xs10; add_tool(automatic = new GammaAuto(client, x, y)); - y += automatic->get_h() + 10; + y += automatic->get_h() + ys10; add_tool(title = new BC_Title(x, y, _("Gamma:"))); - x += title->get_w() + 10; + x += title->get_w() + xs10; x = x1; // recover x of the "MaxSlider" to align the "GammaSlider" add_tool(gamma_slider = new GammaSlider(client, this, x, y, - 190)); - x += gamma_slider->get_w() + 10; + xs190)); + x += gamma_slider->get_w() + xs10; add_tool(gamma_text = new GammaText(client, this, x, y, - 100)); - y += gamma_text->get_h() + 10; - x = 10; + xs100)); + y += gamma_text->get_h() + ys10; + x = xs10; add_tool(plot = new GammaPlot(client, x, y)); - y += plot->get_h() + 10; + y += plot->get_h() + ys10; add_tool(new GammaColorPicker(client, this, x, y)); - add_tool(reset = new GammaReset(client, this, get_w()-110, y)); + add_tool(reset = new GammaReset(client, this, get_w()-xs110, y)); show_window(); flush(); diff --git a/cinelerra-5.1/plugins/gradient/gradient.C b/cinelerra-5.1/plugins/gradient/gradient.C index 6ceb8b1b..24bbdf72 100644 --- a/cinelerra-5.1/plugins/gradient/gradient.C +++ b/cinelerra-5.1/plugins/gradient/gradient.C @@ -128,11 +128,11 @@ int GradientConfig::get_out_color() return result; } -#define COLOR_W 100 -#define COLOR_H 30 +#define COLOR_W xS(100) +#define COLOR_H yS(30) GradientWindow::GradientWindow(GradientMain *plugin) - : PluginClientWindow(plugin, 350, 290, 350, 290, 0) + : PluginClientWindow(plugin, xS(350), yS(290), xS(350), yS(290), 0) { this->plugin = plugin; angle = 0; @@ -149,8 +149,10 @@ GradientWindow::~GradientWindow() void GradientWindow::create_objects() { + int xs10 = xS(10); + int ys10 = yS(10); int margin = plugin->get_theme()->widget_border; - int x = 10, y = 10; + int x = xs10, y = ys10; BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Shape:"))); @@ -216,7 +218,7 @@ void GradientWindow::update_shape() delete center_y; center_y = 0; if( !angle ) { add_subwindow(angle_title = new BC_Title(x, y, _("Angle:"))); - add_subwindow(angle = new GradientAngle(plugin, x + angle_title->get_w() + 10, y)); + add_subwindow(angle = new GradientAngle(plugin, x + angle_title->get_w() + xS(10), y)); } } else { @@ -225,11 +227,11 @@ void GradientWindow::update_shape() if( !center_x ) { add_subwindow(center_x_title = new BC_Title(x, y, _("Center X:"))); add_subwindow(center_x = new GradientCenterX(plugin, - x + center_x_title->get_w() + 10, y)); - x += center_x_title->get_w() + 10 + center_x->get_w() + 10; + x + center_x_title->get_w() + xS(10), y)); + x += center_x_title->get_w() + xS(10) + center_x->get_w() + xS(10); add_subwindow(center_y_title = new BC_Title(x, y, _("Center Y:"))); add_subwindow(center_y = new GradientCenterY(plugin, - x + center_y_title->get_w() + 10, y)); + x + center_y_title->get_w() + xS(10), y)); } } show_window(); @@ -242,7 +244,7 @@ void GradientWindow::done_event(int result) } GradientShape::GradientShape(GradientMain *plugin, GradientWindow *gui, int x, int y) - : BC_PopupMenu(x, y, 100, to_text(plugin->config.shape), 1) + : BC_PopupMenu(x, y, xS(100), to_text(plugin->config.shape), 1) { this->plugin = plugin; this->gui = gui; @@ -275,7 +277,7 @@ int GradientShape::handle_event() GradientCenterX::GradientCenterX(GradientMain *plugin, int x, int y) - : BC_FPot(x, y, plugin->config.center_x, 0, 100) + : BC_FPot(x, y, plugin->config.center_x, 0, xS(100)) { this->plugin = plugin; } @@ -288,7 +290,7 @@ int GradientCenterX::handle_event() GradientCenterY::GradientCenterY(GradientMain *plugin, int x, int y) - : BC_FPot(x, y, plugin->config.center_y, 0, 100) + : BC_FPot(x, y, plugin->config.center_y, 0, xS(100)) { this->plugin = plugin; } @@ -316,7 +318,7 @@ int GradientAngle::handle_event() GradientRate::GradientRate(GradientMain *plugin, int x, int y) - : BC_PopupMenu(x, y, 100, to_text(plugin->config.rate), 1) + : BC_PopupMenu(x, y, xS(100), to_text(plugin->config.rate), 1) { this->plugin = plugin; } @@ -351,7 +353,7 @@ int GradientRate::handle_event() GradientInRadius::GradientInRadius(GradientMain *plugin, int x, int y) - : BC_FSlider(x, y, 0, 200, 200, + : BC_FSlider(x, y, 0, xS(200), yS(200), 0.f, 100.f, (float)plugin->config.in_radius) { this->plugin = plugin; @@ -366,7 +368,7 @@ int GradientInRadius::handle_event() GradientOutRadius::GradientOutRadius(GradientMain *plugin, int x, int y) - : BC_FSlider(x, y, 0, 200, 200, + : BC_FSlider(x, y, 0, xS(200), yS(200), 0.f, 100.f, (float)plugin->config.out_radius) { this->plugin = plugin; diff --git a/cinelerra-5.1/plugins/graphic/graphic.C b/cinelerra-5.1/plugins/graphic/graphic.C index ad2eae77..8dcdf979 100644 --- a/cinelerra-5.1/plugins/graphic/graphic.C +++ b/cinelerra-5.1/plugins/graphic/graphic.C @@ -40,10 +40,10 @@ // Canvas parameters #define MAJOR_DIVISIONS 7 #define MINOR_DIVISIONS 5 -#define LINE_W4 12 -#define LINE_W3 10 -#define LINE_W2 5 -#define LINE_W1 2 +#define LINE_W4 xS(12) +#define LINE_W3 xS(10) +#define LINE_W2 xS(5) +#define LINE_W1 xS(2) @@ -227,7 +227,7 @@ int GraphicCanvas::button_release_event() return 0; } -#define BOX_SIZE 10 +#define BOX_SIZE xS(10) int GraphicCanvas::freq_to_y(int freq, ArrayList *points, @@ -699,7 +699,7 @@ int GraphicReset::handle_event() GraphicSize::GraphicSize(GraphicGUI *window, GraphicEQ *plugin, int x, int y) - : BC_PopupMenu(x, y, 100, "4096", 1) + : BC_PopupMenu(x, y, xS(100), "4096", 1) { this->plugin = plugin; this->window = window; @@ -766,8 +766,8 @@ GraphicGUI::GraphicGUI(GraphicEQ *plugin) : PluginClientWindow(plugin, plugin->w, plugin->h, - 320, - 200, + xS(320), + yS(200), 1) { this->plugin = plugin; @@ -802,12 +802,12 @@ void GraphicGUI::create_objects() // int y1 = y; add_subwindow(freq_title = new BC_Title(x, y, _("Frequency:"))); x += freq_title->get_w() + margin; - add_subwindow(freq_text = new FreqTextBox(plugin, this, x, y, 100)); + add_subwindow(freq_text = new FreqTextBox(plugin, this, x, y, xS(100))); x += freq_text->get_w() + margin; add_subwindow(level_title = new BC_Title(x, y, _("Level:"))); x += level_title->get_w() + margin; - add_subwindow(value_text = new ValueTextBox(plugin, this, x, y, 100)); + add_subwindow(value_text = new ValueTextBox(plugin, this, x, y, xS(100))); x += value_text->get_w() + margin; add_subwindow(reset = new GraphicReset(plugin, this, x, y)); @@ -1031,8 +1031,8 @@ GraphicEQ::GraphicEQ(PluginServer *server) fft = 0; need_reconfigure = 1; active_point = -1; - w = 640; - h = 480; + w = xS(640); + h = yS(480); } GraphicEQ::~GraphicEQ() diff --git a/cinelerra-5.1/plugins/greycstoration/greycstorationwindow.C b/cinelerra-5.1/plugins/greycstoration/greycstorationwindow.C index fad9565f..e0dab620 100644 --- a/cinelerra-5.1/plugins/greycstoration/greycstorationwindow.C +++ b/cinelerra-5.1/plugins/greycstoration/greycstorationwindow.C @@ -27,7 +27,7 @@ // configuration window GreyCStorationWindow::GreyCStorationWindow(GreyCStorationMain *client) - : PluginClientWindow(client, 300, 180, 300, 180, 0) + : PluginClientWindow(client, xS(300), yS(180), xS(300), yS(180), 0) { this->client = client; } @@ -39,21 +39,23 @@ GreyCStorationWindow::~GreyCStorationWindow() // controls in window void GreyCStorationWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; BC_Title *title; - add_subwindow(title = new BC_Title(x, y + 10, _("Amplitude:"))); + add_subwindow(title = new BC_Title(x, y + ys10, _("Amplitude:"))); add_tool(greycamp_slider = new GreyCAmpSlider(client, &(client->config.amplitude), x+title->get_w(), y)); - y += 30; - add_subwindow(title = new BC_Title(x, y + 10, _("Sharpness:"))); + y += ys30; + add_subwindow(title = new BC_Title(x, y + ys10, _("Sharpness:"))); add_tool(greycsharp_slider = new GreyCSharpSlider(client, &(client->config.sharpness), x+title->get_w(), y)); - y += 30; - add_subwindow(title = new BC_Title(x, y + 10, _("Anisotropy:"))); + y += ys30; + add_subwindow(title = new BC_Title(x, y + ys10, _("Anisotropy:"))); add_tool(greycani_slider = new GreyCAniSlider(client, &(client->config.anisotropy), x+title->get_w(), y)); - y += 30; - add_subwindow(title = new BC_Title(x, y + 10, _("Noise scale:"))); + y += ys30; + add_subwindow(title = new BC_Title(x, y + ys10, _("Noise scale:"))); add_tool(greycnoise_slider = new GreyCNoiseSlider(client, &(client->config.noise_scale), x+title->get_w(), y)); @@ -71,7 +73,7 @@ int GreyCStorationWindow::close_event() // amp slider implementation GreyCAmpSlider::GreyCAmpSlider(GreyCStorationMain *client, float *output, int x, int y) - : BC_ISlider(x, y, 0, 200, 200, 0, 255, //MAX + : BC_ISlider(x, y, 0, xS(200), yS(200), 0, 255, //MAX (int)*output, 0, 0, 0) { this->client = client; @@ -91,7 +93,7 @@ int GreyCAmpSlider::handle_event() GreyCSharpSlider::GreyCSharpSlider(GreyCStorationMain *client, float *output, int x, int y) - : BC_FSlider(x, y, 0, 200, 200, 0.0f, 1.0f, //MAX + : BC_FSlider(x, y, 0, xS(200), yS(200), 0.0f, 1.0f, //MAX (float)*output, 0, 0) { this->client = client; @@ -113,7 +115,7 @@ int GreyCSharpSlider::handle_event() GreyCAniSlider::GreyCAniSlider(GreyCStorationMain *client, float *output, int x, int y) - : BC_FSlider(x, y, 0, 200, 200, 0.0f, 1.0f, //MAX + : BC_FSlider(x, y, 0, xS(200), yS(200), 0.0f, 1.0f, //MAX (float)*output, 0, 0) { this->client = client; @@ -135,7 +137,7 @@ int GreyCAniSlider::handle_event() // noise scale GreyCNoiseSlider::GreyCNoiseSlider(GreyCStorationMain *client, float *output, int x, int y) - : BC_FSlider(x, y, 0, 200, 200, 0.0f, 10.0f, //MAX + : BC_FSlider(x, y, 0, xS(200), yS(200), 0.0f, 10.0f, //MAX (float)*output, 0, 0) { this->client = client; diff --git a/cinelerra-5.1/plugins/histeq/histeq.C b/cinelerra-5.1/plugins/histeq/histeq.C index cbe092f9..8477ed82 100644 --- a/cinelerra-5.1/plugins/histeq/histeq.C +++ b/cinelerra-5.1/plugins/histeq/histeq.C @@ -82,25 +82,27 @@ HistEqWindow::~HistEqWindow() void HistEqWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs60 = xS(60); + int ys10 = yS(10); + int x = xs10, y = ys10; int cw = get_w()-2*x, ch = cw*3/4; add_subwindow(canvas = new HistEqCanvas(this, plugin, x, y, cw, ch)); - y += canvas->get_h() + 10; + y += canvas->get_h() + ys10; add_subwindow(split = new HistEqSplit(this, plugin, x, y)); - y += split->get_h() + 10; + y += split->get_h() + ys10; add_subwindow(plot = new HistEqPlot(this, plugin, x, y)); - y += plot->get_h() + 10; + y += plot->get_h() + ys10; - int x1 = x + 60; + int x1 = x + xs60; add_subwindow(new BC_Title(x, y, _("Blend:"))); add_subwindow(blend = new HistEqBlend(this, plugin, x1, y)); - y += blend->get_h() + 10; + y += blend->get_h() + ys10; add_subwindow(new BC_Title(x, y, _("Gain:"))); add_subwindow(gain = new HistEqGain(this, plugin, x1, y)); - y += gain->get_h() + 10; + y += gain->get_h() + ys10; show_window(); } @@ -237,7 +239,7 @@ int HistEqPlot::handle_event() } HistEqBlend::HistEqBlend(HistEqWindow *gui, HistEqMain *plugin, int x, int y) - : BC_FSlider(x, y, 0, 150, 200, 0, 1.0, plugin->config.blend, 0) + : BC_FSlider(x, y, 0, xS(150), yS(200), 0, xS(1.0), plugin->config.blend, 0) { this->gui = gui; this->plugin = plugin; @@ -256,7 +258,7 @@ int HistEqBlend::handle_event() HistEqGain::HistEqGain(HistEqWindow *gui, HistEqMain *plugin, int x, int y) - : BC_FSlider(x, y, 0, 150, 200, 0, 1.0, plugin->config.gain, 0) + : BC_FSlider(x, y, 0, xS(150), yS(200), 0, xS(1.0), plugin->config.gain, 0) { this->gui = gui; this->plugin = plugin; @@ -277,7 +279,7 @@ int HistEqGain::handle_event() HistEqMain::HistEqMain(PluginServer *server) : PluginVClient(server) { - w = 300; h = 375; + w = xS(300); h = yS(375); engine = 0; sz = 0; binsz = bsz = 0; bins = 0; diff --git a/cinelerra-5.1/plugins/histogram/histogramwindow.C b/cinelerra-5.1/plugins/histogram/histogramwindow.C index 9529b6e1..3a2e6cf2 100644 --- a/cinelerra-5.1/plugins/histogram/histogramwindow.C +++ b/cinelerra-5.1/plugins/histogram/histogramwindow.C @@ -38,8 +38,8 @@ HistogramWindow::HistogramWindow(HistogramMain *plugin) : PluginClientWindow(plugin, plugin->w, plugin->h, - 440, - 500, + xS(440), + yS(500), 1) { this->plugin = plugin; @@ -106,7 +106,7 @@ void HistogramWindow::create_objects() y += canvas_title2->get_h() + margin; x = x1; - canvas_h = get_h() - y - 210; + canvas_h = get_h() - y - yS(210); add_subwindow(low_input_carrot = new HistogramCarrot(plugin, @@ -182,7 +182,7 @@ void HistogramWindow::create_objects() x = x1; add_subwindow(output = new HistogramSlider(plugin, this, - canvas->get_x(), y, canvas->get_w(), 20, 0)); + canvas->get_x(), y, canvas->get_w(), yS(20), 0)); output->update(); // Output border @@ -216,7 +216,7 @@ void HistogramWindow::create_objects() add_subwindow(automatic = new HistogramAuto(plugin, x, y)); //int y1 = y; - x = 200; + x = xS(200); add_subwindow(threshold_title = new BC_Title(x, y, _("Threshold:"))); x += threshold_title->get_w() + margin; threshold = new HistogramText(plugin, this, x, y); @@ -230,7 +230,7 @@ void HistogramWindow::create_objects() y += automatic->get_h() + margin; add_subwindow(plot = new HistogramPlot(plugin, x, y)); - y += plot->get_h() + 5; + y += plot->get_h() + yS(5); add_subwindow(split = new HistogramSplit(plugin, x, y)); update(1, 1, 1, 1); @@ -973,7 +973,7 @@ int HistogramMode::handle_event() HistogramText::HistogramText(HistogramMain *plugin, HistogramWindow *gui, int x, int y, float hist_min, float hist_max) - : BC_TumbleTextBox(gui, 0.0, hist_min, hist_max, x, y, 70) + : BC_TumbleTextBox(gui, 0.0, hist_min, hist_max, x, y, xS(70)) { this->plugin = plugin; this->gui = gui; diff --git a/cinelerra-5.1/plugins/histogram_bezier/bistogramwindow.C b/cinelerra-5.1/plugins/histogram_bezier/bistogramwindow.C index 8d23ff4a..fd5429cd 100644 --- a/cinelerra-5.1/plugins/histogram_bezier/bistogramwindow.C +++ b/cinelerra-5.1/plugins/histogram_bezier/bistogramwindow.C @@ -32,7 +32,7 @@ #include HistogramWindow::HistogramWindow(HistogramMain *plugin) - : PluginClientWindow(plugin, 440, 480, 440, 480, 0) + : PluginClientWindow(plugin, xS(440), yS(480), xS(440), yS(480), 0) { this->plugin = plugin; max_picon = 0; @@ -56,7 +56,9 @@ static VFramePng min_picon_image(min_picon_png); void HistogramWindow::create_objects() { - int x = 10, y = 10, x1 = 10; + int xs10 = xS(10), xs15 = xS(15), xs20 = xS(20), xs80 = xS(80), xs100 = xS(100), xs120 = xS(120), xs150 = xS(150); + int ys6 = yS(6), ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(40), ys170 = yS(170); + int x = xs10, y = ys10, x1 = xs10; BC_Title *title = 0; max_picon = create_pixmap(&max_picon_image); @@ -64,40 +66,40 @@ void HistogramWindow::create_objects() min_picon = create_pixmap(&min_picon_image); add_subwindow(mode_v = new HistogramMode(plugin, x, y, HISTOGRAM_VALUE, _("Value"))); - x += 80; + x += xs80; add_subwindow(mode_r = new HistogramMode(plugin, x, y, HISTOGRAM_RED, _("Red"))); - x += 80; + x += xs80; add_subwindow(mode_g = new HistogramMode(plugin, x, y, HISTOGRAM_GREEN, _("Green"))); - x += 80; + x += xs80; add_subwindow(mode_b = new HistogramMode(plugin, x, y, HISTOGRAM_BLUE, _("Blue"))); -// x += 80; +// x += xs80; // add_subwindow(mode_a = new HistogramMode(plugin, x, y, // HISTOGRAM_ALPHA, _("Alpha"))); - x = get_w() - HistogramClear::calculate_w(this, _("Clear")) - 15; + x = get_w() - HistogramClear::calculate_w(this, _("Clear")) - xs15; add_subwindow(clear = new HistogramClear(plugin, x, y, _("Clear"))); x = x1; - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Input X:"))); - x += title->get_w() + 10; + x += title->get_w() + xs10; input_x = new HistogramInputText(plugin, this, x, y, 1); input_x->create_objects(); - x += input_x->get_w() + 10; + x += input_x->get_w() + xs10; add_subwindow(title = new BC_Title(x, y, _("Input Y:"))); - x += title->get_w() + 10; + x += title->get_w() + xs10; input_y = new HistogramInputText(plugin, this, x, y, 0); input_y->create_objects(); - y += 30; + y += ys30; x = x1; canvas_w = get_w() - x - x; - canvas_h = get_h() - y - 170; + canvas_h = get_h() - y - ys170; title1_x = x; title2_x = x + (int)(canvas_w * -HIST_MIN_INPUT / FLOAT_RANGE); title3_x = x + (int)(canvas_w * (1.0 - HIST_MIN_INPUT) / FLOAT_RANGE); @@ -113,45 +115,45 @@ void HistogramWindow::create_objects() add_subwindow(new BC_Title(title3_x - get_text_width(MEDIUMFONT, "100"), y, "100%")); add_subwindow(new BC_Title(title4_x - get_text_width(MEDIUMFONT, "110"), y, "110%")); - y += 20; + y += ys20; add_subwindow(title = new BC_Title(x, y, _("Output min:"))); - x += title->get_w() + 10; + x += title->get_w() + xs10; output_min = new HistogramOutputText(plugin, this, x, y, &plugin->config.output_min[plugin->mode]); output_min->create_objects(); - x += output_min->get_w() + 10; + x += output_min->get_w() + xs10; add_subwindow(new BC_Title(x, y, _("Output Max:"))); - x += title->get_w() + 10; + x += title->get_w() + xs10; output_max = new HistogramOutputText(plugin, this, x, y, &plugin->config.output_max[plugin->mode]); output_max->create_objects(); x = x1; - y += 30; + y += ys30; add_subwindow(output = new HistogramSlider(plugin, this, - x, y, get_w() - 20, 30, 0)); + x, y, get_w() - xs20, ys30, 0)); output->update(); - y += 40; + y += ys40; add_subwindow(automatic = new HistogramAuto(plugin, x, y)); - x += 120; + x += xs120; add_subwindow(new HistogramReset(plugin, x, y)); - x += 100; + x += xs100; add_subwindow(new BC_Title(x, y, _("Threshold:"))); - x += 100; + x += xs100; threshold = new HistogramOutputText(plugin, this, x, y, &plugin->config.threshold); threshold->create_objects(); x = x1; - y += 40; + y += ys40; add_subwindow(split = new HistogramSplit(plugin, x, y)); - y += 6; - x += 150; + y += ys6; + x += xs150; add_subwindow(new BC_Title(x,y, _("Interpolation:"))); - x += 120; + x += xs120; add_subwindow(smoothModeChoser = new HistogramSmoothMode(plugin, this, x, y)); smoothModeChoser->create_objects(); @@ -744,7 +746,7 @@ HistogramOutputText::HistogramOutputText(HistogramMain *plugin, HistogramWindow *gui, int x, int y, float *output) : BC_TumbleTextBox(gui, output ? (float)*output : 0.0, (float)HIST_MIN_INPUT, (float)HIST_MAX_INPUT, - x, y, 60) + x, y, xS(60)) { this->plugin = plugin; this->output = output; @@ -769,7 +771,7 @@ HistogramInputText::HistogramInputText(HistogramMain *plugin, HistogramWindow *gui, int x, int y, int do_x) : BC_TumbleTextBox(gui, 0.0, (float)HIST_MIN_INPUT, (float)HIST_MAX_INPUT, - x, y, 60) + x, y, xS(60)) { this->do_x = do_x; this->plugin = plugin; @@ -828,7 +830,7 @@ void HistogramInputText::update() HistogramSmoothMode::HistogramSmoothMode(HistogramMain*plugin, HistogramWindow *gui, int x, int y) - : BC_PopupMenu(x, y, 120, to_text(plugin->config.smoothMode), 1) + : BC_PopupMenu(x, y, xS(120), to_text(plugin->config.smoothMode), 1) { this->plugin = plugin; this->gui = gui; diff --git a/cinelerra-5.1/plugins/holo/holowindow.C b/cinelerra-5.1/plugins/holo/holowindow.C index 3a7f17b5..b607002b 100644 --- a/cinelerra-5.1/plugins/holo/holowindow.C +++ b/cinelerra-5.1/plugins/holo/holowindow.C @@ -31,10 +31,10 @@ HoloWindow::HoloWindow(HoloMain *client) : PluginClientWindow(client, - 300, - 170, - 300, - 170, + xS(300), + yS(170), + xS(300), + yS(170), 0) { this->client = client; @@ -46,7 +46,7 @@ HoloWindow::~HoloWindow() void HoloWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(new BC_Title(x, y, "HolographicTV from EffectTV\n" "Copyright (C) 2001 FUKUCHI Kentarou") diff --git a/cinelerra-5.1/plugins/huesaturation/huesaturation.C b/cinelerra-5.1/plugins/huesaturation/huesaturation.C index ce1e1512..bbaf2ca6 100644 --- a/cinelerra-5.1/plugins/huesaturation/huesaturation.C +++ b/cinelerra-5.1/plugins/huesaturation/huesaturation.C @@ -227,31 +227,33 @@ int HueSliderClr::handle_event() HueWindow::HueWindow(HueEffect *plugin) - : PluginClientWindow(plugin, 370, 140, 370, 140, 0) + : PluginClientWindow(plugin, xS(370), yS(140), xS(370), yS(140), 0) { this->plugin = plugin; } void HueWindow::create_objects() { - int x = 10, y = 10, x1 = 100; - int x2 = 0; int clrBtn_w = 50; + int xs10 = xS(10), xs50 = xS(50), xs100 = xS(100), xs200 = xS(200); + int ys10 = yS(10), ys30 = yS(30), ys40 = yS(40); + int x = xs10, y = ys10, x1 = xs100; + int x2 = 0; int clrBtn_w = xs50; add_subwindow(new BC_Title(x, y, _("Hue:"))); - add_subwindow(hue = new HueSlider(plugin, x1, y, 200)); - x2 = x1 + hue->get_w() + 10; + add_subwindow(hue = new HueSlider(plugin, x1, y, xs200)); + x2 = x1 + hue->get_w() + xs10; add_subwindow(hueClr = new HueSliderClr(plugin, this, x2, y, clrBtn_w, RESET_HUV)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Saturation:"))); - add_subwindow(saturation = new SaturationSlider(plugin, x1, y, 200)); + add_subwindow(saturation = new SaturationSlider(plugin, x1, y, xs200)); add_subwindow(satClr = new HueSliderClr(plugin, this, x2, y, clrBtn_w, RESET_SAT)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Value:"))); - add_subwindow(value = new ValueSlider(plugin, x1, y, 200)); + add_subwindow(value = new ValueSlider(plugin, x1, y, xs200)); add_subwindow(valClr = new HueSliderClr(plugin, this, x2, y, clrBtn_w, RESET_VAL)); - y += 40; + y += ys40; add_subwindow(reset = new HueReset(plugin, this, x, y)); show_window(); flush(); diff --git a/cinelerra-5.1/plugins/interpolate/interpolate.C b/cinelerra-5.1/plugins/interpolate/interpolate.C index 9294d8fd..05c8565c 100644 --- a/cinelerra-5.1/plugins/interpolate/interpolate.C +++ b/cinelerra-5.1/plugins/interpolate/interpolate.C @@ -45,8 +45,8 @@ InterpolatePixelsOffset::InterpolatePixelsOffset(InterpolatePixelsWindow *window : BC_ISlider(x, y, 0, - 50, - 50, + xS(50), + yS(50), 0, 1, *output, @@ -74,10 +74,10 @@ int InterpolatePixelsOffset::handle_event() InterpolatePixelsWindow::InterpolatePixelsWindow(InterpolatePixelsMain *client) : PluginClientWindow(client, - 200, - 100, - 200, - 100, + xS(200), + yS(100), + xS(200), + yS(100), 0) { this->client = client; @@ -89,21 +89,23 @@ InterpolatePixelsWindow::~InterpolatePixelsWindow() void InterpolatePixelsWindow::create_objects() { - int x = 10, y = 10; + int xs5 = xS(5), xs10 = xS(10), xs50 = xS(50); + int ys5 = yS(5), ys10 = yS(10); + int x = xs10, y = ys10; BC_Title *title; add_tool(title = new BC_Title(x, y, _("X Offset:"))); add_tool(x_offset = new InterpolatePixelsOffset(this, - x + title->get_w() + 5, + x + title->get_w() + xs5, y, &client->config.x)); - y += MAX(x_offset->get_h(), title->get_h()) + 5; + y += MAX(x_offset->get_h(), title->get_h()) + ys5; add_tool(title = new BC_Title(x, y, _("Y Offset:"))); add_tool(y_offset = new InterpolatePixelsOffset(this, - x + title->get_w() + 5, + x + title->get_w() + xs5, y, &client->config.y)); - y += MAX(y_offset->get_h(), title->get_h()) + 5; + y += MAX(y_offset->get_h(), title->get_h()) + ys5; show_window(); } diff --git a/cinelerra-5.1/plugins/interpolatevideo/interpolatewindow.C b/cinelerra-5.1/plugins/interpolatevideo/interpolatewindow.C index 3db333ff..a0052ea1 100644 --- a/cinelerra-5.1/plugins/interpolatevideo/interpolatewindow.C +++ b/cinelerra-5.1/plugins/interpolatevideo/interpolatewindow.C @@ -34,10 +34,10 @@ InterpolateVideoWindow::InterpolateVideoWindow(InterpolateVideo *plugin) : PluginClientWindow(plugin, - 250, - 250, - 250, - 250, + xS(250), + yS(250), + xS(250), + yS(250), 0) { this->plugin = plugin; @@ -49,7 +49,9 @@ InterpolateVideoWindow::~InterpolateVideoWindow() void InterpolateVideoWindow::create_objects() { - int x = 10, y = 10; + int xs5 = xS(5), xs10 = xS(10); + int ys10 = yS(10); + int x = xs10, y = ys10; BC_Title *title; @@ -62,7 +64,7 @@ void InterpolateVideoWindow::create_objects() y)); add_subwindow(rate_menu = new InterpolateVideoRateMenu(plugin, this, - x + rate->get_w() + 5, + x + rate->get_w() + xs5, y)); y += rate->get_h() + plugin->get_theme()->widget_border; add_subwindow(keyframes = new InterpolateVideoKeyframes(plugin, @@ -147,7 +149,7 @@ InterpolateVideoRate::InterpolateVideoRate(InterpolateVideo *plugin, int y) : BC_TextBox(x, y, - 90, + xS(90), 1, (float)plugin->config.input_rate) { @@ -171,8 +173,8 @@ InterpolateVideoRateMenu::InterpolateVideoRateMenu(InterpolateVideo *plugin, int y) : BC_ListBox(x, y, - 100, - 200, + xS(100), + yS(200), LISTBOX_TEXT, &plugin->get_theme()->frame_rates, 0, diff --git a/cinelerra-5.1/plugins/invertvideo/invert.C b/cinelerra-5.1/plugins/invertvideo/invert.C index 7dc94c01..13ee8dd8 100644 --- a/cinelerra-5.1/plugins/invertvideo/invert.C +++ b/cinelerra-5.1/plugins/invertvideo/invert.C @@ -157,25 +157,21 @@ int InvertVideoEnable::handle_event() InvertVideoWindow::InvertVideoWindow(InvertVideoEffect *plugin) - : PluginClientWindow(plugin, - 260, - 130, - 260, - 130, - 0) + : PluginClientWindow(plugin, xS(200), yS(130), xS(200), yS(130), 0) { this->plugin = plugin; } void InvertVideoWindow::create_objects() { - int x = 10, y = 10; + int ys30 = yS(30); + int x = xS(10), y = yS(10); add_subwindow(r = new InvertVideoEnable(plugin, &plugin->config.r, x, y, _("Invert R"))); - y += 30; + y += ys30; add_subwindow(g = new InvertVideoEnable(plugin, &plugin->config.g, x, y, _("Invert G"))); - y += 30; + y += ys30; add_subwindow(b = new InvertVideoEnable(plugin, &plugin->config.b, x, y, _("Invert B"))); - y += 30; + y += ys30; add_subwindow(a = new InvertVideoEnable(plugin, &plugin->config.a, x, y, _("Invert A"))); show_window(); diff --git a/cinelerra-5.1/plugins/invertvideo/invertwindow.C b/cinelerra-5.1/plugins/invertvideo/invertwindow.C index 24895eec..200341be 100644 --- a/cinelerra-5.1/plugins/invertvideo/invertwindow.C +++ b/cinelerra-5.1/plugins/invertvideo/invertwindow.C @@ -38,9 +38,11 @@ InvertWindow::~InvertWindow() int InvertWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys35 = yS(35); + int x = xs10, y = ys10; add_tool(new BC_Title(x, y, _("Invert"))); - y += 20; + y += ys20; add_tool(invert = new InvertToggle(client, &(client->invert), x, y)); } diff --git a/cinelerra-5.1/plugins/irissquare/irissquare.C b/cinelerra-5.1/plugins/irissquare/irissquare.C index 6d3d85b3..f48ab927 100644 --- a/cinelerra-5.1/plugins/irissquare/irissquare.C +++ b/cinelerra-5.1/plugins/irissquare/irissquare.C @@ -92,10 +92,10 @@ int IrisSquareOut::handle_event() IrisSquareWindow::IrisSquareWindow(IrisSquareMain *plugin) : PluginClientWindow(plugin, - 320, - 50, - 320, - 50, + xS(320), + yS(50), + xS(320), + yS(50), 0) { this->plugin = plugin; @@ -104,14 +104,16 @@ IrisSquareWindow::IrisSquareWindow(IrisSquareMain *plugin) void IrisSquareWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs100 = xS(100); + int ys10 = yS(10); + int x = xs10, y = ys10; add_subwindow(new BC_Title(x, y, _("Direction:"))); - x += 100; + x += xs100; add_subwindow(in = new IrisSquareIn(plugin, this, x, y)); - x += 100; + x += xs100; add_subwindow(out = new IrisSquareOut(plugin, this, x, diff --git a/cinelerra-5.1/plugins/ivtc/ivtcwindow.C b/cinelerra-5.1/plugins/ivtc/ivtcwindow.C index 22a113ca..d3b99664 100644 --- a/cinelerra-5.1/plugins/ivtc/ivtcwindow.C +++ b/cinelerra-5.1/plugins/ivtc/ivtcwindow.C @@ -42,10 +42,10 @@ static const char *pattern_text[] = IVTCWindow::IVTCWindow(IVTCMain *client) : PluginClientWindow(client, - 210, - 230, - 210, - 230, + xS(210), + yS(230), + xS(210), + yS(230), 0) { this->client = client; @@ -57,18 +57,20 @@ IVTCWindow::~IVTCWindow() void IVTCWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(40); + int x = xs10, y = ys10; add_tool(new BC_Title(x, y, _("Pattern offset:"))); - y += 20; + y += ys20; add_tool(frame_offset = new IVTCOffset(client, x, y)); - y += 30; + y += ys30; add_tool(first_field = new IVTCFieldOrder(client, x, y)); -// y += 30; +// y += ys30; // add_tool(automatic = new IVTCAuto(client, x, y)); - y += 40; + y += ys40; add_subwindow(new BC_Title(x, y, _("Pattern:"))); - y += 20; + y += ys20; for(int i = 0; i < TOTAL_PATTERNS; i++) { add_subwindow(pattern[i] = new IVTCPattern(client, @@ -77,7 +79,7 @@ void IVTCWindow::create_objects() _(pattern_text[i]), x, y)); - y += 20; + y += ys20; } if(client->config.pattern == IVTCConfig::AUTOMATIC) @@ -85,9 +87,9 @@ void IVTCWindow::create_objects() frame_offset->disable(); first_field->disable(); } -// y += 30; +// y += ys30; // add_tool(new BC_Title(x, y, _("Field threshold:"))); -// y += 20; +// y += ys20; // add_tool(threshold = new IVTCAutoThreshold(client, x, y)); show_window(); flush(); @@ -98,7 +100,7 @@ void IVTCWindow::create_objects() IVTCOffset::IVTCOffset(IVTCMain *client, int x, int y) : BC_TextBox(x, y, - 190, + xS(190), 1, client->config.frame_offset) { @@ -189,7 +191,7 @@ int IVTCPattern::handle_event() IVTCAutoThreshold::IVTCAutoThreshold(IVTCMain *client, int x, int y) - : BC_TextBox(x, y, 190, 1, client->config.auto_threshold) + : BC_TextBox(x, y, xS(190), 1, client->config.auto_threshold) { this->client = client; } diff --git a/cinelerra-5.1/plugins/lens/lens.C b/cinelerra-5.1/plugins/lens/lens.C index 7649377b..a6777be2 100644 --- a/cinelerra-5.1/plugins/lens/lens.C +++ b/cinelerra-5.1/plugins/lens/lens.C @@ -115,7 +115,7 @@ void LensConfig::boundaries() LensSlider::LensSlider(LensMain *plugin, LensGUI *gui, LensText *text, float *output, int x, int y, float min, float max) - : BC_FSlider(x, y, 0, 200, 200, min, max, *output) + : BC_FSlider(x, y, 0, xS(200), yS(200), min, max, *output) { this->gui = gui; this->plugin = plugin; @@ -161,7 +161,7 @@ int LensSlider::handle_event() LensText::LensText(LensMain *plugin, LensGUI *gui, LensSlider *slider, float *output, int x, int y) - : BC_TextBox(x, y, 100, 1, *output) + : BC_TextBox(x, y, xS(100), 1, *output) { this->gui = gui; this->plugin = plugin; @@ -260,7 +260,7 @@ int LensMode::calculate_w(LensGUI *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(LensConfig::SPHERICAL_SHRINK))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(LensConfig::RECTILINEAR_STRETCH))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(LensConfig::RECTILINEAR_SHRINK))); - return result + 50; + return result + xS(50); } int LensMode::from_text(char *text) @@ -385,7 +385,7 @@ int LensInterpItem::handle_event() } LensInterp::LensInterp(LensMain *plugin, int x, int y) - : BC_PopupMenu(x, y, 120, "") + : BC_PopupMenu(x, y, xS(120), "") { this->plugin = plugin; } @@ -434,7 +434,7 @@ int LensReset::handle_event() LensGUI::LensGUI(LensMain *plugin) - : PluginClientWindow(plugin, 350, 550, 350, 550, 0) + : PluginClientWindow(plugin, xS(350), yS(556), xS(350), yS(556), 0) { this->plugin = plugin; } @@ -446,8 +446,10 @@ LensGUI::~LensGUI() void LensGUI::create_objects() { - int x = 10; - int y = 10; + int xs5 = xS(5), xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10); + int x = xs10; + int y = ys10; int x1; BC_Title *title = 0; LensToggle *toggle; @@ -460,104 +462,104 @@ void LensGUI::create_objects() case 3: add_tool(title = new BC_Title(x, y, _("A Field of View:"))); break; } - y += title->get_h() + 5; + y += title->get_h() + ys5; add_tool(fov_slider[i] = new LensSlider(plugin, this, 0, &plugin->config.fov[i], x, y, 0.0001, 1.0)); - x1 = x + fov_slider[i]->get_w() + 5; + x1 = x + fov_slider[i]->get_w() + xs5; add_tool(fov_text[i] = new LensText(plugin, this, fov_slider[i], &plugin->config.fov[i], x1, y)); fov_slider[i]->text = fov_text[i]; - y += fov_text[i]->get_h() + 5; + y += fov_text[i]->get_h() + ys5; } add_tool(toggle = new LensToggle(plugin, &plugin->lock, x, y, _("Lock"))); - y += toggle->get_h() + 10; + y += toggle->get_h() + ys10; BC_Bar *bar; add_tool(bar = new BC_Bar(x, y, get_w() - x * 2)); - y += bar->get_h() + 5; + y += bar->get_h() + ys5; add_tool(title = new BC_Title(x, y, _("Aspect Ratio:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; add_tool(aspect_slider = new LensSlider(plugin, this, 0, &plugin->config.aspect, x, y, 0.333, 3.0)); - x1 = x + aspect_slider->get_w() + 5; + x1 = x + aspect_slider->get_w() + xs5; add_tool(aspect_text = new LensText(plugin, this, aspect_slider, &plugin->config.aspect, x1, y)); aspect_slider->text = aspect_text; - y += aspect_text->get_h() + 5; + y += aspect_text->get_h() + ys5; add_tool(title = new BC_Title(x, y, _("Radius:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; add_tool(radius_slider = new LensSlider(plugin, this, 0, &plugin->config.radius, x, y, 0.333, 3.0)); - x1 = x + radius_slider->get_w() + 5; + x1 = x + radius_slider->get_w() + xs5; add_tool(radius_text = new LensText(plugin, this, radius_slider, &plugin->config.radius, x1, y)); radius_slider->text = radius_text; - y += radius_text->get_h() + 5; + y += radius_text->get_h() + ys5; add_tool(title = new BC_Title(x, y, _("Center X:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; add_tool(centerx_slider = new LensSlider(plugin, this, 0, &plugin->config.center_x, x, y, 0.0, 99.0)); - x1 = x + centerx_slider->get_w() + 5; + x1 = x + centerx_slider->get_w() + xs5; add_tool(centerx_text = new LensText(plugin, this, centerx_slider, &plugin->config.center_x, x1, y)); centerx_slider->text = centerx_text; centerx_slider->set_precision(1.0); - y += centerx_text->get_h() + 5; + y += centerx_text->get_h() + ys5; add_tool(title = new BC_Title(x, y, _("Center Y:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; add_tool(centery_slider = new LensSlider(plugin, this, 0, &plugin->config.center_y, x, y, 0.0, 99.0)); - x1 = x + centery_slider->get_w() + 5; + x1 = x + centery_slider->get_w() + xs5; add_tool(centery_text = new LensText(plugin, this, centery_slider, &plugin->config.center_y, x1, y)); centery_slider->text = centery_text; centery_slider->set_precision(1.0); - y += centery_text->get_h() + 10; + y += centery_text->get_h() + ys10; add_tool(bar = new BC_Bar(x, y, get_w() - x * 2)); - y += bar->get_h() + 5; + y += bar->get_h() + ys5; // add_tool(reverse = new LensToggle(plugin, // &plugin->config.reverse, x, y, _("Reverse"))); -// y += reverse->get_h() + 5; +// y += reverse->get_h() + ys5; add_tool(draw_guides = new LensToggle(plugin, &plugin->config.draw_guides, x, y, _("Draw center"))); - y += draw_guides->get_h() + 5; + y += draw_guides->get_h() + ys5; add_tool(title = new BC_Title(x, y, _("Mode:"))); add_tool(mode = new LensMode(plugin, this, - x + title->get_w() + 5, y)); + x + title->get_w() + xs5, y)); mode->create_objects(); - y += mode->get_h() + 5; + y += mode->get_h() + ys5; add_tool(title = new BC_Title(x, y, _("Interp:"))); - x1 = x + title->get_w() + 5; + x1 = x + title->get_w() + xs5; add_tool(interp = new LensInterp(plugin, x1, y)); interp->create_objects(); - y += interp->get_h() + 5; + y += interp->get_h() + ys5; add_tool(reset = new LensReset(plugin, this, x, y)); - y += reset->get_h() + 5; + y += reset->get_h() + ys5; // add_tool(title = new BC_Title(x, y, _("Preset:"))); // add_tool(presets = new LensPresets(plugin, this, -// x + title->get_w() + 5, y, get_w() - x - title->get_w() - 50)); +// x + title->get_w() + xs5, y, get_w() - x - title->get_w() - xS(50))); // presets->create_objects(); -// y += presets->get_h() + 5; +// y += presets->get_h() + ys5; // // add_tool(save_preset = new LensSavePreset(plugin, this, x, y)); // add_tool(preset_text = new LensPresetText(plugin, this, -// x + save_preset->get_w() + 5, y, -// get_w() - x - save_preset->get_w() - 10)); -// y += preset_text->get_h() + 5; +// x + save_preset->get_w() + xs5, y, +// get_w() - x - save_preset->get_w() - xs10)); +// y += preset_text->get_h() + ys5; // add_tool(delete_preset = new LensDeletePreset(plugin, this, x, y)); show_window(); diff --git a/cinelerra-5.1/plugins/level/leveleffect.C b/cinelerra-5.1/plugins/level/leveleffect.C index d8c00d03..a81b357b 100644 --- a/cinelerra-5.1/plugins/level/leveleffect.C +++ b/cinelerra-5.1/plugins/level/leveleffect.C @@ -93,7 +93,7 @@ void SoundLevelConfig::interpolate(SoundLevelConfig &prev, SoundLevelDuration::SoundLevelDuration(SoundLevelEffect *plugin, int x, int y) - : BC_FSlider(x, y, 0, 180, 180, 0.0, 10.0, plugin->config.duration) + : BC_FSlider(x, y, 0, xS(180), yS(180), 0.0, 10.0, plugin->config.duration) { this->plugin = plugin; set_precision(0.1); @@ -110,10 +110,10 @@ int SoundLevelDuration::handle_event() SoundLevelWindow::SoundLevelWindow(SoundLevelEffect *plugin) : PluginClientWindow(plugin, - 350, - 120, - 350, - 120, + xS(350), + yS(120), + xS(350), + yS(120), 0) { this->plugin = plugin; @@ -121,18 +121,20 @@ SoundLevelWindow::SoundLevelWindow(SoundLevelEffect *plugin) void SoundLevelWindow::create_objects() { + int xs10 = xS(10), xs150 = xS(150); + int ys10 = yS(10), ys35 = yS(35); //printf("SoundLevelWindow::create_objects 1\n"); - int x = 10, y = 10; + int x = xs10, y = ys10; add_subwindow(new BC_Title(x, y, _("Duration (seconds):"))); - add_subwindow(duration = new SoundLevelDuration(plugin, x + 150, y)); - y += 35; + add_subwindow(duration = new SoundLevelDuration(plugin, x + xs150, y)); + y += ys35; add_subwindow(new BC_Title(x, y, _("Max soundlevel (dB):"))); - add_subwindow(soundlevel_max = new BC_Title(x + 150, y, "0.0")); - y += 35; + add_subwindow(soundlevel_max = new BC_Title(x + xs150, y, "0.0")); + y += ys35; add_subwindow(new BC_Title(x, y, _("RMS soundlevel (dB):"))); - add_subwindow(soundlevel_rms = new BC_Title(x + 150, y, "0.0")); + add_subwindow(soundlevel_rms = new BC_Title(x + xs150, y, "0.0")); show_window(); flush(); diff --git a/cinelerra-5.1/plugins/linearblur/linearblur.C b/cinelerra-5.1/plugins/linearblur/linearblur.C index dab0043a..428b6083 100644 --- a/cinelerra-5.1/plugins/linearblur/linearblur.C +++ b/cinelerra-5.1/plugins/linearblur/linearblur.C @@ -135,10 +135,10 @@ void LinearBlurConfig::interpolate(LinearBlurConfig &prev, LinearBlurWindow::LinearBlurWindow(LinearBlurMain *plugin) : PluginClientWindow(plugin, - 280, - 320, - 280, - 320, + xS(280), + yS(320), + xS(280), + yS(320), 0) { this->plugin = plugin; @@ -150,40 +150,42 @@ LinearBlurWindow::~LinearBlurWindow() void LinearBlurWindow::create_objects() { - int x = 10, y = 10; - int x1 = 0; int clrBtn_w = 50; - int defaultBtn_w = 100; + int xs10 = xS(10), xs50 = xS(50), xs100 = xS(100); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(40); + int x = xs10, y = ys10; + int x1 = 0; int clrBtn_w = xs50; + int defaultBtn_w = xs100; add_subwindow(new BC_Title(x, y, _("Length:"))); - y += 20; + y += ys20; add_subwindow(radius = new LinearBlurSize(plugin, x, y, &plugin->config.radius, 0, 100)); - x1 = x + radius->get_w() + 10; + x1 = x + radius->get_w() + xs10; add_subwindow(radiusClr = new LinearBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_RADIUS)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Angle:"))); - y += 20; + y += ys20; add_subwindow(angle = new LinearBlurSize(plugin, x, y, &plugin->config.angle, -180, 180)); add_subwindow(angleClr = new LinearBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_ANGLE)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Steps:"))); - y += 20; + y += ys20; add_subwindow(steps = new LinearBlurSize(plugin, x, y, &plugin->config.steps, 1, 200)); add_subwindow(stepsClr = new LinearBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_STEPS)); - y += 30; + y += ys30; add_subwindow(r = new LinearBlurToggle(plugin, x, y, &plugin->config.r, _("Red"))); - y += 30; + y += ys30; add_subwindow(g = new LinearBlurToggle(plugin, x, y, &plugin->config.g, _("Green"))); - y += 30; + y += ys30; add_subwindow(b = new LinearBlurToggle(plugin, x, y, &plugin->config.b, _("Blue"))); - y += 30; + y += ys30; add_subwindow(a = new LinearBlurToggle(plugin, x, y, &plugin->config.a, _("Alpha"))); - y += 40; + y += ys40; add_subwindow(reset = new LinearBlurReset(plugin, this, x, y)); add_subwindow(default_settings = new LinearBlurDefaultSettings(plugin, this, - (280 - 10 - defaultBtn_w), y, defaultBtn_w)); + (xS(280) - xs10 - defaultBtn_w), y, defaultBtn_w)); show_window(); flush(); @@ -253,7 +255,7 @@ LinearBlurSize::LinearBlurSize(LinearBlurMain *plugin, int *output, int min, int max) - : BC_ISlider(x, y, 0, 200, 200, min, max, *output) + : BC_ISlider(x, y, 0, xS(200), yS(200), min, max, *output) { this->plugin = plugin; this->output = output; diff --git a/cinelerra-5.1/plugins/liveaudio/liveaudio.C b/cinelerra-5.1/plugins/liveaudio/liveaudio.C index 394608b3..3d36db72 100644 --- a/cinelerra-5.1/plugins/liveaudio/liveaudio.C +++ b/cinelerra-5.1/plugins/liveaudio/liveaudio.C @@ -128,10 +128,10 @@ LiveAudioConfig::LiveAudioConfig() LiveAudioWindow::LiveAudioWindow(LiveAudio *plugin) : PluginClientWindow(plugin, - 300, - 160, - 300, - 160, + xS(300), + yS(160), + xS(300), + yS(160), 0) { this->plugin = plugin; @@ -143,7 +143,7 @@ LiveAudioWindow::~LiveAudioWindow() void LiveAudioWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Live audio"))); diff --git a/cinelerra-5.1/plugins/livevideo/livevideo.C b/cinelerra-5.1/plugins/livevideo/livevideo.C index f08a7371..1aa84222 100644 --- a/cinelerra-5.1/plugins/livevideo/livevideo.C +++ b/cinelerra-5.1/plugins/livevideo/livevideo.C @@ -197,8 +197,8 @@ LiveVideoWindow::LiveVideoWindow(LiveVideo *plugin) : PluginClientWindow(plugin, plugin->w, plugin->h, - 100, - 100, + xS(100), + yS(100), 1) { this->plugin = plugin; @@ -211,7 +211,9 @@ LiveVideoWindow::~LiveVideoWindow() void LiveVideoWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10); + int x = xs10, y = ys10; EDLSession *session = plugin->get_edl()->session; if(session) @@ -225,14 +227,14 @@ void LiveVideoWindow::create_objects() } add_subwindow(title = new BC_Title(x, y, _("Channels:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; add_subwindow(list = new LiveChannelList(plugin, this, x, y, - get_w() - x - 10, - get_h() - y - BC_OKButton::calculate_h() - 10 - 10)); - y += list->get_h() + 10; + get_w() - x - xs10, + get_h() - y - BC_OKButton::calculate_h() - ys10 - ys10)); + y += list->get_h() + ys10; add_subwindow(select = new LiveChannelSelect(plugin, this, x, @@ -345,8 +347,8 @@ LiveVideo::LiveVideo(PluginServer *server) vdevice = 0; temp = 0; channeldb = new ChannelDB; - w = 320; - h = 640; + w = xS(320); + h = yS(640); prev_channel = 0; dv = 0; mjpeg = 0; diff --git a/cinelerra-5.1/plugins/loopaudio/loopaudio.C b/cinelerra-5.1/plugins/loopaudio/loopaudio.C index 8bae8b51..5974c90e 100644 --- a/cinelerra-5.1/plugins/loopaudio/loopaudio.C +++ b/cinelerra-5.1/plugins/loopaudio/loopaudio.C @@ -103,10 +103,10 @@ LoopAudioConfig::LoopAudioConfig() LoopAudioWindow::LoopAudioWindow(LoopAudio *plugin) : PluginClientWindow(plugin, - 210, - 160, - 200, - 160, + xS(210), + yS(160), + xS(200), + yS(160), 0) { this->plugin = plugin; @@ -118,10 +118,12 @@ LoopAudioWindow::~LoopAudioWindow() void LoopAudioWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys20 = yS(20); + int x = xs10, y = ys10; add_subwindow(new BC_Title(x, y, _("Samples to loop:"))); - y += 20; + y += ys20; add_subwindow(samples = new LoopAudioSamples(plugin, x, y)); @@ -142,7 +144,7 @@ LoopAudioSamples::LoopAudioSamples(LoopAudio *plugin, int y) : BC_TextBox(x, y, - 100, + xS(100), 1, plugin->config.samples) { diff --git a/cinelerra-5.1/plugins/loopvideo/loopvideo.C b/cinelerra-5.1/plugins/loopvideo/loopvideo.C index 17983efa..dd20c24a 100644 --- a/cinelerra-5.1/plugins/loopvideo/loopvideo.C +++ b/cinelerra-5.1/plugins/loopvideo/loopvideo.C @@ -100,10 +100,10 @@ LoopVideoConfig::LoopVideoConfig() LoopVideoWindow::LoopVideoWindow(LoopVideo *plugin) : PluginClientWindow(plugin, - 210, - 160, - 200, - 160, + xS(210), + yS(160), + xS(200), + yS(160), 0) { this->plugin = plugin; @@ -115,10 +115,12 @@ LoopVideoWindow::~LoopVideoWindow() void LoopVideoWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys20 = yS(20); + int x = xs10, y = ys10; add_subwindow(new BC_Title(x, y, _("Frames to loop:"))); - y += 20; + y += ys20; add_subwindow(frames = new LoopVideoFrames(plugin, x, y)); @@ -141,7 +143,7 @@ LoopVideoFrames::LoopVideoFrames(LoopVideo *plugin, int y) : BC_TextBox(x, y, - 100, + xS(100), 1, plugin->config.frames) { diff --git a/cinelerra-5.1/plugins/mandelcuda/mandelbrotwindow.C b/cinelerra-5.1/plugins/mandelcuda/mandelbrotwindow.C index c4b11687..1808bc43 100644 --- a/cinelerra-5.1/plugins/mandelcuda/mandelbrotwindow.C +++ b/cinelerra-5.1/plugins/mandelcuda/mandelbrotwindow.C @@ -33,7 +33,7 @@ #include "theme.h" MandelbrotWindow::MandelbrotWindow(Mandelbrot *plugin) - : PluginClientWindow(plugin, 180, 130, 180, 130, 0) + : PluginClientWindow(plugin, xS(180), yS(130), xS(180), yS(130), 0) { this->plugin = plugin; press_x = press_y = 0; @@ -47,7 +47,7 @@ MandelbrotWindow::~MandelbrotWindow() void MandelbrotWindow::create_objects() { - int x = 10, y = 10, pad = 5; + int x = xS(10), y = yS(10), pad = xS(5); BC_Title *title; add_subwindow(title = new BC_Title(x,y, _("Mandelbrot:"), MEDIUMFONT, YELLOW)); y += title->get_h() + pad; diff --git a/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.C b/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.C index eeadec0c..d797fe93 100644 --- a/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.C +++ b/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.C @@ -31,7 +31,7 @@ #include "pluginserver.h" MotionCVWindow::MotionCVWindow(MotionCVMain *plugin) - : PluginClientWindow(plugin, 815, 600, 815, 600, 0) + : PluginClientWindow(plugin, xS(815), yS(600), xS(815), yS(600), 0) { this->plugin = plugin; } @@ -42,109 +42,111 @@ MotionCVWindow::~MotionCVWindow() void MotionCVWindow::create_objects() { - int x1 = 10, x = 10, y = 10; - int x2 = 410; + int xs10 = xS(10), xs20 = xS(20), xs30 = xS(30), xs50 = xS(50), xs120 = xS(120), xs410 = xS(410); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(40), ys50 = yS(50); + int x1 = xs10, x = xs10, y = ys10; + int x2 = xs410; BC_Title *title; add_subwindow(global = new MotionCVGlobal(plugin, this, x1, y)); add_subwindow(rotate = new MotionCVRotate(plugin, this, x2, y)); - y += 50; + y += ys50; add_subwindow(title = new BC_Title(x1, y, _("Translation search radius:\n(W/H Percent of image)"))); add_subwindow(global_range_w = new GlobalRange(plugin, - x1 + title->get_w() + 10, y, + x1 + title->get_w() + xs10, y, &plugin->config.global_range_w)); add_subwindow(global_range_h = new GlobalRange(plugin, - x1 + title->get_w() + 30 + global_range_w->get_w(), y, + x1 + title->get_w() + xs30 + global_range_w->get_w(), y, &plugin->config.global_range_h)); add_subwindow(title = new BC_Title(x2, y, _("Rotation search radius:\n(Degrees)"))); add_subwindow(rotation_range = - new RotationRange(plugin, x2 + title->get_w() + 10, y)); + new RotationRange(plugin, x2 + title->get_w() + xs10, y)); - y += 50; + y += ys50; add_subwindow(title = new BC_Title(x1, y, _("Translation block size:\n(W/H Percent of image)"))); add_subwindow(global_block_w = new BlockSize(plugin, - x1 + title->get_w() + 10, y, + x1 + title->get_w() + xs10, y, &plugin->config.global_block_w)); add_subwindow(global_block_h = new BlockSize(plugin, - x1 + title->get_w() + 30 + global_block_w->get_w(), y, + x1 + title->get_w() + xs30 + global_block_w->get_w(), y, &plugin->config.global_block_h)); add_subwindow(title = new BC_Title(x2, y, _("Rotation block size:\n(W/H Percent of image)"))); add_subwindow(rotation_block_w = new BlockSize(plugin, - x2 + title->get_w() + 10, y, + x2 + title->get_w() + xs10, y, &plugin->config.rotation_block_w)); add_subwindow(rotation_block_h = new BlockSize(plugin, - x2 + title->get_w() + 30 + rotation_block_w->get_w(), y, + x2 + title->get_w() + xs30 + rotation_block_w->get_w(), y, &plugin->config.rotation_block_h)); - y += 50; + y += ys50; add_subwindow(title = new BC_Title(x1, y, _("Translation search steps:"))); add_subwindow(global_search_positions = new GlobalSearchPositions(plugin, - x1 + title->get_w() + 10, y, 80)); + x1 + title->get_w() + xs10, y, xs120)); global_search_positions->create_objects(); add_subwindow(title = new BC_Title(x2, y, _("Rotation search steps:"))); add_subwindow(rotation_search_positions = new RotationSearchPositions(plugin, - x2 + title->get_w() + 10, y, 80)); + x2 + title->get_w() + xs10, y, xs120)); rotation_search_positions->create_objects(); - y += 50; + y += ys50; add_subwindow(title = new BC_Title(x, y, _("Translation direction:"))); add_subwindow(mode3 = new Mode3(plugin, - this, x + title->get_w() + 10, y)); + this, x + title->get_w() + xs10, y)); mode3->create_objects(); - y += 40; int y1 = y; + y += ys40; int y1 = y; add_subwindow(title = new BC_Title(x2, y, _("Tracking file:"))); add_subwindow(tracking_file = new MotionCVTrackingFile(plugin, plugin->config. tracking_file, this, - x2 + title->get_w() + 20, y)); - y1 += tracking_file->get_h() + 10; + x2 + title->get_w() + xs20, y)); + y1 += tracking_file->get_h() + ys10; - add_subwindow(title = new BC_Title(x, y + 10, _("Block X:"))); + add_subwindow(title = new BC_Title(x, y + xs10, _("Block X:"))); add_subwindow(block_x = new MotionCVBlockX(plugin, this, - x + title->get_w() + 10, y)); + x + title->get_w() + xs10, y)); add_subwindow(block_x_text = new MotionCVBlockXText(plugin, - this, x + title->get_w() + 10 + block_x->get_w() + 10, y + 10)); + this, x + title->get_w() + xs10 + block_x->get_w() + xs10, y + ys10)); - y += 40; - add_subwindow(title = new BC_Title(x, y + 10, _("Block Y:"))); + y += ys40; + add_subwindow(title = new BC_Title(x, y + ys10, _("Block Y:"))); add_subwindow(block_y = new MotionCVBlockY(plugin, this, - x + title->get_w() + 10, y)); + x + title->get_w() + xs10, y)); add_subwindow(block_y_text = new MotionCVBlockYText(plugin, this, - x + title->get_w() + 10 + block_y->get_w() + 10, y + 10)); + x + title->get_w() + xs10 + block_y->get_w() + xs10, y + ys10)); - add_subwindow(title = new BC_Title(x2, y1 + 10, _("Maximum absolute offset:"))); + add_subwindow(title = new BC_Title(x2, y1 + ys10, _("Maximum absolute offset:"))); add_subwindow(magnitude = new MotionCVMagnitude(plugin, - x2 + title->get_w() + 10, y1)); + x2 + title->get_w() + xs10, y1)); - y1 += 40; - add_subwindow(title = new BC_Title(x2, y1 + 10, _("Settling speed:"))); + y1 += ys40; + add_subwindow(title = new BC_Title(x2, y1 + ys10, _("Settling speed:"))); add_subwindow(return_speed = new MotionCVReturnSpeed(plugin, - x2 + title->get_w() + 10, y1)); + x2 + title->get_w() + xs10, y1)); - y1 += 40; + y1 += ys40; add_subwindow(vectors = new MotionCVDrawVectors(plugin, this, x2, y1)); - y = y1 + vectors->get_h() + 10; + y = y1 + vectors->get_h() + ys10; x1 = x; y1 = y; add_subwindow(track_single = new TrackSingleFrame(plugin, this, x1, y1)); - y += 20; + y += ys20; add_subwindow(track_previous = new TrackPreviousFrame(plugin, this, x, y)); - y += 20; + y += ys20; add_subwindow(previous_same = new PreviousFrameSameBlock(plugin, this, x, y)); - y += 40; + y += ys40; add_subwindow(title = new BC_Title(x, y, _("Master layer:"))); add_subwindow(master_layer = new MasterLayer(plugin, this, - x + title->get_w() + 10, y)); + x + title->get_w() + xs10, y)); master_layer->create_objects(); add_subwindow(title = new BC_Title(x1=x2, y1=y, _("Frame number:"))); @@ -156,23 +158,23 @@ void MotionCVWindow::create_objects() add_subwindow(addtrackedframeoffset = new AddTrackedFrameOffset(plugin, this, x1=x2, y1+=track_frame_number->get_h())); int pef = client->server->mwindow->edl->session->video_every_frame; - add_subwindow(pef_title = new BC_Title(x1=x2+50, y1+=addtrackedframeoffset->get_h() + 5, + add_subwindow(pef_title = new BC_Title(x1=x2+xs50, y1+=addtrackedframeoffset->get_h() + yS(5), !pef ? _("For best results\n" " Set: Play every frame\n" " Preferences-> Playback-> Video Out") : _("Currently using: Play every frame"), MEDIUMFONT, !pef ? RED : GREEN)); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Action:"))); add_subwindow(mode1 = new Mode1(plugin, this, - x + title->get_w() + 10, y)); + x + title->get_w() + xs10, y)); mode1->create_objects(); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Calculation:"))); add_subwindow(mode2 = new Mode2(plugin, this, - x + title->get_w() + 10, y)); + x + title->get_w() + xs10, y)); mode2->create_objects(); show_window(1); @@ -336,7 +338,7 @@ int AddTrackedFrameOffset::handle_event() MotionCVTrackingFile::MotionCVTrackingFile(MotionCVMain *plugin, const char *filename, MotionCVWindow *gui, int x, int y) - : BC_TextBox(x, y, 250, 1, filename) + : BC_TextBox(x, y, xS(250), 1, filename) { this->plugin = plugin; this->gui = gui; @@ -413,7 +415,7 @@ int MotionCVBlockY::handle_event() MotionCVBlockXText::MotionCVBlockXText(MotionCVMain *plugin, MotionCVWindow *gui, int x, int y) - : BC_TextBox(x, y, 75, 1, (float)plugin->config.block_x) + : BC_TextBox(x, y, xS(75), 1, (float)plugin->config.block_x) { this->plugin = plugin; this->gui = gui; @@ -430,7 +432,7 @@ int MotionCVBlockXText::handle_event() MotionCVBlockYText::MotionCVBlockYText(MotionCVMain *plugin, MotionCVWindow *gui, int x, int y) - : BC_TextBox(x, y, 75, 1, (float)plugin->config.block_y) + : BC_TextBox(x, y, xS(75), 1, (float)plugin->config.block_y) { this->plugin = plugin; this->gui = gui; @@ -483,7 +485,7 @@ int TrackSingleFrame::handle_event() TrackFrameNumber::TrackFrameNumber(MotionCVMain *plugin, MotionCVWindow *gui, int x, int y) - : BC_TextBox(x, y, 100, 1, plugin->config.track_frame) + : BC_TextBox(x, y, xS(100), 1, plugin->config.track_frame) { this->plugin = plugin; this->gui = gui; @@ -576,7 +578,7 @@ int MasterLayer::calculate_w(MotionCVWindow *gui) int result = 0; result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(0))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(1))); - return result + 50; + return result + xS(80); } Mode1::Mode1(MotionCVMain *plugin, MotionCVWindow *gui, int x, int y) @@ -632,7 +634,7 @@ int Mode1::calculate_w(MotionCVWindow *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionCVConfig::STABILIZE))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionCVConfig::STABILIZE_PIXEL))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionCVConfig::NOTHING))); - return result + 50; + return result + xS(80); } Mode2::Mode2(MotionCVMain *plugin, MotionCVWindow *gui, int x, int y) @@ -684,7 +686,7 @@ int Mode2::calculate_w(MotionCVWindow *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionCVConfig::RECALCULATE))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionCVConfig::SAVE))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionCVConfig::LOAD))); - return result + 50; + return result + xS(80); } Mode3::Mode3(MotionCVMain *plugin, MotionCVWindow *gui, int x, int y) @@ -732,7 +734,7 @@ int Mode3::calculate_w(MotionCVWindow *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(1, 0))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(0, 1))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(0, 0))); - return result + 50; + return result + xS(80); } diff --git a/cinelerra-5.1/plugins/motion-hv/motionwindow-hv.C b/cinelerra-5.1/plugins/motion-hv/motionwindow-hv.C index d61080b9..39560e66 100644 --- a/cinelerra-5.1/plugins/motion-hv/motionwindow-hv.C +++ b/cinelerra-5.1/plugins/motion-hv/motionwindow-hv.C @@ -36,7 +36,7 @@ MotionHVWindow::MotionHVWindow(MotionHVMain *plugin) - : PluginClientWindow(plugin, 600, 650, 600, 650, 0) + : PluginClientWindow(plugin, xS(600), yS(650), xS(600), yS(650), 0) { this->plugin = plugin; } @@ -47,8 +47,10 @@ MotionHVWindow::~MotionHVWindow() void MotionHVWindow::create_objects() { - int x1 = 10, x = 10, y = 10; - int x2 = 310; + int xs10 = xS(10), xs20 = xS(20), xs310 = xS(310); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(40), ys50 = yS(50); + int x1 = xs10, x = xs10, y = ys10; + int x2 = xs310; BC_Title *title; @@ -62,17 +64,17 @@ void MotionHVWindow::create_objects() this, x2, y)); - y += 50; + y += ys50; add_subwindow(title = new BC_Title(x1, y, _("Translation search radius:\n(W/H Percent of image)"))); add_subwindow(global_range_w = new GlobalRange(plugin, - x1 + title->get_w() + 10, + x1 + title->get_w() + xs10, y, &plugin->config.global_range_w)); add_subwindow(global_range_h = new GlobalRange(plugin, - x1 + title->get_w() + 10 + global_range_w->get_w(), + x1 + title->get_w() + xs10 + global_range_w->get_w(), y, &plugin->config.global_range_h)); @@ -80,19 +82,19 @@ void MotionHVWindow::create_objects() y, _("Rotation search radius:\n(Degrees)"))); add_subwindow(rotation_range = new RotationRange(plugin, - x2 + title->get_w() + 10, + x2 + title->get_w() + xs10, y)); - y += 50; + y += ys50; add_subwindow(title = new BC_Title(x1, y, _("Translation block size:\n(W/H Percent of image)"))); add_subwindow(global_block_w = new BlockSize(plugin, - x1 + title->get_w() + 10, + x1 + title->get_w() + xs10, y, &plugin->config.global_block_w)); add_subwindow(global_block_h = new BlockSize(plugin, - x1 + title->get_w() + 10 + global_block_w->get_w(), + x1 + title->get_w() + xs10 + global_block_w->get_w(), y, &plugin->config.global_block_h)); @@ -100,148 +102,148 @@ void MotionHVWindow::create_objects() // y, // _("Rotation block size:\n(W/H Percent of image)"))); // add_subwindow(rotation_block_w = new BlockSize(plugin, -// x2 + title->get_w() + 10, +// x2 + title->get_w() + xs10, // y, // &plugin->config.rotation_block_w)); // add_subwindow(rotation_block_h = new BlockSize(plugin, -// x2 + title->get_w() + 10 + rotation_block_w->get_w(), +// x2 + title->get_w() + xs10 + rotation_block_w->get_w(), // y, // &plugin->config.rotation_block_h)); -// y += 50; +// y += ys50; // add_subwindow(title = new BC_Title(x1, y, _("Translation search steps:"))); // add_subwindow(global_search_positions = new GlobalSearchPositions(plugin, -// x1 + title->get_w() + 10, +// x1 + title->get_w() + xs10, // y, -// 80)); +// xs80)); // global_search_positions->create_objects(); // // add_subwindow(title = new BC_Title(x2, y, _("Rotation search steps:"))); // add_subwindow(rotation_search_positions = new RotationSearchPositions(plugin, -// x2 + title->get_w() + 10, +// x2 + title->get_w() + xs10, // y, -// 80)); +// xs80)); // rotation_search_positions->create_objects(); - y += 50; + y += ys50; add_subwindow(title = new BC_Title(x, y, _("Translation direction:"))); add_subwindow(track_direction = new TrackDirection(plugin, this, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); track_direction->create_objects(); - y += 40; - add_subwindow(title = new BC_Title(x, y + 10, _("Block X:"))); + y += ys40; + add_subwindow(title = new BC_Title(x, y + ys10, _("Block X:"))); add_subwindow(block_x = new MotionHVBlockX(plugin, this, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); add_subwindow(block_x_text = new MotionHVBlockXText(plugin, this, - x + title->get_w() + 10 + block_x->get_w() + 10, - y + 10)); + x + title->get_w() + xs10 + block_x->get_w() + xs10, + y + ys10)); add_subwindow(title = new BC_Title(x2, y, _("Rotation center:"))); add_subwindow(rotation_center = new RotationCenter(plugin, - x2 + title->get_w() + 10, + x2 + title->get_w() + xs10, y)); int y1 = y; - y += 50; - add_subwindow(title = new BC_Title(x2, y + 10, _("Maximum angle offset:"))); + y += ys50; + add_subwindow(title = new BC_Title(x2, y + ys10, _("Maximum angle offset:"))); add_subwindow(rotate_magnitude = new MotionHVRMagnitude(plugin, - x2 + title->get_w() + 10, + x2 + title->get_w() + xs10, y)); - y += 40; - add_subwindow(title = new BC_Title(x2, y + 10, _("Rotation settling speed:"))); + y += ys40; + add_subwindow(title = new BC_Title(x2, y + ys10, _("Rotation settling speed:"))); add_subwindow(rotate_return_speed = new MotionHVRReturnSpeed(plugin, - x2 + title->get_w() + 10, + x2 + title->get_w() + xs10, y)); y = y1; - y += 40; - add_subwindow(title = new BC_Title(x, y + 10, _("Block Y:"))); + y += ys40; + add_subwindow(title = new BC_Title(x, y + ys10, _("Block Y:"))); add_subwindow(block_y = new MotionHVBlockY(plugin, this, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); add_subwindow(block_y_text = new MotionHVBlockYText(plugin, this, - x + title->get_w() + 10 + block_y->get_w() + 10, - y + 10)); + x + title->get_w() + xs10 + block_y->get_w() + xs10, + y + ys10)); - y += 50; - add_subwindow(title = new BC_Title(x, y + 10, _("Maximum absolute offset:"))); + y += ys50; + add_subwindow(title = new BC_Title(x, y + ys10, _("Maximum absolute offset:"))); add_subwindow(magnitude = new MotionHVMagnitude(plugin, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); - y += 40; - add_subwindow(title = new BC_Title(x, y + 10, _("MotionHV settling speed:"))); + y += ys40; + add_subwindow(title = new BC_Title(x, y + ys10, _("MotionHV settling speed:"))); add_subwindow(return_speed = new MotionHVReturnSpeed(plugin, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); - y += 40; + y += ys40; add_subwindow(vectors = new MotionHVDrawVectors(plugin, this, x, y)); - y += 40; + y += ys40; add_subwindow(track_single = new TrackSingleFrame(plugin, this, x, y)); - add_subwindow(title = new BC_Title(x + track_single->get_w() + 20, + add_subwindow(title = new BC_Title(x + track_single->get_w() + xs20, y, _("Frame number:"))); add_subwindow(track_frame_number = new TrackFrameNumber(plugin, this, - x + track_single->get_w() + title->get_w() + 20, + x + track_single->get_w() + title->get_w() + xs20, y)); if(plugin->config.tracking_object != MotionHVScan::TRACK_SINGLE) track_frame_number->disable(); - y += 20; + y += ys20; add_subwindow(track_previous = new TrackPreviousFrame(plugin, this, x, y)); - y += 20; + y += ys20; add_subwindow(previous_same = new PreviousFrameSameBlock(plugin, this, x, y)); - y += 40; + y += ys40; y1 = y; add_subwindow(title = new BC_Title(x, y, _("Master layer:"))); add_subwindow(master_layer = new MasterLayer(plugin, this, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); master_layer->create_objects(); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Action:"))); add_subwindow(action_type = new ActionType(plugin, this, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); action_type->create_objects(); - y += 30; + y += ys30; @@ -249,7 +251,7 @@ void MotionHVWindow::create_objects() add_subwindow(title = new BC_Title(x, y, _("Calculation:"))); add_subwindow(tracking_type = new TrackingType(plugin, this, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); tracking_type->create_objects(); @@ -656,10 +658,7 @@ MotionHVBlockXText::MotionHVBlockXText(MotionHVMain *plugin, MotionHVWindow *gui, int x, int y) - : BC_TextBox(x, - y, - 75, - 1, + : BC_TextBox(x, y, xS(75), 1, (float)plugin->config.block_x) { this->plugin = plugin; @@ -682,10 +681,7 @@ MotionHVBlockYText::MotionHVBlockYText(MotionHVMain *plugin, MotionHVWindow *gui, int x, int y) - : BC_TextBox(x, - y, - 75, - 1, + : BC_TextBox(x, y, xS(75), 1, (float)plugin->config.block_y) { this->plugin = plugin; @@ -777,7 +773,7 @@ TrackFrameNumber::TrackFrameNumber(MotionHVMain *plugin, MotionHVWindow *gui, int x, int y) - : BC_TextBox(x, y, 100, 1, plugin->config.track_frame) + : BC_TextBox(x, y, xS(100), 1, plugin->config.track_frame) { this->plugin = plugin; this->gui = gui; @@ -893,7 +889,7 @@ int MasterLayer::calculate_w(MotionHVWindow *gui) int result = 0; result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(0))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(1))); - return result + 50; + return result + xS(50); } @@ -965,7 +961,7 @@ int ActionType::calculate_w(MotionHVWindow *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionHVScan::STABILIZE))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionHVScan::STABILIZE_PIXEL))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionHVScan::NOTHING))); - return result + 50; + return result + xS(50); } @@ -1029,7 +1025,7 @@ int TrackingType::calculate_w(MotionHVWindow *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionHVScan::CALCULATE))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionHVScan::SAVE))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionHVScan::LOAD))); - return result + 50; + return result + xS(50); } @@ -1086,6 +1082,6 @@ int TrackDirection::calculate_w(MotionHVWindow *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(1, 0))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(0, 1))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(0, 0))); - return result + 50; + return result + xS(50); } diff --git a/cinelerra-5.1/plugins/motion/motionwindow.C b/cinelerra-5.1/plugins/motion/motionwindow.C index b8930e20..e799aee6 100644 --- a/cinelerra-5.1/plugins/motion/motionwindow.C +++ b/cinelerra-5.1/plugins/motion/motionwindow.C @@ -32,7 +32,7 @@ #include "pluginserver.h" MotionWindow::MotionWindow(MotionMain *plugin) - : PluginClientWindow(plugin, 800, 640, 800, 640, 0) + : PluginClientWindow(plugin, xS(800), yS(640), xS(800), yS(640), 0) { this->plugin = plugin; } @@ -43,36 +43,38 @@ MotionWindow::~MotionWindow() void MotionWindow::create_objects() { - int x = 10, y = 10; + int xs5 = xS(5), xs10 = xS(10), xs20 = xS(20), xs50 = xS(50), xs120 = xS(120); + int ys10 = yS(10), ys20 = yS(20), ys50 = yS(50), ys30 = yS(30), ys40 = yS(40), ys60 = yS(60); + int x = xs10, y = ys10; int x1 = x, x2 = get_w() / 2; BC_Title *title; add_subwindow(global = new MotionGlobal(plugin, this, x1, y)); add_subwindow(rotate = new MotionRotate(plugin, this, x2, y)); - y += 50; + y += ys50; add_subwindow(title = new BC_Title(x1, y, _("Translation search radius:\n(W/H Percent of image)"))); add_subwindow(global_range_w = new GlobalRange(plugin, - x1 + title->get_w() + 10, y, + x1 + title->get_w() + xs10, y, &plugin->config.global_range_w)); add_subwindow(global_range_h = new GlobalRange(plugin, - x1 + title->get_w() + 10 + global_range_w->get_w(), y, + x1 + title->get_w() + xs10 + global_range_w->get_w(), y, &plugin->config.global_range_h)); add_subwindow(title = new BC_Title(x2, y, _("Rotation search radius:\n(Degrees)"))); add_subwindow(rotation_range = new RotationRange(plugin, - x2 + title->get_w() + 10, y)); + x2 + title->get_w() + xs10, y)); - y += 50; + y += ys50; add_subwindow(title = new BC_Title(x1, y, _("Translation block size:\n(W/H Percent of image)"))); add_subwindow(global_block_w = - new BlockSize(plugin, x1 + title->get_w() + 10, y, + new BlockSize(plugin, x1 + title->get_w() + xs10, y, &plugin->config.global_block_w)); add_subwindow(global_block_h = - new BlockSize(plugin, x1 + title->get_w() + 10 + + new BlockSize(plugin, x1 + title->get_w() + xs10 + global_block_w->get_w(), y, &plugin->config.global_block_h)); @@ -80,93 +82,93 @@ void MotionWindow::create_objects() // y, // _("Rotation block size:\n(W/H Percent of image)"))); // add_subwindow(rotation_block_w = new BlockSize(plugin, -// x2 + title->get_w() + 10, +// x2 + title->get_w() + xs10, // y, // &plugin->config.rotation_block_w)); // add_subwindow(rotation_block_h = new BlockSize(plugin, -// x2 + title->get_w() + 10 + rotation_block_w->get_w(), +// x2 + title->get_w() + xs10 + rotation_block_w->get_w(), // y, // &plugin->config.rotation_block_h)); - y += 50; + y += ys50; add_subwindow(title = new BC_Title(x1, y, _("Translation search steps:"))); add_subwindow(global_search_positions = - new GlobalSearchPositions(plugin, x1 + title->get_w() + 10, y, 80)); + new GlobalSearchPositions(plugin, x1 + title->get_w() + xs10, y, xs120)); global_search_positions->create_objects(); add_subwindow(title = new BC_Title(x2, y, _("Rotation search steps:"))); add_subwindow(rotation_search_positions = - new RotationSearchPositions(plugin, x2 + title->get_w() + 10, y, 80)); + new RotationSearchPositions(plugin, x2 + title->get_w() + xs10, y, xs120)); rotation_search_positions->create_objects(); - y += 50; + y += ys50; add_subwindow(title = new BC_Title(x, y, _("Translation direction:"))); add_subwindow(track_direction = new TrackDirection(plugin, this, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); track_direction->create_objects(); - y += 40; + y += ys40; add_subwindow(title = new BC_Title(x2, y, _("Tracking file:"))); add_subwindow(tracking_file = new MotionTrackingFile(plugin, - plugin->config.tracking_file, this, x2+title->get_w() + 20, y)); + plugin->config.tracking_file, this, x2+title->get_w() + xs20, y)); int y1 = y; - add_subwindow(title = new BC_Title(x, y + 10, _("Block X:"))); + add_subwindow(title = new BC_Title(x, y + ys10, _("Block X:"))); add_subwindow(block_x = - new MotionBlockX(plugin, this, x + title->get_w() + 10, y)); + new MotionBlockX(plugin, this, x + title->get_w() + xs10, y)); add_subwindow(block_x_text = new MotionBlockXText(plugin, this, - x + title->get_w() + 10 + block_x->get_w() + 10, y + 10)); + x + title->get_w() + xs10 + block_x->get_w() + xs10, y + ys10)); - y += 40; + y += ys40; add_subwindow(title = new BC_Title(x2, y, _("Rotation center:"))); add_subwindow(rotation_center = - new RotationCenter(plugin, x2 + title->get_w() + 10, y)); + new RotationCenter(plugin, x2 + title->get_w() + xs10, y)); - y += 40; - add_subwindow(title = new BC_Title(x2, y + 10, _("Maximum angle offset:"))); + y += ys40; + add_subwindow(title = new BC_Title(x2, y + ys10, _("Maximum angle offset:"))); add_subwindow(rotate_magnitude = - new MotionRMagnitude(plugin, x2 + title->get_w() + 10, y)); + new MotionRMagnitude(plugin, x2 + title->get_w() + xs10, y)); - y += 40; - add_subwindow(title = new BC_Title(x2, y + 10, _("Rotation settling speed:"))); + y += ys40; + add_subwindow(title = new BC_Title(x2, y + ys10, _("Rotation settling speed:"))); add_subwindow(rotate_return_speed = - new MotionRReturnSpeed(plugin, x2 + title->get_w() + 10, y)); - y += 40; + new MotionRReturnSpeed(plugin, x2 + title->get_w() + xs10, y)); + y += ys40; add_subwindow(vectors = new MotionDrawVectors(plugin, this, x2, y)); - y = y1 + 60; - add_subwindow(title = new BC_Title(x, y + 10, _("Block Y:"))); + y = y1 + ys60; + add_subwindow(title = new BC_Title(x, y + ys10, _("Block Y:"))); add_subwindow(block_y = - new MotionBlockY(plugin, this, x + title->get_w() + 10, y)); + new MotionBlockY(plugin, this, x + title->get_w() + xs10, y)); add_subwindow(block_y_text = new MotionBlockYText(plugin, this, - x + title->get_w() + 10 + block_y->get_w() + 10, y + 10)); + x + title->get_w() + xs10 + block_y->get_w() + xs10, y + ys10)); - y += 50; - add_subwindow(title = new BC_Title(x, y + 10, _("Maximum absolute offset:"))); + y += ys50; + add_subwindow(title = new BC_Title(x, y + ys10, _("Maximum absolute offset:"))); add_subwindow(magnitude = new MotionMagnitude(plugin, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); - y += 40; - add_subwindow(title = new BC_Title(x, y + 10, _("Motion settling speed:"))); + y += ys40; + add_subwindow(title = new BC_Title(x, y + ys10, _("Motion settling speed:"))); add_subwindow(return_speed = - new MotionReturnSpeed(plugin, x + title->get_w() + 10, y)); + new MotionReturnSpeed(plugin, x + title->get_w() + xs10, y)); - y += 40; + y += ys40; add_subwindow(track_single = new TrackSingleFrame(plugin, this, x, y)); - y += 20; + y += ys20; add_subwindow(track_previous = new TrackPreviousFrame(plugin, this, x, y)); - y += 20; + y += ys20; add_subwindow(previous_same = new PreviousFrameSameBlock(plugin, this, x, y)); - y += 40; + y += ys40; x1 = x; y1 = y; add_subwindow(title = new BC_Title(x1=x2, y1, _("Frame number:"))); @@ -178,7 +180,7 @@ void MotionWindow::create_objects() add_subwindow(addtrackedframeoffset = new AddTrackedFrameOffset(plugin, this, x1=x2, y1+=track_frame_number->get_h())); int pef = client->server->mwindow->edl->session->video_every_frame; - add_subwindow(pef_title = new BC_Title(x1=x2+50, y1+=addtrackedframeoffset->get_h() + 5, + add_subwindow(pef_title = new BC_Title(x1=x2+xs50, y1+=addtrackedframeoffset->get_h() + xs5, !pef ? _("For best results\n" " Set: Play every frame\n" " Preferences-> Playback-> Video Out") : @@ -187,19 +189,19 @@ void MotionWindow::create_objects() add_subwindow(title = new BC_Title(x, y, _("Master layer:"))); add_subwindow(master_layer = new MasterLayer(plugin, - this, x + title->get_w() + 10, y)); + this, x + title->get_w() + xs10, y)); master_layer->create_objects(); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Action:"))); add_subwindow(action_type = new ActionType(plugin, - this, x + title->get_w() + 10, y)); + this, x + title->get_w() + xs10, y)); action_type->create_objects(); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Calculation:"))); add_subwindow(tracking_type = new TrackingType(plugin, - this, x + title->get_w() + 10, y)); + this, x + title->get_w() + xs10, y)); tracking_type->create_objects(); show_window(1); @@ -222,7 +224,7 @@ void MotionWindow::update_mode() MotionTrackingFile::MotionTrackingFile(MotionMain *plugin, const char *filename, MotionWindow *gui, int x, int y) - : BC_TextBox(x, y, 150, 1, filename) + : BC_TextBox(x, y, xS(150), 1, filename) { this->plugin = plugin; this->gui = gui; @@ -522,7 +524,7 @@ int MotionBlockY::handle_event() MotionBlockXText::MotionBlockXText(MotionMain *plugin, MotionWindow *gui, int x, int y) - : BC_TextBox(x, y, 75, 1, (float)plugin->config.block_x) + : BC_TextBox(x, y, xS(75), 1, (float)plugin->config.block_x) { this->plugin = plugin; this->gui = gui; @@ -542,7 +544,7 @@ int MotionBlockXText::handle_event() MotionBlockYText::MotionBlockYText(MotionMain *plugin, MotionWindow *gui, int x, int y) - : BC_TextBox(x, y, 75, 1, (float)plugin->config.block_y) + : BC_TextBox(x, y, xS(75), 1, (float)plugin->config.block_y) { this->plugin = plugin; this->gui = gui; @@ -604,7 +606,7 @@ TrackFrameNumber::TrackFrameNumber(MotionMain *plugin, MotionWindow *gui, int x, int y) - : BC_TextBox(x, y, 100, 1, plugin->config.track_frame) + : BC_TextBox(x, y, xS(100), 1, plugin->config.track_frame) { this->plugin = plugin; this->gui = gui; @@ -703,7 +705,7 @@ int MasterLayer::calculate_w(MotionWindow *gui) int result = 0; result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(0))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(1))); - return result + 50; + return result + xS(80); } @@ -769,7 +771,7 @@ int ActionType::calculate_w(MotionWindow *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionScan::STABILIZE))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionScan::STABILIZE_PIXEL))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionScan::NOTHING))); - return result + 50; + return result + xS(80); } @@ -826,7 +828,7 @@ int TrackingType::calculate_w(MotionWindow *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionScan::CALCULATE))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionScan::SAVE))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionScan::LOAD))); - return result + 50; + return result + xS(80); } @@ -875,6 +877,6 @@ int TrackDirection::calculate_w(MotionWindow *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(1, 0))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(0, 1))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(0, 0))); - return result + 50; + return result + xS(80); } diff --git a/cinelerra-5.1/plugins/motion2point/motionwindow.C b/cinelerra-5.1/plugins/motion2point/motionwindow.C index 8b330724..069da37f 100644 --- a/cinelerra-5.1/plugins/motion2point/motionwindow.C +++ b/cinelerra-5.1/plugins/motion2point/motionwindow.C @@ -37,7 +37,7 @@ MotionWindow::MotionWindow(MotionMain2 *plugin) - : PluginClientWindow(plugin, 680, 660, 680, 660, 0) + : PluginClientWindow(plugin, xS(680), yS(660), xS(680), yS(660), 0) { this->plugin = plugin; } @@ -48,8 +48,10 @@ MotionWindow::~MotionWindow() void MotionWindow::create_objects() { + int xs10 = xS(10), xs20 = xS(20), xs120 = xS(120); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(40), ys50 = yS(50); int x1[] = { 10, get_w()/2 }; - int x = 10, y = 10, y1 = 10; + int x = xs10, y = ys10, y1 = ys10; BC_Title *title; @@ -67,88 +69,88 @@ void MotionWindow::create_objects() y, &plugin->config.global[i], global_title[i])); - y += 50; + y += yS(50); add_subwindow(title = new BC_Title(x1[i], y, _("Translation search radius:\n(W/H Percent of image)"))); add_subwindow(global_range_w[i] = new MotionPot(plugin, - x1[i] + title->get_w() + 10, + x1[i] + title->get_w() + xs10, y, &plugin->config.global_range_w[i], MIN_RADIUS, MAX_RADIUS)); add_subwindow(global_range_h[i] = new MotionPot(plugin, - x1[i] + title->get_w() + 10 + global_range_w[i]->get_w(), + x1[i] + title->get_w() + xs10 + global_range_w[i]->get_w(), y, &plugin->config.global_range_h[i], MIN_RADIUS, MAX_RADIUS)); - y += 50; + y += ys50; add_subwindow(title = new BC_Title(x1[i], y, _("Translation search offset:\n(X/Y Percent of image)"))); add_subwindow(global_origin_x[i] = new MotionPot(plugin, - x1[i] + title->get_w() + 10, + x1[i] + title->get_w() + xs10, y, &plugin->config.global_origin_x[i], MIN_ORIGIN, MAX_ORIGIN)); add_subwindow(global_origin_y[i] = new MotionPot(plugin, - x1[i] + title->get_w() + 10 + global_origin_x[i]->get_w(), + x1[i] + title->get_w() + xs10 + global_origin_x[i]->get_w(), y, &plugin->config.global_origin_y[i], MIN_ORIGIN, MAX_ORIGIN)); - y += 50; + y += ys50; add_subwindow(title = new BC_Title(x1[i], y, _("Translation block size:\n(W/H Percent of image)"))); add_subwindow(global_block_w[i] = new MotionPot(plugin, - x1[i] + title->get_w() + 10, + x1[i] + title->get_w() + xs10, y, &plugin->config.global_block_w[i], MIN_BLOCK, MAX_BLOCK)); add_subwindow(global_block_h[i] = new MotionPot(plugin, - x1[i] + title->get_w() + 10 + global_block_w[i]->get_w(), + x1[i] + title->get_w() + xs10 + global_block_w[i]->get_w(), y, &plugin->config.global_block_h[i], MIN_BLOCK, MAX_BLOCK)); - y += 40; - add_subwindow(title = new BC_Title(x1[i], y + 10, _("Block X:"))); + y += ys40; + add_subwindow(title = new BC_Title(x1[i], y + ys10, _("Block X:"))); add_subwindow(block_x[i] = new MotionBlockX(plugin, this, - x1[i] + title->get_w() + 10, + x1[i] + title->get_w() + xs10, y, i)); add_subwindow(block_x_text[i] = new MotionBlockXText(plugin, this, - x1[i] + title->get_w() + 10 + block_x[i]->get_w() + 10, - y + 10, + x1[i] + title->get_w() + xs10 + block_x[i]->get_w() + xs10, + y + ys10, i)); - y += 40; - add_subwindow(title = new BC_Title(x1[i], y + 10, _("Block Y:"))); + y += ys40; + add_subwindow(title = new BC_Title(x1[i], y + ys10, _("Block Y:"))); add_subwindow(block_y[i] = new MotionBlockY(plugin, this, - x1[i] + title->get_w() + 10, + x1[i] + title->get_w() + xs10, y, i)); add_subwindow(block_y_text[i] = new MotionBlockYText(plugin, this, - x1[i] + title->get_w() + 10 + block_y[i]->get_w() + 10, - y + 10, + x1[i] + title->get_w() + xs10 + block_y[i]->get_w() + xs10, + y + ys10, i)); - y += 40; + y += ys40; add_subwindow(vectors[i] = new MotionDrawVectors(plugin, this, x1[i], @@ -157,82 +159,80 @@ void MotionWindow::create_objects() } - y += 30; + y += ys30; add_subwindow(new BC_Bar(x, y, get_w() - x * 2)); - y += 10; + y += ys10; add_subwindow(title = new BC_Title(x, y, _("Search steps:"))); add_subwindow(global_search_positions = new GlobalSearchPositions(plugin, - x + title->get_w() + 10, - y, - 80)); + x + title->get_w() + xs10, y, xs120)); global_search_positions->create_objects(); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Search directions:"))); add_subwindow(tracking_direction = new TrackingDirection(plugin, this, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); tracking_direction->create_objects(); - y += 30; - add_subwindow(title = new BC_Title(x, y + 10, _("Maximum absolute offset:"))); + y += ys30; + add_subwindow(title = new BC_Title(x, y + ys10, _("Maximum absolute offset:"))); add_subwindow(magnitude = new MotionMagnitude(plugin, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); - y += 40; - add_subwindow(title = new BC_Title(x, y + 10, _("Settling speed:"))); + y += ys40; + add_subwindow(title = new BC_Title(x, y + ys10, _("Settling speed:"))); add_subwindow(return_speed = new MotionReturnSpeed(plugin, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); - y += 40; + y += ys40; add_subwindow(track_single = new TrackSingleFrame(plugin, this, x, y)); - add_subwindow(title = new BC_Title(x + track_single->get_w() + 20, + add_subwindow(title = new BC_Title(x + track_single->get_w() + xs20, y, _("Frame number:"))); add_subwindow(track_frame_number = new TrackFrameNumber(plugin, this, - x + track_single->get_w() + title->get_w() + 20, + x + track_single->get_w() + title->get_w() + xs20, y)); if(plugin->config.tracking_object != MotionScan::TRACK_SINGLE) track_frame_number->disable(); - y += 20; + y += ys20; add_subwindow(track_previous = new TrackPreviousFrame(plugin, this, x, y)); - y += 20; + y += ys20; add_subwindow(previous_same = new PreviousFrameSameBlock(plugin, this, x, y)); - y += 40; + y += ys40; y1 = y; add_subwindow(title = new BC_Title(x, y, _("Master layer:"))); add_subwindow(master_layer = new MasterLayer(plugin, this, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); master_layer->create_objects(); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Action:"))); add_subwindow(action = new Action(plugin, this, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); action->create_objects(); - y += 30; + y += ys30; @@ -240,7 +240,7 @@ void MotionWindow::create_objects() add_subwindow(title = new BC_Title(x, y, _("Calculation:"))); add_subwindow(calculation = new Calculation(plugin, this, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); calculation->create_objects(); @@ -486,10 +486,7 @@ MotionBlockXText::MotionBlockXText(MotionMain2 *plugin, int x, int y, int number) - : BC_TextBox(x, - y, - 75, - 1, + : BC_TextBox(x, y, xS(75), 1, (float)plugin->config.block_x[number]) { this->plugin = plugin; @@ -514,10 +511,7 @@ MotionBlockYText::MotionBlockYText(MotionMain2 *plugin, int x, int y, int number) - : BC_TextBox(x, - y, - 75, - 1, + : BC_TextBox(x, y, xS(75), 1, (float)plugin->config.block_y[number]) { this->plugin = plugin; @@ -612,7 +606,7 @@ TrackFrameNumber::TrackFrameNumber(MotionMain2 *plugin, MotionWindow *gui, int x, int y) - : BC_TextBox(x, y, 100, 1, plugin->config.track_frame) + : BC_TextBox(x, y, xS(100), 1, plugin->config.track_frame) { this->plugin = plugin; this->gui = gui; @@ -728,7 +722,7 @@ int MasterLayer::calculate_w(MotionWindow *gui) int result = 0; result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(0))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(1))); - return result + 50; + return result + xS(80); } @@ -807,7 +801,7 @@ int Action::calculate_w(MotionWindow *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionScan::STABILIZE))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionScan::STABILIZE_PIXEL))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionScan::NOTHING))); - return result + 50; + return result + xS(80); } @@ -877,7 +871,7 @@ int Calculation::calculate_w(MotionWindow *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionScan::CALCULATE))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionScan::SAVE))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(MotionScan::LOAD))); - return result + 50; + return result + xS(80); } @@ -934,6 +928,6 @@ int TrackingDirection::calculate_w(MotionWindow *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(1, 0))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(0, 1))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(0, 0))); - return result + 50; + return result + xS(80); } diff --git a/cinelerra-5.1/plugins/motion51/motionwindow51.C b/cinelerra-5.1/plugins/motion51/motionwindow51.C index 96bb6821..c84305bf 100644 --- a/cinelerra-5.1/plugins/motion51/motionwindow51.C +++ b/cinelerra-5.1/plugins/motion51/motionwindow51.C @@ -32,7 +32,7 @@ #include "pluginserver.h" Motion51Window::Motion51Window(Motion51Main *plugin) - : PluginClientWindow(plugin, 600, 400, 600, 400, 0) + : PluginClientWindow(plugin, xS(600), yS(400), xS(600), yS(400), 0) { this->plugin = plugin; } @@ -43,62 +43,64 @@ Motion51Window::~Motion51Window() void Motion51Window::create_objects() { - int x = 10, y = 20; + int xs10 = xS(10), xs30 = xS(30), xs120 = xS(120); + int ys5 = yS(5), ys10 = yS(10), ys20 = yS(20); + int x = xs10, y = ys20, xs72 = xS(72); int x0 = x, x1 = get_w()/2; - add_subwindow(sample_steps = new Motion51SampleSteps(plugin, x0=x, y, 120)); - BC_Title *title = new BC_Title(x0+=sample_steps->get_w()+10, y, _("Samples")); + add_subwindow(sample_steps = new Motion51SampleSteps(plugin, x0=x, y, xs120)); + BC_Title *title = new BC_Title(x0+=sample_steps->get_w()+xs10, y, _("Samples")); add_subwindow(title); sample_steps->create_objects(); sample_r = new Motion51Limits(plugin, this, x1,y, _("Sample Radius%"), - &plugin->config.sample_r, 0.f,100.f, 72); + &plugin->config.sample_r, 0.f,100.f, xs72); sample_r->create_objects(); - y += sample_r->get_h() + 20; + y += sample_r->get_h() + ys20; block_x = new Motion51Limits(plugin, this, x0=x,y, _("Center X%"), - &plugin->config.block_x, 0.f, 100.f, 72); + &plugin->config.block_x, 0.f, 100.f, xs72); block_x->create_objects(); block_y = new Motion51Limits(plugin, this, x1,y, _("Center Y%"), - &plugin->config.block_y, 0.f, 100.f, 72); + &plugin->config.block_y, 0.f, 100.f, xs72); block_y->create_objects(); - y += block_x->get_h() + 10; + y += block_x->get_h() + ys10; block_w = new Motion51Limits(plugin, this, x0,y, _("Search W%"), - &plugin->config.block_w, 0.f,100.f, 72); + &plugin->config.block_w, 0.f,100.f, xs72); block_w->create_objects(); block_h = new Motion51Limits(plugin, this, x1,y, _("Search H%"), - &plugin->config.block_h, 0.f,100.f, 72); + &plugin->config.block_h, 0.f,100.f, xs72); block_h->create_objects(); - y += block_w->get_h() + 10; + y += block_w->get_h() + ys10; horiz_limit = new Motion51Limits(plugin, this, x0=x,y, _("Horiz shake limit%"), - &plugin->config.horiz_limit, 0.f, 75.f, 72); + &plugin->config.horiz_limit, 0.f, 75.f, xs72); horiz_limit->create_objects(); shake_fade = new Motion51Limits(plugin, this, x1,y, _("Shake fade%"), - &plugin->config.shake_fade, 0.f, 75.f, 72); + &plugin->config.shake_fade, 0.f, 75.f, xs72); shake_fade->create_objects(); - y += horiz_limit->get_h() + 10; + y += horiz_limit->get_h() + ys10; vert_limit = new Motion51Limits(plugin, this, x0,y, _("Vert shake limit%"), - &plugin->config.vert_limit, 0.f, 75.f, 72); + &plugin->config.vert_limit, 0.f, 75.f, xs72); vert_limit->create_objects(); - y += vert_limit->get_h() + 10; + y += vert_limit->get_h() + ys10; twist_limit = new Motion51Limits(plugin, this, x0,y, _("Twist limit%"), - &plugin->config.twist_limit, 0.f, 75.f, 72); + &plugin->config.twist_limit, 0.f, 75.f, xs72); twist_limit->create_objects(); twist_fade = new Motion51Limits(plugin, this, x1,y, _("Twist fade%"), - &plugin->config.twist_fade, 0.f, 75.f, 72); + &plugin->config.twist_fade, 0.f, 75.f, xs72); twist_fade->create_objects(); - y += twist_fade->get_h() + 20; + y += twist_fade->get_h() + ys20; add_subwindow(draw_vectors = new Motion51DrawVectors(plugin, this, x, y)); add_subwindow(title = new BC_Title(x1, y, _("Tracking file:"))); - y += draw_vectors->get_h() + 5; + y += draw_vectors->get_h() + ys5; add_subwindow(enable_tracking = new Motion51EnableTracking(plugin, this, x, y)); add_subwindow(tracking_file = new Motion51TrackingFile(plugin, - plugin->config.tracking_file, this, x1, y, get_w()-30-x1)); - y += enable_tracking->get_h() + 20; + plugin->config.tracking_file, this, x1, y, get_w()-xs30-x1)); + y += enable_tracking->get_h() + ys20; add_subwindow(reset_config = new Motion51ResetConfig(plugin, this, x0=x, y)); add_subwindow(reset_tracking = new Motion51ResetTracking(plugin, this, x1, y)); - y += reset_config->get_h()+20; + y += reset_config->get_h()+ys20; int pef = client->server->mwindow->edl->session->video_every_frame; add_subwindow(pef_title = new BC_Title(x, y, @@ -154,7 +156,7 @@ Motion51Limits::~Motion51Limits() void Motion51Limits::create_objects() { BC_TumbleTextBox::create_objects(); - int tx = BC_TumbleTextBox::get_x() + BC_TumbleTextBox::get_w() + 5; + int tx = BC_TumbleTextBox::get_x() + BC_TumbleTextBox::get_w() + xS(5); int ty = BC_TumbleTextBox::get_y(); gui->add_subwindow(title = new BC_Title(tx,ty,ttext)); } diff --git a/cinelerra-5.1/plugins/motionblur/motionblur.C b/cinelerra-5.1/plugins/motionblur/motionblur.C index aac86d25..ee86e2b2 100644 --- a/cinelerra-5.1/plugins/motionblur/motionblur.C +++ b/cinelerra-5.1/plugins/motionblur/motionblur.C @@ -231,10 +231,10 @@ void MotionBlurConfig::interpolate(MotionBlurConfig &prev, MotionBlurWindow::MotionBlurWindow(MotionBlurMain *plugin) : PluginClientWindow(plugin, - 260, - 120, - 260, - 120, + xS(260), + yS(120), + xS(260), + yS(120), 0) { this->plugin = plugin; @@ -246,14 +246,16 @@ MotionBlurWindow::~MotionBlurWindow() void MotionBlurWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30); + int x = xs10, y = ys10; add_subwindow(new BC_Title(x, y, _("Length:"))); - y += 20; + y += ys20; add_subwindow(radius = new MotionBlurSize(plugin, x, y, &plugin->config.radius, 0, 100)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Steps:"))); - y += 20; + y += ys20; add_subwindow(steps = new MotionBlurSize(plugin, x, y, &plugin->config.steps, 1, 100)); show_window(); @@ -270,7 +272,7 @@ MotionBlurSize::MotionBlurSize(MotionBlurMain *plugin, int *output, int min, int max) - : BC_ISlider(x, y, 0, 240, 240, min, max, *output) + : BC_ISlider(x, y, 0, xS(240), yS(240), min, max, *output) { this->plugin = plugin; this->output = output; diff --git a/cinelerra-5.1/plugins/moveobj/moveobjwindow.C b/cinelerra-5.1/plugins/moveobj/moveobjwindow.C index aac65d69..c85b94b2 100644 --- a/cinelerra-5.1/plugins/moveobj/moveobjwindow.C +++ b/cinelerra-5.1/plugins/moveobj/moveobjwindow.C @@ -26,7 +26,7 @@ #include "theme.h" MoveObjWindow::MoveObjWindow(MoveObj *plugin) - : PluginClientWindow(plugin, 320, 240, 320, 240, 0) + : PluginClientWindow(plugin, xS(320), yS(240), xS(320), yS(240), 0) { this->plugin = plugin; } @@ -37,7 +37,7 @@ MoveObjWindow::~MoveObjWindow() void MoveObjWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); int margin = plugin->get_theme()->widget_border; BC_Title *title; diff --git a/cinelerra-5.1/plugins/nbodycuda/nbodywindow.C b/cinelerra-5.1/plugins/nbodycuda/nbodywindow.C index c5c7766e..d5c2e9f9 100644 --- a/cinelerra-5.1/plugins/nbodycuda/nbodywindow.C +++ b/cinelerra-5.1/plugins/nbodycuda/nbodywindow.C @@ -38,7 +38,7 @@ static const char *display_modes[] = { static const int num_display_modes = sizeof(display_modes)/sizeof(*display_modes); N_BodyWindow::N_BodyWindow(N_BodyMain *plugin) - : PluginClientWindow(plugin, 240, 200, 240, 200, 0) + : PluginClientWindow(plugin, xS(240), yS(200), xS(240), yS(200), 0) { this->plugin = plugin; press_x = press_y = 0; @@ -52,8 +52,8 @@ N_BodyWindow::~N_BodyWindow() void N_BodyWindow::create_objects() { - int x = 10, y = 10, pad = 5; - int x1 = 100; + int x = xS(10), y = yS(10), pad = xS(5); + int x1 = xS(100); BC_Title *title; add_subwindow(title = new BC_Title(x,y, _("NBody"), MEDIUMFONT, YELLOW)); y += title->get_h() + 2*pad; @@ -192,7 +192,7 @@ int N_BodyDrag::handle_event() } N_BodySetMode::N_BodySetMode(N_BodyWindow *gui, int x, int y, const char *text) - : BC_PopupTextBox(gui, 0, text, x, y, 100, 160) + : BC_PopupTextBox(gui, 0, text, x, y, xS(100), yS(160)) { this->gui = gui; } @@ -215,7 +215,7 @@ int N_BodySetMode::handle_event() N_BodySetDemo::N_BodySetDemo(N_BodyWindow *gui, int x, int y, const char *text) - : BC_PopupTextBox(gui, 0, text, x, y, 100, 160) + : BC_PopupTextBox(gui, 0, text, x, y, xS(100), yS(160)) { this->gui = gui; } @@ -240,7 +240,7 @@ int N_BodySetDemo::handle_event() } N_BodyNumBodies::N_BodyNumBodies(N_BodyWindow *gui, int x, int y, const char *text) - : BC_PopupTextBox(gui, 0, text, x, y, 100, 160) + : BC_PopupTextBox(gui, 0, text, x, y, xS(100), yS(160)) { this->gui = gui; } diff --git a/cinelerra-5.1/plugins/normalize/normalizewindow.C b/cinelerra-5.1/plugins/normalize/normalizewindow.C index 2bdb20ca..463ca610 100644 --- a/cinelerra-5.1/plugins/normalize/normalizewindow.C +++ b/cinelerra-5.1/plugins/normalize/normalizewindow.C @@ -24,16 +24,8 @@ #include "normalizewindow.h" NormalizeWindow::NormalizeWindow(int x, int y) - : BC_Window(_(PROGRAM_NAME ": Normalize"), - x - 160, - y - 75, - 320, - 150, - 320, - 150, - 0, - 0, - 1) + : BC_Window(_(PROGRAM_NAME ": Normalize"), x - xS(160), y - yS(75), + xS(320), yS(150), xS(320), yS(150), 0, 0, 1) { } @@ -43,15 +35,17 @@ NormalizeWindow::~NormalizeWindow() void NormalizeWindow::create_objects(float *db_over, int *separate_tracks) { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30); + int x = xs10, y = ys10; this->db_over = db_over; this->separate_tracks = separate_tracks; lock_window("NormalizeWindow::create_objects"); add_subwindow(new BC_Title(x, y, _("Enter the DB to overload by:"))); - y += 20; + y += ys20; add_subwindow(new NormalizeWindowOverload(x, y, this->db_over)); - y += 30; + y += ys30; add_subwindow(new NormalizeWindowSeparate(x, y, this->separate_tracks)); add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); @@ -66,7 +60,7 @@ int NormalizeWindow::close_event() } NormalizeWindowOverload::NormalizeWindowOverload(int x, int y, float *db_over) - : BC_TextBox(x, y, 200, 1, *db_over) + : BC_TextBox(x, y, xS(200), 1, *db_over) { this->db_over = db_over; } diff --git a/cinelerra-5.1/plugins/oilpainting/oil.C b/cinelerra-5.1/plugins/oilpainting/oil.C index 30d71577..0e2c039d 100644 --- a/cinelerra-5.1/plugins/oilpainting/oil.C +++ b/cinelerra-5.1/plugins/oilpainting/oil.C @@ -226,8 +226,8 @@ OilRadius::OilRadius(OilEffect *plugin, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (float)0, (float)30, plugin->config.radius) @@ -283,10 +283,10 @@ int OilReset::handle_event() OilWindow::OilWindow(OilEffect *plugin) : PluginClientWindow(plugin, - 300, - 120, - 300, - 120, + xS(300), + yS(120), + xS(300), + yS(120), 0) { this->plugin = plugin; @@ -298,12 +298,14 @@ OilWindow::~OilWindow() void OilWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs70 = xS(70); + int ys10 = yS(10), ys40 = yS(40); + int x = xs10, y = ys10; add_subwindow(new BC_Title(x, y, _("Radius:"))); - add_subwindow(radius = new OilRadius(plugin, x + 70, y)); - y += 40; + add_subwindow(radius = new OilRadius(plugin, x + xs70, y)); + y += ys40; add_subwindow(intensity = new OilIntensity(plugin, x, y)); - y += 40; + y += ys40; add_subwindow(reset = new OilReset(plugin, this, x, y)); show_window(); diff --git a/cinelerra-5.1/plugins/oilpainting/oilwindow.C b/cinelerra-5.1/plugins/oilpainting/oilwindow.C index dc64774c..99eb8ef3 100644 --- a/cinelerra-5.1/plugins/oilpainting/oilwindow.C +++ b/cinelerra-5.1/plugins/oilpainting/oilwindow.C @@ -59,14 +59,16 @@ OilWindow::~OilWindow() int OilWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs50 = xS(50); + int ys10 = yS(10), ys20 = yS(20), ys50 = yS(50); + int x = xs10, y = ys10; add_tool(new BC_Title(x, y, _("Oil Painting"))); - y += 20; + y += ys20; add_tool(radius = new OilRadius(client, x, y)); - x += 50; + x += xs50; add_tool(new BC_Title(x, y, _("Radius"))); - y += 50; - x = 10; + y += ys50; + x = xs10; add_tool(use_intensity = new OilIntensity(client, x, y)); } diff --git a/cinelerra-5.1/plugins/overlay/overlay.C b/cinelerra-5.1/plugins/overlay/overlay.C index a77898f3..8bc8db56 100644 --- a/cinelerra-5.1/plugins/overlay/overlay.C +++ b/cinelerra-5.1/plugins/overlay/overlay.C @@ -184,10 +184,10 @@ const char* OverlayConfig::output_to_text(int output_layer) OverlayWindow::OverlayWindow(Overlay *plugin) : PluginClientWindow(plugin, - 300, - 160, - 300, - 160, + xS(300), + yS(160), + xS(300), + yS(160), 0) { this->plugin = plugin; @@ -199,26 +199,28 @@ OverlayWindow::~OverlayWindow() void OverlayWindow::create_objects() { - int x = 10, y = 10; + int xs5 = xS(5), xs10 = xS(10); + int ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Mode:"))); add_subwindow(mode = new OverlayMode(plugin, - x + title->get_w() + 5, + x + title->get_w() + xs5, y)); mode->create_objects(); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Layer order:"))); add_subwindow(direction = new OverlayDirection(plugin, - x + title->get_w() + 5, + x + title->get_w() + xs5, y)); direction->create_objects(); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Output layer:"))); add_subwindow(output = new OverlayOutput(plugin, - x + title->get_w() + 5, + x + title->get_w() + xs5, y)); output->create_objects(); @@ -233,7 +235,7 @@ void OverlayWindow::create_objects() OverlayMode::OverlayMode(Overlay *plugin, int x, int y) - : BC_PopupMenu(x, y, 150, + : BC_PopupMenu(x, y, xS(150), OverlayConfig::mode_to_text(plugin->config.mode), 1) { this->plugin = plugin; @@ -266,9 +268,7 @@ int OverlayMode::handle_event() OverlayDirection::OverlayDirection(Overlay *plugin, int x, int y) - : BC_PopupMenu(x, - y, - 150, + : BC_PopupMenu(x, y, xS(150), OverlayConfig::direction_to_text(plugin->config.direction), 1) { @@ -307,9 +307,7 @@ int OverlayDirection::handle_event() OverlayOutput::OverlayOutput(Overlay *plugin, int x, int y) - : BC_PopupMenu(x, - y, - 100, + : BC_PopupMenu(x, y, xS(100), OverlayConfig::output_to_text(plugin->config.output_layer), 1) { diff --git a/cinelerra-5.1/plugins/overlayaudio/overlayaudio.C b/cinelerra-5.1/plugins/overlayaudio/overlayaudio.C index ca9d31ec..975b3b31 100644 --- a/cinelerra-5.1/plugins/overlayaudio/overlayaudio.C +++ b/cinelerra-5.1/plugins/overlayaudio/overlayaudio.C @@ -185,10 +185,10 @@ const char* OverlayAudioConfig::mode_to_text(int mode) OverlayAudioWindow::OverlayAudioWindow(OverlayAudio *plugin) : PluginClientWindow(plugin, - 400, - 100, - 400, - 100, + xS(400), + yS(100), + xS(400), + yS(100), 0) { this->plugin = plugin; @@ -196,7 +196,7 @@ OverlayAudioWindow::OverlayAudioWindow(OverlayAudio *plugin) void OverlayAudioWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); int x1 = x; BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Output track:"))); @@ -221,9 +221,7 @@ void OverlayAudioWindow::create_objects() OutputTrack::OutputTrack(OverlayAudio *plugin, int x , int y) - : BC_PopupMenu(x, - y, - 100, + : BC_PopupMenu(x, y, xS(100), OverlayAudioConfig::output_to_text(plugin->config.output_track), 1) { @@ -269,12 +267,8 @@ int OutputTrack::handle_event() -OverlayMode::OverlayMode(OverlayAudio *plugin, - int x, - int y) - : BC_PopupMenu(x, - y, - 150, +OverlayMode::OverlayMode(OverlayAudio *plugin, int x, int y) + : BC_PopupMenu(x, y, xS(150), OverlayAudioConfig::mode_to_text(plugin->config.mode), 1) { diff --git a/cinelerra-5.1/plugins/parametric/parametric.C b/cinelerra-5.1/plugins/parametric/parametric.C index f1e42e5c..ddc85229 100644 --- a/cinelerra-5.1/plugins/parametric/parametric.C +++ b/cinelerra-5.1/plugins/parametric/parametric.C @@ -231,7 +231,7 @@ int ParametricMagnitude::handle_event() ParametricMode::ParametricMode(ParametricEQ *plugin, int x, int y, int band) : BC_PopupMenu(x, y, - 150, + xS(150), mode_to_text(plugin->config.band[band].mode)) { //printf("ParametricMode::ParametricMode %d %d\n", band, plugin->config.band[band].mode); @@ -311,10 +311,10 @@ ParametricBandGUI::~ParametricBandGUI() } -#define X1 10 -#define X2 60 -#define X3 110 -#define X4 160 +#define X1 xS(10) +#define X2 xS(60) +#define X3 xS(110) +#define X4 xS(160) void ParametricBandGUI::create_objects() @@ -360,7 +360,7 @@ int ParametricWetness::handle_event() ParametricSize::ParametricSize(ParametricWindow *window, ParametricEQ *plugin, int x, int y) - : BC_PopupMenu(x, y, 100, "4096", 1) + : BC_PopupMenu(x, y, xS(100), "4096", 1) { this->plugin = plugin; this->window = window; @@ -401,10 +401,10 @@ void ParametricSize::update(int size) ParametricWindow::ParametricWindow(ParametricEQ *plugin) : PluginClientWindow(plugin, - 350, - 400, - 350, - 400, + xS(350), + yS(400), + xS(350), + yS(400), 0) { this->plugin = plugin; @@ -418,7 +418,7 @@ ParametricWindow::~ParametricWindow() void ParametricWindow::create_objects() { - int y = 35; + int y = yS(35); SET_TRACE add_subwindow(new BC_Title(X1, 10, _("Freq"))); @@ -427,37 +427,37 @@ SET_TRACE add_subwindow(new BC_Title(X4, 10, _("Mode"))); for(int i = 0; i < BANDS; i++) { - bands[i] = new ParametricBandGUI(plugin, this, 10, y, i); + bands[i] = new ParametricBandGUI(plugin, this, xS(10), y, i); bands[i]->create_objects(); - y += 50; + y += yS(50); } SET_TRACE BC_Title *title; int x = plugin->get_theme()->widget_border; - add_subwindow(title = new BC_Title(x, y + 10, _("Wetness:"))); + add_subwindow(title = new BC_Title(x, y + yS(10), _("Wetness:"))); x += title->get_w() + plugin->get_theme()->widget_border; add_subwindow(wetness = new ParametricWetness(plugin, x, y)); x += wetness->get_w() + plugin->get_theme()->widget_border; - add_subwindow(title = new BC_Title(x, y + 10, _("Window:"))); + add_subwindow(title = new BC_Title(x, y + yS(10), _("Window:"))); x += title->get_w() + plugin->get_theme()->widget_border; add_subwindow(size = new ParametricSize(this, plugin, x, - y + 10)); + y + yS(10))); size->create_objects(); size->update(plugin->config.window_size); - y += 50; - int canvas_x = 30; + y += yS(50); + int canvas_x = xS(30); int canvas_y = y; - int canvas_w = get_w() - canvas_x - 10; - int canvas_h = get_h() - canvas_y - 30; + int canvas_w = get_w() - canvas_x - xS(10); + int canvas_h = get_h() - canvas_y - yS(30); add_subwindow(canvas = new BC_SubWindow(canvas_x, canvas_y, canvas_w, @@ -472,10 +472,10 @@ SET_TRACE for(int i = 0; i <= MAJOR_DIVISIONS; i++) { int y1 = canvas_y + canvas_h - i * (canvas_h / MAJOR_DIVISIONS) - 2; - int y2 = y1 + 3; - int x1 = canvas_x - 25; - int x2 = canvas_x - 10; - int x3 = canvas_x - 2; + int y2 = y1 + yS(3); + int x1 = canvas_x - xS(25); + int x2 = canvas_x - xS(10); + int x3 = canvas_x - xS(2); char string[BCTEXTLEN]; if(i == 0) @@ -495,7 +495,7 @@ SET_TRACE for(int j = 1; j < MINOR_DIVISIONS; j++) { int y3 = y1 - j * (canvas_h / MAJOR_DIVISIONS) / MINOR_DIVISIONS; - int x4 = x3 - 5; + int x4 = x3 - xS(5); set_color(BLACK); draw_line(x4 + 1, y3 + 1, x3 + 1, y3 + 1); set_color(RED); @@ -511,12 +511,12 @@ SET_TRACE { int freq = Freq::tofreq(i * TOTALFREQS / MAJOR_DIVISIONS); int x1 = canvas_x + i * canvas_w / MAJOR_DIVISIONS; - int y1 = canvas_y + canvas_h + 20; + int y1 = canvas_y + canvas_h + yS(20); char string[BCTEXTLEN]; sprintf(string, "%d", freq); int x2 = x1 - get_text_width(SMALLFONT, string); - int y2 = y1 - 10; - int y3 = y2 - 5; + int y2 = y1 - yS(10); + int y3 = y2 - yS(5); int y4 = canvas_y + canvas_h; set_color(BLACK); @@ -537,7 +537,7 @@ SET_TRACE exp(-(double)j * 0.7) * (canvas_w / MAJOR_DIVISIONS)); set_color(BLACK); - draw_line(x3 + 1, y4 + 1, x3 + 1, y3 + 1); + draw_line(x3+1, y4+1, x3+1, y3+1); set_color(RED); draw_line(x3, y4, x3, y3); } diff --git a/cinelerra-5.1/plugins/perspective/perspective.C b/cinelerra-5.1/plugins/perspective/perspective.C index fc391597..c98e9b06 100644 --- a/cinelerra-5.1/plugins/perspective/perspective.C +++ b/cinelerra-5.1/plugins/perspective/perspective.C @@ -24,8 +24,8 @@ #include "language.h" #include "perspective.h" -#define PERSPECTIVE_WIDTH 400 -#define PERSPECTIVE_HEIGHT 600 +#define PERSPECTIVE_WIDTH xS(400) +#define PERSPECTIVE_HEIGHT yS(600) REGISTER_PLUGIN(PerspectiveMain) @@ -33,9 +33,9 @@ REGISTER_PLUGIN(PerspectiveMain) PerspectiveConfig::PerspectiveConfig() { x1 = 0; y1 = 0; - x2 = 100; y2 = 0; - x3 = 100; y3 = 100; - x4 = 0; y4 = 100; + x2 = xS(100); y2 = 0; + x3 = xS(100); y3 = yS(100); + x4 = 0; y4 = yS(100); mode = AffineEngine::PERSPECTIVE; smoothing = AffineEngine::AF_DEFAULT; window_w = PERSPECTIVE_WIDTH; @@ -120,63 +120,65 @@ PerspectiveWindow::~PerspectiveWindow() void PerspectiveWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs20 = xS(20), xs80 = xS(80), xs100 = xS(100), xs120 = xS(120); + int ys5 = yS(5), ys10 = yS(10), ys30 = yS(30), ys40 = yS(40); + int x = xs10, y = ys10; add_subwindow(canvas = new PerspectiveCanvas(this, - x, y, get_w() - 20, get_h() - 290)); + x, y, get_w() - xs20, get_h() - yS(290))); canvas->set_cursor(CROSS_CURSOR, 0, 0); - y += canvas->get_h() + 10; + y += canvas->get_h() + ys10; add_subwindow(new BC_Title(x, y, _("Current X:"))); - x += 80; + x += xs80; this->x = new PerspectiveCoord(this, x, y, plugin->get_current_x(), 1); this->x->create_objects(); - x += 140; + x += xS(140); add_subwindow(new BC_Title(x, y, _("Y:"))); - x += 20; + x += xs20; this->y = new PerspectiveCoord(this, x, y, plugin->get_current_y(), 0); this->y->create_objects(); - x = 10; y += 30; + x = xs10; y += ys30; add_subwindow(mode_perspective = new PerspectiveMode(this, x, y, AffineEngine::PERSPECTIVE, _("Perspective"))); - x += 120; + x += xs120; add_subwindow(mode_sheer = new PerspectiveMode(this, x, y, AffineEngine::SHEER, _("Sheer"))); - x += 100; + x += xs100; add_subwindow(affine = new PerspectiveAffine(this, x, y)); affine->create_objects(); - x = 10; y += 30; + x = xs10; y += ys30; add_subwindow(mode_stretch = new PerspectiveMode(this, x, y, AffineEngine::STRETCH, _("Stretch"))); - x += 120; + x += xs120; add_subwindow(new PerspectiveReset(this, x, y)); update_canvas(); - x = 10; y += 30; + x = xs10; y += ys30; BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Zoom view:"))); - int x1 = x + title->get_w() + 10, w1 = get_w() - x1 - 10; + int x1 = x + title->get_w() + xs10, w1 = get_w() - x1 - xs10; add_subwindow(zoom_view = new PerspectiveZoomView(this, x1, y, w1)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Perspective direction:"))); - x += 170; + x += xS(170); add_subwindow(forward = new PerspectiveDirection(this, x, y, 1, _("Forward"))); - x += 100; + x += xs100; add_subwindow(reverse = new PerspectiveDirection(this, x, y, 0, _("Reverse"))); - x = 10; y += 40; + x = xs10; y += ys40; add_subwindow(title = new BC_Title(x, y, _("Alt/Shift:"))); - add_subwindow(new BC_Title(x+100, y, _("Button1 Action:"))); - y += title->get_h() + 5; + add_subwindow(new BC_Title(x+xs100, y, _("Button1 Action:"))); + y += title->get_h() + ys5; add_subwindow(new BC_Title(x, y, " 0 / 0\n" " 0 / 1\n" " 1 / 0\n" " 1 / 1")); - add_subwindow(new BC_Title(x+100, y, + add_subwindow(new BC_Title(x+xs100, y, _("Translate endpoint\n" "Zoom image\n" "Translate image\n" @@ -515,10 +517,11 @@ int PerspectiveCanvas::cursor_motion_event() PerspectiveCoord::PerspectiveCoord(PerspectiveWindow *gui, int x, int y, float value, int is_x) - : BC_TumbleTextBox(gui, value, (float)-100, (float)200, x, y, 100) + : BC_TumbleTextBox(gui, value, -100.f, 200.f, x, y, xS(70)) { this->gui = gui; this->is_x = is_x; + set_precision(2); } int PerspectiveCoord::handle_event() @@ -598,7 +601,7 @@ int PerspectiveAffineItem::handle_event() } PerspectiveAffine::PerspectiveAffine(PerspectiveWindow *gui, int x, int y) - : BC_PopupMenu(x, y, 100, "", 1) + : BC_PopupMenu(x, y, xS(100), "", 1) { this->gui = gui; affine_modes[AffineEngine::AF_DEFAULT] = _("default"); diff --git a/cinelerra-5.1/plugins/photoscale/photoscale.C b/cinelerra-5.1/plugins/photoscale/photoscale.C index 59b3ff02..55f515f2 100644 --- a/cinelerra-5.1/plugins/photoscale/photoscale.C +++ b/cinelerra-5.1/plugins/photoscale/photoscale.C @@ -39,10 +39,10 @@ PhotoScaleWindow::PhotoScaleWindow(PhotoScaleMain *plugin) : PluginClientWindow(plugin, - 250, - 200, - 250, - 200, + xS(250), + yS(200), + xS(250), + yS(200), 0) { this->plugin = plugin; @@ -54,7 +54,7 @@ PhotoScaleWindow::~PhotoScaleWindow() void PhotoScaleWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); BC_Title *title; int x2 = x + BC_Title::calculate_w(this, _("Height:")) + plugin->get_theme()->widget_border; @@ -69,7 +69,7 @@ void PhotoScaleWindow::create_objects() this, x2, y, - 100, + xS(100), &(plugin->config.width))); y += output_size[0]->get_h() + plugin->get_theme()->widget_border; @@ -79,7 +79,7 @@ void PhotoScaleWindow::create_objects() this, x2, y, - 100, + xS(100), &(plugin->config.height))); FrameSizePulldown *pulldown; @@ -231,8 +231,8 @@ int PhotoScaleSwapExtents::handle_event() PhotoScaleConfig::PhotoScaleConfig() { - width = 640; - height = 480; + width = xS(640); + height = yS(480); use_file = 1; } diff --git a/cinelerra-5.1/plugins/piano/piano.C b/cinelerra-5.1/plugins/piano/piano.C index d996be05..5ea1b09b 100644 --- a/cinelerra-5.1/plugins/piano/piano.C +++ b/cinelerra-5.1/plugins/piano/piano.C @@ -464,8 +464,8 @@ void PianoThread::run() { BC_DisplayInfo info; window = new PianoWindow(synth, - info.get_abs_cursor_x() - 125, - info.get_abs_cursor_y() - 115); + info.get_abs_cursor_x() - xS(125), + info.get_abs_cursor_y() - yS(115)); window->create_objects(); int result = window->run_window(); completion.unlock(); @@ -484,16 +484,8 @@ void PianoThread::run() PianoWindow::PianoWindow(Piano *synth, int x, int y) - : BC_Window(synth->gui_string, - x, - y, - 380, - synth->h, - 380, - 10, - 1, - 0, - 1) + : BC_Window(synth->gui_string, x, y, xS(380), synth->h, + xS(380), yS(10), 1, 0, 1) { this->synth = synth; } @@ -530,59 +522,61 @@ int PianoWindow::create_objects() harmonicmenu->add_item(new PianoFreqOdd(synth)); harmonicmenu->add_item(new PianoFreqPrime(synth)); - int x = 10, y = 30, i; + int xs10 = xS(10), xs240 = xS(240); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys35 = yS(35); + int x = xs10, y = ys30, i; add_subwindow(new BC_Title(x, y, _("Waveform"))); - x += 240; + x += xs240; add_subwindow(new BC_Title(x, y, _("Wave Function"))); - y += 20; - x = 10; - add_subwindow(canvas = new PianoCanvas(synth, this, x, y, 230, 160)); + y += ys20; + x = xs10; + add_subwindow(canvas = new PianoCanvas(synth, this, x, y, xS(230), yS(160))); canvas->update(); - x += 240; + x += xS(240); char string[BCTEXTLEN]; waveform_to_text(string, synth->config.wavefunction); add_subwindow(waveform = new PianoWaveForm(synth, x, y, string)); waveform->create_objects(); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Base Frequency:"))); - y += 30; + y += ys30; add_subwindow(base_freq = new PianoBaseFreq(synth, x, y)); - x += 80; - add_subwindow(freqpot = new PianoFreqPot(synth, this, x, y - 10)); + x += xs80; + add_subwindow(freqpot = new PianoFreqPot(synth, this, x, y - ys10)); base_freq->freq_pot = freqpot; freqpot->freq_text = base_freq; - x -= 80; - y += 40; + x -= xs80; + y += ys40; add_subwindow(new BC_Title(x, y, _("Wetness:"))); - add_subwindow(wetness = new PianoWetness(synth, x + 70, y - 10)); + add_subwindow(wetness = new PianoWetness(synth, x + xs70, y - ys10)); - y += 40; + y += ys40; add_subwindow(new PianoClear(synth, x, y)); - x = 50; - y = 220; + x = xs50; + y = yS(220); add_subwindow(new BC_Title(x, y, _("Level"))); - x += 75; + x += xs75; add_subwindow(new BC_Title(x, y, _("Phase"))); - x += 75; + x += xs75; add_subwindow(new BC_Title(x, y, _("Harmonic"))); - y += 20; x = 10; - add_subwindow(subwindow = new PianoSubWindow(synth, x, y, 265, get_h() - y)); - x += 265; + y += ys20; x = xs10; + add_subwindow(subwindow = new PianoSubWindow(synth, x, y, xS(265), get_h() - y)); + x += xS(265); add_subwindow(scroll = new PianoScroll(synth, this, x, y, get_h() - y)); - x += 20; + x += xs20; add_subwindow(new PianoAddOsc(synth, this, x, y)); - y += 30; + y += ys30; add_subwindow(new PianoDelOsc(synth, this, x, y)); update_scrollbar(); @@ -662,7 +656,7 @@ void PianoWindow::update_oscillators() { gui = oscillators.values[i]; - gui->title->reposition_window(gui->title->get_x(), y + 15); + gui->title->reposition_window(gui->title->get_x(), y + yS(15)); gui->level->reposition_window(gui->level->get_x(), y); gui->level->update(config->level); @@ -723,7 +717,7 @@ int PianoOscGUI::create_objects(int y) { char text[BCTEXTLEN]; sprintf(text, "%d:", number + 1); - window->subwindow->add_subwindow(title = new BC_Title(10, y + 15, text)); + window->subwindow->add_subwindow(title = new BC_Title(xs10, y + ys15, text)); window->subwindow->add_subwindow(level = new PianoOscGUILevel(window->synth, this, y)); window->subwindow->add_subwindow(phase = new PianoOscGUIPhase(window->synth, this, y)); @@ -735,7 +729,7 @@ int PianoOscGUI::create_objects(int y) PianoOscGUILevel::PianoOscGUILevel(Piano *synth, PianoOscGUI *gui, int y) - : BC_FPot(50, + : BC_FPot(xS(50), y, synth->config.oscillator_config.values[gui->number]->level, INFINITYGAIN, @@ -761,11 +755,11 @@ int PianoOscGUILevel::handle_event() PianoOscGUIPhase::PianoOscGUIPhase(Piano *synth, PianoOscGUI *gui, int y) - : BC_IPot(125, + : BC_IPot(xS(125), y, (int64_t)(synth->config.oscillator_config.values[gui->number]->phase * 360), 0, - 360) + xS(360)) { this->synth = synth; this->gui = gui; @@ -787,11 +781,11 @@ int PianoOscGUIPhase::handle_event() PianoOscGUIFreq::PianoOscGUIFreq(Piano *synth, PianoOscGUI *gui, int y) - : BC_IPot(200, + : BC_IPot(xS(200), y, (int64_t)(synth->config.oscillator_config.values[gui->number]->freq_factor), - 1, - 100) + yS(1), + xS(100)) { this->synth = synth; this->gui = gui; @@ -930,7 +924,7 @@ int PianoClear::handle_event() PianoWaveForm::PianoWaveForm(Piano *synth, int x, int y, char *text) - : BC_PopupMenu(x, y, 120, text) + : BC_PopupMenu(x, y, xS(120), text) { this->synth = synth; } @@ -1012,7 +1006,7 @@ int PianoFreqPot::handle_event() PianoBaseFreq::PianoBaseFreq(Piano *synth, int x, int y) - : BC_TextBox(x, y, 70, 1, (int)synth->config.base_freq) + : BC_TextBox(x, y, xS(70), 1, (int)synth->config.base_freq) { this->synth = synth; } diff --git a/cinelerra-5.1/plugins/pitch/pitch.C b/cinelerra-5.1/plugins/pitch/pitch.C index 673c33c1..b858ea28 100644 --- a/cinelerra-5.1/plugins/pitch/pitch.C +++ b/cinelerra-5.1/plugins/pitch/pitch.C @@ -401,10 +401,10 @@ void PitchConfig::interpolate(PitchConfig &prev, PitchWindow::PitchWindow(PitchEffect *plugin) : PluginClientWindow(plugin, - 150, - 100, - 150, - 100, + xS(150), + yS(100), + xS(150), + yS(100), 0) { this->plugin = plugin; @@ -412,7 +412,7 @@ PitchWindow::PitchWindow(PitchEffect *plugin) void PitchWindow::create_objects() { - int x1 = 10, x = 10, y = 10; + int x1 = xS(10), x = xS(10), y = yS(10); BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Scale:"))); @@ -465,7 +465,7 @@ int PitchScale::handle_event() PitchSize::PitchSize(PitchWindow *window, PitchEffect *plugin, int x, int y) - : BC_PopupMenu(x, y, 100, "4096", 1) + : BC_PopupMenu(x, y, xS(100), "4096", 1) { this->plugin = plugin; } diff --git a/cinelerra-5.1/plugins/polar/polar.C b/cinelerra-5.1/plugins/polar/polar.C index ffdc0ae5..417afc71 100644 --- a/cinelerra-5.1/plugins/polar/polar.C +++ b/cinelerra-5.1/plugins/polar/polar.C @@ -235,10 +235,10 @@ void PolarConfig::interpolate(PolarConfig &prev, PolarWindow::PolarWindow(PolarEffect *plugin) : PluginClientWindow(plugin, - 330, - 122, - 330, - 122, + xS(330), + yS(122), + xS(330), + yS(122), 0) { this->plugin = plugin; @@ -246,19 +246,21 @@ PolarWindow::PolarWindow(PolarEffect *plugin) void PolarWindow::create_objects() { - int x = 10, y = 10, x1 = x + 50; - int x2 = 0; int clrBtn_w = 50; + int xs10 = xS(10), xs50 = xS(50); + int ys10 = yS(10), ys40 = yS(40); + int x = xs10, y = ys10, x1 = x + xs50; + int x2 = 0; int clrBtn_w = xs50; add_subwindow(new BC_Title(x, y, _("Depth:"))); add_subwindow(depth = new PolarDepth(plugin, x1, y)); - x2 = x1 + depth->get_w() + 10; + x2 = x1 + depth->get_w() + xs10; add_subwindow(depthClr = new PolarSliderClr(plugin, this, x2, y, clrBtn_w, RESET_DEPTH)); - y += 40; + y += ys40; add_subwindow(new BC_Title(x, y, _("Angle:"))); add_subwindow(angle = new PolarAngle(plugin, x1, y)); add_subwindow(angleClr = new PolarSliderClr(plugin, this, x2, y, clrBtn_w, RESET_ANGLE)); - y += 40; + y += ys40; add_subwindow(reset = new PolarReset(plugin, this, x, y)); show_window(); @@ -289,8 +291,8 @@ PolarDepth::PolarDepth(PolarEffect *plugin, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (float)1, (float)100, plugin->config.depth) @@ -312,8 +314,8 @@ PolarAngle::PolarAngle(PolarEffect *plugin, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (float)1, (float)360, plugin->config.angle) diff --git a/cinelerra-5.1/plugins/polar/polarwindow.C b/cinelerra-5.1/plugins/polar/polarwindow.C index bf777450..46b4d287 100644 --- a/cinelerra-5.1/plugins/polar/polarwindow.C +++ b/cinelerra-5.1/plugins/polar/polarwindow.C @@ -55,15 +55,17 @@ PolarWindow::~PolarWindow() int PolarWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs80 = xS(80), xs190 = xS(190), xs200 = xS(200); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys35 = yS(35); + int x = xs10, y = ys10; add_tool(new BC_Title(x, y, _("Depth"))); - add_tool(automation[0] = new AutomatedFn(client, this, x + 80, y, 0)); - y += 20; + add_tool(automation[0] = new AutomatedFn(client, this, x + xs80, y, 0)); + y += ys20; add_tool(depth_slider = new DepthSlider(client, x, y)); - y += 35; + y += ys35; add_tool(new BC_Title(x, y, _("Angle"))); - add_tool(automation[1] = new AutomatedFn(client, this, x + 80, y, 1)); - y += 20; + add_tool(automation[1] = new AutomatedFn(client, this, x + xs80, y, xS(1))); + y += ys20; add_tool(angle_slider = new AngleSlider(client, x, y)); } @@ -76,7 +78,7 @@ int PolarWindow::close_event() } DepthSlider::DepthSlider(PolarMain *client, int x, int y) - : BC_ISlider(x, y, 190, 30, 200, client->depth, 0, MAXDEPTH, DKGREY, BLACK, 1) + : BC_ISlider(x, y, xs190, ys30, xs200, client->depth, 0, MAXDEPTH, DKGREY, BLACK, 1) { this->client = client; } @@ -91,7 +93,7 @@ int DepthSlider::handle_event() } AngleSlider::AngleSlider(PolarMain *client, int x, int y) - : BC_ISlider(x, y, 190, 30, 200, client->angle, 0, MAXANGLE, DKGREY, BLACK, 1) + : BC_ISlider(x, y, xs190, ys30, xs200, client->angle, 0, MAXANGLE, DKGREY, BLACK, 1) { this->client = client; } @@ -106,7 +108,7 @@ int AngleSlider::handle_event() } AutomatedFn::AutomatedFn(PolarMain *client, PolarWindow *window, int x, int y, int number) - : BC_CheckBox(x, y, 16, 16, client->automated_function == number, _("Automate")) + : BC_CheckBox(x, y, xS(16), yS(16), client->automated_function == number, _("Automate")) { this->client = client; this->window = window; diff --git a/cinelerra-5.1/plugins/puzzleobj/puzzleobjwindow.C b/cinelerra-5.1/plugins/puzzleobj/puzzleobjwindow.C index da3d1470..18573fdb 100644 --- a/cinelerra-5.1/plugins/puzzleobj/puzzleobjwindow.C +++ b/cinelerra-5.1/plugins/puzzleobj/puzzleobjwindow.C @@ -26,7 +26,7 @@ #include "theme.h" PuzzleObjWindow::PuzzleObjWindow(PuzzleObj *plugin) - : PluginClientWindow(plugin, 320, 100, 320, 100, 0) + : PluginClientWindow(plugin, xS(320), yS(100), xS(320), yS(100), 0) { this->plugin = plugin; pixels = 0; @@ -41,18 +41,20 @@ PuzzleObjWindow::~PuzzleObjWindow() void PuzzleObjWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs50 = xS(50), xs80 = xS(80), xs180 = xS(180); + int ys10 = yS(10); + int x = xs10, y = ys10; BC_Title *title = new BC_Title(x, y, _("PuzzleObj")); add_subwindow(title); - y += title->get_h() + 10; - int x1 = x + 80; + y += title->get_h() + ys10; + int x1 = x + xs80; add_subwindow(pixels_title = new BC_Title(x,y,_("Pixels:"))); add_subwindow(pixels = new PuzzleObjISlider(this, - x1,y,180, 1,1000, &plugin->config.pixels)); - y += pixels->get_h() + 10; + x1,y,xs180, 1,1000, &plugin->config.pixels)); + y += pixels->get_h() + ys10; add_subwindow(iterations_title = new BC_Title(x,y,_("Iterations:"))); add_subwindow(iterations = new PuzzleObjISlider(this, - x1,y,180, 0,50, &plugin->config.iterations)); + x1,y,xs180, 0,50, &plugin->config.iterations)); show_window(1); } diff --git a/cinelerra-5.1/plugins/radialblur/radialblur.C b/cinelerra-5.1/plugins/radialblur/radialblur.C index 5b80b0b8..8f25f176 100644 --- a/cinelerra-5.1/plugins/radialblur/radialblur.C +++ b/cinelerra-5.1/plugins/radialblur/radialblur.C @@ -38,8 +38,8 @@ void RadialBlurConfig::reset(int clear) { switch(clear) { case RESET_ALL : - x = 50; - y = 50; + x = xS(50); + y = yS(50); angle = 0; steps = 1; r = 1; @@ -47,9 +47,9 @@ void RadialBlurConfig::reset(int clear) b = 1; a = 1; break; - case RESET_XSLIDER : x = 50; + case RESET_XSLIDER : x = xS(50); break; - case RESET_YSLIDER : y = 50; + case RESET_YSLIDER : y = yS(50); break; case RESET_ANGLE : angle = 0; break; @@ -57,8 +57,8 @@ void RadialBlurConfig::reset(int clear) break; case RESET_DEFAULT_SETTINGS : default: - x = 50; - y = 50; + x = xS(50); + y = yS(50); angle = 33; steps = 10; r = 1; @@ -126,10 +126,10 @@ void RadialBlurConfig::interpolate(RadialBlurConfig &prev, RadialBlurWindow::RadialBlurWindow(RadialBlurMain *plugin) : PluginClientWindow(plugin, - 280, - 370, - 280, - 370, + xS(280), + yS(370), + xS(280), + yS(370), 0) { this->plugin = plugin; @@ -141,43 +141,45 @@ RadialBlurWindow::~RadialBlurWindow() void RadialBlurWindow::create_objects() { - int x = 10, y = 10; - int x1 = 0; int clrBtn_w = 50; - int defaultBtn_w = 100; + int xs10 = xS(10), xs50 = xS(50), xs100 = xS(100); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(45); + int x = xs10, y = ys10; + int x1 = 0; int clrBtn_w = xs50; + int defaultBtn_w = xs100; add_subwindow(new BC_Title(x, y, _("X:"))); - y += 20; + y += ys20; add_subwindow(this->x = new RadialBlurSize(plugin, x, y, &plugin->config.x, 0, 100)); - x1 = x + this->x->get_w() + 10; + x1 = x + this->x->get_w() + xs10; add_subwindow(xClr = new RadialBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_XSLIDER)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Y:"))); - y += 20; + y += ys20; add_subwindow(this->y = new RadialBlurSize(plugin, x, y, &plugin->config.y, 0, 100)); add_subwindow(yClr = new RadialBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_YSLIDER)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Angle:"))); - y += 20; + y += ys20; add_subwindow(angle = new RadialBlurSize(plugin, x, y, &plugin->config.angle, 0, 360)); add_subwindow(angleClr = new RadialBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_ANGLE)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Steps:"))); - y += 20; + y += ys20; add_subwindow(steps = new RadialBlurSize(plugin, x, y, &plugin->config.steps, 1, 100)); add_subwindow(stepsClr = new RadialBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_STEPS)); - y += 30; + y += ys30; add_subwindow(r = new RadialBlurToggle(plugin, x, y, &plugin->config.r, _("Red"))); - y += 30; + y += ys30; add_subwindow(g = new RadialBlurToggle(plugin, x, y, &plugin->config.g, _("Green"))); - y += 30; + y += ys30; add_subwindow(b = new RadialBlurToggle(plugin, x, y, &plugin->config.b, _("Blue"))); - y += 30; + y += ys30; add_subwindow(a = new RadialBlurToggle(plugin, x, y, &plugin->config.a, _("Alpha"))); - y += 40; + y += ys40; add_subwindow(reset = new RadialBlurReset(plugin, this, x, y)); add_subwindow(default_settings = new RadialBlurDefaultSettings(plugin, this, (280 - 10 - defaultBtn_w), y, defaultBtn_w)); @@ -251,7 +253,7 @@ RadialBlurSize::RadialBlurSize(RadialBlurMain *plugin, int *output, int min, int max) - : BC_ISlider(x, y, 0, 200, 200, min, max, *output) + : BC_ISlider(x, y, 0, xS(200), yS(200), min, max, *output) { this->plugin = plugin; this->output = output; diff --git a/cinelerra-5.1/plugins/reframe/reframe.C b/cinelerra-5.1/plugins/reframe/reframe.C index dc3ddda1..4af96105 100644 --- a/cinelerra-5.1/plugins/reframe/reframe.C +++ b/cinelerra-5.1/plugins/reframe/reframe.C @@ -150,7 +150,7 @@ int ReFrame::process_loop(VFrame *buffer) ReFrameOutput::ReFrameOutput(ReFrame *plugin, int x, int y) - : BC_TextBox(x, y, 150, 1, (float)plugin->scale) + : BC_TextBox(x, y, xS(150), 1, (float)plugin->scale) { this->plugin = plugin; } @@ -167,10 +167,10 @@ ReFrameWindow::ReFrameWindow(ReFrame *plugin, int x, int y) : BC_Window(plugin->plugin_title(), x, y, - 230, - 160, - 230, - 160, + xS(230), + yS(160), + xS(230), + yS(160), 0, 0, 1) @@ -185,10 +185,10 @@ ReFrameWindow::~ReFrameWindow() void ReFrameWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); lock_window("ReFrameWindow::create_objects"); add_subwindow(new BC_Title(x, y, _("Scale factor:"))); - y += 20; + y += yS(20); add_subwindow(new ReFrameOutput(plugin, x, y)); add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); diff --git a/cinelerra-5.1/plugins/reframert/reframert.C b/cinelerra-5.1/plugins/reframert/reframert.C index 1c52881f..9558a343 100644 --- a/cinelerra-5.1/plugins/reframert/reframert.C +++ b/cinelerra-5.1/plugins/reframert/reframert.C @@ -108,7 +108,7 @@ void ReframeRTConfig::boundaries() ReframeRTWindow::ReframeRTWindow(ReframeRT *plugin) - : PluginClientWindow(plugin, 230, 235, 230, 235, 0) + : PluginClientWindow(plugin, xS(230), yS(235), xS(230), yS(235), 0) { this->plugin = plugin; } @@ -144,11 +144,11 @@ void ReframeRTWindow::create_objects() y += denom->get_h() + plugin->get_theme()->widget_border; add_subwindow(stretch = new ReframeRTStretch(plugin, this, x, y)); - y += 30; + y += yS(30); add_subwindow(downsample = new ReframeRTDownsample(plugin, this, x, y)); - y += 30; + y += yS(30); add_subwindow(interpolate = new ReframeRTInterpolate(plugin, this, x, y)); - y += 40; + y += yS(40); add_subwindow(reset = new ReframeRTReset(plugin, this, x, y)); show_window(); } diff --git a/cinelerra-5.1/plugins/removegaps/removegaps.C b/cinelerra-5.1/plugins/removegaps/removegaps.C index 660af956..4fff8f2b 100644 --- a/cinelerra-5.1/plugins/removegaps/removegaps.C +++ b/cinelerra-5.1/plugins/removegaps/removegaps.C @@ -84,10 +84,10 @@ void RemoveGapsConfig::boundaries() RemoveGapsWindow::RemoveGapsWindow(RemoveGaps *plugin) : PluginClientWindow(plugin, - 320, - 160, - 320, - 160, + xS(320), + yS(160), + xS(320), + yS(160), 0) { this->plugin = plugin; @@ -99,7 +99,7 @@ RemoveGapsWindow::~RemoveGapsWindow() void RemoveGapsWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Threshold of gap (DB):"))); diff --git a/cinelerra-5.1/plugins/reroute/reroute.C b/cinelerra-5.1/plugins/reroute/reroute.C index 7527523e..6b05b592 100644 --- a/cinelerra-5.1/plugins/reroute/reroute.C +++ b/cinelerra-5.1/plugins/reroute/reroute.C @@ -176,7 +176,7 @@ const char* RerouteConfig::output_to_text(int output_track) RerouteWindow::RerouteWindow(Reroute *plugin) - : PluginClientWindow(plugin, 300, 160, 0, 0, 1) + : PluginClientWindow(plugin, xS(300), yS(160), 0, 0, 1) { this->plugin = plugin; } @@ -187,18 +187,20 @@ RerouteWindow::~RerouteWindow() void RerouteWindow::create_objects() { - int x = 10, y = 10; + int xs5 = xS(5), xs10 = xS(10); + int ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Target track:"))); - int col2 = title->get_w() + 5; + int col2 = title->get_w() + xs5; add_subwindow(output = new RerouteOutput(plugin, x + col2, y)); output->create_objects(); - y += 30; + y += ys30; add_subwindow(title = new BC_Title(x, y, _("Operation:"))); add_subwindow(operation = new RerouteOperation(plugin, x + col2, @@ -221,7 +223,7 @@ RerouteOperation::RerouteOperation(Reroute *plugin, int y) : BC_PopupMenu(x, y, - 150, + xS(150), RerouteConfig::operation_to_text(plugin->config.operation), 1) { @@ -270,7 +272,7 @@ RerouteOutput::RerouteOutput(Reroute *plugin, int y) : BC_PopupMenu(x, y, - 100, + xS(100), RerouteConfig::output_to_text(plugin->config.output_track), 1) { diff --git a/cinelerra-5.1/plugins/resample/resample.C b/cinelerra-5.1/plugins/resample/resample.C index 29e6a258..6293ba69 100644 --- a/cinelerra-5.1/plugins/resample/resample.C +++ b/cinelerra-5.1/plugins/resample/resample.C @@ -42,7 +42,7 @@ PluginClient* new_plugin(PluginServer *server) ResampleFraction::ResampleFraction(ResampleEffect *plugin, int x, int y) - : BC_TextBox(x, y, 100, 1, (float)plugin->scale, 1, MEDIUMFONT, 6) + : BC_TextBox(x, y, xS(100), 1, (float)plugin->scale, 1, MEDIUMFONT, 6) { this->plugin = plugin; } @@ -62,12 +62,12 @@ int ResampleFraction::handle_event() ResampleWindow::ResampleWindow(ResampleEffect *plugin, int x, int y) : BC_Window(_(PROGRAM_NAME ": Resample"), - x - 160, - y - 75, - 320, - 150, - 320, - 150, + x - xS(160), + y - yS(75), + xS(320), + yS(150), + xS(320), + yS(150), 0, 0, 1) @@ -77,10 +77,12 @@ ResampleWindow::ResampleWindow(ResampleEffect *plugin, int x, int y) void ResampleWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys20 = yS(20); + int x = xs10, y = ys10; lock_window("ResampleWindow::create_objects"); add_subwindow(new BC_Title(x, y, _("Scale factor:"))); - y += 20; + y += ys20; add_subwindow(new ResampleFraction(plugin, x, y)); add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); diff --git a/cinelerra-5.1/plugins/resamplert/resamplert.C b/cinelerra-5.1/plugins/resamplert/resamplert.C index af6c4ab6..27f60270 100644 --- a/cinelerra-5.1/plugins/resamplert/resamplert.C +++ b/cinelerra-5.1/plugins/resamplert/resamplert.C @@ -79,10 +79,10 @@ void ResampleRTConfig::boundaries() ResampleRTWindow::ResampleRTWindow(ResampleRT *plugin) : PluginClientWindow(plugin, - 210, - 160, - 200, - 160, + xS(210), + yS(160), + xS(200), + yS(160), 0) { this->plugin = plugin; diff --git a/cinelerra-5.1/plugins/reverb/reverbwindow.C b/cinelerra-5.1/plugins/reverb/reverbwindow.C index add6ab45..86933363 100644 --- a/cinelerra-5.1/plugins/reverb/reverbwindow.C +++ b/cinelerra-5.1/plugins/reverb/reverbwindow.C @@ -33,10 +33,10 @@ ReverbWindow::ReverbWindow(Reverb *reverb) : PluginClientWindow(reverb, - 300, - 230, - 300, - 230, + xS(300), + yS(230), + xS(300), + yS(230), 0) { this->reverb = reverb; @@ -48,23 +48,25 @@ ReverbWindow::~ReverbWindow() void ReverbWindow::create_objects() { - int x = 200, y = 10; - add_tool(new BC_Title(5, y + 10, _("Initial signal level:"))); - add_tool(level_init = new ReverbLevelInit(reverb, x, y)); y += 25; - add_tool(new BC_Title(5, y + 10, _("ms before reflections:"))); - add_tool(delay_init = new ReverbDelayInit(reverb, x + 35, y)); y += 25; - add_tool(new BC_Title(5, y + 10, _("First reflection level:"))); - add_tool(ref_level1 = new ReverbRefLevel1(reverb, x, y)); y += 25; - add_tool(new BC_Title(5, y + 10, _("Last reflection level:"))); - add_tool(ref_level2 = new ReverbRefLevel2(reverb, x + 35, y)); y += 25; - add_tool(new BC_Title(5, y + 10, _("Number of reflections:"))); - add_tool(ref_total = new ReverbRefTotal(reverb, x, y)); y += 25; - add_tool(new BC_Title(5, y + 10, _("ms of reflections:"))); - add_tool(ref_length = new ReverbRefLength(reverb, x + 35, y)); y += 25; - add_tool(new BC_Title(5, y + 10, _("Start band for lowpass:"))); - add_tool(lowpass1 = new ReverbLowPass1(reverb, x, y)); y += 25; - add_tool(new BC_Title(5, y + 10, _("End band for lowpass:"))); - add_tool(lowpass2 = new ReverbLowPass2(reverb, x + 35, y)); y += 40; + int xs5 = xS(5), xs35 = xS(35), xs200 = xS(200); + int ys10 = yS(10), ys25 = yS(25), ys40 = yS(40); + int x = xs200, y = ys10; + add_tool(new BC_Title(xs5, y + ys10, _("Initial signal level:"))); + add_tool(level_init = new ReverbLevelInit(reverb, x, y)); y += ys25; + add_tool(new BC_Title(xs5, y + ys10, _("ms before reflections:"))); + add_tool(delay_init = new ReverbDelayInit(reverb, x + xs35, y)); y += ys25; + add_tool(new BC_Title(xs5, y + ys10, _("First reflection level:"))); + add_tool(ref_level1 = new ReverbRefLevel1(reverb, x, y)); y += ys25; + add_tool(new BC_Title(xs5, y + ys10, _("Last reflection level:"))); + add_tool(ref_level2 = new ReverbRefLevel2(reverb, x + xs35, y)); y += ys25; + add_tool(new BC_Title(xs5, y + ys10, _("Number of reflections:"))); + add_tool(ref_total = new ReverbRefTotal(reverb, x, y)); y += ys25; + add_tool(new BC_Title(xs5, y + ys10, _("ms of reflections:"))); + add_tool(ref_length = new ReverbRefLength(reverb, x + xs35, y)); y += ys25; + add_tool(new BC_Title(xs5, y + ys10, _("Start band for lowpass:"))); + add_tool(lowpass1 = new ReverbLowPass1(reverb, x, y)); y += ys25; + add_tool(new BC_Title(xs5, y + ys10, _("End band for lowpass:"))); + add_tool(lowpass2 = new ReverbLowPass2(reverb, x + xs35, y)); y += ys40; show_window(); flush(); } diff --git a/cinelerra-5.1/plugins/reverseaudio/reverseaudio.C b/cinelerra-5.1/plugins/reverseaudio/reverseaudio.C index 687c950c..1a1f2907 100644 --- a/cinelerra-5.1/plugins/reverseaudio/reverseaudio.C +++ b/cinelerra-5.1/plugins/reverseaudio/reverseaudio.C @@ -104,7 +104,7 @@ ReverseAudioConfig::ReverseAudioConfig() ReverseAudioWindow::ReverseAudioWindow(ReverseAudio *plugin) - : PluginClientWindow(plugin, 265, 60, 265, 60, 0) + : PluginClientWindow(plugin, xS(265), yS(60), xS(265), yS(60), 0) { this->plugin = plugin; } @@ -115,7 +115,7 @@ ReverseAudioWindow::~ReverseAudioWindow() void ReverseAudioWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(enabled = new ReverseAudioEnabled(plugin, x, diff --git a/cinelerra-5.1/plugins/reversevideo/reversevideo.C b/cinelerra-5.1/plugins/reversevideo/reversevideo.C index cf8f1e1d..4fba5312 100644 --- a/cinelerra-5.1/plugins/reversevideo/reversevideo.C +++ b/cinelerra-5.1/plugins/reversevideo/reversevideo.C @@ -102,10 +102,10 @@ ReverseVideoConfig::ReverseVideoConfig() ReverseVideoWindow::ReverseVideoWindow(ReverseVideo *plugin) : PluginClientWindow(plugin, - 210, - 160, - 200, - 160, + xS(210), + yS(160), + xS(200), + yS(160), 0) { this->plugin = plugin; @@ -117,7 +117,7 @@ ReverseVideoWindow::~ReverseVideoWindow() void ReverseVideoWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); add_subwindow(enabled = new ReverseVideoEnabled(plugin, x, diff --git a/cinelerra-5.1/plugins/rgb601/rgb601window.C b/cinelerra-5.1/plugins/rgb601/rgb601window.C index e688a2c8..0ddb7d87 100644 --- a/cinelerra-5.1/plugins/rgb601/rgb601window.C +++ b/cinelerra-5.1/plugins/rgb601/rgb601window.C @@ -34,7 +34,7 @@ RGB601Window::RGB601Window(RGB601Main *client) - : PluginClientWindow(client, 235, 100, 235, 100, 0) + : PluginClientWindow(client, xS(235), yS(100), xS(235), yS(100), 0) { this->client = client; } @@ -45,7 +45,9 @@ RGB601Window::~RGB601Window() void RGB601Window::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; add_tool(forward = new RGB601Direction(this, x, @@ -53,7 +55,7 @@ void RGB601Window::create_objects() &client->config.direction, 1, _("RGB -> 601 compression"))); - y += 30; + y += ys30; add_tool(reverse = new RGB601Direction(this, x, y, diff --git a/cinelerra-5.1/plugins/rgbshift/rgbshift.C b/cinelerra-5.1/plugins/rgbshift/rgbshift.C index f05cb3a0..95d12058 100644 --- a/cinelerra-5.1/plugins/rgbshift/rgbshift.C +++ b/cinelerra-5.1/plugins/rgbshift/rgbshift.C @@ -97,7 +97,7 @@ void RGBShiftConfig::interpolate(RGBShiftConfig &prev, #define MAXVALUE 100 RGBShiftLevel::RGBShiftLevel(RGBShiftEffect *plugin, int *output, int x, int y) - : BC_ISlider(x, y, 0, 200, 200, -MAXVALUE, MAXVALUE, *output) + : BC_ISlider(x, y, 0, xS(200), yS(200), -MAXVALUE, MAXVALUE, *output) { this->plugin = plugin; this->output = output; @@ -152,47 +152,49 @@ int RGBShiftSliderClr::handle_event() RGBShiftWindow::RGBShiftWindow(RGBShiftEffect *plugin) - : PluginClientWindow(plugin, 320, 230, 320, 230, 0) + : PluginClientWindow(plugin, xS(320), yS(230), xS(320), yS(230), 0) { this->plugin = plugin; } void RGBShiftWindow::create_objects() { - int x = 10, y = 10, x1 = 50; - int x2 = 0; int clrBtn_w = 50; + int xs10 = xS(10), xs50 = xS(50); + int ys10 = yS(10), ys30 = yS(30), ys40 = yS(40); + int x = xs10, y = ys10, x1 = xs50; + int x2 = 0; int clrBtn_w = xs50; add_subwindow(new BC_Title(x, y, _("R_dx:"))); add_subwindow(r_dx = new RGBShiftLevel(plugin, &plugin->config.r_dx, x1, y)); - x2 = x1 + r_dx->get_w() + 10; + x2 = x1 + r_dx->get_w() + xs10; add_subwindow(r_dxClr = new RGBShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_R_DX)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("R_dy:"))); add_subwindow(r_dy = new RGBShiftLevel(plugin, &plugin->config.r_dy, x1, y)); add_subwindow(r_dyClr = new RGBShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_R_DY)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("G_dx:"))); add_subwindow(g_dx = new RGBShiftLevel(plugin, &plugin->config.g_dx, x1, y)); add_subwindow(g_dxClr = new RGBShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_G_DX)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("G_dy:"))); add_subwindow(g_dy = new RGBShiftLevel(plugin, &plugin->config.g_dy, x1, y)); add_subwindow(g_dyClr = new RGBShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_G_DY)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("B_dx:"))); add_subwindow(b_dx = new RGBShiftLevel(plugin, &plugin->config.b_dx, x1, y)); add_subwindow(b_dxClr = new RGBShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_B_DX)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("B_dy:"))); add_subwindow(b_dy = new RGBShiftLevel(plugin, &plugin->config.b_dy, x1, y)); add_subwindow(b_dyClr = new RGBShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_B_DY)); - y += 40; + y += ys40; add_subwindow(reset = new RGBShiftReset(plugin, this, x, y)); show_window(); diff --git a/cinelerra-5.1/plugins/rotate/rotate.C b/cinelerra-5.1/plugins/rotate/rotate.C index 7d578b7a..a2033f0f 100644 --- a/cinelerra-5.1/plugins/rotate/rotate.C +++ b/cinelerra-5.1/plugins/rotate/rotate.C @@ -179,7 +179,7 @@ RotateText::RotateText(RotateWindow *window, int y) : BC_TextBox(x, y, - 90, + xS(90), 1, (float)plugin->config.angle) { @@ -263,19 +263,21 @@ int RotateReset::handle_event() RotateWindow::RotateWindow(RotateEffect *plugin) - : PluginClientWindow(plugin, 300, 230, 300, 230, 0) + : PluginClientWindow(plugin, xS(300), yS(230), xS(300), yS(230), 0) { this->plugin = plugin; } -#define RADIUS 30 +#define RADIUS xS(30) void RotateWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs50 = xS(50), xs150 = xS(150); + int ys10 = yS(10), ys20 = yS(20), ys25 = yS(25), ys50 = yS(50), ys60 = yS(60); + int x = xs10, y = ys10; BC_Title *title; add_tool(new BC_Title(x, y, _("Rotate"))); - x += 50; y += 20; + x += xs50; y += ys20; add_tool(toggle0 = new RotateToggle(this, plugin, plugin->config.angle == 0, x, y, 0, "0")); x += RADIUS; y += RADIUS; @@ -287,25 +289,25 @@ void RotateWindow::create_objects() x -= RADIUS; y -= RADIUS; add_tool(toggle270 = new RotateToggle(this, plugin, plugin->config.angle == 270, x, y, 270, "270")); -// add_subwindow(bilinear = new RotateInterpolate(plugin, 10, y + 60)); - x += 150; y -= 50; +// add_subwindow(bilinear = new RotateInterpolate(plugin, xs10, y + ys60)); + x += xs150; y -= ys50; add_tool(fine = new RotateFine(this, plugin, x, y)); - y += fine->get_h() + 10; + y += fine->get_h() + ys10; add_tool(text = new RotateText(this, plugin, x, y)); - y += 25; + y += ys25; add_tool(new BC_Title(x, y, _("Degrees"))); - y += text->get_h() + 10; + y += text->get_h() + ys10; add_subwindow(title = new BC_Title(x, y, _("Pivot (x,y):"))); - y += title->get_h() + 10; + y += title->get_h() + ys10; add_subwindow(this->x = new RotateX(this, plugin, x, y)); - x += this->x->get_w() + 10; + x += this->x->get_w() + xs10; add_subwindow(this->y = new RotateY(this, plugin, x, y)); -// y += this->y->get_h() + 10; - x = 10; +// y += this->y->get_h() + ys10; + x = xs10; add_subwindow(draw_pivot = new RotateDrawPivot(this, plugin, x, y)); - y += 60; + y += ys60; add_subwindow(reset = new RotateReset(plugin, this, x, y)); show_window(); @@ -532,8 +534,8 @@ int RotateEffect::process_buffer(VFrame *frame, //printf("RotateEffect::process_buffer %d draw_pivot=%d\n", __LINE__, config.draw_pivot); // Draw center -#define CENTER_H 20 -#define CENTER_W 20 +#define CENTER_H xS(20) +#define CENTER_W yS(20) #define DRAW_CENTER(components, type, max) \ { \ type **rows = (type**)get_output()->get_rows(); \ diff --git a/cinelerra-5.1/plugins/rumbler/rumbler.C b/cinelerra-5.1/plugins/rumbler/rumbler.C index bb687a09..f76be447 100644 --- a/cinelerra-5.1/plugins/rumbler/rumbler.C +++ b/cinelerra-5.1/plugins/rumbler/rumbler.C @@ -69,7 +69,7 @@ void RumblerConfig::interpolate(RumblerConfig &prev, RumblerConfig &next, } RumblerWindow::RumblerWindow(Rumbler *plugin) - : PluginClientWindow(plugin, 300, 150, 300, 150, 0) + : PluginClientWindow(plugin, xS(300), yS(150), xS(300), yS(150), 0) { this->plugin = plugin; } @@ -80,24 +80,26 @@ RumblerWindow::~RumblerWindow() void RumblerWindow::create_objects() { - int x = 10, x1 = x + 64, x2 =x1 + 100; - int y = 10; + int xs10 = xS(10), xs64 = xS(64), xs100 = xS(100); + int ys10 = yS(10), ys35 = yS(35); + int x = xs10, x1 = x + xs64, x2 = x1 + xs100; + int y = ys10; BC_Title *title; add_subwindow(title = new BC_Title(x1, y, _("rumble"))); add_subwindow(title = new BC_Title(x2, y, _("rate"))); - y += title->get_h() + 10; + y += title->get_h() + ys10; add_subwindow(title = new BC_Title(x, y, _("time:"))); add_subwindow(time_rumble = new RumblerRate(plugin, this, plugin->config.time_rumble, x1, y)); add_subwindow(time_rate = new RumblerRate(plugin, this, plugin->config.time_rate, x2, y)); - y += title->get_h() + 10; + y += title->get_h() + ys10; add_subwindow(title = new BC_Title(x, y, _("space:"))); add_subwindow(space_rumble = new RumblerRate(plugin, this, plugin->config.space_rumble, x1, y)); add_subwindow(space_rate = new RumblerRate(plugin, this, plugin->config.space_rate, x2, y)); - y += title->get_h() + 10; + y += title->get_h() + ys10; add_subwindow(title = new BC_Title(x, y, _("seq:"))); add_subwindow(seq = new RumblerSeq(plugin, this, plugin->config.sequence, x1, y)); - y += 35; + y += ys35; add_subwindow(reset = new RumblerReset(plugin, this, x, y)); show_window(); @@ -117,7 +119,7 @@ void RumblerWindow::update() RumblerRate::RumblerRate(Rumbler *plugin, RumblerWindow *gui, float &value, int x, int y) - : BC_TextBox(x, y, 90, 1, value) + : BC_TextBox(x, y, xS(90), 1, value) { this->plugin = plugin; this->value = &value; @@ -133,7 +135,7 @@ int RumblerRate::handle_event() RumblerSeq::RumblerSeq(Rumbler *plugin, RumblerWindow *gui, int &value, int x, int y) - : BC_TextBox(x, y, 72, 1, value) + : BC_TextBox(x, y, xS(72), 1, value) { this->plugin = plugin; this->value = &value; diff --git a/cinelerra-5.1/plugins/scale/scalewin.C b/cinelerra-5.1/plugins/scale/scalewin.C index 96ef5d8c..479aee67 100644 --- a/cinelerra-5.1/plugins/scale/scalewin.C +++ b/cinelerra-5.1/plugins/scale/scalewin.C @@ -29,7 +29,7 @@ ScaleWin::ScaleWin(ScaleMain *client) - : PluginClientWindow(client, 400, 100, 400, 100, 0) + : PluginClientWindow(client, xS(400), yS(100), xS(400), yS(100), 0) { this->client = client; } @@ -44,17 +44,19 @@ ScaleWin::~ScaleWin() void ScaleWin::create_objects() { - int x0 = 10, y0 = 10; - int y1 = y0 + 25; - int y2 = y1 + 25; + int xs10 = xS(10), xs15 = xS(15), xs20 = xS(20); + int ys10 = yS(10), ys25 = yS(25); + int x0 = xs10, y0 = ys10; + int y1 = y0 + ys25; + int y2 = y1 + ys25; BC_Title *title = new BC_Title(x0, y1, _("Scale:")); add_tool(title); - int x1 = x0 + title->get_w() + 10; + int x1 = x0 + title->get_w() + xs10; add_tool(use_scale = new ScaleUseScale(this, client, x1, y1)); - int x2 = x1 + use_scale->get_w() + 10; + int x2 = x1 + use_scale->get_w() + xs10; x_factor = new ScaleXFactor(this, client, x2, y1); x_factor->create_objects(); - int x3 = x2 + x_factor->get_w() + 20; + int x3 = x2 + x_factor->get_w() + xs20; y_factor = new ScaleYFactor(this, client, x3, y1); y_factor->create_objects(); add_tool(constrain = new ScaleConstrain(client, x1, y2)); @@ -64,11 +66,11 @@ void ScaleWin::create_objects() add_tool(use_size = new ScaleUseSize(this, client, x1, y0)); width = new ScaleWidth(this, client, x2, y0); width->create_objects(); - int x = x2 + width->get_w() + 3; + int x = x2 + width->get_w() + xS(3); add_tool(new BC_Title(x, y0, _("x"))); height= new ScaleHeight(this, client, x3, y0); height->create_objects(); - int x4 = x3 + height->get_w() + 15; + int x4 = x3 + height->get_w() + xs15; add_tool(pulldown = new FrameSizePulldown(client->server->mwindow->theme, width->get_textbox(), height->get_textbox(), x4, y0)); @@ -78,7 +80,7 @@ void ScaleWin::create_objects() ScaleXFactor::ScaleXFactor(ScaleWin *win, ScaleMain *client, int x, int y) - : BC_TumbleTextBox(win, (float)client->config.x_factor, 0., 100., x, y, 100) + : BC_TumbleTextBox(win, (float)client->config.x_factor, 0., 100., x, y, xS(100)) { //printf("ScaleXFactor::ScaleXFactor %f\n", client->config.x_factor); this->client = client; @@ -113,7 +115,7 @@ int ScaleXFactor::handle_event() ScaleYFactor::ScaleYFactor(ScaleWin *win, ScaleMain *client, int x, int y) - : BC_TumbleTextBox(win, (float)client->config.y_factor, 0., 100., x, y, 100) + : BC_TumbleTextBox(win, (float)client->config.y_factor, 0., 100., x, y, xS(100)) { this->client = client; this->win = win; @@ -145,7 +147,7 @@ int ScaleYFactor::handle_event() ScaleWidth::ScaleWidth(ScaleWin *win, ScaleMain *client, int x, int y) - : BC_TumbleTextBox(win, client->config.width, 0, 100000, x, y, 90) + : BC_TumbleTextBox(win, client->config.width, 0, 100000, x, y, xS(90)) { //printf("ScaleWidth::ScaleWidth %f\n", client->config.x_factor); this->client = client; @@ -173,7 +175,7 @@ int ScaleWidth::handle_event() ScaleHeight::ScaleHeight(ScaleWin *win, ScaleMain *client, int x, int y) - : BC_TumbleTextBox(win, client->config.height, 0, 100000, x, y, 90) + : BC_TumbleTextBox(win, client->config.height, 0, 100000, x, y, xS(90)) { this->client = client; this->win = win; diff --git a/cinelerra-5.1/plugins/scaleratio/scaleratiowin.C b/cinelerra-5.1/plugins/scaleratio/scaleratiowin.C index 10961a10..155b5944 100644 --- a/cinelerra-5.1/plugins/scaleratio/scaleratiowin.C +++ b/cinelerra-5.1/plugins/scaleratio/scaleratiowin.C @@ -29,7 +29,7 @@ ScaleRatioWin::ScaleRatioWin(ScaleRatioMain *client) - : PluginClientWindow(client, 400, 320, 400, 320, 0) + : PluginClientWindow(client, xS(400), yS(320), xS(400), yS(320), 0) { this->client = client; } @@ -40,96 +40,98 @@ ScaleRatioWin::~ScaleRatioWin() void ScaleRatioWin::create_objects() { - int x = 10, y = 10; - int x0 = x, x1 = x0 + 50; + int xs10 = xS(10), xs50 = xS(50); + int ys5 = yS(5), ys8 = yS(8), ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; + int x0 = x, x1 = x0 + xs50; int y0 = y; client->load_configuration(); add_tool(new BC_Title(x0, y0, _("In R:"))); add_tool(in_r = new ScaleRatioRatio(this, client, x1, y0, &client->config.in_r)); in_r->create_objects(); - y0 += in_r->get_th() + 10; + y0 += in_r->get_th() + ys10; add_tool(new BC_Title(x0, y0, _("In W:"))); in_w = new ScaleRatioCoord(this, client, x1, y0, 0, &client->config.in_w); in_w->create_objects(); - y0 += in_w->get_h() + 8; + y0 += in_w->get_h() + ys8; add_tool(new BC_Title(x0, y0, _("In H:"))); in_h = new ScaleRatioCoord(this, client, x1, y0, 0, &client->config.in_h); in_h->create_objects(); x0 = get_w()/2; y0 = y; - x1 = x0 + 50; + x1 = x0 + xs50; add_tool(new BC_Title(x0, y0, _("Out R:"))); add_tool(out_r = new ScaleRatioRatio(this, client, x1, y0, &client->config.out_r)); out_r->create_objects(); - y0 += out_r->get_th() + 10; + y0 += out_r->get_th() + ys10; add_tool(new BC_Title(x0, y0, _("Out W:"))); out_w = new ScaleRatioCoord(this, client, x1, y0, 0, &client->config.out_w); out_w->create_objects(); - y0 += out_w->get_h() + 8; + y0 += out_w->get_h() + ys8; add_tool(new BC_Title(x0, y0, _("Out H:"))); out_h = new ScaleRatioCoord(this, client, x1, y0, 0, &client->config.out_h); out_h->create_objects(); - y0 += out_h->get_h() + 8; + y0 += out_h->get_h() + ys8; - y = y0 + 5; + y = y0 + ys5; add_tool(apply_button = new ScaleRatioApply(this, x, y)); - int x2 = x + apply_button->get_w() + 50; + int x2 = x + apply_button->get_w() + xs50; add_tool(type_popup = new ScaleRatioType(this, x2, y, &client->config.type)); type_popup->create_objects(); - y += apply_button->get_h() + 30; + y += apply_button->get_h() + ys30; x0 = x; y0 = y; - x1 = x0 + 50; + x1 = x0 + xs50; add_tool(new BC_Title(x0, y0, _("Src X:"))); src_x = new ScaleRatioCoord(this, client, x1, y0, 1, &client->config.src_x); src_x->create_objects(); - y0 += 30; + y0 += ys30; add_tool(new BC_Title(x0, y0, _("Src Y:"))); src_y = new ScaleRatioCoord(this, client, x1, y0, 1, &client->config.src_y); src_y->create_objects(); - y0 += 30; + y0 += ys30; add_tool(new BC_Title(x0, y0, _("Src W:"))); src_w = new ScaleRatioCoord(this, client, x1, y0, 0, &client->config.src_w); src_w->create_objects(); - y0 += 30; + y0 += ys30; add_tool(new BC_Title(x0, y0, _("Src H:"))); src_h = new ScaleRatioCoord(this, client, x1, y0, 0, &client->config.src_h); src_h->create_objects(); - y0 += 30; + y0 += ys30; x0 = get_w()/2; - x1 = x0 + 50; + x1 = x0 + xs50; y0 = y; add_tool(new BC_Title(x0, y0, _("Dst X:"))); dst_x = new ScaleRatioCoord(this, client, x1, y0, 1, &client->config.dst_x); dst_x->create_objects(); - y0 += 30; + y0 += ys30; add_tool(new BC_Title(x0, y0, _("Dst Y:"))); dst_y = new ScaleRatioCoord(this, client, x1, y0, 1, &client->config.dst_y); dst_y->create_objects(); - y0 += 30; + y0 += ys30; add_tool(new BC_Title(x0, y0, _("Dst W:"))); dst_w = new ScaleRatioCoord(this, client, x1, y0, 0, &client->config.dst_w); dst_w->create_objects(); - y0 += 30; + y0 += ys30; add_tool(new BC_Title(x0, y0, _("Dst H:"))); dst_h = new ScaleRatioCoord(this, client, x1, y0, 0, &client->config.dst_h); dst_h->create_objects(); - y0 += 30; + y0 += ys30; show_window(); flush(); @@ -139,7 +141,7 @@ void ScaleRatioWin::create_objects() ScaleRatioCoord::ScaleRatioCoord(ScaleRatioWin *win, ScaleRatioMain *client, int x, int y, int s, float *value) - : BC_TumbleTextBox(win, (int)*value, (int)-10000*s, (int)10000, x, y, 100) + : BC_TumbleTextBox(win, (int)*value, (int)-10000*s, (int)10000, x, y, xS(100)) { this->client = client; this->win = win; @@ -159,7 +161,7 @@ int ScaleRatioCoord::handle_event() ScaleRatioTumbler::ScaleRatioTumbler(ScaleRatioRatio *ratio, int value, int x, int y) - : BC_TumbleTextBox(ratio->win, value, 0, 10000, x, y, 45) + : BC_TumbleTextBox(ratio->win, value, 0, 10000, x, y, xS(45)) { this->ratio = ratio; } @@ -176,7 +178,7 @@ int ScaleRatioTumbler::handle_event() ScaleRatioRatio::ScaleRatioRatio(ScaleRatioWin *win, ScaleRatioMain *client, int x, int y, float *value) - : BC_TextBox(x, y, 100, 1, *value) + : BC_TextBox(x, y, xS(100), 1, *value) { this->client = client; this->win = win; @@ -208,12 +210,12 @@ void ScaleRatioRatio::create_objects() int tx = BC_TextBox::get_x(); int ty = BC_TextBox::get_y(); int x = tx; - int y = ty + BC_TextBox::get_h() + 5; + int y = ty + BC_TextBox::get_h() + yS(5); float faw = 0, fah = 0; MWindow::create_aspect_ratio(faw, fah, *value*1000000, 1000000); aw = new ScaleRatioTumbler(this, faw, x, y); aw->create_objects(); - x += aw->get_w() + 5; + x += aw->get_w() + xS(5); ah = new ScaleRatioTumbler(this, fah, x, y); ah->create_objects(); x += ah->get_w(); @@ -253,7 +255,7 @@ int ScaleRatioTypeItem::handle_event() ScaleRatioType::ScaleRatioType(ScaleRatioWin *win, int x, int y, int *value) - : BC_PopupMenu(x, y, 180, "", 1) + : BC_PopupMenu(x, y, xS(180), "", 1) { this->win = win; this->value = value; diff --git a/cinelerra-5.1/plugins/shapewipe/shapewipe.C b/cinelerra-5.1/plugins/shapewipe/shapewipe.C index e372f30a..ca675e2d 100644 --- a/cinelerra-5.1/plugins/shapewipe/shapewipe.C +++ b/cinelerra-5.1/plugins/shapewipe/shapewipe.C @@ -164,7 +164,7 @@ ShapeWipeFeather::ShapeWipeFeather(ShapeWipeMain *client, ShapeWipeWindow *window, int x, int y) : BC_TumbleTextBox(window, bclip(client->config.feather, SHAPE_FMIN, SHAPE_FMAX), - SHAPE_FMIN, SHAPE_FMAX, x, y, 64, 3) + SHAPE_FMIN, SHAPE_FMAX, x, y, xS(64), yS(3)) { this->client = client; this->window = window; @@ -241,7 +241,7 @@ int ShapeWipeShape::handle_event() ShapeWipeWindow::ShapeWipeWindow(ShapeWipeMain *plugin) - : PluginClientWindow(plugin, 425, 215, 425, 215, 0) + : PluginClientWindow(plugin, xS(425), yS(215), xS(425), yS(215), 0) { this->plugin = plugin; shape_feather = 0; @@ -258,7 +258,7 @@ void ShapeWipeWindow::create_objects() { BC_Title *title = 0; lock_window("ShapeWipeWindow::create_objects"); - int pad = 10, margin = 10; + int pad = xS(10), margin = xS(10); int x = margin, y = margin; int ww = get_w() - 2*margin; @@ -268,13 +268,13 @@ void ShapeWipeWindow::create_objects() } BC_TitleBar *bar; - add_subwindow(bar = new BC_TitleBar(x, y, ww, 20, 10, + add_subwindow(bar = new BC_TitleBar(x, y, ww, xS(20), yS(10), _("Wipe"), MEDIUMFONT)); y += bar->get_h() + pad; add_subwindow(title = new BC_Title(x, y, _("Shape:"))); - int x1 = 85, x2 = 355, x3 = 386; - shape_text = new ShapeWipeShape(plugin, this, x1, y, x2-x1, 200); + int x1 = xS(85), x2 = xS(355), x3 = xS(386); + shape_text = new ShapeWipeShape(plugin, this, x1, y, x2-x1, yS(200)); shape_text->create_objects(); add_subwindow(new ShapeWipeTumble(plugin, this, x3, y)); y += shape_text->get_h() + pad; @@ -296,7 +296,7 @@ void ShapeWipeWindow::create_objects() plugin, this, x, y)); y += aspect_ratio->get_h() + pad; - add_subwindow(bar = new BC_TitleBar(x, y, ww, 20, 10, + add_subwindow(bar = new BC_TitleBar(x, y, ww, xS(20), yS(10), _("Direction"), MEDIUMFONT)); y += bar->get_h() + pad; x = margin; diff --git a/cinelerra-5.1/plugins/sharpen/sharpenwindow.C b/cinelerra-5.1/plugins/sharpen/sharpenwindow.C index 67f31bcf..61ab6b50 100644 --- a/cinelerra-5.1/plugins/sharpen/sharpenwindow.C +++ b/cinelerra-5.1/plugins/sharpen/sharpenwindow.C @@ -33,7 +33,7 @@ SharpenWindow::SharpenWindow(SharpenMain *client) - : PluginClientWindow(client, 280, 190, 280, 190, 0) //195 was 150 + : PluginClientWindow(client, xS(280), yS(190), xS(280), yS(190), 0) //195 was 150 { this->client = client; } @@ -44,26 +44,28 @@ SharpenWindow::~SharpenWindow() void SharpenWindow::create_objects() { - int x = 10, y = 10; - int x1 = 0; int clrBtn_w = 50; - int defaultBtn_w = 100; + int xs10 = xS(10), xs50 = xS(50), xs100 = xS(100); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(40); + int x = xs10, y = ys10; + int x1 = 0; int clrBtn_w = xs50; + int defaultBtn_w = xs100; add_tool(new BC_Title(x, y, _("Sharpness"))); - y += 20; + y += ys20; add_tool(sharpen_slider = new SharpenSlider(client, &(client->config.sharpness), x, y)); - x1 = x + sharpen_slider->get_w() + 10; + x1 = x + sharpen_slider->get_w() + xs10; add_subwindow(sharpen_sliderClr = new SharpenSliderClr(client, this, x1, y, clrBtn_w)); - y += 30; + y += ys30; add_tool(sharpen_interlace = new SharpenInterlace(client, x, y)); - y += 30; + y += ys30; add_tool(sharpen_horizontal = new SharpenHorizontal(client, x, y)); - y += 30; + y += ys30; add_tool(sharpen_luminance = new SharpenLuminance(client, x, y)); - y += 40; + y += ys40; add_tool(reset = new SharpenReset(client, this, x, y)); add_subwindow(default_settings = new SharpenDefaultSettings(client, this, - (280 - 10 - defaultBtn_w), y, defaultBtn_w)); + (xS(280) - xs10 - defaultBtn_w), y, defaultBtn_w)); show_window(); flush(); @@ -90,8 +92,8 @@ SharpenSlider::SharpenSlider(SharpenMain *client, float *output, int x, int y) : BC_ISlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), 0, MAXSHARPNESS, (int)*output, diff --git a/cinelerra-5.1/plugins/shiftinterlace/shiftinterlace.C b/cinelerra-5.1/plugins/shiftinterlace/shiftinterlace.C index 4d578886..c7b4e0ba 100644 --- a/cinelerra-5.1/plugins/shiftinterlace/shiftinterlace.C +++ b/cinelerra-5.1/plugins/shiftinterlace/shiftinterlace.C @@ -86,10 +86,10 @@ void ShiftInterlaceConfig::interpolate(ShiftInterlaceConfig &prev, ShiftInterlaceWindow::ShiftInterlaceWindow(ShiftInterlaceMain *plugin) : PluginClientWindow(plugin, - 370, - 110, - 370, - 110, + xS(370), + yS(110), + xS(370), + yS(110), 0) { this->plugin = plugin; @@ -98,21 +98,23 @@ ShiftInterlaceWindow::ShiftInterlaceWindow(ShiftInterlaceMain *plugin) void ShiftInterlaceWindow::create_objects() { - int x = 10, y = 10; - int margin = 30; - int x1 = 0; int clrBtn_w = 50; + int xs10 = xS(10), xs30 = xS(30), xs50 = xS(50), xs90 = xS(90); + int ys10 = yS(10), ys40 = yS(40); + int x = xs10, y = ys10; + int margin = xs30; + int x1 = 0; int clrBtn_w = xs50; add_subwindow(new BC_Title(x, y, _("Odd offset:"))); - add_subwindow(odd_offset = new ShiftInterlaceOdd(plugin, x + 90, y)); - x1 = x + 90 + odd_offset->get_w() + 10; + add_subwindow(odd_offset = new ShiftInterlaceOdd(plugin, x + xs90, y)); + x1 = x + xs90 + odd_offset->get_w() + xs10; add_subwindow(odd_offsetClr = new ShiftInterlaceSliderClr(plugin, this, x1, y, clrBtn_w, RESET_ODD_OFFSET)); y += margin; add_subwindow(new BC_Title(x, y, _("Even offset:"))); - add_subwindow(even_offset = new ShiftInterlaceEven(plugin, x + 90, y)); + add_subwindow(even_offset = new ShiftInterlaceEven(plugin, x + xs90, y)); add_subwindow(even_offsetClr = new ShiftInterlaceSliderClr(plugin, this, x1, y, clrBtn_w, RESET_EVEN_OFFSET)); - y += 40; + y += ys40; add_subwindow(reset = new ShiftInterlaceReset(plugin, this, x, y)); show_window(); flush(); @@ -140,8 +142,8 @@ ShiftInterlaceOdd::ShiftInterlaceOdd(ShiftInterlaceMain *plugin, int x, int y) : BC_ISlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), -100, 100, plugin->config.odd_offset) @@ -162,8 +164,8 @@ ShiftInterlaceEven::ShiftInterlaceEven(ShiftInterlaceMain *plugin, int x, int y) : BC_ISlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), -100, 100, plugin->config.even_offset) diff --git a/cinelerra-5.1/plugins/sketcher/sketcherwindow.C b/cinelerra-5.1/plugins/sketcher/sketcherwindow.C index 2235260c..f62802a7 100644 --- a/cinelerra-5.1/plugins/sketcher/sketcherwindow.C +++ b/cinelerra-5.1/plugins/sketcher/sketcherwindow.C @@ -39,8 +39,8 @@ #define AltMask Mod1Mask -#define COLOR_W 40 -#define COLOR_H 24 +#define COLOR_W xS(40) +#define COLOR_H yS(24) const char *SketcherPoint::types[] = { N_("off"), @@ -79,7 +79,7 @@ int SketcherCurvePenItem::handle_event() } SketcherCurvePen::SketcherCurvePen(SketcherWindow *gui, int x, int y, int pen) - : BC_PopupMenu(x,y,100,_(cv_pen[pen])) + : BC_PopupMenu(x,y,xS(100),_(cv_pen[pen])) { this->gui = gui; this->pen = pen; @@ -256,7 +256,7 @@ void SketcherCurveWidth::update(int width) SketcherWindow::SketcherWindow(Sketcher *plugin) - : PluginClientWindow(plugin, 380, 620, 380, 620, 0) + : PluginClientWindow(plugin, xS(380), yS(620), xS(380), yS(620), 0) { this->plugin = plugin; this->title_pen = 0; this->curve_pen = 0; @@ -293,7 +293,7 @@ SketcherWindow::~SketcherWindow() void SketcherWindow::create_objects() { - int x = 10, y = 10, dy = 0, x1, y1; + int x = xS(10), y = yS(10), dy = 0, x1, y1; int margin = plugin->get_theme()->widget_border; BC_Title *title; int ci = plugin->config.cv_selected; @@ -301,7 +301,7 @@ void SketcherWindow::create_objects() ci = plugin->new_curve(); SketcherCurve *cv = plugin->config.curves[ci]; - reset_curves = new SketcherResetCurves(this, plugin, x1=x, y+3); + reset_curves = new SketcherResetCurves(this, plugin, x1=x, y+yS(3)); add_subwindow(reset_curves); dy = bmax(dy,reset_curves->get_h()); x1 += reset_curves->get_w() + 2*margin; const char *curve_text = _("Curve"); @@ -328,9 +328,9 @@ void SketcherWindow::create_objects() add_subwindow(curve_up); dy = bmax(dy,curve_up->get_h()); x1 += curve_up->get_w() + 4*margin; y1 = BC_Title::calculate_h(this, _("Pen:")); - title_pen = new BC_Title(x1+30, y+dy-y1, _("Pen:")); + title_pen = new BC_Title(x1+xS(30), y+dy-y1, _("Pen:")); add_subwindow(title_pen); dy = bmax(dy,title_pen->get_h()); - int x2 = (get_w()+x1)/2 + 20; + int x2 = (get_w()+x1)/2 + xS(20); y1 = BC_Title::calculate_h(this, _("Color:")); title_color = new BC_Title(x2, y+dy-y1, _("Color:")); add_subwindow(title_color); dy = bmax(dy,title_color->get_h()); @@ -352,17 +352,17 @@ void SketcherWindow::create_objects() curve_list->update(ci); BC_Bar *bar; - bar = new BC_Bar(x, y, get_w()-2*x); + bar = new BC_Bar(x, y, get_w()-xS(2)*x); add_subwindow(bar); dy = bmax(dy,bar->get_h()); - bar = new BC_Bar(x, y+=dy, get_w()-2*x); + bar = new BC_Bar(x, y+=dy, get_w()-xS(2)*x); add_subwindow(bar); dy = bmax(dy,bar->get_h()); - y += dy + 2*margin; + y += dy + yS(2)*margin; int pi = plugin->config.pt_selected; SketcherPoint *pt = pi >= 0 && pi < cv->points.size() ? cv->points[pi] : 0; - reset_points = new SketcherResetPoints(this, plugin, x1=x, y+3); + reset_points = new SketcherResetPoints(this, plugin, x1=x, y+yS(3)); add_subwindow(reset_points); dy = bmax(dy,reset_points->get_h()); - x1 += reset_points->get_w() + 2*margin; + x1 += reset_points->get_w() + xS(2)*margin; if( plugin->config.drag ) { if( !grab(plugin->server->mwindow->cwindow->gui) ) { eprintf("drag enabled, but compositor already grabbed\n"); @@ -371,7 +371,7 @@ void SketcherWindow::create_objects() } drag = new SketcherDrag(this, x1, y); add_subwindow(drag); dy = bmax(dy,drag->get_h()); - x1 += drag->get_w() + 2*margin; + x1 += drag->get_w() + xS(2)*margin; int arc = pt ? pt->arc : ARC_LINE; point_type = new SketcherPointType(this, x1, y, arc); add_subwindow(point_type); dy = bmax(dy,point_type->get_h()); @@ -392,15 +392,15 @@ void SketcherWindow::create_objects() x1 += new_point->get_w() + margin; point_up = new SketcherPointUp(this, x1, y); add_subwindow(point_up); dy = bmax(dy,point_up->get_h()); - x1 += point_up->get_w() + 2*margin; + x1 += point_up->get_w() + xS(2)*margin; title_x = new BC_Title(x1, y, _("X:")); add_subwindow(title_x); dy = bmax(dy,title_x->get_h()); x1 += title_x->get_w() + margin; point_x = new SketcherPointX(this, x1, y, !pt ? 0.f : pt->x); point_x->create_objects(); dy = bmax(dy, point_x->get_h()); - x2 = x1 + point_x->get_w() + 2*margin + 10; + x2 = x1 + point_x->get_w() + xS(2)*margin + xS(10); y1 = BC_Title::calculate_h(this, _("ID:")); - title_id = new BC_Title(x2+16, y+dy-y1, _("ID:")); + title_id = new BC_Title(x2+xS(16), y+dy-y1, _("ID:")); add_subwindow(title_id); dy = bmax(dy, title_id->get_h()); y += dy + margin; dy = 0; @@ -409,7 +409,7 @@ void SketcherWindow::create_objects() x1 += del_point->get_w() + margin; point_dn = new SketcherPointDn(this, x1, y); add_subwindow(point_dn); dy = bmax(dy,point_dn->get_h()); - x1 += point_dn->get_w() + 2*margin; + x1 += point_dn->get_w() + xS(2)*margin; title_y = new BC_Title(x1, y, _("Y:")); add_subwindow(title_y); dy = bmax(dy,title_y->get_h()); x1 += title_y->get_w() + margin; @@ -417,12 +417,12 @@ void SketcherWindow::create_objects() point_y->create_objects(); dy = bmax(dy, point_y->get_h()); point_id = new SketcherPointId(this, x2, y, !pt ? 0 : pt->id); point_id->create_objects(); dy = bmax(dy, point_id->get_h()); - y += dy + margin + 5; dy = 0; + y += dy + margin + yS(5); dy = 0; point_list->update(pi); - bar = new BC_Bar(x, y, get_w()-2*x); + bar = new BC_Bar(x, y, get_w()-xS(2)*x); add_subwindow(bar); dy = bmax(dy,bar->get_h()); - y += dy + 2*margin; + y += dy + yS(2)*margin; add_subwindow(notes0 = new BC_Title(x, y, _("\n" @@ -431,21 +431,21 @@ void SketcherWindow::create_objects() "Ctrl=\n" "Ctrl+Alt=\n" "Ctrl+Shift="))); dy = bmax(dy, notes0->get_h()); - add_subwindow(notes1 = new BC_Title(x+100, y, + add_subwindow(notes1 = new BC_Title(x+xS(100), y, _(" LMB\n" "new line point\n" "select point\n" "drag point\n" "drag all curves\n" "new fill point"))); dy = bmax(dy, notes1->get_h()); - add_subwindow(notes2 = new BC_Title(x+220, y, + add_subwindow(notes2 = new BC_Title(x+xS(220), y, _(" RMB\n" "new arc point\n" "select curve\n" "drag curve\n" "new curve\n" "new off point"))); dy = bmax(dy, notes2->get_h()); - y += dy + margin + 10; + y += dy + margin + yS(10); add_subwindow(notes3 = new BC_Title(x, y, "Key DEL= delete point, +Shift= delete curve\n")); @@ -732,15 +732,15 @@ int SketcherWindow::keypress_event() SketcherCurveList::SketcherCurveList(SketcherWindow *gui, Sketcher *plugin, int x, int y) - : BC_ListBox(x, y, 360, 130, LISTBOX_TEXT) + : BC_ListBox(x, y, xS(360), yS(130), LISTBOX_TEXT) { this->gui = gui; this->plugin = plugin; - col_titles[CV_ID] = _("ID"); col_widths[CV_ID] = 64; - col_titles[CV_RAD] = _("width"); col_widths[CV_RAD] = 64; - col_titles[CV_PEN] = _("pen"); col_widths[CV_PEN] = 64; - col_titles[CV_CLR] = _("color"); col_widths[CV_CLR] = 80; - col_titles[CV_ALP] = _("alpha"); col_widths[CV_ALP] = 64; + col_titles[CV_ID] = _("ID"); col_widths[CV_ID] = xS(64); + col_titles[CV_RAD] = _("width"); col_widths[CV_RAD] = xS(64); + col_titles[CV_PEN] = _("pen"); col_widths[CV_PEN] = xS(64); + col_titles[CV_CLR] = _("color"); col_widths[CV_CLR] = xS(80); + col_titles[CV_ALP] = _("alpha"); col_widths[CV_ALP] = xS(64); } SketcherCurveList::~SketcherCurveList() { @@ -830,7 +830,7 @@ void SketcherCurveList::add_curve(const char *id, const char *pen, } SketcherNewCurve::SketcherNewCurve(SketcherWindow *gui, Sketcher *plugin, int x, int y) - : BC_GenericButton(x, y, 64, _("New")) + : BC_GenericButton(x, y, xS(64), _("New")) { this->gui = gui; this->plugin = plugin; @@ -856,7 +856,7 @@ int SketcherNewCurve::handle_event() } SketcherDelCurve::SketcherDelCurve(SketcherWindow *gui, Sketcher *plugin, int x, int y) - : BC_GenericButton(x, y, 64, C_("Del")) + : BC_GenericButton(x, y, xS(64), C_("Del")) { this->gui = gui; this->plugin = plugin; @@ -967,7 +967,7 @@ int SketcherPointTypeItem::handle_event() } SketcherPointType::SketcherPointType(SketcherWindow *gui, int x, int y, int arc) - : BC_PopupMenu(x,y,100,_(pt_type[arc])) + : BC_PopupMenu(x,y,xS(100),_(pt_type[arc])) { this->gui = gui; this->type = arc; @@ -984,14 +984,14 @@ void SketcherPointType::update(int arc) SketcherPointList::SketcherPointList(SketcherWindow *gui, Sketcher *plugin, int x, int y) - : BC_ListBox(x, y, 360, 130, LISTBOX_TEXT) + : BC_ListBox(x, y, xS(360), yS(130), LISTBOX_TEXT) { this->gui = gui; this->plugin = plugin; - col_titles[PT_ID] = _("ID"); col_widths[PT_ID] = 50; - col_titles[PT_TY] = _("Type"); col_widths[PT_TY] = 80; - col_titles[PT_X] = _("X"); col_widths[PT_X] = 90; - col_titles[PT_Y] = _("Y"); col_widths[PT_Y] = 90; + col_titles[PT_ID] = _("ID"); col_widths[PT_ID] = xS(50); + col_titles[PT_TY] = _("Type"); col_widths[PT_TY] = xS(80); + col_titles[PT_X] = _("X"); col_widths[PT_X] = xS(90); + col_titles[PT_Y] = _("Y"); col_widths[PT_Y] = xS(90); set_selection_mode(LISTBOX_MULTIPLE); } SketcherPointList::~SketcherPointList() @@ -1212,7 +1212,7 @@ int SketcherDrag::handle_event() } SketcherNewPoint::SketcherNewPoint(SketcherWindow *gui, Sketcher *plugin, int x, int y) - : BC_GenericButton(x, y, 64, _("New")) + : BC_GenericButton(x, y, xS(64), _("New")) { this->gui = gui; this->plugin = plugin; @@ -1231,7 +1231,7 @@ int SketcherNewPoint::handle_event() } SketcherDelPoint::SketcherDelPoint(SketcherWindow *gui, Sketcher *plugin, int x, int y) - : BC_GenericButton(x, y, 64, C_("Del")) + : BC_GenericButton(x, y, xS(64), C_("Del")) { this->gui = gui; this->plugin = plugin; diff --git a/cinelerra-5.1/plugins/slide/slide.C b/cinelerra-5.1/plugins/slide/slide.C index 99a2df83..9e6b6d0e 100644 --- a/cinelerra-5.1/plugins/slide/slide.C +++ b/cinelerra-5.1/plugins/slide/slide.C @@ -137,10 +137,10 @@ int SlideOut::handle_event() SlideWindow::SlideWindow(SlideMain *plugin) : PluginClientWindow(plugin, - 320, - 100, - 320, - 100, + xS(320), + yS(100), + xS(320), + yS(100), 0) { this->plugin = plugin; @@ -153,28 +153,30 @@ SlideWindow::SlideWindow(SlideMain *plugin) void SlideWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs100 = xS(100); + int ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; add_subwindow(new BC_Title(x, y, _("Direction:"))); - x += 100; + x += xs100; add_subwindow(left = new SlideLeft(plugin, this, x, y)); - x += 100; + x += xs100; add_subwindow(right = new SlideRight(plugin, this, x, y)); - y += 30; - x = 10; + y += ys30; + x = xs10; add_subwindow(new BC_Title(x, y, _("Direction:"))); - x += 100; + x += xs100; add_subwindow(in = new SlideIn(plugin, this, x, y)); - x += 100; + x += xs100; add_subwindow(out = new SlideOut(plugin, this, x, diff --git a/cinelerra-5.1/plugins/spectrogram/spectrogram.C b/cinelerra-5.1/plugins/spectrogram/spectrogram.C index 7b81bbeb..15730e64 100644 --- a/cinelerra-5.1/plugins/spectrogram/spectrogram.C +++ b/cinelerra-5.1/plugins/spectrogram/spectrogram.C @@ -125,9 +125,7 @@ int SpectrogramLevel::handle_event() SpectrogramMode::SpectrogramMode(Spectrogram *plugin, int x, int y) - : BC_PopupMenu(x, - y, - 120, + : BC_PopupMenu(x, y, xS(120), mode_to_text(plugin->config.mode)) { this->plugin = plugin; @@ -195,13 +193,8 @@ int SpectrogramHistory::handle_event() SpectrogramWindowSize::SpectrogramWindowSize(Spectrogram *plugin, - int x, - int y, - char *text) - : BC_PopupMenu(x, - y, - 80, - text) + int x, int y, char *text) + : BC_PopupMenu(x, y, xS(120), text) { this->plugin = plugin; } @@ -266,10 +259,7 @@ int SpectrogramNormalize::handle_event() SpectrogramFreq::SpectrogramFreq(Spectrogram *plugin, int x, int y) - : BC_TextBox(x, - y, - 100, - 1, + : BC_TextBox(x, y, xS(100), 1, (int)plugin->config.frequency) { this->plugin = plugin; @@ -345,8 +335,8 @@ void SpectrogramCanvas::calculate_point() { int x = get_cursor_x(); int y = get_cursor_y(); - CLAMP(x, 0, get_w() - 1); - CLAMP(y, 0, get_h() - 1); + CLAMP(x, 0, get_w()-1); + CLAMP(y, 0, get_h()-1); ((SpectrogramWindow*)plugin->thread->window)->calculate_frequency( x, @@ -377,12 +367,8 @@ void SpectrogramCanvas::draw_overlay() SpectrogramWindow::SpectrogramWindow(Spectrogram *plugin) - : PluginClientWindow(plugin, - plugin->w, - plugin->h, - 320, - 320, - 1) + : PluginClientWindow(plugin, plugin->w, plugin->h, + xS(320), yS(320), 1) { this->plugin = plugin; probe_x = probe_y = -1; @@ -403,11 +389,7 @@ void SpectrogramWindow::create_objects() add_subwindow(canvas = new SpectrogramCanvas(plugin, - 0, - 0, - get_w(), - get_h() - - BC_Pot::calculate_h() * 2 - + 0, 0, get_w(), get_h() - BC_Pot::calculate_h() * 2 - plugin->get_theme()->widget_border * 3)); canvas->set_cursor(CROSS_CURSOR, 0, 0); @@ -666,8 +648,8 @@ Spectrogram::Spectrogram(PluginServer *server) { reset(); timer = new Timer; - w = 640; - h = 480; + w = xS(640); + h = yS(480); } Spectrogram::~Spectrogram() @@ -1030,10 +1012,10 @@ void Spectrogram::update_gui() float db = ptr->data[ MIN((w - x2), ptr->data_size - 1)]; //if(x2 > w - 10) printf("%.02f ", ptr->data[x2]); - int y2 = h - 1 - (int)((db - INFINITYGAIN) / + int y2 = h-1 - (int)((db - INFINITYGAIN) / (0 - INFINITYGAIN) * h); - CLAMP(y2, 0, h - 1); + CLAMP(y2, 0, h-1); if(number) { diff --git a/cinelerra-5.1/plugins/spherecam/spherecam.C b/cinelerra-5.1/plugins/spherecam/spherecam.C index 692c1a84..dcb455b3 100644 --- a/cinelerra-5.1/plugins/spherecam/spherecam.C +++ b/cinelerra-5.1/plugins/spherecam/spherecam.C @@ -140,8 +140,8 @@ SphereCamSlider::SphereCamSlider(SphereCamMain *client, : BC_FSlider(x, y, 0, - gui->get_w() / 2 - client->get_theme()->widget_border * 3 - 100, - gui->get_w() / 2 - client->get_theme()->widget_border * 3 - 100, + gui->get_w() / 2 - client->get_theme()->widget_border * xS(3) - xS(100), + gui->get_w() / 2 - client->get_theme()->widget_border * xS(3) - xS(100), min, max, *output) @@ -168,7 +168,7 @@ SphereCamText::SphereCamText(SphereCamMain *client, float *output, int x, int y) - : BC_TextBox(x, y, 100, 1, *output) + : BC_TextBox(x, y, xS(100), 1, *output) { this->gui = gui; this->client = client; @@ -238,7 +238,7 @@ int SphereCamMode::calculate_w(SphereCamGUI *gui) result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(SphereCamConfig::EQUIRECT))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(SphereCamConfig::DO_NOTHING))); result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(SphereCamConfig::ALIGN))); - return result + 50; + return result + xS(50); } int SphereCamMode::from_text(char *text) @@ -270,7 +270,7 @@ const char* SphereCamMode::to_text(int mode) SphereCamGUI::SphereCamGUI(SphereCamMain *client) - : PluginClientWindow(client, 640, 600, 640, 600, 0) + : PluginClientWindow(client, xS(640), yS(600), xS(640), yS(600), 0) { this->client = client; } diff --git a/cinelerra-5.1/plugins/stylizeobj/stylizeobjwindow.C b/cinelerra-5.1/plugins/stylizeobj/stylizeobjwindow.C index 9b68d965..b6091645 100644 --- a/cinelerra-5.1/plugins/stylizeobj/stylizeobjwindow.C +++ b/cinelerra-5.1/plugins/stylizeobj/stylizeobjwindow.C @@ -26,7 +26,7 @@ #include "theme.h" StylizeObjWindow::StylizeObjWindow(StylizeObj *plugin) - : PluginClientWindow(plugin, 320, 160, 320, 160, 0) + : PluginClientWindow(plugin, xS(320), yS(160), xS(320), yS(160), 0) { this->plugin = plugin; smoothing = 0; @@ -43,16 +43,18 @@ StylizeObjWindow::~StylizeObjWindow() void StylizeObjWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys15 = yS(15); + int x = xs10, y = ys10; BC_Title *title = new BC_Title(x, y, _("StylizeObj")); add_subwindow(title); - y += title->get_h() + 10; + y += title->get_h() + ys10; int x1 = x; add_subwindow(title = new BC_Title(x1, y, _("Mode: "))); - x1 += title->get_w() + 15; + x1 += title->get_w() + ys15; add_subwindow(mode = new StylizeObjMode(this, x1, y, &plugin->config.mode)); mode->create_objects(); - y += mode->get_h() + 10; + y += mode->get_h() + ys10; x0 = x; y0 = y; update_params(); show_window(1); @@ -60,28 +62,29 @@ void StylizeObjWindow::create_objects() void StylizeObjWindow::update_params() { + int ys10 = yS(10); int x = x0, y = y0; if( plugin->config.mode == MODE_PENCIL_SKETCH || plugin->config.mode == MODE_COLOR_SKETCH ) { - int x1 = x + 80; + int x1 = x + xS(80); if( !smooth_title ) add_subwindow(smooth_title = new BC_Title(x,y,_("Smooth:"))); if( !smoothing ) add_subwindow(smoothing = new StylizeObjFSlider(this, - x1,y,180, 0,100, &plugin->config.smoothing)); - y += smoothing->get_h() + 10; + x1,y,xS(180), 0,xS(100), &plugin->config.smoothing)); + y += smoothing->get_h() + ys10; if( !edge_title ) add_subwindow(edge_title = new BC_Title(x,y,_("Edges:"))); if( !edge_strength ) add_subwindow(edge_strength = new StylizeObjFSlider(this, - x1,y,180, 0,100, &plugin->config.edge_strength)); - y += edge_strength->get_h() + 10; + x1,y,xS(180), 0,xS(100), &plugin->config.edge_strength)); + y += edge_strength->get_h() + ys10; if( !shade_title ) add_subwindow(shade_title = new BC_Title(x,y,_("Shade:"))); if( !shade_factor ) add_subwindow(shade_factor = new StylizeObjFSlider(this, - x1,y,180, 0,100, &plugin->config.shade_factor)); - //y += shade_factor->get_h() + 10; + x1,y,xS(180), 0,xS(100), &plugin->config.shade_factor)); + //y += shade_factor->get_h() + ys10; } else { delete smooth_title; smooth_title = 0; @@ -112,7 +115,7 @@ int StylizeObjModeItem::handle_event() } StylizeObjMode::StylizeObjMode(StylizeObjWindow *win, int x, int y, int *value) - : BC_PopupMenu(x, y, 150, "", 1) + : BC_PopupMenu(x, y, xS(150), "", 1) { this->win = win; this->value = value; diff --git a/cinelerra-5.1/plugins/svg/svgwin.C b/cinelerra-5.1/plugins/svg/svgwin.C index 028a9307..e5f5b920 100644 --- a/cinelerra-5.1/plugins/svg/svgwin.C +++ b/cinelerra-5.1/plugins/svg/svgwin.C @@ -44,7 +44,7 @@ struct fifo_struct { }; SvgWin::SvgWin(SvgMain *client) - : PluginClientWindow(client, 420, 210, 420, 210, 1) + : PluginClientWindow(client, xS(420), yS(210), xS(420), yS(210), 1) { this->client = client; this->editing = 0; @@ -56,19 +56,21 @@ SvgWin::~SvgWin() void SvgWin::create_objects() { + int xs10 = xS(10), xs15 = xS(15); + int ys5 = yS(5), ys10 = yS(10), ys20 = yS(20), ys15 = yS(15); BC_Title *title; - int x0 = 10, y = 10; + int x0 = xs10, y = ys10; add_tool(title = new BC_Title(x0, y, _("Out X:"))); - int x1 = x0 + title->get_w() + 10; + int x1 = x0 + title->get_w() + xs10; out_x = new SvgCoord(this, client, x1, y, &client->config.out_x); out_x->create_objects(); - int x2 = x1 + out_x->get_w() + 15; + int x2 = x1 + out_x->get_w() + xs15; add_tool(title = new BC_Title(x2, y, _("Out W:"))); - int x3 = x2 + title->get_w() + 10; + int x3 = x2 + title->get_w() + xs10; out_w = new SvgCoord(this, client, x3, y, &client->config.out_w); out_w->create_objects(); - y += out_x->get_h() + 5; + y += out_x->get_h() + ys5; add_tool(new BC_Title(x0, y, _("Out Y:"))); out_y = new SvgCoord(this, client, x1, y, &client->config.out_y); @@ -76,17 +78,17 @@ void SvgWin::create_objects() add_tool(title = new BC_Title(x2, y, _("Out H:"))); out_h = new SvgCoord(this, client, x3, y, &client->config.out_h); out_h->create_objects(); - y += out_y->get_h() + 20; + y += out_y->get_h() + ys20; add_tool(title = new BC_Title(x0, y, _("DPI:"))); dpi = new DpiValue(this, client, x1, y, &client->config.dpi); dpi->create_objects(); add_tool(dpi_button = new DpiButton(this, client, x2, y)); dpi_button->create_objects(); - y += dpi->get_h() + 20; + y += dpi->get_h() + ys20; add_tool(svg_file_title = new BC_Title(x0, y, client->config.svg_file)); - y += svg_file_title->get_h() + 5; + y += svg_file_title->get_h() + ys5; struct stat st; int64_t ms_time = stat(client->config.svg_file, &st) ? 0 : st.st_mtim.tv_sec*1000 + st.st_mtim.tv_nsec/1000000; @@ -96,12 +98,12 @@ void SvgWin::create_objects() ctime_r(&tm ,mtime); } add_tool(svg_file_mstime = new BC_Title(x0, y, mtime)); - y += svg_file_mstime->get_h() + 15; + y += svg_file_mstime->get_h() + ys15; - y = get_h() - NewSvgButton::calculate_h() - 5; + y = get_h() - NewSvgButton::calculate_h() - ys5; add_tool(new_svg_button = new NewSvgButton(client, this, x0, y)); - y = get_h() - EditSvgButton::calculate_h() - 5; - add_tool(edit_svg_button = new EditSvgButton(client, this, x0+300, y)); + y = get_h() - EditSvgButton::calculate_h() - ys5; + add_tool(edit_svg_button = new EditSvgButton(client, this, x0+xS(300), y)); show_window(); flush(); @@ -142,7 +144,7 @@ void SvgWin::update_gui(SvgConfig &config) } SvgCoord::SvgCoord(SvgWin *win, SvgMain *client, int x, int y, float *value) - : BC_TumbleTextBox(win, *value, (float)0, (float)3000, x, y, 100) + : BC_TumbleTextBox(win, *value, (float)0, (float)3000, x, y, xS(100)) { //printf("SvgWidth::SvgWidth %f\n", client->config.w); this->client = client; diff --git a/cinelerra-5.1/plugins/swapchannels/swapchannels.C b/cinelerra-5.1/plugins/swapchannels/swapchannels.C index 52ab4caf..3fc831fb 100644 --- a/cinelerra-5.1/plugins/swapchannels/swapchannels.C +++ b/cinelerra-5.1/plugins/swapchannels/swapchannels.C @@ -85,10 +85,10 @@ void SwapConfig::copy_from(SwapConfig &that) SwapWindow::SwapWindow(SwapMain *plugin) : PluginClientWindow(plugin, - 250, - 200, - 250, - 200, + xS(250), + yS(200), + xS(250), + yS(200), 0) { this->plugin = plugin; @@ -101,28 +101,30 @@ SwapWindow::~SwapWindow() void SwapWindow::create_objects() { - int x = 10, y = 10; - int margin = 30; + int xs10 = xS(10), xs30 = xS(30), xs160 = xS(160); + int ys5 = yS(5), ys10 = yS(10), ys40 = yS(40); + int x = xs10, y = ys10; + int margin = xs30; add_subwindow(new BC_Title(x, y, _("Swap channels"))); y += margin; - add_subwindow(new BC_Title(x + 160, y + 5, _("-> Red"))); + add_subwindow(new BC_Title(x + xs160, y + ys5, _("-> Red"))); add_subwindow(red = new SwapMenu(plugin, &(plugin->config.red), x, y)); red->create_objects(); y += margin; - add_subwindow(new BC_Title(x + 160, y + 5, _("-> Green"))); + add_subwindow(new BC_Title(x + xs160, y + ys5, _("-> Green"))); add_subwindow(green = new SwapMenu(plugin, &(plugin->config.green), x, y)); green->create_objects(); y += margin; - add_subwindow(new BC_Title(x + 160, y + 5, _("-> Blue"))); + add_subwindow(new BC_Title(x + xs160, y + ys5, _("-> Blue"))); add_subwindow(blue = new SwapMenu(plugin, &(plugin->config.blue), x, y)); blue->create_objects(); y += margin; - add_subwindow(new BC_Title(x + 160, y + 5, _("-> Alpha"))); + add_subwindow(new BC_Title(x + xs160, y + ys5, _("-> Alpha"))); add_subwindow(alpha = new SwapMenu(plugin, &(plugin->config.alpha), x, y)); alpha->create_objects(); - y += 40; + y += ys40; add_subwindow(reset = new SwapReset(plugin, this, x, y)); show_window(); @@ -137,7 +139,7 @@ void SwapWindow::create_objects() SwapMenu::SwapMenu(SwapMain *client, int *output, int x, int y) - : BC_PopupMenu(x, y, 150, client->output_to_text(*output)) + : BC_PopupMenu(x, y, xS(150), client->output_to_text(*output)) { this->client = client; this->output = output; diff --git a/cinelerra-5.1/plugins/swapframes/swapframes.C b/cinelerra-5.1/plugins/swapframes/swapframes.C index 6e37f7a0..69b395f6 100644 --- a/cinelerra-5.1/plugins/swapframes/swapframes.C +++ b/cinelerra-5.1/plugins/swapframes/swapframes.C @@ -184,10 +184,10 @@ int SwapFramesReset::handle_event() SwapFramesWindow::SwapFramesWindow(SwapFrames *plugin) : PluginClientWindow(plugin, - 260, - 135, - 260, - 135, + xS(260), + yS(135), + xS(260), + yS(135), 0) { this->plugin = plugin; @@ -195,23 +195,25 @@ SwapFramesWindow::SwapFramesWindow(SwapFrames *plugin) void SwapFramesWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10), ys35 = yS(35); + int x = xs10, y = ys10; add_subwindow(on = new SwapFramesOn(plugin, x, y)); - y += on->get_h() + 5; + y += on->get_h() + ys5; BC_Bar *bar; - add_subwindow(bar = new BC_Bar(x, y, get_w() - x * 2)); - y += bar->get_h() + 5; + add_subwindow(bar = new BC_Bar(x, y, get_w() - x * xS(2))); + y += bar->get_h() + ys5; add_subwindow(swap_even = new SwapFramesEven(plugin, this, x, y)); - y += swap_even->get_h() + 5; + y += swap_even->get_h() + ys5; add_subwindow(swap_odd = new SwapFramesOdd(plugin, this, x, y)); - y += 35; + y += ys35; add_subwindow(reset = new SwapFramesReset(plugin, this, x, y)); show_window(); diff --git a/cinelerra-5.1/plugins/synthesizer/synthesizer.C b/cinelerra-5.1/plugins/synthesizer/synthesizer.C index 194da4c7..909b1928 100644 --- a/cinelerra-5.1/plugins/synthesizer/synthesizer.C +++ b/cinelerra-5.1/plugins/synthesizer/synthesizer.C @@ -44,8 +44,8 @@ Synth::Synth(PluginServer *server) : PluginAClient(server) { reset(); - window_w = 640; - window_h = 480; + window_w = xS(640); + window_h = yS(480); } @@ -531,8 +531,8 @@ SynthWindow::SynthWindow(Synth *synth) : PluginClientWindow(synth, synth->window_w, synth->window_h, - 400, - 350, + xS(400), + yS(350), 1) { this->synth = synth; @@ -590,66 +590,68 @@ void SynthWindow::create_objects() harmonicmenu->add_item(new SynthFreqOdd(synth)); harmonicmenu->add_item(new SynthFreqPrime(synth)); - int x = 10, y = 30; + int xs10 = xS(10), xs20 = xS(20), xs50 = xS(50), xs70 = xS(70), xs75 = xS(75), xs240 = xS(240), xs265 = xS(265); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(40), ys220 = yS(220); + int x = xs10, y = ys30; add_subwindow(new BC_Title(x, y, _("Waveform"))); - x += 240; + x += xs240; add_subwindow(new BC_Title(x, y, _("Wave Function"))); - y += 20; - x = 10; - add_subwindow(canvas = new SynthCanvas(synth, this, x, y, 230, 160)); + y += ys20; + x = xs10; + add_subwindow(canvas = new SynthCanvas(synth, this, x, y, xS(230), yS(160))); canvas->update(); - x += 240; + x += xs240; char string[BCTEXTLEN]; waveform_to_text(string, synth->config.wavefunction); add_subwindow(waveform = new SynthWaveForm(synth, x, y, string)); waveform->create_objects(); - y += 30; - int x1 = x + waveform->get_w() + 10; + y += ys30; + int x1 = x + waveform->get_w() + xs10; add_subwindow(new BC_Title(x, y, _("Base Frequency:"))); - y += 30; + y += ys30; add_subwindow(base_freq = new SynthBaseFreq(synth, this, x, y)); base_freq->update((float)synth->config.base_freq[0]); x += base_freq->get_w() + synth->get_theme()->widget_border; - add_subwindow(freqpot = new SynthFreqPot(synth, this, x, y - 10)); + add_subwindow(freqpot = new SynthFreqPot(synth, this, x, y - ys10)); base_freq->freq_pot = freqpot; freqpot->freq_text = base_freq; x -= base_freq->get_w() + synth->get_theme()->widget_border; - y += 40; + y += ys40; add_subwindow(new BC_Title(x, y, _("Wetness:"))); - add_subwindow(wetness = new SynthWetness(synth, x + 70, y - 10)); + add_subwindow(wetness = new SynthWetness(synth, x + xs70, y - ys10)); - y += 40; + y += ys40; add_subwindow(new SynthClear(synth, x, y)); - x = 50; - y = 220; + x = xs50; + y = ys220; add_subwindow(new BC_Title(x, y, _("Level"))); - x += 75; + x += xs75; add_subwindow(new BC_Title(x, y, _("Phase"))); - x += 75; + x += xs75; add_subwindow(new BC_Title(x, y, _("Harmonic"))); - y += 20; x = 10; - add_subwindow(osc_subwindow = new BC_SubWindow(x, y, 265, get_h() - y)); - x += 265; + y += ys20; x = xs10; + add_subwindow(osc_subwindow = new BC_SubWindow(x, y, xs265, get_h() - y)); + x += xs265; add_subwindow(osc_scroll = new OscScroll(synth, this, x, y, get_h() - y)); - x += 20; + x += xs20; add_subwindow(new SynthAddOsc(synth, this, x, y)); - y += 30; + y += ys30; add_subwindow(new SynthDelOsc(synth, this, x, y)); // Create keyboard - y = 30; + y = ys30; #include "white_up_png.h" #include "white_hi_png.h" @@ -1482,7 +1484,7 @@ int SynthClear::handle_event() SynthWaveForm::SynthWaveForm(Synth *synth, int x, int y, char *text) - : BC_PopupMenu(x, y, 120, text) + : BC_PopupMenu(x, y, xS(120), text) { this->synth = synth; } @@ -1566,7 +1568,7 @@ int SynthFreqPot::handle_event() SynthBaseFreq::SynthBaseFreq(Synth *synth, SynthWindow *window, int x, int y) - : BC_TextBox(x, y, 100, 1, (float)0) + : BC_TextBox(x, y, xS(100), 1, (float)0) { this->synth = synth; this->window = window; diff --git a/cinelerra-5.1/plugins/theme_blond/blondtheme.C b/cinelerra-5.1/plugins/theme_blond/blondtheme.C index 3babdd66..0390829e 100644 --- a/cinelerra-5.1/plugins/theme_blond/blondtheme.C +++ b/cinelerra-5.1/plugins/theme_blond/blondtheme.C @@ -53,12 +53,6 @@ PluginClient* new_plugin(PluginServer *server) return new BlondThemeMain(server); } - - - - - - BlondThemeMain::BlondThemeMain(PluginServer *server) : PluginTClient(server) { @@ -78,13 +72,6 @@ Theme* BlondThemeMain::new_theme() return theme; } - - - - - - - BlondTheme::BlondTheme() : Theme() { @@ -124,7 +111,7 @@ void BlondTheme::initialize() resources->popup_title_text = 0x000000; resources->menu_item_text = 0x000000; resources->menu_highlighted_fontcolor = WHITE; - resources->generic_button_margin = 30; + resources->generic_button_margin = xS(30); resources->pot_needle_color = resources->text_default; resources->pot_offset = 1; resources->progress_text = resources->text_default; @@ -135,13 +122,13 @@ void BlondTheme::initialize() resources->menu_down = 0x4b4b4b; resources->menu_up = 0x4b4b4b; resources->menu_shadow = 0x202020; - resources->popupmenu_margin = 15; - resources->popupmenu_triangle_margin = 15; + resources->popupmenu_margin = xS(15); + resources->popupmenu_triangle_margin = xS(15); resources->listbox_title_color = 0x000000; - resources->listbox_title_margin = 20; - resources->listbox_title_hotspot = 20; + resources->listbox_title_margin = xS(20); + resources->listbox_title_hotspot = xS(20); resources->listbox_border1 = 0x1a1a1a; resources->listbox_border2 = 0xcecea2; resources->listbox_border3 = 0xcecea2; @@ -151,7 +138,7 @@ void BlondTheme::initialize() resources->listbox_bg = 0; resources->listbox_text = 0x000000; - resources->filebox_margin = 130; + resources->filebox_margin = yS(130); resources->file_color = 0x000000; resources->directory_color = 0xa0a0ff; @@ -394,7 +381,7 @@ void BlondTheme::initialize() resources->bar_data = new_image("bar", "bar.png"); resources->check = new_image("check", "check.png"); - resources->min_menu_w = 96; + resources->min_menu_w = xS(96); resources->menu_popup_bg = new_image("menu_popup_bg.png"); resources->menu_item_bg = new_image_set(3, "menuitem_up.png", @@ -526,7 +513,7 @@ void BlondTheme::initialize() "vscroll_right_up.png", "vscroll_right_hi.png", "vscroll_right_dn.png"); - resources->scroll_minhandle = 20; + resources->scroll_minhandle = xS(20); new_button("prevtip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip"); @@ -544,17 +531,17 @@ void BlondTheme::initialize() preferences_category_overlap = 0; preferencescategory_x = 0; - preferencescategory_y = 5; - preferencestitle_x = 5; - preferencestitle_y = 10; - preferencesoptions_x = 5; + preferencescategory_y = yS(5); + preferencestitle_x = xS(5); + preferencestitle_y = yS(10); + preferencesoptions_x = xS(5); preferencesoptions_y = 0; // MWindow message_normal = resources->text_default; audio_color = GREEN; - mtransport_margin = 10; - toggle_margin = 10; + mtransport_margin = xS(10); + toggle_margin = xS(10); new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png", "pane"); new_image_set("xpane", 3, "xpane_up.png", "xpane_hi.png", "xpane_dn.png"); @@ -605,22 +592,22 @@ void BlondTheme::initialize() setformat_w = get_image("setformat_bg")->get_w(); setformat_h = get_image("setformat_bg")->get_h(); - setformat_x1 = 15; - setformat_x2 = 110; + setformat_x1 = xS(15); + setformat_x2 = xS(110); - setformat_x3 = 315; - setformat_x4 = 425; - setformat_y1 = 20; - setformat_y2 = 85; - setformat_y3 = 125; - setformat_margin = 30; - setformat_channels_x = 25; - setformat_channels_y = 242; - setformat_channels_w = 250; - setformat_channels_h = 250; + setformat_x3 = xS(315); + setformat_x4 = xS(425); + setformat_y1 = xS(20); + setformat_y2 = xS(85); + setformat_y3 = xS(125); + setformat_margin = xS(30); + setformat_channels_x = xS(25); + setformat_channels_y = yS(242); + setformat_channels_w = xS(250); + setformat_channels_h = yS(250); - loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + 10; - browse_pad = 20; + loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + yS(10); + browse_pad = yS(20); new_toggle("playpatch.png", @@ -933,13 +920,13 @@ void BlondTheme::initialize() recordgui_variable_color = RED; channel_position_color = MEYELLOW; - resources->meter_title_w = 25; + resources->meter_title_w = xS(25); // (asset) edit info text color edit_font_color = YELLOW; } -#define VWINDOW_METER_MARGIN 5 +#define VWINDOW_METER_MARGIN xS(5) void BlondTheme::build_bg_data() @@ -974,18 +961,18 @@ void BlondTheme::build_overlays() void BlondTheme::draw_rwindow_bg(RecordGUI *gui) { // int y; -// int margin = 50; -// int margin2 = 80; +// int margin = xS(50); +// int margin2 = xS(80); // gui->draw_9segment(recordgui_batch_x - margin, // 0, // mwindow->session->rwindow_w - recordgui_status_x + margin, // recordgui_buttons_y, // rgui_batch); // gui->draw_3segmenth(recordgui_options_x - margin2, -// recordgui_buttons_y - 5, +// recordgui_buttons_y - yS(5), // mwindow->session->rwindow_w - recordgui_options_x + margin2, // rgui_controls); -// y = recordgui_buttons_y - 5 + rgui_controls->get_h(); +// y = recordgui_buttons_y - yS(5) + rgui_controls->get_h(); // gui->draw_9segment(0, // y, // mwindow->session->rwindow_w, @@ -995,27 +982,21 @@ void BlondTheme::draw_rwindow_bg(RecordGUI *gui) void BlondTheme::draw_rmonitor_bg(RecordMonitorGUI *gui) { -// int margin = 45; -// int panel_w = 300; +// int margin = xS(45); +// int panel_w = xS(300); // int x = rmonitor_meter_x - margin; // int w = mwindow->session->rmonitor_w - x; // if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w(); -// gui->clear_box(0, -// 0, +// gui->clear_box(0, 0, // mwindow->session->rmonitor_w, // mwindow->session->rmonitor_h); -// gui->draw_9segment(x, -// 0, +// gui->draw_9segment(x, 0, // w, // mwindow->session->rmonitor_h, // rmonitor_meters); } - - - - void BlondTheme::draw_mwindow_bg(MWindowGUI *gui) { // Button bar @@ -1027,18 +1008,19 @@ void BlondTheme::draw_mwindow_bg(MWindowGUI *gui) x += 9 * get_image("play")->get_w(); x += mtransport_margin; // the control buttons + int xs2 = xS(2); gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 2 * get_image("arrow")->get_w() + toggle_margin; // the mode buttons gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 3 * get_image("autokeyframe")->get_w() + toggle_margin; // the state toggle buttons gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); // Clock @@ -1048,10 +1030,8 @@ void BlondTheme::draw_mwindow_bg(MWindowGUI *gui) get_image("clock_bg")); // Patchbay - gui->draw_3segmentv(patchbay_x, - patchbay_y, - patchbay_h, - get_image("patchbay_bg")); + gui->draw_3segmentv(patchbay_x, patchbay_y, + patchbay_h, get_image("patchbay_bg")); // Track canvas gui->set_color(BLACK); @@ -1061,17 +1041,13 @@ void BlondTheme::draw_mwindow_bg(MWindowGUI *gui) mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ) - mtimebar_h); // Timebar - gui->draw_3segmenth(mtimebar_x, - mtimebar_y, - mtimebar_w, - get_image("timebar_bg")); + gui->draw_3segmenth(mtimebar_x, mtimebar_y, + mtimebar_w, get_image("timebar_bg")); // Zoombar gui->set_color(0xcecea2); - gui->draw_box(mzoom_x, - mzoom_y, - mwindow->session->mwindow_w, - 25); + gui->draw_box(mzoom_x, mzoom_y, + mwindow->session->mwindow_w, yS(25)); // Scrollbar filler // gui->draw_vframe(get_image("mscroll_filler"), @@ -1083,8 +1059,6 @@ void BlondTheme::draw_mwindow_bg(MWindowGUI *gui) mzoom_y, mzoom_w, get_image("statusbar")); - - } void BlondTheme::draw_cwindow_bg(CWindowGUI *gui) @@ -1109,42 +1083,36 @@ void BlondTheme::draw_cwindow_bg(CWindowGUI *gui) { gui->draw_3segmenth(cstatus_x, ccomposite_h, - cmeter_x - widget_border - cstatus_x + 100, + cmeter_x - widget_border - cstatus_x + xS(100), get_image("cbuttons_right")); } } void BlondTheme::draw_vwindow_bg(VWindowGUI *gui) { - gui->draw_3segmenth(0, - vcanvas_h, + gui->draw_3segmenth(0, vcanvas_h, vdivision_x, get_image("vbuttons_left")); if(mwindow->edl->session->vwindow_meter) { - gui->draw_3segmenth(vdivision_x, - vcanvas_h, + gui->draw_3segmenth(vdivision_x, vcanvas_h, vmeter_x - widget_border - vdivision_x, get_image("cbuttons_right")); - gui->draw_9segment(vmeter_x - widget_border, - 0, + gui->draw_9segment(vmeter_x - widget_border, 0, mwindow->session->vwindow_w - vmeter_x + widget_border, mwindow->session->vwindow_h, get_image("cmeter_bg")); } else { - gui->draw_3segmenth(vdivision_x, - vcanvas_h, - vmeter_x - widget_border - vdivision_x + 100, + gui->draw_3segmenth(vdivision_x, vcanvas_h, + vmeter_x - widget_border - vdivision_x + xS(100), get_image("cbuttons_right")); } // Clock border - gui->draw_3segmenth(vtime_x - 20, - vtime_y - 1, - vtime_w + 40, - get_image("vclock")); + gui->draw_3segmenth(vtime_x - xS(20), vtime_y - 1, + vtime_w + xS(40), get_image("vclock")); } void BlondTheme::draw_preferences_bg(PreferencesWindow *gui) diff --git a/cinelerra-5.1/plugins/theme_blond/mask_all_linear.png b/cinelerra-5.1/plugins/theme_blond/mask_all_linear.png deleted file mode 100644 index 001d0e96..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_all_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_all_smooth.png b/cinelerra-5.1/plugins/theme_blond/mask_all_smooth.png deleted file mode 100644 index 49fa6d1f..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_all_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_button_dn.png b/cinelerra-5.1/plugins/theme_blond/mask_button_dn.png deleted file mode 100644 index 9d9eefe6..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_button_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_button_hi.png b/cinelerra-5.1/plugins/theme_blond/mask_button_hi.png deleted file mode 100644 index d0863324..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_button_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_button_up.png b/cinelerra-5.1/plugins/theme_blond/mask_button_up.png deleted file mode 100644 index bf161e8e..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_button_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_crv_linear.png b/cinelerra-5.1/plugins/theme_blond/mask_crv_linear.png deleted file mode 100644 index 776f9779..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_crv_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_crv_smooth.png b/cinelerra-5.1/plugins/theme_blond/mask_crv_smooth.png deleted file mode 100644 index 2670fdbf..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_crv_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_pnt_linear.png b/cinelerra-5.1/plugins/theme_blond/mask_pnt_linear.png deleted file mode 100644 index 1301f2f7..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_pnt_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_pnt_smooth.png b/cinelerra-5.1/plugins/theme_blond/mask_pnt_smooth.png deleted file mode 100644 index 7a8c72ec..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_pnt_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_prst_crc.png b/cinelerra-5.1/plugins/theme_blond/mask_prst_crc.png deleted file mode 100644 index 06097a45..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_prst_crc.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_prst_load.png b/cinelerra-5.1/plugins/theme_blond/mask_prst_load.png deleted file mode 100644 index d02083f1..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_prst_load.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_prst_ovl.png b/cinelerra-5.1/plugins/theme_blond/mask_prst_ovl.png deleted file mode 100644 index 28bcce28..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_prst_ovl.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_prst_save.png b/cinelerra-5.1/plugins/theme_blond/mask_prst_save.png deleted file mode 100644 index c4cfd9a9..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_prst_save.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_prst_sqr.png b/cinelerra-5.1/plugins/theme_blond/mask_prst_sqr.png deleted file mode 100644 index dd30da16..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_prst_sqr.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_prst_tri.png b/cinelerra-5.1/plugins/theme_blond/mask_prst_tri.png deleted file mode 100644 index cd1090b5..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_prst_tri.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_prst_trsh.png b/cinelerra-5.1/plugins/theme_blond/mask_prst_trsh.png deleted file mode 100644 index 1b47ed90..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_prst_trsh.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_pstn_cen.png b/cinelerra-5.1/plugins/theme_blond/mask_pstn_cen.png deleted file mode 100644 index 3a387219..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_pstn_cen.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_pstn_nrm.png b/cinelerra-5.1/plugins/theme_blond/mask_pstn_nrm.png deleted file mode 100644 index fcae6372..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_pstn_nrm.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_scale_chkd.png b/cinelerra-5.1/plugins/theme_blond/mask_scale_chkd.png deleted file mode 100644 index 6e75ca43..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_scale_chkd.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_scale_chkdhi.png b/cinelerra-5.1/plugins/theme_blond/mask_scale_chkdhi.png deleted file mode 100644 index 560dac4d..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_scale_chkdhi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_scale_up.png b/cinelerra-5.1/plugins/theme_blond/mask_scale_up.png deleted file mode 100644 index bf161e8e..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_scale_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_scale_uphi.png b/cinelerra-5.1/plugins/theme_blond/mask_scale_uphi.png deleted file mode 100644 index d0863324..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_scale_uphi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_scale_x.png b/cinelerra-5.1/plugins/theme_blond/mask_scale_x.png deleted file mode 100644 index 6055af16..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_scale_x.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_scale_xdown.png b/cinelerra-5.1/plugins/theme_blond/mask_scale_xdown.png deleted file mode 100644 index 812086aa..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_scale_xdown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_scale_xy.png b/cinelerra-5.1/plugins/theme_blond/mask_scale_xy.png deleted file mode 100644 index 4464ab34..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_scale_xy.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_scale_xydown.png b/cinelerra-5.1/plugins/theme_blond/mask_scale_xydown.png deleted file mode 100644 index 5fb66c23..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_scale_xydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_scale_y.png b/cinelerra-5.1/plugins/theme_blond/mask_scale_y.png deleted file mode 100644 index c3879aa5..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_scale_y.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/mask_scale_ydown.png b/cinelerra-5.1/plugins/theme_blond/mask_scale_ydown.png deleted file mode 100644 index 18b39836..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/mask_scale_ydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/unclear.png b/cinelerra-5.1/plugins/theme_blond/unclear.png deleted file mode 100644 index 8e631961..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/unclear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/unclear_dn.png b/cinelerra-5.1/plugins/theme_blond/unclear_dn.png deleted file mode 100644 index 9d9eefe6..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/unclear_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/unclear_hi.png b/cinelerra-5.1/plugins/theme_blond/unclear_hi.png deleted file mode 100644 index d0863324..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/unclear_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond/unclear_up.png b/cinelerra-5.1/plugins/theme_blond/unclear_up.png deleted file mode 100644 index bf161e8e..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond/unclear_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C index 7830a1d2..3e11654d 100644 --- a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C +++ b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C @@ -45,19 +45,11 @@ #include "vwindowgui.h" - - PluginClient* new_plugin(PluginServer *server) { return new BlondCVThemeMain(server); } - - - - - - BlondCVThemeMain::BlondCVThemeMain(PluginServer *server) : PluginTClient(server) { @@ -78,12 +70,6 @@ Theme* BlondCVThemeMain::new_theme() } - - - - - - BlondCVTheme::BlondCVTheme() : Theme() { @@ -185,7 +171,7 @@ void BlondCVTheme::initialize() "radial_down.png", "radial_checkedhi.png"); - resources->generic_button_margin = 15; + resources->generic_button_margin = xS(15); resources->pot_needle_color = resources->text_default; resources->pot_offset = 1; resources->progress_text = resources->text_default; @@ -212,8 +198,8 @@ void BlondCVTheme::initialize() resources->menu_down = 0x007d7b; resources->menu_up = 0x009594; resources->menu_shadow = 0x004a4a; - resources->popupmenu_margin = 10; // ugly - resources->popupmenu_triangle_margin = 15; // ugly + resources->popupmenu_margin = xS(10); + resources->popupmenu_triangle_margin = xS(15); resources->hscroll_data = new_image_set(10, "hscroll_center_up.png", "hscroll_center_hi.png", @@ -240,7 +226,7 @@ void BlondCVTheme::initialize() "vscroll_fwd_dn.png"); resources->listbox_title_margin = 0; - resources->listbox_title_hotspot = 5; // No. of pixels around the borders to allow dragging + resources->listbox_title_hotspot = xS(5); // No. of pixels around the borders to allow dragging resources->listbox_border1 = 0x4a484a; // (top outer) resources->listbox_border2 = 0x000000; // (top inner) resources->listbox_border3 = 0xffe200; // (bottom inner) @@ -255,8 +241,8 @@ void BlondCVTheme::initialize() "generic_dn.png", "ok_button"); - resources->dirbox_margin = 50; - resources->filebox_margin = 120; + resources->dirbox_margin = yS(50); + resources->filebox_margin = yS(120); resources->file_color = 0x000000; resources->directory_color = 0x0000ff; @@ -552,11 +538,11 @@ void BlondCVTheme::initialize() "editpanel_dn.png", "swap_extents"); preferences_category_overlap = 0; - preferencescategory_x = 5; - preferencescategory_y = 5; - preferencestitle_x = 5; - preferencestitle_y = 10; - preferencesoptions_x = 5; + preferencescategory_x = xS(5); + preferencescategory_y = yS(5); + preferencestitle_x = xS(5); + preferencestitle_y = yS(10); + preferencesoptions_x = xS(5); preferencesoptions_y = 0; // CWindow cpanel_bg = new_image("cpanel_bg.png"); @@ -571,8 +557,8 @@ void BlondCVTheme::initialize() message_normal = resources->text_default; audio_color = BLACK; - mtransport_margin = 11; - toggle_margin = 11; + mtransport_margin = xS(11); + toggle_margin = xS(11); // VWindow vbuttons_left = new_image("vbuttons_left.png"); vbuttons_right = new_image("vbuttons_right.png"); @@ -626,31 +612,27 @@ void BlondCVTheme::initialize() timebar_view_data = new_image("timebar_view.png"); new_image("preferences_bg", "preferences_bg.png"); - setformat_w = 600; - setformat_h = 560; - setformat_x1 = 15; - setformat_x2 = 100; new_image("new_bg", "new_bg.png"); new_image("setformat_bg", "setformat_bg2.png"); - setformat_x3 = 315; - setformat_x4 = 415; - setformat_y1 = 20; - setformat_y2 = 85; setformat_w = get_image("setformat_bg")->get_w(); setformat_h = get_image("setformat_bg")->get_h(); - setformat_x4 = 425; - setformat_y3 = 125; - setformat_margin = 30; - setformat_channels_x = 25; - setformat_channels_y = 242; - setformat_channels_w = 250; - setformat_channels_h = 250; - - loadfile_pad = 52; - browse_pad = 20; - + setformat_x1 = xS(15); + setformat_x2 = xS(100); + setformat_x3 = xS(315); + setformat_x4 = xS(415); + setformat_y1 = yS(20); + setformat_y2 = yS(85); + setformat_y3 = yS(125); + setformat_margin = xS(30); + setformat_channels_x = xS(25); + setformat_channels_y = yS(242); + setformat_channels_w = xS(250); + setformat_channels_h = yS(250); + + loadfile_pad = yS(52); + browse_pad = yS(20); new_image_set("playpatch_data", 5, @@ -709,12 +691,8 @@ void BlondCVTheme::initialize() new_image_set("playpatch_data", 5, "playpatch_up.png", "playpatch_hi.png", "playpatch_checked.png", "playpatch_dn.png", "playpatch_checkedhi.png"); new_image_set("recordpatch_data", 5, "recordpatch_up.png", "recordpatch_hi.png", "recordpatch_checked.png", "recordpatch_dn.png", "recordpatch_checkedhi.png"); - build_overlays(); - - - out_point = new_image_set(5, "out_up.png", "out_hi.png", @@ -1006,7 +984,7 @@ void BlondCVTheme::initialize() resources->medium_font = cstrdup(string); channel_position_color = MEYELLOW; - resources->meter_title_w = 25; + resources->meter_title_w = xS(25); // (asset) edit info text color edit_font_color = YELLOW; @@ -1029,19 +1007,19 @@ void BlondCVTheme::initialize() } -#define CWINDOW_METER_MARGIN 5 -#define VWINDOW_METER_MARGIN 5 +#define CWINDOW_METER_MARGIN xS(5) +#define VWINDOW_METER_MARGIN xS(5) void BlondCVTheme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) { mbuttons_x = 0; mbuttons_y = gui->mainmenu->get_h(); - mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_p_toggle[0]->get_w()+2); + mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+xS(2) + proxy_p_toggle[0]->get_w()+xS(2)); mbuttons_h = get_image("mbutton_bg")->get_h(); - mclock_x = 10; + mclock_x = xS(10); mclock_y = mbuttons_y + mbuttons_h + CWINDOW_METER_MARGIN; - mclock_w = get_image("clock_bg")->get_w() - 40; + mclock_w = get_image("clock_bg")->get_w() - xS(40); mclock_h = get_image("clock_bg")->get_h(); mtimebar_x = get_image("patchbay_bg")->get_w(); mtimebar_y = mbuttons_y + mbuttons_h; @@ -1051,11 +1029,11 @@ void BlondCVTheme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) mstatus_y = h - statusbar_left->get_h(); mstatus_w = w; mstatus_h = statusbar_left->get_h(); - mstatus_message_x = 10; - mstatus_message_y = 5; - mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 240; + mstatus_message_x = xS(10); + mstatus_message_y = yS(5); + mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - xS(240); mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h(); - mstatus_progress_w = 230; + mstatus_progress_w = xS(230); mstatus_cancel_x = mstatus_w - statusbar_cancel_data[0]->get_w(); mstatus_cancel_y = mstatus_h - statusbar_cancel_data[0]->get_h(); mzoom_x = 0; @@ -1087,23 +1065,23 @@ void BlondCVTheme::get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls) if(cwindow_controls) { ccomposite_x = 0; - ccomposite_y = 5; + ccomposite_y = yS(5); ccomposite_w = cpanel_bg->get_w(); ccomposite_h = mwindow->session->cwindow_h - cbuttons_left->get_h(); - cedit_x = 10; - cedit_y = ccomposite_h + 17; - ctransport_x = 10; + cedit_x = xS(10); + cedit_y = ccomposite_h + yS(17); + ctransport_x = xS(10); ctransport_y = mwindow->session->cwindow_h - get_image_set("autokeyframe")[0]->get_h(); ccanvas_x = ccomposite_x + ccomposite_w; ccanvas_y = 0; ccanvas_h = ccomposite_h; - cstatus_x = 525; - cstatus_y = mwindow->session->cwindow_h - 40; + cstatus_x = xS(525); + cstatus_y = mwindow->session->cwindow_h - yS(40); if(mwindow->edl->session->cwindow_meter) { cmeter_x = mwindow->session->cwindow_w - MeterPanel::get_meters_width(this,mwindow->edl->session->audio_channels, mwindow->edl->session->cwindow_meter); - ccanvas_w = cmeter_x - ccanvas_x - 5; + ccanvas_w = cmeter_x - ccanvas_x - xS(5); } else { @@ -1120,10 +1098,10 @@ SET_TRACE ccomposite_w = cpanel_bg->get_w(); ccomposite_h = mwindow->session->cwindow_h - get_image("cbuttons_left")->get_h(); - cedit_x = 10; - cedit_y = mwindow->session->cwindow_h + 17; - ctransport_x = 10; - ctransport_y = cedit_y + 40; + cedit_x = xS(10); + cedit_y = mwindow->session->cwindow_h + yS(17); + ctransport_x = xS(10); + ctransport_y = cedit_y + yS(40); ccanvas_x = 0; ccanvas_y = 0; ccanvas_w = mwindow->session->cwindow_w; @@ -1136,25 +1114,24 @@ SET_TRACE SET_TRACE - czoom_x = ctransport_x + PlayTransport::get_transport_width(mwindow) + 20; - czoom_y = ctransport_y + 5; - + czoom_x = ctransport_x + PlayTransport::get_transport_width(mwindow) + xS(20); + czoom_y = ctransport_y + yS(5); - cmeter_y = 5; + cmeter_y = yS(5); cmeter_h = mwindow->session->cwindow_h - cmeter_y; - cslider_w = ccanvas_x + ccanvas_w - cslider_x - 5; + cslider_w = ccanvas_x + ccanvas_w - cslider_x - xS(5); ctimebar_x = ccanvas_x; ctimebar_y = ccanvas_y + ccanvas_h; ctimebar_w = ccanvas_w; - ctimebar_h = 16; + ctimebar_h = yS(16); // Not used ctime_x = ctransport_x + PlayTransport::get_transport_width(mwindow); ctime_y = ctransport_y; cdest_x = czoom_x; - cdest_y = czoom_y + 30; + cdest_y = czoom_y + yS(30); SET_TRACE } @@ -1162,57 +1139,49 @@ SET_TRACE void BlondCVTheme::get_recordgui_sizes(RecordGUI *gui, int w, int h) { - recordgui_status_x = 10; - recordgui_status_y = 10; - recordgui_status_x2 = 160; - recordgui_batch_x = 310; - recordgui_batch_y = 10; - recordgui_batchcaption_x = recordgui_batch_x + 110; + recordgui_status_x = xS(10); + recordgui_status_y = yS(10); + recordgui_status_x2 = xS(160); + recordgui_batch_x = xS(310); + recordgui_batch_y = yS(10); + recordgui_batchcaption_x = recordgui_batch_x + xS(110); recordgui_transport_x = recordgui_batch_x; - recordgui_transport_y = recordgui_batch_y + 150; + recordgui_transport_y = recordgui_batch_y + yS(150); - //recordgui_buttons_x = recordgui_batch_x - 50; - //recordgui_buttons_y = recordgui_transport_y + 40; + //recordgui_buttons_x = recordgui_batch_x - xS(50); + //recordgui_buttons_y = recordgui_transport_y + yS(40); //recordgui_options_x = recordgui_buttons_x; - //recordgui_options_y = recordgui_buttons_y + 35; + //recordgui_options_y = recordgui_buttons_y + yS(35); - recordgui_batches_x = 10; - recordgui_batches_y = 270; - recordgui_batches_w = w - 20; - recordgui_batches_h = h - recordgui_batches_y - 70; + recordgui_batches_x = xS(10); + recordgui_batches_y = yS(270); + recordgui_batches_w = w - xS(20); + recordgui_batches_h = h - recordgui_batches_y - yS(70); recordgui_loadmode_x = w / 2 - loadmode_w / 2; - recordgui_loadmode_y = h - 60; + recordgui_loadmode_y = h - yS(60); - recordgui_controls_x = 10; - recordgui_controls_y = h - 40; + recordgui_controls_x = xS(10); + recordgui_controls_y = h - yS(40); } /* -void BlondCVTheme::get_rmonitor_sizes(int do_audio, - int do_video, - int do_channel, - int do_interlace, - int do_avc, - int audio_channels) +void BlondCVTheme::get_rmonitor_sizes(int do_audio, int do_video, + int do_channel, int do_interlace, int do_avc, int audio_channels) { - Theme::get_rmonitor_sizes(do_audio, - do_video, - do_channel, - do_interlace, - do_avc, - audio_channels); + Theme::get_rmonitor_sizes(do_audio, do_video, + do_channel, do_interlace, do_avc, audio_channels); if(!do_video && do_audio) { - rmonitor_meter_y -= 30; - rmonitor_meter_h += 30; + rmonitor_meter_y -= yS(30); + rmonitor_meter_h += yS(30); } } */ void BlondCVTheme::get_vwindow_sizes(VWindowGUI *gui) { - vmeter_y = 5; + vmeter_y = yS(5); vmeter_h = mwindow->session->vwindow_h - cmeter_y; vcanvas_x = 0; vcanvas_y = 0; @@ -1220,8 +1189,8 @@ void BlondCVTheme::get_vwindow_sizes(VWindowGUI *gui) if(mwindow->edl->session->vwindow_meter) { - rmonitor_meter_y -= 30; - rmonitor_meter_h += 30; + rmonitor_meter_y -= yS(30); + rmonitor_meter_h += yS(30); vmeter_x = mwindow->session->vwindow_w - VWINDOW_METER_MARGIN - MeterPanel::get_meters_width(this, @@ -1238,19 +1207,19 @@ void BlondCVTheme::get_vwindow_sizes(VWindowGUI *gui) vtimebar_x = vcanvas_x; vtimebar_y = vcanvas_y + vcanvas_h; vtimebar_w = vcanvas_w; - vtimebar_h = 16; + vtimebar_h = yS(16); - vslider_x = 10; - vslider_y = vtimebar_y + 25; + vslider_x = xS(10); + vslider_y = vtimebar_y + yS(25); vslider_w = vtimebar_w - vslider_x; - vedit_x = 10; + vedit_x = xS(10); vedit_y = vslider_y + BC_Slider::get_span(0); - vtransport_x = 10; + vtransport_x = xS(10); vtransport_y = mwindow->session->vwindow_h - get_image_set("autokeyframe")[0]->get_h(); - vtime_x = 380; - vtime_y = vedit_y + 10; - vtime_w = 125; + vtime_x = xS(380); + vtime_y = vedit_y + yS(10); + vtime_w = xS(125); } @@ -1300,28 +1269,21 @@ void BlondCVTheme::build_overlays() } - - - - - - - void BlondCVTheme::draw_rwindow_bg(RecordGUI *gui) { // int y; -// int margin = 50; -// int margin2 = 80; +// int margin = xS(50); +// int margin2 = xS(80); // gui->draw_9segment(recordgui_batch_x - margin, // 0, // mwindow->session->rwindow_w - recordgui_status_x + margin, // recordgui_buttons_y, // rgui_batch); // gui->draw_3segmenth(recordgui_options_x - margin2, -// recordgui_buttons_y - 5, +// recordgui_buttons_y - yS(5), // mwindow->session->rwindow_w - recordgui_options_x + margin2, // rgui_controls); -// y = recordgui_buttons_y - 5 + rgui_controls->get_h(); +// y = recordgui_buttons_y - yS(5) + rgui_controls->get_h(); // gui->draw_9segment(0, // y, // mwindow->session->rwindow_w, @@ -1331,81 +1293,58 @@ void BlondCVTheme::draw_rwindow_bg(RecordGUI *gui) void BlondCVTheme::draw_rmonitor_bg(RecordMonitorGUI *gui) { -// int margin = 45; -// int panel_w = 300; +// int margin = xS(45); +// int panel_w = xS(300); // int x = rmonitor_meter_x - margin; // int w = mwindow->session->rmonitor_w - x; // if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w(); -// gui->clear_box(0, -// 0, +// gui->clear_box(0, 0, // mwindow->session->rmonitor_w, // mwindow->session->rmonitor_h); -// gui->draw_9segment(x, -// 0, +// gui->draw_9segment(x, 0, // w, // mwindow->session->rmonitor_h, // rmonitor_meters); } - - - - void BlondCVTheme::draw_mwindow_bg(MWindowGUI *gui) { // Button bar - gui->draw_3segmenth(mbuttons_x, - mbuttons_y, - 750, - mbutton_left); - gui->draw_3segmenth(mbuttons_x + 750, - mbuttons_y, - mbuttons_w - 500, - mbutton_right); + gui->draw_3segmenth(mbuttons_x, mbuttons_y, + xS(750), mbutton_left); + gui->draw_3segmenth(mbuttons_x + xS(750), mbuttons_y, + mbuttons_w - xS(500), mbutton_right); // Clock - gui->draw_3segmenth(0, - mbuttons_y + mbutton_left->get_h(), - get_image("patchbay_bg")->get_w(), - get_image("clock_bg")); + gui->draw_3segmenth(0, mbuttons_y + mbutton_left->get_h(), + get_image("patchbay_bg")->get_w(), get_image("clock_bg")); // Patchbay - gui->draw_3segmentv(patchbay_x, - patchbay_y, - patchbay_h + 20, - get_image("patchbay_bg")); + gui->draw_3segmentv(patchbay_x, patchbay_y, + patchbay_h + yS(20), get_image("patchbay_bg")); // Track canvas - gui->draw_9segment(mcanvas_x, - mcanvas_y, - mcanvas_w, - patchbay_h + 20, + gui->draw_9segment(mcanvas_x, mcanvas_y, + mcanvas_w, patchbay_h + yS(20), tracks_bg); // Timebar - gui->draw_3segmenth(mtimebar_x, - mtimebar_y, + gui->draw_3segmenth(mtimebar_x, mtimebar_y, mtimebar_w, get_image("timebar_bg")); // Zoombar - int zoombar_center = 710; - gui->draw_3segmenth(mzoom_x, - mzoom_y, - zoombar_center, - zoombar_left); + int zoombar_center = xS(710); + gui->draw_3segmenth(mzoom_x, mzoom_y, + zoombar_center, zoombar_left); if(mzoom_w > zoombar_center) - gui->draw_3segmenth(mzoom_x + zoombar_center, - mzoom_y, - mzoom_w - zoombar_center, - zoombar_right); + gui->draw_3segmenth(mzoom_x + zoombar_center, mzoom_y, + mzoom_w - zoombar_center, zoombar_right); // Status - gui->draw_3segmenth(mstatus_x, - mstatus_y, - zoombar_center, - statusbar_left); + gui->draw_3segmenth(mstatus_x, mstatus_y, + zoombar_center, statusbar_left); if(mstatus_w > zoombar_center) gui->draw_3segmenth(mstatus_x + zoombar_center, @@ -1416,7 +1355,7 @@ void BlondCVTheme::draw_mwindow_bg(MWindowGUI *gui) void BlondCVTheme::draw_cwindow_bg(CWindowGUI *gui) { - const int button_division = 570; + const int button_division = xS(570); gui->draw_3segmentv(0, 0, ccomposite_h, get_image("cpanel_bg")); gui->draw_3segmenth(0, ccomposite_h, button_division, get_image("cbuttons_left")); if(mwindow->edl->session->cwindow_meter) @@ -1435,35 +1374,30 @@ void BlondCVTheme::draw_cwindow_bg(CWindowGUI *gui) { gui->draw_3segmenth(button_division, ccomposite_h, - cmeter_x - CWINDOW_METER_MARGIN - button_division + 100, + cmeter_x - CWINDOW_METER_MARGIN - button_division + xS(100), get_image("cbuttons_right")); } } void BlondCVTheme::draw_vwindow_bg(VWindowGUI *gui) { - const int button_division = 400; - gui->draw_3segmenth(0, - vcanvas_h, - button_division, - get_image("vbuttons_left")); + const int button_division = xS(400); + gui->draw_3segmenth(0, vcanvas_h, + button_division, get_image("vbuttons_left")); if(mwindow->edl->session->vwindow_meter) { - gui->draw_3segmenth(button_division, - vcanvas_h, + gui->draw_3segmenth(button_division, vcanvas_h, vmeter_x - VWINDOW_METER_MARGIN - button_division, get_image("cbuttons_right")); - gui->draw_9segment(vmeter_x - VWINDOW_METER_MARGIN, - 0, + gui->draw_9segment(vmeter_x - VWINDOW_METER_MARGIN, 0, mwindow->session->vwindow_w - vmeter_x + VWINDOW_METER_MARGIN, mwindow->session->vwindow_h, get_image("cmeter_bg")); } else { - gui->draw_3segmenth(button_division, - vcanvas_h, - vmeter_x - VWINDOW_METER_MARGIN - button_division + 100, + gui->draw_3segmenth(button_division, vcanvas_h, + vmeter_x - VWINDOW_METER_MARGIN - button_division + xS(100), get_image("cbuttons_right")); } } @@ -1497,7 +1431,9 @@ void BlondCVTheme::draw_setformat_bg(SetFormatWindow *gui) // pmd: SUV (same), 1_2_2blond (nonexist) void BlondCVTheme::get_plugindialog_sizes() { - int x = 10, y = 30; + int xs10 = xS(10), xs20 = xS(20); + int ys10 = yS(10), ys120 = yS(120); + int x = xs10, y = yS(30); plugindialog_new_x = x; plugindialog_new_y = y; plugindialog_shared_x = mwindow->session->plugindialog_w / 3; @@ -1505,19 +1441,19 @@ void BlondCVTheme::get_plugindialog_sizes() plugindialog_module_x = mwindow->session->plugindialog_w * 2 / 3; plugindialog_module_y = y; - plugindialog_new_w = plugindialog_shared_x - plugindialog_new_x - 10; - plugindialog_new_h = mwindow->session->plugindialog_h - 120; - plugindialog_shared_w = plugindialog_module_x - plugindialog_shared_x - 10; - plugindialog_shared_h = mwindow->session->plugindialog_h - 120; - plugindialog_module_w = mwindow->session->plugindialog_w - plugindialog_module_x - 10; - plugindialog_module_h = mwindow->session->plugindialog_h - 120; - - plugindialog_newattach_x = plugindialog_new_x + 20; - plugindialog_newattach_y = plugindialog_new_y + plugindialog_new_h + 10; - plugindialog_sharedattach_x = plugindialog_shared_x + 20; - plugindialog_sharedattach_y = plugindialog_shared_y + plugindialog_shared_h + 10; - plugindialog_moduleattach_x = plugindialog_module_x + 20; - plugindialog_moduleattach_y = plugindialog_module_y + plugindialog_module_h + 10; + plugindialog_new_w = plugindialog_shared_x - plugindialog_new_x - xs10; + plugindialog_new_h = mwindow->session->plugindialog_h - ys120; + plugindialog_shared_w = plugindialog_module_x - plugindialog_shared_x - xs10; + plugindialog_shared_h = mwindow->session->plugindialog_h - ys120; + plugindialog_module_w = mwindow->session->plugindialog_w - plugindialog_module_x - xs10; + plugindialog_module_h = mwindow->session->plugindialog_h - ys120; + + plugindialog_newattach_x = plugindialog_new_x + xs20; + plugindialog_newattach_y = plugindialog_new_y + plugindialog_new_h + ys10; + plugindialog_sharedattach_x = plugindialog_shared_x + xs20; + plugindialog_sharedattach_y = plugindialog_shared_y + plugindialog_shared_h + ys10; + plugindialog_moduleattach_x = plugindialog_module_x + xs20; + plugindialog_moduleattach_y = plugindialog_module_y + plugindialog_module_h + ys10; } diff --git a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C.orig b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C.orig deleted file mode 100644 index 8aff33a4..00000000 --- a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C.orig +++ /dev/null @@ -1,1199 +0,0 @@ - -/* - * CINELERRA - * Copyright (C) 2008 Adam Williams - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include "bcsignals.h" -#include "clip.h" -#include "cwindowgui.h" -#include "defaulttheme.h" -#include "edl.h" -#include "edlsession.h" -#include "mainmenu.h" -#include "mainsession.h" -#include "mbuttons.h" -#include "meterpanel.h" -#include "mwindow.h" -#include "mwindowgui.h" -#include "new.h" -#include "patchbay.h" -#include "preferencesthread.h" -#include "recordgui.h" -#include "recordmonitor.h" -#include "setformat.h" -#include "statusbar.h" -#include "timebar.h" -#include "trackcanvas.h" -#include "vframe.h" -#include "vwindowgui.h" - - - - -PluginClient* new_plugin(PluginServer *server) -{ - return new BlondThemeMain(server); -} - - - - - - - -BlondThemeMain::BlondThemeMain(PluginServer *server) - : PluginTClient(server) -{ -} - -BlondThemeMain::~BlondThemeMain() -{ -} - -const char* BlondThemeMain::plugin_title() { return "Blond-cv"; } - -Theme* BlondThemeMain::new_theme() -{ - theme = new BlondTheme; - extern unsigned char _binary_defaulttheme_data_start[]; - theme->set_data(_binary_defaulttheme_data_start); - return theme; -} - - - - - - - - -BlondTheme::BlondTheme() - : Theme() -{ -} - -BlondTheme::~BlondTheme() -{ -} - -void BlondTheme::initialize() -{ - BC_Resources *resources = BC_WindowBase::get_resources(); - - - resources->text_default = 0x000000; - resources->text_background = 0xffffff; - resources->text_border1 = 0x4a484a; // (top outer) - resources->text_border2 = 0x000000; // (top inner) - resources->text_border3 = 0xacaeac; // (bottom inner) - resources->text_border4 = 0xffffff; // (bottom outer) - resources->text_inactive_highlight = 0xacacac; - - resources->bg_color = BLOND; - resources->default_text_color = 0x000000; - resources->menu_title_text = 0x000000; - resources->popup_title_text = 0x000000; - resources->menu_item_text = 0x000000; - - resources->generic_button_margin = 15; - resources->pot_needle_color = resources->text_default; - resources->pot_offset = 1; - resources->progress_text = resources->text_default; - resources->meter_font_color = RED; - - resources->menu_light = 0x00cacd; - resources->menu_highlighted = 0x9c95ff; - resources->menu_down = 0x007d7b; - resources->menu_up = 0x009594; - resources->menu_shadow = 0x004a4a; - resources->popupmenu_margin = 10; // ugly - resources->popupmenu_triangle_margin = 15; // ugly - - resources->listbox_title_color = 0x000000; - - resources->listbox_title_margin = 0; - resources->listbox_title_hotspot = 5; // No. of pixels around the borders to allow dragging - resources->listbox_border1 = 0x4a484a; // (top outer) - resources->listbox_border2 = 0x000000; // (top inner) - resources->listbox_border3 = 0xffe200; // (bottom inner) - resources->listbox_border4 = 0xffffff; // (bottom outer) - resources->listbox_highlighted = 0xeee6ee; - resources->listbox_inactive = 0xffffffff; // (background) - resources->listbox_bg = new_image("list_bg.png"); - resources->listbox_text = 0x000000; - - resources->dirbox_margin = 50; - resources->filebox_margin = 101; - resources->file_color = 0x000000; - resources->directory_color = 0x0000ff; - - - - - resources->filebox_icons_images = new_button("icons.png", - "fileboxbutton_up.png", - "fileboxbutton_hi.png", - "fileboxbutton_dn.png"); - - resources->filebox_text_images = new_button("text.png", - "fileboxbutton_up.png", - "fileboxbutton_hi.png", - "fileboxbutton_dn.png"); - - resources->filebox_newfolder_images = new_button("folder.png", - "fileboxbutton_up.png", - "fileboxbutton_hi.png", - "fileboxbutton_dn.png"); - - resources->filebox_updir_images = new_button("updir.png", - "fileboxbutton_up.png", - "fileboxbutton_hi.png", - "fileboxbutton_dn.png"); - - resources->filebox_delete_images = new_button("delete.png", - "fileboxbutton_up.png", - "fileboxbutton_hi.png", - "fileboxbutton_dn.png"); - - resources->filebox_reload_images = new_button("reload.png", - "fileboxbutton_up.png", - "fileboxbutton_hi.png", - "fileboxbutton_dn.png"); - - - resources->filebox_descend_images = new_button("openfolder.png", - "generic_up.png", - "generic_hi.png", - "generic_dn.png"); - - resources->usethis_button_images = - resources->ok_images = new_button("ok.png", - "generic_up.png", - "generic_hi.png", - "generic_dn.png"); - - new_button("ok.png", - "generic_up.png", - "generic_hi.png", - "generic_dn.png", - "new_ok_images"); - - resources->cancel_images = new_button("cancel.png", - "generic_up.png", - "generic_hi.png", - "generic_dn.png"); - - new_button("cancel.png", - "generic_up.png", - "generic_hi.png", - "generic_dn.png", - "new_cancel_images"); - - resources->bar_data = new_image("bar", "bar.png"); - - - resources->min_menu_w = 0; - resources->menu_popup_bg = 0; // if (0) use menu_light, menu_up, menu_shadow - resources->menu_item_bg = 0; // if (0) use menu_light, menu_highlighted, menu_down, menu_shadow - resources->menu_bar_bg = 0; // if (0) use menu_light, menu_shadow, and height of MEDIUMFONT + 8 - resources->menu_title_bg = 0; // if (0) use menu_light, menu_highlighted, menu_down, menu_shadow - - - resources->popupmenu_images = 0; // if (0) get_resources()->use generic_button_images - - resources->toggle_highlight_bg = 0; // if (0) "Draw a plain box" as per bctoggle.C - - resources->generic_button_images = new_image_set(3, - "generic_up.png", - "generic_hi.png", - "generic_dn.png"); - resources->horizontal_slider_data = new_image_set(6, - "hslider_fg_up.png", - "hslider_fg_hi.png", - "hslider_fg_dn.png", - "hslider_bg_up.png", - "hslider_bg_hi.png", - "hslider_bg_dn.png"); - resources->vertical_slider_data = new_image_set(6, - "vertical_slider_fg_up.png", - "vertical_slider_fg_hi.png", - "vertical_slider_fg_dn.png", - "vertical_slider_bg_up.png", - "vertical_slider_bg_hi.png", - "vertical_slider_bg_dn.png"); - resources->progress_images = new_image_set(2, - "progress_bg.png", - "progress_hi.png"); - resources->tumble_data = new_image_set(4, - "tumble_up.png", - "tumble_hi.png", - "tumble_bottom.png", - "tumble_top.png"); - resources->listbox_button = new_image_set(4, - "listbox_button_up.png", - "listbox_button_hi.png", - "listbox_button_dn.png", - "listbox_button_disabled.png"); // probably need to make this for the suv theme - resources->listbox_column = new_image_set(3, - "column_up.png", - "column_hi.png", - "column_dn.png"); - resources->listbox_expand = new_image_set(5, - "listbox_expandup.png", - "listbox_expanduphi.png", - "listbox_expandchecked.png", - "listbox_expanddn.png", - "listbox_expandcheckedhi.png"); - resources->listbox_up = new_image("listbox_up.png"); - resources->listbox_dn = new_image("listbox_dn.png"); - resources->pan_data = new_image_set(7, - "pan_up.png", - "pan_hi.png", - "pan_popup.png", - "pan_channel.png", - "pan_stick.png", - "pan_channel_small.png", - "pan_stick_small.png"); - resources->pan_text_color = WHITE; - - resources->pot_images = new_image_set(3, - "pot_up.png", - "pot_hi.png", - "pot_dn.png"); - - resources->checkbox_images = new_image_set(5, - "checkbox_up.png", - "checkbox_hi.png", - "checkbox_checked.png", - "checkbox_dn.png", - "checkbox_checkedhi.png"); - - resources->radial_images = new_image_set(5, - "radial_up.png", - "radial_hi.png", - "radial_checked.png", - "radial_dn.png", - "radial_checkedhi.png"); - - resources->xmeter_images = new_image_set(6, - "xmeter_normal.png", - "xmeter_green.png", - "xmeter_red.png", - "xmeter_yellow.png", - "xmeter_white.png", - "xmeter_over.png"); - resources->ymeter_images = new_image_set(6, - "ymeter_normal.png", - "ymeter_green.png", - "ymeter_red.png", - "ymeter_yellow.png", - "ymeter_white.png", - "ymeter_over.png"); - - resources->hscroll_data = new_image_set(10, - "hscroll_handle_up.png", - "hscroll_handle_hi.png", - "hscroll_handle_dn.png", - "hscroll_handle_bg.png", - "hscroll_left_up.png", - "hscroll_left_hi.png", - "hscroll_left_dn.png", - "hscroll_right_up.png", - "hscroll_right_hi.png", - "hscroll_right_dn.png"); - - resources->vscroll_data = new_image_set(10, - "vscroll_handle_up.png", - "vscroll_handle_hi.png", - "vscroll_handle_dn.png", - "vscroll_handle_bg.png", - "vscroll_left_up.png", - "vscroll_left_hi.png", - "vscroll_left_dn.png", - "vscroll_right_up.png", - "vscroll_right_hi.png", - "vscroll_right_dn.png"); - - - new_button("prevtip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip"); - new_button("nexttip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "next_tip"); - new_button("closetip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "close_tip"); - new_button("swap_extents.png", - "editpanel_up.png", - "editpanel_hi.png", - "editpanel_dn.png", - "swap_extents"); - - -// Record windows - rgui_batch = new_image("recordgui_batch.png"); - rgui_controls = new_image("recordgui_controls.png"); - rgui_list = new_image("recordgui_list.png"); - rmonitor_panel = new_image("recordmonitor_panel.png"); - rmonitor_meters = new_image("recordmonitor_meters.png"); - - - preferences_category_overlap = 0; - preferencescategory_x = 5; - preferencescategory_y = 5; - preferencestitle_x = 5; - preferencestitle_y = 10; - preferencesoptions_x = 5; - preferencesoptions_y = 0; - -// MWindow - message_normal = resources->text_default; - audio_color = BLACK; - mtransport_margin = 11; - toggle_margin = 11; - - new_image("mbutton_bg", "mbutton_bg.png"); - new_image("mbutton_blue", "mbutton_blue.png"); - new_image("timebar_bg", "timebar_bg.png"); - new_image("timebar_brender", "timebar_brender.png"); - new_image("clock_bg", "mclock.png"); - new_image("patchbay_bg", "patchbay_bg.png"); - new_image("tracks_bg","tracks_bg.png"); - new_image("zoombar_left","zoombar_left.png"); - new_image("zoombar_right","zoombar_right.png"); - new_image("statusbar_left","statusbar_left.png"); - new_image("statusbar_right","statusbar_right.png"); - - new_image_set("zoombar_menu", 3, "generic_up.png", "generic_hi.png", "generic_dn.png"); - new_image_set("zoombar_tumbler", 4, "tumble_up.png", "tumble_hi.png", "tumble_bottom.png", "tumble_top.png"); - - new_image_set("mode_popup", 3, "generic_up.png", "generic_hi.png", "generic_dn.png"); - new_image("mode_add", "mode_add.png"); - new_image("mode_divide", "mode_divide.png"); - new_image("mode_multiply", "mode_multiply.png"); - new_image("mode_normal", "mode_normal.png"); - new_image("mode_replace", "mode_replace.png"); - new_image("mode_subtract", "mode_subtract.png"); - new_image("mode_max", "mode_max.png"); - - new_toggle("plugin_on.png", - "pluginbutton_hi.png", - "pluginbutton_hi.png", - "pluginbutton_select.png", - "pluginbutton_dn.png", - "pluginbutton_selecthi.png", - "plugin_on"); - - new_toggle("plugin_show.png", - "plugin_show.png", - "pluginbutton_hi.png", - "pluginbutton_select.png", - "pluginbutton_dn.png", - "pluginbutton_selecthi.png", - "plugin_show"); - -// CWindow - new_image("cpanel_bg", "cpanel_bg.png"); - new_image("cbuttons_left", "cbuttons_left.png"); - new_image("cbuttons_right", "cbuttons_right.png"); - new_image("cmeter_bg", "cmeter_bg.png"); - -// VWindow - new_image("vbuttons_left", "vbuttons_left.png"); - - new_image("preferences_bg", "preferences_bg.png"); - - - new_image("new_bg", "new_bg.png"); - new_image("setformat_bg", "setformat_bg2.png"); - - - timebar_view_data = new_image("timebar_view.png"); - - setformat_w = get_image("setformat_bg")->get_w(); - setformat_h = get_image("setformat_bg")->get_h(); - setformat_x1 = 15; - setformat_x2 = 100; - - setformat_x3 = 315; - setformat_x4 = 425; - setformat_y1 = 20; - setformat_y2 = 85; - setformat_y3 = 125; - setformat_margin = 30; - setformat_channels_x = 25; - setformat_channels_y = 242; - setformat_channels_w = 250; - setformat_channels_h = 250; - - loadfile_pad = 52; - browse_pad = 20; - - - new_image_set("playpatch_data", - 5, - "playpatch_up.png", - "playpatch_hi.png", - "playpatch_checked.png", - "playpatch_dn.png", - "playpatch_checkedhi.png"); - - new_image_set("recordpatch_data", - 5, - "recordpatch_up.png", - "recordpatch_hi.png", - "recordpatch_checked.png", - "recordpatch_dn.png", - "recordpatch_checkedhi.png"); - - new_image_set("gangpatch_data", - 5, - "gangpatch_up.png", - "gangpatch_hi.png", - "gangpatch_checked.png", - "gangpatch_dn.png", - "gangpatch_checkedhi.png"); - - new_image_set("drawpatch_data", - 5, - "drawpatch_up.png", - "drawpatch_hi.png", - "drawpatch_checked.png", - "drawpatch_dn.png", - "drawpatch_checkedhi.png"); - - - new_image_set("mutepatch_data", - 5, - "mutepatch_up.png", - "mutepatch_hi.png", - "mutepatch_checked.png", - "mutepatch_dn.png", - "mutepatch_checkedhi.png"); - - new_image_set("expandpatch_data", - 5, - "expandpatch_up.png", - "expandpatch_hi.png", - "expandpatch_checked.png", - "expandpatch_dn.png", - "expandpatch_checkedhi.png"); - - build_icons(); - build_bg_data(); - build_overlays(); - - - - - out_point = new_image_set(5, - "out_up.png", - "out_hi.png", - "out_checked.png", - "out_dn.png", - "out_checkedhi.png"); - in_point = new_image_set(5, - "in_up.png", - "in_hi.png", - "in_checked.png", - "in_dn.png", - "in_checkedhi.png"); - - label_toggle = new_image_set(5, - "labeltoggle_up.png", - "labeltoggle_uphi.png", - "label_checked.png", - "labeltoggle_dn.png", - "label_checkedhi.png"); - - - statusbar_cancel_data = new_image_set(3, - "statusbar_cancel_up.png", - "statusbar_cancel_hi.png", - "statusbar_cancel_dn.png"); - - - VFrame *editpanel_up = new_image("editpanel_up.png"); - VFrame *editpanel_hi = new_image("editpanel_hi.png"); - VFrame *editpanel_dn = new_image("editpanel_dn.png"); - VFrame *editpanel_checked = new_image("editpanel_checked.png"); - VFrame *editpanel_checkedhi = new_image("editpanel_checkedhi.png"); - - new_image("panel_divider", "panel_divider.png"); - new_button("bottom_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "bottom_justify"); - new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify"); - new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel"); - - - new_button("copy.png", editpanel_up, editpanel_hi, editpanel_dn, "copy"); - new_button("cut.png", editpanel_up, editpanel_hi, editpanel_dn, "cut"); - new_button("fit.png", editpanel_up, editpanel_hi, editpanel_dn, "fit"); - new_button("fitautos.png", editpanel_up, editpanel_hi, editpanel_dn, "fitautos"); - new_button("inpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "inbutton"); - new_button("label.png", editpanel_up, editpanel_hi, editpanel_dn, "labelbutton"); - new_button("left_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "left_justify"); - new_button("magnify.png", editpanel_up, editpanel_hi, editpanel_dn, "magnify_button"); - new_button("middle_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "middle_justify"); - new_button("nextlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "nextlabel"); - new_button("outpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "outbutton"); - over_button = new_button("over.png", editpanel_up, editpanel_hi, editpanel_dn); - overwrite_data = new_button("overwrite.png", editpanel_up, editpanel_hi, editpanel_dn); - new_button("paste.png", editpanel_up, editpanel_hi, editpanel_dn, "paste"); - new_button("prevlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "prevlabel"); - new_button("redo.png", editpanel_up, editpanel_hi, editpanel_dn, "redo"); - new_button("right_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "right_justify"); - splice_data = new_button("splice.png", editpanel_up, editpanel_hi, editpanel_dn); - new_button("toclip.png", editpanel_up, editpanel_hi, editpanel_dn, "toclip"); - new_button("goto.png", editpanel_up, editpanel_hi, editpanel_dn, "goto"); - new_button("top_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "top_justify"); - new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo"); - new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench"); - - -#define TRANSPORT_LEFT_IMAGES "transport_left_up.png", "transport_left_hi.png", "transport_left_dn.png" -#define TRANSPORT_CENTER_IMAGES "transport_center_up.png", "transport_center_hi.png", "transport_center_dn.png" -#define TRANSPORT_RIGHT_IMAGES "transport_right_up.png", "transport_right_hi.png", "transport_right_dn.png" - - new_button("end.png", TRANSPORT_RIGHT_IMAGES, "end"); - new_button("fastfwd.png",TRANSPORT_CENTER_IMAGES, "fastfwd"); - new_button("fastrev.png",TRANSPORT_CENTER_IMAGES, "fastrev"); - new_button("play.png",TRANSPORT_CENTER_IMAGES, "play"); - new_button("framefwd.png", TRANSPORT_CENTER_IMAGES, "framefwd"); - new_button("framerev.png", TRANSPORT_CENTER_IMAGES, "framerev"); - new_button("pause.png", TRANSPORT_CENTER_IMAGES, "pause"); - new_button("record.png", TRANSPORT_CENTER_IMAGES, "record"); - new_button("singleframe.png", TRANSPORT_CENTER_IMAGES, "recframe"); - new_button("reverse.png", TRANSPORT_CENTER_IMAGES, "reverse"); - new_button("rewind.png", TRANSPORT_LEFT_IMAGES, "rewind"); - new_button("stop.png", TRANSPORT_CENTER_IMAGES, "stop"); - new_button("stop.png", TRANSPORT_RIGHT_IMAGES, "stoprec"); - - - -// CWindow icons - new_image("cwindow_inactive", "cwindow_inactive.png"); - new_image("cwindow_active", "cwindow_active.png"); - - - new_image_set("batch_render_start", - 3, - "batchstart_up.png", - "batchstart_hi.png", - "batchstart_dn.png"); - new_image_set("batch_render_stop", - 3, - "batchstop_up.png", - "batchstop_hi.png", - "batchstop_dn.png"); - new_image_set("batch_render_cancel", - 3, - "batchcancel_up.png", - "batchcancel_hi.png", - "batchcancel_dn.png"); - - new_image_set("category_button", - 3, - "preferencesbutton_dn.png", - "preferencesbutton_dnhi.png", - "preferencesbutton_dnlo.png"); - - new_image_set("category_button_checked", - 3, - "preferencesbutton_up.png", - "preferencesbutton_uphi.png", - "preferencesbutton_dnlo.png"); - - - - - - - new_toggle("arrow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "arrow"); - new_toggle("autokeyframe.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "autokeyframe"); - new_toggle("ibeam.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "ibeam"); - new_toggle("show_meters.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "meters"); - - VFrame *cpanel_up = new_image("editpanel_up.png"); - VFrame *cpanel_hi = new_image("editpanel_hi.png"); - VFrame *cpanel_dn = new_image("editpanel_dn.png"); - VFrame *cpanel_checked = new_image("editpanel_checked.png"); - VFrame *cpanel_checkedhi = new_image("editpanel_checkedhi.png"); - new_toggle("blank30x30.png", - new_image("locklabels_locked.png"), - new_image("locklabels_lockedhi.png"), - new_image("locklabels_unlocked.png"), - new_image("locklabels_dn.png"), // can't have seperate down for each!!?? - new_image("locklabels_unlockedhi.png"), - "locklabels"); - - - new_toggle("camera.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "camera"); - new_toggle("crop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "crop"); - new_toggle("eyedrop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "eyedrop"); - new_toggle("magnify.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "magnify"); - new_toggle("mask.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "mask"); - new_toggle("ruler.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "ruler"); - new_toggle("projector.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "projector"); - new_toggle("protect.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "protect"); - new_toggle("titlesafe.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "titlesafe"); - new_toggle("toolwindow.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "tool"); - - // toggle for tangent mode (compositor/tool window) - new_toggle("tan_smooth.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_smooth"); - new_toggle("tan_linear.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_linear"); - - - flush_images(); - - title_font = MEDIUMFONT_3D; - title_color = WHITE; - recordgui_fixed_color = YELLOW; - recordgui_variable_color = RED; - resources->medium_font = "-*-helvetica-bold-r-normal-*-14-*"; - - channel_position_color = MEYELLOW; - resources->meter_title_w = 25; - - // (asset) edit info text color - edit_font_color = YELLOW; - - //labels - resources->label_images = new_image_set(5, - "radial_up.png", - "radial_hi.png", - "radial_checked.png", - "radial_dn.png", - "radial_checkedhi.png"); - - /* resources->type_to_icon = new_image_set(5, - "file_folder.png", - "file_unknown.png", - "file_film.png", - "file_sound.png", - "file_column.png"); - */ -} - -#define CWINDOW_METER_MARGIN 5 -#define VWINDOW_METER_MARGIN 5 - -void BlondTheme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) -{ - mbuttons_x = 0; - mbuttons_y = gui->mainmenu->get_h() + 1; - mbuttons_w = w; - mbuttons_h = get_image("mbutton_bg")->get_h(); - mclock_x = 10; - mclock_y = mbuttons_y - 1 + mbuttons_h + CWINDOW_METER_MARGIN; - mclock_w = get_image("clock_bg")->get_w() - 40; - mclock_h = get_image("clock_bg")->get_h(); - mtimebar_x = get_image("patchbay_bg")->get_w(); - mtimebar_y = mbuttons_y - 1 + mbuttons_h; - mtimebar_w = w - mtimebar_x; - mtimebar_h = get_image("timebar_bg")->get_h(); - mzoom_h = get_image("zoombar_left")->get_h(); - mzoom_x = 0; - mzoom_y = h - get_image("statusbar_left")->get_h() - mzoom_h; - mzoom_w = w; - mstatus_x = 0; - mstatus_y = mzoom_y + mzoom_h; - mstatus_w = w; - mstatus_h = h - mstatus_y; - mstatus_message_x = 10; - mstatus_message_y = 5; - mstatus_progress_w = 230; - mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 2*3 - mstatus_progress_w; - mstatus_progress_y = mstatus_h/2 - BC_WindowBase::get_resources()->progress_images[0]->get_h()/2; - - mstatus_cancel_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 3; - mstatus_cancel_y = mstatus_h/2 - statusbar_cancel_data[0]->get_h()/2; - - patchbay_x = 0; - patchbay_y = mtimebar_y + mtimebar_h; - patchbay_w = get_image("patchbay_bg")->get_w(); - patchbay_h = mzoom_y - patchbay_y - BC_ScrollBar::get_span(SCROLL_HORIZ); - mcanvas_x = patchbay_x + patchbay_w; - mcanvas_y = patchbay_y; - mcanvas_w = w - patchbay_w - BC_ScrollBar::get_span(SCROLL_VERT); - mcanvas_h = patchbay_h; - mhscroll_x = 0; - mhscroll_y = mzoom_y - BC_ScrollBar::get_span(SCROLL_HORIZ); - mhscroll_w = w - BC_ScrollBar::get_span(SCROLL_VERT); - mvscroll_x = mcanvas_x + mcanvas_w; - mvscroll_y = mcanvas_y; - mvscroll_h = mcanvas_h; -} - -void BlondTheme::get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls) -{ - if(cwindow_controls) - { -SET_TRACE - ccomposite_x = 0; - ccomposite_y = 5; - ccomposite_w = get_image("cpanel_bg")->get_w(); - ccomposite_h = mwindow->session->cwindow_h - - get_image("cbuttons_left")->get_h(); - cslider_x = 5; - cslider_y = ccomposite_h + 23; - cedit_x = 10; - cedit_y = cslider_y + 17; - ctransport_x = 10; - ctransport_y = mwindow->session->cwindow_h - - get_image_set("autokeyframe")[0]->get_h(); - ccanvas_x = ccomposite_x + ccomposite_w; - ccanvas_y = 0; - ccanvas_h = ccomposite_h; - cstatus_x = 525; - cstatus_y = mwindow->session->cwindow_h - 40; - if(mwindow->edl->session->cwindow_meter) - { - cmeter_x = mwindow->session->cwindow_w - MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, - mwindow->edl->session->cwindow_meter); - ccanvas_w = cmeter_x - ccanvas_x - 5; - } - else - { - cmeter_x = mwindow->session->cwindow_w; - ccanvas_w = cmeter_x - ccanvas_x; - } -SET_TRACE - } - else - { -SET_TRACE - ccomposite_x = -get_image("cpanel_bg")->get_w(); - ccomposite_y = 0; - ccomposite_w = get_image("cpanel_bg")->get_w(); - ccomposite_h = mwindow->session->cwindow_h - get_image("cbuttons_left")->get_h(); - - cslider_x = 5; - cslider_y = mwindow->session->cwindow_h; - cedit_x = 10; - cedit_y = cslider_y + 17; - ctransport_x = 10; - ctransport_y = cedit_y + 40; - ccanvas_x = 0; - ccanvas_y = 0; - ccanvas_w = mwindow->session->cwindow_w; - ccanvas_h = mwindow->session->cwindow_h; - cmeter_x = mwindow->session->cwindow_w; - cstatus_x = mwindow->session->cwindow_w; - cstatus_y = mwindow->session->cwindow_h; -SET_TRACE - } - -SET_TRACE - - czoom_x = ctransport_x + PlayTransport::get_transport_width(mwindow) + 20; - czoom_y = ctransport_y + 5; - - - cmeter_y = 5; - cmeter_h = mwindow->session->cwindow_h - cmeter_y; - - cslider_w = ccanvas_x + ccanvas_w - cslider_x - 5; - ctimebar_x = ccanvas_x; - ctimebar_y = ccanvas_y + ccanvas_h; - ctimebar_w = ccanvas_w; - ctimebar_h = 16; - - -// Not used - ctime_x = ctransport_x + PlayTransport::get_transport_width(mwindow); - ctime_y = ctransport_y; - cdest_x = czoom_x; - cdest_y = czoom_y + 30; -SET_TRACE -} - - - -void BlondTheme::get_recordgui_sizes(RecordGUI *gui, int w, int h) -{ - -} - -void BlondTheme::get_rmonitor_sizes(int do_audio, - int do_video, - int do_channel, - int do_interlace, - int do_avc, - int audio_channels) -{ - Theme::get_rmonitor_sizes(do_audio, - do_video, - do_channel, - do_interlace, - do_avc, - audio_channels); - if(!do_video && do_audio) - { - rmonitor_meter_y -= 30; - rmonitor_meter_h += 30; - } -} - - -void BlondTheme::get_vwindow_sizes(VWindowGUI *gui) -{ - vmeter_y = 5; - vmeter_h = mwindow->session->vwindow_h - cmeter_y; - vcanvas_x = 0; - vcanvas_y = 0; - vcanvas_h = mwindow->session->vwindow_h - get_image("vbuttons_left")->get_h(); - - if(mwindow->edl->session->vwindow_meter) - { - vmeter_x = mwindow->session->vwindow_w - - VWINDOW_METER_MARGIN - - MeterPanel::get_meters_width(mwindow->edl->session->audio_channels, - mwindow->edl->session->vwindow_meter); - vcanvas_w = vmeter_x - vcanvas_x - VWINDOW_METER_MARGIN; - } - else - { - vmeter_x = mwindow->session->vwindow_w; - vcanvas_w = mwindow->session->vwindow_w; - } - - vtimebar_x = vcanvas_x; - vtimebar_y = vcanvas_y + vcanvas_h; - vtimebar_w = vcanvas_w; - vtimebar_h = 16; - - vslider_x = 10; - vslider_y = vtimebar_y + 25; - vslider_w = vtimebar_w - vslider_x; - vedit_x = 10; - vedit_y = vslider_y + BC_Slider::get_span(0); - vtransport_x = 10; - vtransport_y = mwindow->session->vwindow_h - - get_image_set("autokeyframe")[0]->get_h(); - vtime_x = 380; - vtime_y = vedit_y + 10; - vtime_w = 125; - - - - - vzoom_x = vtime_x + 150; - vzoom_y = vtime_y; - vsource_x = vtime_x + 50; - vsource_y = vtransport_y + 5; -} - - - - - -void BlondTheme::build_icons() -{ - new_image("mwindow_icon", "heroine_icon.png"); - new_image("vwindow_icon", "heroine_icon.png"); - new_image("cwindow_icon", "heroine_icon.png"); - new_image("awindow_icon", "heroine_icon.png"); - new_image("record_icon", "heroine_icon.png"); - new_image("clip_icon", "clip_icon.png"); -} - - - -void BlondTheme::build_bg_data() -{ -// Audio settings - channel_bg_data = new VFrame(get_image_data("channel_bg.png")); - channel_position_data = new VFrame(get_image_data("channel_position.png")); - -// Track bitmaps - new_image("resource1024", "resource1024.png"); - new_image("resource512", "resource512.png"); - new_image("resource256", "resource256.png"); - new_image("resource128", "resource128.png"); - new_image("resource64", "resource64.png"); - new_image("resource32", "resource32.png"); - new_image("plugin_bg_data", "plugin_bg.png"); - new_image("title_bg_data", "title_bg.png"); - new_image("vtimebar_bg_data", "vwindow_timebar.png"); -} - - - -void BlondTheme::build_overlays() -{ - keyframe_data = new VFrame(get_image_data("keyframe3.png")); - camerakeyframe_data = new VFrame(get_image_data("camerakeyframe.png")); - maskkeyframe_data = new VFrame(get_image_data("maskkeyframe.png")); - modekeyframe_data = new VFrame(get_image_data("modekeyframe.png")); - pankeyframe_data = new VFrame(get_image_data("pankeyframe.png")); - projectorkeyframe_data = new VFrame(get_image_data("projectorkeyframe.png")); -} - - - - - - - - - -void BlondTheme::draw_rwindow_bg(RecordGUI *gui) -{ -// int y; -// int margin = 50; -// int margin2 = 80; -// gui->draw_9segment(recordgui_batch_x - margin, -// 0, -// mwindow->session->rwindow_w - recordgui_status_x + margin, -// recordgui_buttons_y, -// rgui_batch); -// gui->draw_3segmenth(recordgui_options_x - margin2, -// recordgui_buttons_y - 5, -// mwindow->session->rwindow_w - recordgui_options_x + margin2, -// rgui_controls); -// y = recordgui_buttons_y - 5 + rgui_controls->get_h(); -// gui->draw_9segment(0, -// y, -// mwindow->session->rwindow_w, -// mwindow->session->rwindow_h - y, -// rgui_list); -} - -void BlondTheme::draw_rmonitor_bg(RecordMonitorGUI *gui) -{ -// int margin = 45; -// int panel_w = 300; -// int x = rmonitor_meter_x - margin; -// int w = mwindow->session->rmonitor_w - x; -// if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w(); -// gui->clear_box(0, -// 0, -// mwindow->session->rmonitor_w, -// mwindow->session->rmonitor_h); -// gui->draw_9segment(x, -// 0, -// w, -// mwindow->session->rmonitor_h, -// rmonitor_meters); -} - - - - - - -void BlondTheme::draw_mwindow_bg(MWindowGUI *gui) -{ -// Button bar - int mbuttons_rightedge = mbuttons_x - + get_image("end")->get_w() + 7 * get_image("play")->get_w() + get_image("end")->get_w() - + mtransport_margin - + 2 * get_image("arrow")->get_w() - + toggle_margin - + 2 * get_image("autokeyframe")->get_w() - + toggle_margin - + (14 + 1) * get_image("goto")->get_w() + 5; // I don't know why + 1!! - gui->draw_3segmenth(mbuttons_x, - mbuttons_y, - mbuttons_rightedge, - mbuttons_x, - mbuttons_rightedge, - get_image("mbutton_bg"), - 0); - - gui->draw_3segmenth(mbuttons_x + mbuttons_rightedge, - mbuttons_y, - mwindow->session->mwindow_w, - get_image("mbutton_blue")); - - int pdw = get_image("panel_divider")->get_w(); - int x = mbuttons_x; - x += get_image("end")->get_w() + 7 * get_image("play")->get_w() + get_image("end")->get_w(); - x += mtransport_margin; // the control buttons - - gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, - mbuttons_y - 1); - x += 2 * get_image("arrow")->get_w() + toggle_margin; // the mode buttons - - gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, - mbuttons_y - 1); - - x += 2 * get_image("autokeyframe")->get_w() + toggle_margin; // the state toggle buttons - gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, - mbuttons_y - 1); - -// Clock - gui->draw_3segmenth(0, - mbuttons_y + get_image("mbutton_bg")->get_h() - 1, - get_image("patchbay_bg")->get_w(), - get_image("clock_bg")); - -// Patchbay - gui->draw_3segmentv(patchbay_x, - patchbay_y, - patchbay_h, - get_image("patchbay_bg")); - -// Track canvas - gui->draw_9segment(mcanvas_x, - mcanvas_y, - mcanvas_w, - mcanvas_h, - get_image("tracks_bg")); - -// Timebar - gui->draw_3segmenth(mtimebar_x, - mtimebar_y, - mtimebar_w, - get_image("timebar_bg")); - -// Zoombar -#define ZOOMBAR_CENTER 888 - gui->draw_3segmenth(mzoom_x, - mzoom_y, - ZOOMBAR_CENTER, - get_image("zoombar_left")); - if(mzoom_w > ZOOMBAR_CENTER) - gui->draw_3segmenth(mzoom_x + ZOOMBAR_CENTER, - mzoom_y, - mzoom_w - ZOOMBAR_CENTER, - get_image("zoombar_right")); - - -// Status - gui->draw_3segmenth(mstatus_x, - mstatus_y, - ZOOMBAR_CENTER, - get_image("statusbar_left")); - - if(mstatus_w > ZOOMBAR_CENTER) - gui->draw_3segmenth(mstatus_x + ZOOMBAR_CENTER, - mstatus_y, - mstatus_w - ZOOMBAR_CENTER, - get_image("statusbar_right")); - -} - -void BlondTheme::draw_cwindow_bg(CWindowGUI *gui) -{ - const int button_division = 570; - gui->draw_3segmentv(0, 0, ccomposite_h, get_image("cpanel_bg")); - gui->draw_3segmenth(0, ccomposite_h, button_division, get_image("cbuttons_left")); - if(mwindow->edl->session->cwindow_meter) - { - gui->draw_3segmenth(button_division, - ccomposite_h, - cmeter_x - CWINDOW_METER_MARGIN - button_division, - get_image("cbuttons_right")); - gui->draw_9segment(cmeter_x - CWINDOW_METER_MARGIN, - 0, - mwindow->session->cwindow_w - cmeter_x + CWINDOW_METER_MARGIN, - mwindow->session->cwindow_h, - get_image("cmeter_bg")); - } - else - { - gui->draw_3segmenth(button_division, - ccomposite_h, - cmeter_x - CWINDOW_METER_MARGIN - button_division + 100, - get_image("cbuttons_right")); - } -} - -void BlondTheme::draw_vwindow_bg(VWindowGUI *gui) -{ - const int button_division = 400; - gui->draw_3segmenth(0, - vcanvas_h, - button_division, - get_image("vbuttons_left")); - if(mwindow->edl->session->vwindow_meter) - { - gui->draw_3segmenth(button_division, - vcanvas_h, - vmeter_x - VWINDOW_METER_MARGIN - button_division, - get_image("cbuttons_right")); - gui->draw_9segment(vmeter_x - VWINDOW_METER_MARGIN, - 0, - mwindow->session->vwindow_w - vmeter_x + VWINDOW_METER_MARGIN, - mwindow->session->vwindow_h, - get_image("cmeter_bg")); - } - else - { - gui->draw_3segmenth(button_division, - vcanvas_h, - vmeter_x - VWINDOW_METER_MARGIN - button_division + 100, - get_image("cbuttons_right")); - } -} - -void BlondTheme::get_preferences_sizes() -{ -} - - -void BlondTheme::draw_preferences_bg(PreferencesWindow *gui) -{ - gui->draw_vframe(get_image("preferences_bg"), 0, 0); -} - -void BlondTheme::get_new_sizes(NewWindow *gui) -{ -} - -void BlondTheme::draw_new_bg(NewWindow *gui) -{ - gui->draw_vframe(get_image("new_bg"), 0, 0); -} - -void BlondTheme::draw_setformat_bg(SetFormatWindow *gui) -{ - gui->draw_vframe(get_image("setformat_bg"), 0, 0); -} - - -// pmd: SUV (same), 1_2_2blond (nonexist) -void BlondTheme::get_plugindialog_sizes() -{ - int x = 10, y = 30; - plugindialog_new_x = x; - plugindialog_new_y = y; - plugindialog_shared_x = mwindow->session->plugindialog_w / 3; - plugindialog_shared_y = y; - plugindialog_module_x = mwindow->session->plugindialog_w * 2 / 3; - plugindialog_module_y = y; - - plugindialog_new_w = plugindialog_shared_x - plugindialog_new_x - 10; - plugindialog_new_h = mwindow->session->plugindialog_h - 120; - plugindialog_shared_w = plugindialog_module_x - plugindialog_shared_x - 10; - plugindialog_shared_h = mwindow->session->plugindialog_h - 120; - plugindialog_module_w = mwindow->session->plugindialog_w - plugindialog_module_x - 10; - plugindialog_module_h = mwindow->session->plugindialog_h - 120; - - plugindialog_newattach_x = plugindialog_new_x + 20; - plugindialog_newattach_y = plugindialog_new_y + plugindialog_new_h + 10; - plugindialog_sharedattach_x = plugindialog_shared_x + 20; - plugindialog_sharedattach_y = plugindialog_shared_y + plugindialog_shared_h + 10; - plugindialog_moduleattach_x = plugindialog_module_x + 20; - plugindialog_moduleattach_y = plugindialog_module_y + plugindialog_module_h + 10; -} - - - - - diff --git a/cinelerra-5.1/plugins/theme_blond_cv/buttons.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/buttons.xcf.bz2 deleted file mode 100644 index 4f6fd96e..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/buttons.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/cwindow.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/cwindow.xcf.bz2 deleted file mode 100644 index 923c0f81..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/cwindow.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/cwindow2.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/cwindow2.xcf.bz2 deleted file mode 100644 index 9c52ecff..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/cwindow2.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/hscroll.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/hscroll.xcf.bz2 deleted file mode 100644 index b3c4e125..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/hscroll.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/hscroll2.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/hscroll2.xcf.bz2 deleted file mode 100644 index fd548404..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/hscroll2.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_all_linear.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_all_linear.png deleted file mode 100644 index 001d0e96..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_all_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_all_smooth.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_all_smooth.png deleted file mode 100644 index 49fa6d1f..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_all_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_button_dn.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_button_dn.png deleted file mode 100644 index d8c9dc5a..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_button_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_button_hi.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_button_hi.png deleted file mode 100644 index 83b42a8d..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_button_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_button_up.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_button_up.png deleted file mode 100644 index ac9b2bc9..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_button_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_crv_linear.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_crv_linear.png deleted file mode 100644 index 776f9779..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_crv_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_crv_smooth.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_crv_smooth.png deleted file mode 100644 index 2670fdbf..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_crv_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_pnt_linear.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_pnt_linear.png deleted file mode 100644 index 1301f2f7..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_pnt_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_pnt_smooth.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_pnt_smooth.png deleted file mode 100644 index 7a8c72ec..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_pnt_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_crc.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_crc.png deleted file mode 100644 index 06097a45..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_crc.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_load.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_load.png deleted file mode 100644 index d02083f1..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_load.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_ovl.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_ovl.png deleted file mode 100644 index 28bcce28..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_ovl.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_save.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_save.png deleted file mode 100644 index c4cfd9a9..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_save.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_sqr.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_sqr.png deleted file mode 100644 index dd30da16..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_sqr.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_tri.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_tri.png deleted file mode 100644 index cd1090b5..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_tri.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_trsh.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_trsh.png deleted file mode 100644 index 1b47ed90..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_prst_trsh.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_pstn_cen.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_pstn_cen.png deleted file mode 100644 index 3a387219..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_pstn_cen.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_pstn_nrm.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_pstn_nrm.png deleted file mode 100644 index fcae6372..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_pstn_nrm.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_chkd.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_chkd.png deleted file mode 100644 index 1b551e56..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_chkd.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_chkdhi.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_chkdhi.png deleted file mode 100644 index f6bca3e4..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_chkdhi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_up.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_up.png deleted file mode 100644 index ac9b2bc9..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_uphi.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_uphi.png deleted file mode 100644 index a3d9e1d7..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_uphi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_x.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_x.png deleted file mode 100644 index 6055af16..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_x.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_xdown.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_xdown.png deleted file mode 100644 index 7c729e69..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_xdown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_xy.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_xy.png deleted file mode 100644 index 4464ab34..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_xy.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_xydown.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_xydown.png deleted file mode 100644 index 1de22661..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_xydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_y.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_y.png deleted file mode 100644 index c3879aa5..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_y.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_ydown.png b/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_ydown.png deleted file mode 100644 index 0192df0c..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mask_scale_ydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mwindow.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/mwindow.xcf.bz2 deleted file mode 100644 index c31f380b..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mwindow.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/mwindow2.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/mwindow2.xcf.bz2 deleted file mode 100644 index 57df42fe..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/mwindow2.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/preferencesbutton.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/preferencesbutton.xcf.bz2 deleted file mode 100644 index a753b0ed..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/preferencesbutton.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/recordgui.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/recordgui.xcf.bz2 deleted file mode 100644 index abc079c2..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/recordgui.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/recordmonitor.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/recordmonitor.xcf.bz2 deleted file mode 100644 index 87ef7b89..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/recordmonitor.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/scrollbar.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/scrollbar.xcf.bz2 deleted file mode 100644 index d55bac39..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/scrollbar.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/slider_bg.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/slider_bg.xcf.bz2 deleted file mode 100644 index d32be139..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/slider_bg.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/slider_button.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/slider_button.xcf.bz2 deleted file mode 100644 index 1dce41f0..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/slider_button.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/statusbar_cancel.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/statusbar_cancel.xcf.bz2 deleted file mode 100644 index 66924dd4..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/statusbar_cancel.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/tumbler.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/tumbler.xcf.bz2 deleted file mode 100644 index d6cfb71f..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/tumbler.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/unclear.png b/cinelerra-5.1/plugins/theme_blond_cv/unclear.png deleted file mode 100644 index 8e631961..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/unclear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/unclear_dn.png b/cinelerra-5.1/plugins/theme_blond_cv/unclear_dn.png deleted file mode 100644 index d8c9dc5a..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/unclear_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/unclear_hi.png b/cinelerra-5.1/plugins/theme_blond_cv/unclear_hi.png deleted file mode 100644 index 83b42a8d..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/unclear_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/unclear_up.png b/cinelerra-5.1/plugins/theme_blond_cv/unclear_up.png deleted file mode 100644 index ac9b2bc9..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/unclear_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/vscrollbar.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/vscrollbar.xcf.bz2 deleted file mode 100644 index 61d922f2..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/vscrollbar.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/vwindow.xcf.bz2 b/cinelerra-5.1/plugins/theme_blond_cv/vwindow.xcf.bz2 deleted file mode 100644 index 7d755fda..00000000 Binary files a/cinelerra-5.1/plugins/theme_blond_cv/vwindow.xcf.bz2 and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/bluetheme.C b/cinelerra-5.1/plugins/theme_blue/bluetheme.C index e58dc152..309b0e06 100644 --- a/cinelerra-5.1/plugins/theme_blue/bluetheme.C +++ b/cinelerra-5.1/plugins/theme_blue/bluetheme.C @@ -46,19 +46,11 @@ #include "vwindowgui.h" - - PluginClient* new_plugin(PluginServer *server) { return new BlueDotThemeMain(server); } - - - - - - BlueDotThemeMain::BlueDotThemeMain(PluginServer *server) : PluginTClient(server) { @@ -79,12 +71,6 @@ Theme* BlueDotThemeMain::new_theme() } - - - - - - BlueDotTheme::BlueDotTheme() : Theme() { @@ -124,7 +110,7 @@ void BlueDotTheme::initialize() resources->popup_title_text = 0xeeeeff; resources->menu_item_text = 0xeeeeff; resources->menu_highlighted_fontcolor = WHITE; - resources->generic_button_margin = 30; + resources->generic_button_margin = xS(30); resources->pot_needle_color = resources->text_default; resources->pot_offset = 1; resources->progress_text = resources->text_default; @@ -135,13 +121,13 @@ void BlueDotTheme::initialize() resources->menu_down = 0x4b4b4b; resources->menu_up = 0x4b4b4b; resources->menu_shadow = 0x202020; - resources->popupmenu_margin = 15; - resources->popupmenu_triangle_margin = 15; + resources->popupmenu_margin = xS(15); + resources->popupmenu_triangle_margin = xS(15); resources->listbox_title_color = 0xeeeeff; - resources->listbox_title_margin = 20; - resources->listbox_title_hotspot = 20; + resources->listbox_title_margin = xS(20); + resources->listbox_title_hotspot = xS(20); resources->listbox_border1 = 0x1a1a1a; resources->listbox_border2 = 0x1a1447; resources->listbox_border3 = 0x1a1447; @@ -151,7 +137,7 @@ void BlueDotTheme::initialize() resources->listbox_bg = 0; resources->listbox_text = 0xeeeeff; - resources->filebox_margin = 130; + resources->filebox_margin = yS(130); resources->file_color = 0xeeeeff; resources->directory_color = 0xa0a0ff; @@ -394,7 +380,7 @@ void BlueDotTheme::initialize() resources->bar_data = new_image("bar", "bar.png"); resources->check = new_image("check", "check.png"); - resources->min_menu_w = 96; + resources->min_menu_w = xS(96); resources->menu_popup_bg = new_image("menu_popup_bg.png"); resources->menu_item_bg = new_image_set(3, "menuitem_up.png", @@ -526,7 +512,7 @@ void BlueDotTheme::initialize() "vscroll_right_up.png", "vscroll_right_hi.png", "vscroll_right_dn.png"); - resources->scroll_minhandle = 20; + resources->scroll_minhandle = xS(20); new_button("prevtip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip"); @@ -544,17 +530,17 @@ void BlueDotTheme::initialize() preferences_category_overlap = 0; preferencescategory_x = 0; - preferencescategory_y = 5; - preferencestitle_x = 5; - preferencestitle_y = 10; - preferencesoptions_x = 5; + preferencescategory_y = yS(5); + preferencestitle_x = xS(5); + preferencestitle_y = yS(10); + preferencesoptions_x = xS(5); preferencesoptions_y = 0; // MWindow message_normal = resources->text_default; audio_color = GREEN; - mtransport_margin = 10; - toggle_margin = 10; + mtransport_margin = xS(10); + toggle_margin = xS(10); new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png", "pane"); new_image_set("xpane", 3, "xpane_up.png", "xpane_hi.png", "xpane_dn.png"); @@ -605,22 +591,22 @@ void BlueDotTheme::initialize() setformat_w = get_image("setformat_bg")->get_w(); setformat_h = get_image("setformat_bg")->get_h(); - setformat_x1 = 15; - setformat_x2 = 110; + setformat_x1 = xS(15); + setformat_x2 = xS(110); - setformat_x3 = 315; - setformat_x4 = 425; - setformat_y1 = 20; - setformat_y2 = 85; - setformat_y3 = 125; - setformat_margin = 30; - setformat_channels_x = 25; - setformat_channels_y = 242; - setformat_channels_w = 250; - setformat_channels_h = 250; + setformat_x3 = xS(315); + setformat_x4 = xS(425); + setformat_y1 = yS(20); + setformat_y2 = yS(85); + setformat_y3 = yS(125); + setformat_margin = xS(30); + setformat_channels_x = xS(25); + setformat_channels_y = yS(242); + setformat_channels_w = xS(250); + setformat_channels_h = yS(250); - loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + 10; - browse_pad = 20; + loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + yS(10); + browse_pad = yS(20); new_toggle("playpatch.png", @@ -932,13 +918,13 @@ void BlueDotTheme::initialize() recordgui_variable_color = RED; channel_position_color = MEYELLOW; - resources->meter_title_w = 25; + resources->meter_title_w = xS(25); // (asset) edit info text color edit_font_color = YELLOW; } -#define VWINDOW_METER_MARGIN 5 +#define VWINDOW_METER_MARGIN xS(5) void BlueDotTheme::build_bg_data() { @@ -971,18 +957,18 @@ void BlueDotTheme::build_overlays() void BlueDotTheme::draw_rwindow_bg(RecordGUI *gui) { // int y; -// int margin = 50; -// int margin2 = 80; +// int margin = xS(50); +// int margin2 = xS(80); // gui->draw_9segment(recordgui_batch_x - margin, // 0, // mwindow->session->rwindow_w - recordgui_status_x + margin, // recordgui_buttons_y, // rgui_batch); // gui->draw_3segmenth(recordgui_options_x - margin2, -// recordgui_buttons_y - 5, +// recordgui_buttons_y - yS(5), // mwindow->session->rwindow_w - recordgui_options_x + margin2, // rgui_controls); -// y = recordgui_buttons_y - 5 + rgui_controls->get_h(); +// y = recordgui_buttons_y - yS(5) + rgui_controls->get_h(); // gui->draw_9segment(0, // y, // mwindow->session->rwindow_w, @@ -992,17 +978,15 @@ void BlueDotTheme::draw_rwindow_bg(RecordGUI *gui) void BlueDotTheme::draw_rmonitor_bg(RecordMonitorGUI *gui) { -// int margin = 45; -// int panel_w = 300; +// int margin = xS(45); +// int panel_w = xS(300; // int x = rmonitor_meter_x - margin; // int w = mwindow->session->rmonitor_w - x; // if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w(); -// gui->clear_box(0, -// 0, +// gui->clear_box(0, 0, // mwindow->session->rmonitor_w, // mwindow->session->rmonitor_h); -// gui->draw_9segment(x, -// 0, +// gui->draw_9segment(x, 0, // w, // mwindow->session->rmonitor_h, // rmonitor_meters); @@ -1024,31 +1008,28 @@ void BlueDotTheme::draw_mwindow_bg(MWindowGUI *gui) x += 9 * get_image("play")->get_w(); x += mtransport_margin; // the control buttons + int xs2 = xS(2); gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 2 * get_image("arrow")->get_w() + toggle_margin; // the mode buttons gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 3 * get_image("autokeyframe")->get_w() + toggle_margin; // the state toggle buttons gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); // Clock - gui->draw_3segmenth(0, - mbuttons_y - 1 + get_image("mbutton_bg")->get_h(), - get_image("patchbay_bg")->get_w(), - get_image("clock_bg")); + gui->draw_3segmenth(0, mbuttons_y - 1 + get_image("mbutton_bg")->get_h(), + get_image("patchbay_bg")->get_w(), get_image("clock_bg")); // Patchbay - gui->draw_3segmentv(patchbay_x, - patchbay_y, - patchbay_h, - get_image("patchbay_bg")); + gui->draw_3segmentv(patchbay_x, patchbay_y, + patchbay_h, get_image("patchbay_bg")); // Track canvas gui->set_color(BLACK); @@ -1058,17 +1039,13 @@ void BlueDotTheme::draw_mwindow_bg(MWindowGUI *gui) mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ) - mtimebar_h); // Timebar - gui->draw_3segmenth(mtimebar_x, - mtimebar_y, - mtimebar_w, - get_image("timebar_bg")); + gui->draw_3segmenth(mtimebar_x, mtimebar_y, + mtimebar_w, get_image("timebar_bg")); // Zoombar gui->set_color(0x1a1447); - gui->draw_box(mzoom_x, - mzoom_y, - mwindow->session->mwindow_w, - 25); + gui->draw_box(mzoom_x, mzoom_y, + mwindow->session->mwindow_w, yS(25)); // Scrollbar filler // gui->draw_vframe(get_image("mscroll_filler"), @@ -1106,42 +1083,35 @@ void BlueDotTheme::draw_cwindow_bg(CWindowGUI *gui) { gui->draw_3segmenth(cstatus_x, ccomposite_h, - cmeter_x - widget_border - cstatus_x + 100, + cmeter_x - widget_border - cstatus_x + xS(100), get_image("cbuttons_right")); } } void BlueDotTheme::draw_vwindow_bg(VWindowGUI *gui) { - gui->draw_3segmenth(0, - vcanvas_h, - vdivision_x, - get_image("vbuttons_left")); + gui->draw_3segmenth(0, vcanvas_h, + vdivision_x, get_image("vbuttons_left")); if(mwindow->edl->session->vwindow_meter) { - gui->draw_3segmenth(vdivision_x, - vcanvas_h, + gui->draw_3segmenth(vdivision_x, vcanvas_h, vmeter_x - widget_border - vdivision_x, get_image("cbuttons_right")); - gui->draw_9segment(vmeter_x - widget_border, - 0, + gui->draw_9segment(vmeter_x - widget_border, 0, mwindow->session->vwindow_w - vmeter_x + widget_border, mwindow->session->vwindow_h, get_image("cmeter_bg")); } else { - gui->draw_3segmenth(vdivision_x, - vcanvas_h, - vmeter_x - widget_border - vdivision_x + 100, + gui->draw_3segmenth(vdivision_x, vcanvas_h, + vmeter_x - widget_border - vdivision_x + xS(100), get_image("cbuttons_right")); } // Clock border - gui->draw_3segmenth(vtime_x - 20, - vtime_y - 1, - vtime_w + 40, - get_image("vclock")); + gui->draw_3segmenth(vtime_x - xS(20), vtime_y - 1, + vtime_w + xS(40), get_image("vclock")); } void BlueDotTheme::draw_preferences_bg(PreferencesWindow *gui) diff --git a/cinelerra-5.1/plugins/theme_blue/mask_all_linear.png b/cinelerra-5.1/plugins/theme_blue/mask_all_linear.png deleted file mode 100644 index ec43b0b9..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_all_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_all_smooth.png b/cinelerra-5.1/plugins/theme_blue/mask_all_smooth.png deleted file mode 100644 index 4cab563c..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_all_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_button_dn.png b/cinelerra-5.1/plugins/theme_blue/mask_button_dn.png deleted file mode 100644 index 35a37147..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_button_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_button_hi.png b/cinelerra-5.1/plugins/theme_blue/mask_button_hi.png deleted file mode 100644 index 9fb80b7b..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_button_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_button_up.png b/cinelerra-5.1/plugins/theme_blue/mask_button_up.png deleted file mode 100644 index fc52498d..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_button_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_crv_linear.png b/cinelerra-5.1/plugins/theme_blue/mask_crv_linear.png deleted file mode 100644 index e2093bf6..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_crv_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_crv_smooth.png b/cinelerra-5.1/plugins/theme_blue/mask_crv_smooth.png deleted file mode 100644 index 32fe205a..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_crv_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_pnt_linear.png b/cinelerra-5.1/plugins/theme_blue/mask_pnt_linear.png deleted file mode 100644 index 79835735..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_pnt_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_pnt_smooth.png b/cinelerra-5.1/plugins/theme_blue/mask_pnt_smooth.png deleted file mode 100644 index 92173d38..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_pnt_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_prst_crc.png b/cinelerra-5.1/plugins/theme_blue/mask_prst_crc.png deleted file mode 100644 index 01a540b8..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_prst_crc.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_prst_load.png b/cinelerra-5.1/plugins/theme_blue/mask_prst_load.png deleted file mode 100644 index 7e35011b..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_prst_load.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_prst_ovl.png b/cinelerra-5.1/plugins/theme_blue/mask_prst_ovl.png deleted file mode 100644 index 8760bf29..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_prst_ovl.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_prst_save.png b/cinelerra-5.1/plugins/theme_blue/mask_prst_save.png deleted file mode 100644 index 726a085d..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_prst_save.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_prst_sqr.png b/cinelerra-5.1/plugins/theme_blue/mask_prst_sqr.png deleted file mode 100644 index ff3dc1b1..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_prst_sqr.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_prst_tri.png b/cinelerra-5.1/plugins/theme_blue/mask_prst_tri.png deleted file mode 100644 index 5118e349..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_prst_tri.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_prst_trsh.png b/cinelerra-5.1/plugins/theme_blue/mask_prst_trsh.png deleted file mode 100644 index d1f8f908..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_prst_trsh.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_pstn_cen.png b/cinelerra-5.1/plugins/theme_blue/mask_pstn_cen.png deleted file mode 100644 index 1477c60b..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_pstn_cen.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_pstn_nrm.png b/cinelerra-5.1/plugins/theme_blue/mask_pstn_nrm.png deleted file mode 100644 index c19e8ce7..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_pstn_nrm.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_scale_chkd.png b/cinelerra-5.1/plugins/theme_blue/mask_scale_chkd.png deleted file mode 100644 index db23a74c..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_scale_chkd.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_scale_chkdhi.png b/cinelerra-5.1/plugins/theme_blue/mask_scale_chkdhi.png deleted file mode 100644 index b0601293..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_scale_chkdhi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_scale_up.png b/cinelerra-5.1/plugins/theme_blue/mask_scale_up.png deleted file mode 100644 index fc52498d..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_scale_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_scale_uphi.png b/cinelerra-5.1/plugins/theme_blue/mask_scale_uphi.png deleted file mode 100644 index 9fb80b7b..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_scale_uphi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_scale_x.png b/cinelerra-5.1/plugins/theme_blue/mask_scale_x.png deleted file mode 100644 index e4d0c527..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_scale_x.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_scale_xdown.png b/cinelerra-5.1/plugins/theme_blue/mask_scale_xdown.png deleted file mode 100644 index 4e0292e0..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_scale_xdown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_scale_xy.png b/cinelerra-5.1/plugins/theme_blue/mask_scale_xy.png deleted file mode 100644 index d81f83e6..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_scale_xy.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_scale_xydown.png b/cinelerra-5.1/plugins/theme_blue/mask_scale_xydown.png deleted file mode 100644 index acef7141..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_scale_xydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_scale_y.png b/cinelerra-5.1/plugins/theme_blue/mask_scale_y.png deleted file mode 100644 index 1ae351b7..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_scale_y.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/mask_scale_ydown.png b/cinelerra-5.1/plugins/theme_blue/mask_scale_ydown.png deleted file mode 100644 index 9a457e61..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/mask_scale_ydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/unclear.png b/cinelerra-5.1/plugins/theme_blue/unclear.png deleted file mode 100644 index 21316f04..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/unclear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/unclear_dn.png b/cinelerra-5.1/plugins/theme_blue/unclear_dn.png deleted file mode 100644 index 35a37147..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/unclear_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/unclear_hi.png b/cinelerra-5.1/plugins/theme_blue/unclear_hi.png deleted file mode 100644 index 9fb80b7b..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/unclear_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue/unclear_up.png b/cinelerra-5.1/plugins/theme_blue/unclear_up.png deleted file mode 100644 index fc52498d..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue/unclear_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C index 89cd2b94..8865fec1 100644 --- a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C +++ b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C @@ -55,12 +55,6 @@ PluginClient* new_plugin(PluginServer *server) return new BlueDotThemeMain(server); } - - - - - - BlueDotThemeMain::BlueDotThemeMain(PluginServer *server) : PluginTClient(server) { @@ -81,12 +75,6 @@ Theme* BlueDotThemeMain::new_theme() } - - - - - - BlueDotTheme::BlueDotTheme() : Theme() { @@ -112,36 +100,29 @@ void BlueDotTheme::initialize() // about_bg = new_image("about_bg.png"); - // COPIED FROM DEFAULT THEME 1>> resources->text_default = 0x000000; resources->text_background = 0xffffff; resources->text_background_disarmed = 0xff3939; - //listbox borders resources->text_border1 = 0x4a484a; // (top outer) resources->text_border2 = 0x000000; // (top inner) resources->text_border3 = 0xacaeac; // (bottom inner) resources->text_border4 = 0xffffff; // (bottom outer) resources->text_inactive_highlight = 0xacacac; resources->text_highlight = BGREY; - // COPIED FROM DEFAULT THEME <<1 resources->bg_color = FGGREY; //bg of windows (where no pics... - // COPIED FROM DEFAULT THEME 2>> resources->default_text_color = 0x000000; resources->menu_title_text = 0x000000; resources->popup_title_text = 0x000000; - // COPIED FROM DEFAULT THEME <<2 resources->menu_item_text = BLACK; - // COPIED FROM DEFAULT THEME 3>> - resources->generic_button_margin = 15; //Length of buttons and color tabs + resources->generic_button_margin = xS(15); //Length of buttons and color tabs resources->pot_needle_color = resources->text_default; resources->pot_offset = 0; resources->progress_text = resources->text_default; - // COPIED FROM DEFAULT THEME <<3 resources->meter_font = SMALLFONT; //Specific to BD resources->meter_font_color = BLACK; - resources->meter_title_w = 20; //Specific to BD + resources->meter_title_w = xS(20); //Specific to BD resources->meter_3d = 0; //Specific to BD resources->menu_light = FTGREY; //menu @@ -150,13 +131,10 @@ void BlueDotTheme::initialize() resources->menu_up = FGGREY; resources->menu_shadow = FTGREY; - // MIHA: COPIED FROM DEFAULT THEME M1>> - resources->popupmenu_margin = 10; // ugly - resources->popupmenu_triangle_margin = 15; // ugly - // MIHA: COPIED FROM DEFAULT THEME M1<< + resources->popupmenu_margin = xS(10); + resources->popupmenu_triangle_margin = xS(15); - // COPIED FROM DEFAULT THEME 4>> resources->listbox_title_color = 0x000000; resources->listbox_title_margin = 0; @@ -171,11 +149,10 @@ void BlueDotTheme::initialize() resources->listbox_text = 0x000000; resources->listbox_selected = BGREY; - resources->dirbox_margin = 50; - resources->filebox_margin = 105; + resources->dirbox_margin = yS(50); + resources->filebox_margin = yS(105); resources->file_color = 0x000000; resources->directory_color = DKBLUE; - // COPIED FROM DEFAULT THEME <<4 resources->menu_highlighted_fontcolor = DDBLUE; //Specific to BD new_toggle("loadmode_new.png", @@ -556,11 +533,11 @@ void BlueDotTheme::initialize() //COPY START >> preferences_category_overlap = 0; - preferencescategory_x = 5; - preferencescategory_y = 5; - preferencestitle_x = 5; - preferencestitle_y = 10; - preferencesoptions_x = 5; + preferencescategory_x = xS(5); + preferencescategory_y = yS(5); + preferencestitle_x = xS(5); + preferencestitle_y = yS(10); + preferencesoptions_x = xS(5); preferencesoptions_y = 0; //COPY END<< @@ -568,8 +545,8 @@ void BlueDotTheme::initialize() //COPY START >> message_normal = resources->text_default; audio_color = BLACK; - mtransport_margin = 11; - toggle_margin = 11; + mtransport_margin = xS(11); + toggle_margin = xS(11); //COPY END >> new_image("mbutton_left","mbutton_left.png"); @@ -648,24 +625,24 @@ void BlueDotTheme::initialize() new_image("setformat_bg", "setformat_bg2.png"); // x, y of Format dialog box - setformat_w = 600; - setformat_h = 560; - setformat_x1 = 15; - setformat_x2 = 100; - - setformat_x3 = 315; - setformat_x4 = 415; - setformat_y1 = 20; - setformat_y2 = 85; - setformat_y3 = 125; - setformat_margin = 30; - setformat_channels_x = 25; - setformat_channels_y = 242; - setformat_channels_w = 250; - setformat_channels_h = 250; - - loadfile_pad = 70; - browse_pad = 20; + setformat_w = xS(600); + setformat_h = yS(560); + setformat_x1 = xS(15); + setformat_x2 = xS(100); + + setformat_x3 = xS(315); + setformat_x4 = xS(415); + setformat_y1 = yS(20); + setformat_y2 = yS(85); + setformat_y3 = yS(125); + setformat_margin = xS(30); + setformat_channels_x = xS(25); + setformat_channels_y = yS(242); + setformat_channels_w = xS(250); + setformat_channels_h = yS(250); + + loadfile_pad = yS(70); + browse_pad = yS(20); //This buttons miss a bit. May need to be improved new_image_set("playpatch_data", @@ -916,7 +893,6 @@ void BlueDotTheme::initialize() "batchcancel_hi.png", "batchcancel_dn.png"); -// MIHA: COPIED FROM DEFAULT THEME M2>> //Graphic Copied from default. Improve!! new_image_set("category_button", 3, @@ -929,7 +905,6 @@ void BlueDotTheme::initialize() "preferencesbutton_up.png", "preferencesbutton_uphi.png", "preferencesbutton_dnlo.png"); -// MIHA: COPIED FROM DEFAULT THEME M2<< new_toggle("arrow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "arrow"); @@ -945,7 +920,6 @@ void BlueDotTheme::initialize() new_image("locklabels_unlockedhi.png"), "locklabels"); -// MIHA: COPIED FROM DEFAULT THEME M3>> //Is that necessary?? VFrame *cpanel_up = new_image("editpanel_up.png"); VFrame *cpanel_hi = new_image("editpanel_hi.png"); @@ -964,7 +938,6 @@ void BlueDotTheme::initialize() new_toggle("titlesafe.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "titlesafe"); new_toggle("toolwindow.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "tool"); -// MIHA: COPIED FROM DEFAULT THEME M3<< // Maybe we can live without the commented part // MIHA: Commented out in favor of default version M4>> @@ -1007,7 +980,7 @@ void BlueDotTheme::initialize() resources->medium_font = cstrdup(string); channel_position_color = MEYELLOW; - resources->meter_title_w = 25; + resources->meter_title_w = xS(25); // (asset) edit info text color edit_font_color = BLACK; @@ -1052,9 +1025,8 @@ void BlueDotTheme::initialize() resources->tooltip_bg_color = 0xfff7e3; } -//CWINDOW is probalby ComposerWindow, V=ViewerWindow -#define CWINDOW_METER_MARGIN 5 -#define VWINDOW_METER_MARGIN 5 +#define CWINDOW_METER_MARGIN xS(5) +#define VWINDOW_METER_MARGIN xS(5) //Specific to BD void BlueDotTheme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) @@ -1062,11 +1034,11 @@ void BlueDotTheme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) // Position of menu buttons (start, stop, ff, etc.) mbuttons_x = 0; mbuttons_y = gui->mainmenu->get_h(); - mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+2 + proxy_p_toggle[0]->get_w()+2); + mbuttons_w = w - (ffmpeg_toggle[0]->get_w()+xS(2) + proxy_p_toggle[0]->get_w()+xS(2)); mbuttons_h = get_image("mbutton_left")->get_h(); - mclock_x = 20; //x position of digits in clock window + mclock_x = xS(20); //x position of digits in clock window mclock_y = mbuttons_y + 1 + mbuttons_h + CWINDOW_METER_MARGIN; - mclock_w = get_image("clock_bg")->get_w() - 72; + mclock_w = get_image("clock_bg")->get_w() - xS(72); mclock_h = get_image("clock_bg")->get_h(); //Time bar - coordinates and dimensions @@ -1087,10 +1059,10 @@ void BlueDotTheme::get_mwindow_sizes(MWindowGUI *gui, int w, int h) mstatus_y = mzoom_y + mzoom_h; mstatus_w = w; mstatus_h = h - mstatus_y; - mstatus_message_x = 10; - mstatus_message_y = 8; - mstatus_progress_w = 230; - mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - 240; + mstatus_message_x = xS(10); + mstatus_message_y = yS(8); + mstatus_progress_w = xS(230); + mstatus_progress_x = mstatus_w - statusbar_cancel_data[0]->get_w() - xS(240); mstatus_progress_y = mstatus_h - BC_WindowBase::get_resources()->progress_images[0]->get_h(); //Specific to BD @@ -1129,29 +1101,29 @@ void BlueDotTheme::get_cwindow_sizes(CWindowGUI *gui, int cwindow_controls) { SET_TRACE ccomposite_x = 0; - ccomposite_y = 5; + ccomposite_y = yS(5); ccomposite_w = get_image("cpanel_bg")->get_w(); ccomposite_h = mwindow->session->cwindow_h - get_image("cbuttons_left")->get_h(); - cslider_x = 5; - cslider_y = ccomposite_h + 23; - cedit_x = 10; - cedit_y = cslider_y + 17; - ctransport_x = 10; + cslider_x = xS(5); + cslider_y = ccomposite_h + yS(23); + cedit_x = xS(10); + cedit_y = cslider_y + yS(17); + ctransport_x = xS(10); ctransport_y = mwindow->session->cwindow_h - get_image_set("autokeyframe")[0]->get_h(); ccanvas_x = ccomposite_x + ccomposite_w; ccanvas_y = 0; ccanvas_h = ccomposite_h; -//COPIED START - cstatus_x = 453; - cstatus_y = mwindow->session->cwindow_h - 66; -//COPIED END + + cstatus_x = xS(453); + cstatus_y = mwindow->session->cwindow_h - yS(66); + if(mwindow->edl->session->cwindow_meter) { cmeter_x = mwindow->session->cwindow_w - MeterPanel::get_meters_width(this, mwindow->edl->session->audio_channels, mwindow->edl->session->cwindow_meter); - ccanvas_w = cmeter_x - ccanvas_x - 5; + ccanvas_w = cmeter_x - ccanvas_x - xS(5); } else { @@ -1168,12 +1140,12 @@ SET_TRACE ccomposite_w = get_image("cpanel_bg")->get_w(); ccomposite_h = mwindow->session->cwindow_h - get_image("cbuttons_left")->get_h(); - cslider_x = 5; + cslider_x = xS(5); cslider_y = mwindow->session->cwindow_h; - cedit_x = 10; - cedit_y = cslider_y + 17; - ctransport_x = 10; - ctransport_y = cedit_y + 40; + cedit_x = xS(10); + cedit_y = cslider_y + yS(17); + ctransport_x = xS(10); + ctransport_y = cedit_y + yS(40); ccanvas_x = 0; ccanvas_y = 0; ccanvas_w = mwindow->session->cwindow_w; @@ -1188,10 +1160,10 @@ SET_TRACE SET_TRACE - czoom_x = ctransport_x + PlayTransport::get_transport_width(mwindow) + 20; - czoom_y = ctransport_y + 5; + czoom_x = ctransport_x + PlayTransport::get_transport_width(mwindow) + xS(20); + czoom_y = ctransport_y + yS(5); - cmeter_y = 5; + cmeter_y = yS(5); cmeter_h = mwindow->session->cwindow_h - cmeter_y; ctimebar_x = ccanvas_x; @@ -1203,14 +1175,14 @@ SET_TRACE ctimebar_x = ccanvas_x; ctimebar_y = ccanvas_y + ccanvas_h; ctimebar_w = ccanvas_w; - ctimebar_h = 16; + ctimebar_h = yS(16); // Not used ctime_x = ctransport_x + PlayTransport::get_transport_width(mwindow); ctime_y = ctransport_y; cdest_x = czoom_x; - cdest_y = czoom_y + 30; + cdest_y = czoom_y + yS(30); SET_TRACE } @@ -1237,8 +1209,8 @@ void BlueDotTheme::get_rmonitor_sizes(int do_audio, audio_channels); if(!do_video && do_audio) { - rmonitor_meter_y -= 30; - rmonitor_meter_h += 30; + rmonitor_meter_y -= yS(30); + rmonitor_meter_h += yS(30); } } // COPIED END-------- @@ -1246,7 +1218,7 @@ void BlueDotTheme::get_rmonitor_sizes(int do_audio, void BlueDotTheme::get_vwindow_sizes(VWindowGUI *gui) { - vmeter_y = 5; + vmeter_y = yS(5); vmeter_h = mwindow->session->vwindow_h - cmeter_y; vcanvas_x = 0; vcanvas_y = 0; @@ -1269,34 +1241,28 @@ void BlueDotTheme::get_vwindow_sizes(VWindowGUI *gui) vtimebar_x = vcanvas_x; vtimebar_y = vcanvas_y + vcanvas_h; vtimebar_w = vcanvas_w; - vtimebar_h = 16; + vtimebar_h = yS(16); //Specific to BD - vslider_x = 10; - vslider_y = vtimebar_y + 25; + vslider_x = xS(10); + vslider_y = vtimebar_y + yS(25); vslider_w = vtimebar_w - vslider_x; - vedit_x = 10; - vedit_y = vslider_y + 17; - vtransport_x = 10; + vedit_x = xS(10); + vedit_y = vslider_y + yS(17); + vtransport_x = xS(10); vtransport_y = mwindow->session->vwindow_h - get_image_set("autokeyframe")[0]->get_h(); - vtime_x = 373; - vtime_y = vedit_y + 7; - vtime_w = 100; + vtime_x = xS(373); + vtime_y = vedit_y + yS(7); + vtime_w = xS(100); - - - - vzoom_x = vtime_x + 150; + vzoom_x = vtime_x + xS(150); vzoom_y = vtime_y; - vsource_x = vtime_x + 50; - vsource_y = vtransport_y + 5; + vsource_x = vtime_x + xS(50); + vsource_y = vtransport_y + yS(5); } - - - void BlueDotTheme::build_icons() { new_image("mwindow_icon", "heroine_icon.png"); @@ -1351,20 +1317,18 @@ void BlueDotTheme::build_overlays() void BlueDotTheme::draw_rwindow_bg(RecordGUI *gui) { // int y; -// int margin = 50; -// int margin2 = 80; -// gui->draw_9segment(recordgui_batch_x - margin, -// 0, +// int margin = xS(50); +// int margin2 = xS(80); +// gui->draw_9segment(recordgui_batch_x - margin, 0, // mwindow->session->rwindow_w - recordgui_status_x + margin, // recordgui_buttons_y, // rgui_batch); // gui->draw_3segmenth(recordgui_options_x - margin2, -// recordgui_buttons_y - 5, +// recordgui_buttons_y - yS(5), // mwindow->session->rwindow_w - recordgui_options_x + margin2, // rgui_controls); -// y = recordgui_buttons_y - 5 + rgui_controls->get_h(); -// gui->draw_9segment(0, -// y, +// y = recordgui_buttons_y - yS(5) + rgui_controls->get_h(); +// gui->draw_9segment(0, y, // mwindow->session->rwindow_w, // mwindow->session->rwindow_h - y, // rgui_list); @@ -1372,31 +1336,25 @@ void BlueDotTheme::draw_rwindow_bg(RecordGUI *gui) void BlueDotTheme::draw_rmonitor_bg(RecordMonitorGUI *gui) { -// int margin = 45; -// int panel_w = 300; +// int margin = xS(45); +// int panel_w = xS(300); // int x = rmonitor_meter_x - margin; // int w = mwindow->session->rmonitor_w - x; // if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w(); -// gui->clear_box(0, -// 0, +// gui->clear_box(0, 0, // mwindow->session->rmonitor_w, // mwindow->session->rmonitor_h); -// gui->draw_9segment(x, -// 0, +// gui->draw_9segment(x, 0, // w, // mwindow->session->rmonitor_h, // rmonitor_meters); } - - - - //Specific to BD void BlueDotTheme::draw_mwindow_bg(MWindowGUI *gui) { // Button bar (not menu bar) -#define MBUTTONS_RIGHTEDGE 290 + 11 + 2*30 + 11 + 2*30 + 11 + 14*30 +#define MBUTTONS_RIGHTEDGE xS(290 + 11 + 2*30 + 11 + 2*30 + 11 + 14*30) gui->draw_3segmenth(mbuttons_x, mbuttons_y, MBUTTONS_RIGHTEDGE, @@ -1404,25 +1362,21 @@ void BlueDotTheme::draw_mwindow_bg(MWindowGUI *gui) 0); gui->draw_3segmenth(mbuttons_x + MBUTTONS_RIGHTEDGE, mbuttons_y, - mbuttons_w - 500, + mbuttons_w - xS(500), get_image("mbutton_right")); -// MIHA: COPIED FROM DEFAULT THEME M6>> gui->draw_vframe(get_image("panel_divider"), - mbuttons_x + 290 + 5, + mbuttons_x + xS(290 + 5), mbuttons_y - 1); gui->draw_vframe(get_image("panel_divider"), - mbuttons_x + 290 + 11 + 30 * 2 + 5, + mbuttons_x + xS(290 + 11 + 30 * 2 + 5), mbuttons_y - 1); gui->draw_vframe(get_image("panel_divider"), - mbuttons_x + 290 + 11 + 30 * 2 + 11 + 30 * 3 + 5, + mbuttons_x + xS(290 + 11 + 30 * 2 + 11 + 30 * 3 + 5), mbuttons_y - 1); - -// MIHA: COPIED FROM DEFAULT THEME M6<< - //Specific to BD // Clock (here the background of the clock is drawn) gui->draw_3segmenth(0, @@ -1432,61 +1386,43 @@ void BlueDotTheme::draw_mwindow_bg(MWindowGUI *gui) //Specific to BD // Patchbay - gui->draw_3segmentv(patchbay_x, - patchbay_y, - patchbay_h, - get_image("patchbay_bg")); - -//patchbay_h + 10, - + gui->draw_3segmentv(patchbay_x, patchbay_y, + patchbay_h, get_image("patchbay_bg")); +//patchbay_h + yS(10), //Specific to BD //Drawing of Track's canvas - gui->draw_9segment(mcanvas_x, - mcanvas_y, - mcanvas_w, - patchbay_h + 26, + gui->draw_9segment(mcanvas_x, mcanvas_y, + mcanvas_w, patchbay_h + yS(26), get_image("tracks_bg")); -//patchbay_h + 10, +//patchbay_h + yS(10), // Timebar - gui->draw_3segmenth(mtimebar_x, - mtimebar_y, - mtimebar_w, - get_image("timebar_bg")); + gui->draw_3segmenth(mtimebar_x, mtimebar_y, + mtimebar_w, get_image("timebar_bg")); //Specific to BD // Zoombar -#define ZOOMBAR_CENTER 1100 - gui->draw_3segmenth(mzoom_x, - mzoom_y, - ZOOMBAR_CENTER, - get_image("zoombar_left")); +#define ZOOMBAR_CENTER xS(1100) + gui->draw_3segmenth(mzoom_x, mzoom_y, + ZOOMBAR_CENTER, get_image("zoombar_left")); if(mzoom_w > ZOOMBAR_CENTER) - gui->draw_3segmenth(mzoom_x + ZOOMBAR_CENTER, - mzoom_y, - mzoom_w - ZOOMBAR_CENTER, - get_image("zoombar_right")); - - + gui->draw_3segmenth(mzoom_x + ZOOMBAR_CENTER, mzoom_y, + mzoom_w - ZOOMBAR_CENTER, get_image("zoombar_right")); // Status - gui->draw_3segmenth(mstatus_x, - mstatus_y, - ZOOMBAR_CENTER, - get_image("statusbar_left")); + gui->draw_3segmenth(mstatus_x, mstatus_y, + ZOOMBAR_CENTER, get_image("statusbar_left")); if(mstatus_w > ZOOMBAR_CENTER) - gui->draw_3segmenth(mstatus_x + ZOOMBAR_CENTER, - mstatus_y, - mstatus_w - ZOOMBAR_CENTER, - get_image("statusbar_right")); + gui->draw_3segmenth(mstatus_x + ZOOMBAR_CENTER, mstatus_y, + mstatus_w - ZOOMBAR_CENTER, get_image("statusbar_right")); } void BlueDotTheme::draw_cwindow_bg(CWindowGUI *gui) { //Specific to BD - const int button_division = 530; + const int button_division = xS(530); gui->draw_3segmentv(0, 0, ccomposite_h, get_image("cpanel_bg")); gui->draw_3segmenth(0, ccomposite_h, button_division, get_image("cbuttons_left")); if(mwindow->edl->session->cwindow_meter) @@ -1505,7 +1441,7 @@ void BlueDotTheme::draw_cwindow_bg(CWindowGUI *gui) { gui->draw_3segmenth(button_division, ccomposite_h, - cmeter_x - CWINDOW_METER_MARGIN - button_division + 100, + cmeter_x - CWINDOW_METER_MARGIN - button_division + xS(100), get_image("cbuttons_right")); } } @@ -1513,7 +1449,7 @@ void BlueDotTheme::draw_cwindow_bg(CWindowGUI *gui) void BlueDotTheme::draw_vwindow_bg(VWindowGUI *gui) { //Specific to BD - const int button_division = 535; + const int button_division = xS(535); gui->draw_3segmenth(0, vcanvas_h, button_division, @@ -1534,7 +1470,7 @@ void BlueDotTheme::draw_vwindow_bg(VWindowGUI *gui) { gui->draw_3segmenth(button_division, vcanvas_h, - vmeter_x - VWINDOW_METER_MARGIN - button_division + 100, + vmeter_x - VWINDOW_METER_MARGIN - button_division + xS(100), get_image("vbuttons_right")); } } @@ -1546,7 +1482,7 @@ void BlueDotTheme::get_preferences_sizes() //Specific to BD void BlueDotTheme::draw_preferences_bg(PreferencesWindow *gui) { - gui->draw_9segment(0, 0, gui->get_w(), gui->get_h() - 40, get_image("preferences_bg")); + gui->draw_9segment(0, 0, gui->get_w(), gui->get_h() - yS(40), get_image("preferences_bg")); } void BlueDotTheme::get_new_sizes(NewWindow *gui) diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_all_linear.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_all_linear.png deleted file mode 100644 index 79ecf247..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_all_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_all_smooth.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_all_smooth.png deleted file mode 100644 index 98d511ea..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_all_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_button_dn.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_button_dn.png deleted file mode 100644 index 80cb7a62..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_button_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_button_hi.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_button_hi.png deleted file mode 100644 index 88ca0fff..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_button_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_button_up.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_button_up.png deleted file mode 100644 index 996aa58c..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_button_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_crv_linear.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_crv_linear.png deleted file mode 100644 index b82dd90e..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_crv_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_crv_smooth.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_crv_smooth.png deleted file mode 100644 index dc5e344a..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_crv_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_pnt_linear.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_pnt_linear.png deleted file mode 100644 index 1e77fd3d..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_pnt_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_pnt_smooth.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_pnt_smooth.png deleted file mode 100644 index ed476ee2..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_pnt_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_crc.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_crc.png deleted file mode 100644 index 1818cd09..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_crc.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_load.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_load.png deleted file mode 100644 index 649cda04..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_load.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_ovl.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_ovl.png deleted file mode 100644 index f41e3b5c..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_ovl.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_save.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_save.png deleted file mode 100644 index 251406bb..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_save.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_sqr.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_sqr.png deleted file mode 100644 index 9ac6cbd3..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_sqr.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_tri.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_tri.png deleted file mode 100644 index 2cea21da..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_tri.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_trsh.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_trsh.png deleted file mode 100644 index 38d4a369..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_prst_trsh.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_pstn_cen.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_pstn_cen.png deleted file mode 100644 index 3a06986f..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_pstn_cen.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_pstn_nrm.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_pstn_nrm.png deleted file mode 100644 index 5f341f43..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_pstn_nrm.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_chkd.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_chkd.png deleted file mode 100644 index e5dfca82..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_chkd.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_chkdhi.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_chkdhi.png deleted file mode 100644 index 67770ea6..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_chkdhi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_up.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_up.png deleted file mode 100644 index 996aa58c..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_uphi.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_uphi.png deleted file mode 100644 index fd91ee9b..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_uphi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_x.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_x.png deleted file mode 100644 index c2e28ee6..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_x.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_xdown.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_xdown.png deleted file mode 100644 index 8c72b90b..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_xdown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_xy.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_xy.png deleted file mode 100644 index 96febe1d..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_xy.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_xydown.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_xydown.png deleted file mode 100644 index 0dd09d79..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_xydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_y.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_y.png deleted file mode 100644 index 1c086caf..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_y.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_ydown.png b/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_ydown.png deleted file mode 100644 index e01f4eab..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/mask_scale_ydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/unclear.png b/cinelerra-5.1/plugins/theme_blue_dot/unclear.png deleted file mode 100644 index c3915883..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/unclear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/unclear_dn.png b/cinelerra-5.1/plugins/theme_blue_dot/unclear_dn.png deleted file mode 100644 index 80cb7a62..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/unclear_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/unclear_hi.png b/cinelerra-5.1/plugins/theme_blue_dot/unclear_hi.png deleted file mode 100644 index 88ca0fff..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/unclear_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/unclear_up.png b/cinelerra-5.1/plugins/theme_blue_dot/unclear_up.png deleted file mode 100644 index 996aa58c..00000000 Binary files a/cinelerra-5.1/plugins/theme_blue_dot/unclear_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/brighttheme.C b/cinelerra-5.1/plugins/theme_bright/brighttheme.C index af0a1565..c6a9eb3c 100644 --- a/cinelerra-5.1/plugins/theme_bright/brighttheme.C +++ b/cinelerra-5.1/plugins/theme_bright/brighttheme.C @@ -44,19 +44,11 @@ #include "vwindowgui.h" - - PluginClient* new_plugin(PluginServer *server) { return new BrightThemeMain(server); } - - - - - - BrightThemeMain::BrightThemeMain(PluginServer *server) : PluginTClient(server) { @@ -77,12 +69,6 @@ Theme* BrightThemeMain::new_theme() } - - - - - - BrightTheme::BrightTheme() : Theme() { @@ -124,7 +110,7 @@ void BrightTheme::initialize() resources->menu_title_text = 0x000000; resources->popup_title_text = 0x000000; resources->menu_item_text = 0x000000; - resources->generic_button_margin = 20; + resources->generic_button_margin = xS(20); resources->pot_needle_color = resources->text_default; resources->pot_offset = 1; resources->progress_text = resources->text_default; @@ -137,14 +123,14 @@ void BrightTheme::initialize() resources->menu_down = 0xc0c0c0; resources->menu_up = 0xffffff; resources->menu_shadow = 0x000000; - resources->popupmenu_margin = 10; - resources->popupmenu_triangle_margin = 15; + resources->popupmenu_margin = xS(10); + resources->popupmenu_triangle_margin = xS(15); resources->listbox_title_color = 0x000000; - resources->listbox_title_overlap = 20; - resources->listbox_title_margin = 20; - resources->listbox_title_hotspot = 20; + resources->listbox_title_overlap = xS(20); + resources->listbox_title_margin = xS(20); + resources->listbox_title_hotspot = xS(20); resources->listbox_border1 = 0x000000; resources->listbox_border2 = 0xffffff; resources->listbox_border3 = 0xffffff; @@ -157,11 +143,11 @@ void BrightTheme::initialize() resources->listbox_bg = 0; resources->listbox_text = 0x000000; - resources->filebox_margin = 130; + resources->filebox_margin = yS(130); resources->file_color = 0x000000; resources->directory_color = 0x0000ff; - resources->scroll_minhandle = 24; + resources->scroll_minhandle = xS(24); new_toggle("loadmode_new.png", "loadmode_up.png", @@ -401,7 +387,7 @@ void BrightTheme::initialize() resources->bar_data = new_image("bar", "bar.png"); - resources->min_menu_w = 96; + resources->min_menu_w = xS(96); resources->menu_popup_bg = new_image("menu_popup_bg.png"); resources->menu_item_bg = new_image_set(3, "menuitem_up.png", @@ -545,18 +531,18 @@ void BrightTheme::initialize() preferences_category_overlap = 0; preferencescategory_x = 0; - preferencescategory_y = 5; - preferencestitle_x = 5; - preferencestitle_y = 10; - preferencesoptions_x = 5; + preferencescategory_y = yS(5); + preferencestitle_x = xS(5); + preferencestitle_y = yS(10); + preferencesoptions_x = xS(5); preferencesoptions_y = 0; // MWindow message_normal = resources->text_default; audio_color = 0x00ff00; assetedit_color = BLACK; - mtransport_margin = 20; - toggle_margin = 20; + mtransport_margin = xS(20); + toggle_margin = xS(20); timebar_cursor_color = BLACK; new_image("mbutton_bg", "mbutton_bg.png"); @@ -611,23 +597,21 @@ void BrightTheme::initialize() setformat_w = get_image("setformat_bg")->get_w(); setformat_h = get_image("setformat_bg")->get_h(); - setformat_x1 = 15; - setformat_x2 = 100; - - setformat_x3 = 315; - setformat_x4 = 415; - setformat_y1 = 20; - setformat_y2 = 85; - setformat_y3 = 125; - setformat_margin = 30; - setformat_channels_x = 25; - setformat_channels_y = 242; - setformat_channels_w = 250; - setformat_channels_h = 250; - - loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + 10; - browse_pad = 20; - + setformat_x1 = xS(15); + setformat_x2 = xS(100); + setformat_x3 = xS(315); + setformat_x4 = xS(415); + setformat_y1 = yS(20); + setformat_y2 = yS(85); + setformat_y3 = yS(125); + setformat_margin = xS(30); + setformat_channels_x = xS(25); + setformat_channels_y = yS(242); + setformat_channels_w = xS(250); + setformat_channels_h = yS(250); + + loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + yS(10); + browse_pad = yS(20); new_toggle("playpatch.png", "patch_up.png", @@ -855,8 +839,6 @@ void BrightTheme::initialize() new_button("stop.png", transport_up, transport_hi, transport_dn, "stop"); new_button("stop.png", transport_up, transport_hi, transport_dn, "stoprec"); - - // CWindow icons new_image("cwindow_inactive", "cwindow_inactive.png"); new_image("cwindow_active", "cwindow_active.png"); @@ -875,17 +857,12 @@ void BrightTheme::initialize() "preferencesbutton_uphi.png", "preferencesbutton_dnlo.png"); - - new_image_set("color3way_point", 3, "color3way_up.png", "color3way_hi.png", "color3way_dn.png"); - - - new_toggle("arrow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "arrow"); new_toggle("autokeyframe.png", transport_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "autokeyframe"); new_toggle("spankeyframe.png", transport_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "spankeyframe"); @@ -939,7 +916,7 @@ void BrightTheme::initialize() recordgui_variable_color = BLACK; channel_position_color = BLACK; - resources->meter_title_w = 25; + resources->meter_title_w = xS(25); } @@ -975,30 +952,21 @@ void BrightTheme::build_overlays() } - - - - - - - void BrightTheme::draw_rwindow_bg(RecordGUI *gui) { // int y; -// int margin = 50; -// int margin2 = 80; -// gui->draw_9segment(recordgui_batch_x - margin, -// 0, +// int margin = xS(50); +// int margin2 = xS(80); +// gui->draw_9segment(recordgui_batch_x - margin, 0, // mwindow->session->rwindow_w - recordgui_status_x + margin, // recordgui_buttons_y, // rgui_batch); // gui->draw_3segmenth(recordgui_options_x - margin2, -// recordgui_buttons_y - 5, +// recordgui_buttons_y - yS(5), // mwindow->session->rwindow_w - recordgui_options_x + margin2, // rgui_controls); -// y = recordgui_buttons_y - 5 + rgui_controls->get_h(); -// gui->draw_9segment(0, -// y, +// y = recordgui_buttons_y - yS(5) + rgui_controls->get_h(); +// gui->draw_9segment(0, y, // mwindow->session->rwindow_w, // mwindow->session->rwindow_h - y, // rgui_list); @@ -1006,27 +974,21 @@ void BrightTheme::draw_rwindow_bg(RecordGUI *gui) void BrightTheme::draw_rmonitor_bg(RecordMonitorGUI *gui) { -// int margin = 45; -// int panel_w = 300; +// int margin = xS(45); +// int panel_w = xS(300); // int x = rmonitor_meter_x - margin; // int w = mwindow->session->rmonitor_w - x; // if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w(); -// gui->clear_box(0, -// 0, +// gui->clear_box(0, 0, // mwindow->session->rmonitor_w, // mwindow->session->rmonitor_h); -// gui->draw_9segment(x, -// 0, +// gui->draw_9segment(x, 0, // w, // mwindow->session->rmonitor_h, // rmonitor_meters); } - - - - void BrightTheme::draw_mwindow_bg(MWindowGUI *gui) { // Button bar @@ -1034,15 +996,12 @@ void BrightTheme::draw_mwindow_bg(MWindowGUI *gui) gui->menu_w(), get_image("mbutton_bg")); gui->draw_vframe(get_image("panel_divider"), - mbuttons_x + 228, - mbuttons_y - 1); + mbuttons_x + xS(228), mbuttons_y - 1); gui->draw_vframe(get_image("panel_divider"), - mbuttons_x + 294, - mbuttons_y - 1); + mbuttons_x + xS(294), mbuttons_y - 1); gui->draw_vframe(get_image("panel_divider"), - mbuttons_x + 396, - mbuttons_y - 1); + mbuttons_x + xS(396), mbuttons_y - 1); // Clock gui->draw_3segmenth(0, @@ -1071,10 +1030,8 @@ void BrightTheme::draw_mwindow_bg(MWindowGUI *gui) // Zoombar // gui->set_color(0x373737); -// gui->draw_box(mzoom_x, -// mzoom_y, -// mwindow->session->mwindow_w, -// 25); +// gui->draw_box(mzoom_x, mzoom_y, +// mwindow->session->mwindow_w, yS(25)); // Scrollbar filler // gui->draw_vframe(get_image("mscroll_filler"), @@ -1117,7 +1074,7 @@ void BrightTheme::draw_cwindow_bg(CWindowGUI *gui) { gui->draw_3segmenth(cstatus_x, ccomposite_h, - cmeter_x - widget_border - cstatus_x + 100, + cmeter_x - widget_border - cstatus_x + xS(100), get_image("cbuttons_right")); } } @@ -1146,15 +1103,13 @@ void BrightTheme::draw_vwindow_bg(VWindowGUI *gui) { gui->draw_3segmenth(vdivision_x, vcanvas_h, - vmeter_x - widget_border - vdivision_x + 100, + vmeter_x - widget_border - vdivision_x + xS(100), get_image("cbuttons_right")); } // Clock border - gui->draw_3segmenth(vtime_x - 20, - vtime_y - 1, - vtime_w + 40, - get_image("vclock")); + gui->draw_3segmenth(vtime_x - xS(20), vtime_y - 1, + vtime_w + xS(40), get_image("vclock")); } diff --git a/cinelerra-5.1/plugins/theme_bright/mask_all_linear.png b/cinelerra-5.1/plugins/theme_bright/mask_all_linear.png deleted file mode 100644 index 2986a690..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_all_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_all_smooth.png b/cinelerra-5.1/plugins/theme_bright/mask_all_smooth.png deleted file mode 100644 index 088fb31b..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_all_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_button_dn.png b/cinelerra-5.1/plugins/theme_bright/mask_button_dn.png deleted file mode 100644 index 8f117f2a..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_button_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_button_hi.png b/cinelerra-5.1/plugins/theme_bright/mask_button_hi.png deleted file mode 100644 index c9005881..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_button_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_button_up.png b/cinelerra-5.1/plugins/theme_bright/mask_button_up.png deleted file mode 100644 index 830d9b3c..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_button_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_crv_linear.png b/cinelerra-5.1/plugins/theme_bright/mask_crv_linear.png deleted file mode 100644 index e9dffdcf..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_crv_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_crv_smooth.png b/cinelerra-5.1/plugins/theme_bright/mask_crv_smooth.png deleted file mode 100644 index 92943913..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_crv_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_pnt_linear.png b/cinelerra-5.1/plugins/theme_bright/mask_pnt_linear.png deleted file mode 100644 index ac17b251..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_pnt_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_pnt_smooth.png b/cinelerra-5.1/plugins/theme_bright/mask_pnt_smooth.png deleted file mode 100644 index 6564e98e..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_pnt_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_prst_crc.png b/cinelerra-5.1/plugins/theme_bright/mask_prst_crc.png deleted file mode 100644 index 42bd1e43..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_prst_crc.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_prst_load.png b/cinelerra-5.1/plugins/theme_bright/mask_prst_load.png deleted file mode 100644 index f4416298..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_prst_load.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_prst_ovl.png b/cinelerra-5.1/plugins/theme_bright/mask_prst_ovl.png deleted file mode 100644 index 40e3e961..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_prst_ovl.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_prst_save.png b/cinelerra-5.1/plugins/theme_bright/mask_prst_save.png deleted file mode 100644 index 39c4679e..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_prst_save.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_prst_sqr.png b/cinelerra-5.1/plugins/theme_bright/mask_prst_sqr.png deleted file mode 100644 index c8241418..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_prst_sqr.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_prst_tri.png b/cinelerra-5.1/plugins/theme_bright/mask_prst_tri.png deleted file mode 100644 index d69ac443..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_prst_tri.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_prst_trsh.png b/cinelerra-5.1/plugins/theme_bright/mask_prst_trsh.png deleted file mode 100644 index 9bc40e38..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_prst_trsh.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_pstn_cen.png b/cinelerra-5.1/plugins/theme_bright/mask_pstn_cen.png deleted file mode 100644 index 515133f6..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_pstn_cen.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_pstn_nrm.png b/cinelerra-5.1/plugins/theme_bright/mask_pstn_nrm.png deleted file mode 100644 index 40e987a8..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_pstn_nrm.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_scale_chkd.png b/cinelerra-5.1/plugins/theme_bright/mask_scale_chkd.png deleted file mode 100644 index 8f117f2a..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_scale_chkd.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_scale_chkdhi.png b/cinelerra-5.1/plugins/theme_bright/mask_scale_chkdhi.png deleted file mode 100644 index c9005881..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_scale_chkdhi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_scale_up.png b/cinelerra-5.1/plugins/theme_bright/mask_scale_up.png deleted file mode 100644 index 830d9b3c..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_scale_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_scale_uphi.png b/cinelerra-5.1/plugins/theme_bright/mask_scale_uphi.png deleted file mode 100644 index c9005881..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_scale_uphi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_scale_x.png b/cinelerra-5.1/plugins/theme_bright/mask_scale_x.png deleted file mode 100644 index 1f6e7e07..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_scale_x.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_scale_xdown.png b/cinelerra-5.1/plugins/theme_bright/mask_scale_xdown.png deleted file mode 100644 index 0e638420..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_scale_xdown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_scale_xy.png b/cinelerra-5.1/plugins/theme_bright/mask_scale_xy.png deleted file mode 100644 index c5e0b7cd..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_scale_xy.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_scale_xydown.png b/cinelerra-5.1/plugins/theme_bright/mask_scale_xydown.png deleted file mode 100644 index a8c982fd..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_scale_xydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_scale_y.png b/cinelerra-5.1/plugins/theme_bright/mask_scale_y.png deleted file mode 100644 index 6cc4f886..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_scale_y.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/mask_scale_ydown.png b/cinelerra-5.1/plugins/theme_bright/mask_scale_ydown.png deleted file mode 100644 index 46156302..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/mask_scale_ydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/unclear.png b/cinelerra-5.1/plugins/theme_bright/unclear.png deleted file mode 100644 index 15299274..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/unclear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/unclear_dn.png b/cinelerra-5.1/plugins/theme_bright/unclear_dn.png deleted file mode 100644 index 8f117f2a..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/unclear_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/unclear_hi.png b/cinelerra-5.1/plugins/theme_bright/unclear_hi.png deleted file mode 100644 index c9005881..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/unclear_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_bright/unclear_up.png b/cinelerra-5.1/plugins/theme_bright/unclear_up.png deleted file mode 100644 index 830d9b3c..00000000 Binary files a/cinelerra-5.1/plugins/theme_bright/unclear_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_cakewalk/cakewalk.C b/cinelerra-5.1/plugins/theme_cakewalk/cakewalk.C index 72ffee6d..530b40eb 100644 --- a/cinelerra-5.1/plugins/theme_cakewalk/cakewalk.C +++ b/cinelerra-5.1/plugins/theme_cakewalk/cakewalk.C @@ -98,7 +98,7 @@ void CAKEWALKTHEME::initialize() resources->popup_title_text = WHITE; resources->menu_item_text = WHITE; resources->menu_highlighted_fontcolor = BLACK; - resources->generic_button_margin = 20; + resources->generic_button_margin = xS(20); resources->pot_needle_color = TextFg; resources->pot_offset = 1; resources->progress_text = resources->text_default; @@ -108,11 +108,11 @@ void CAKEWALKTHEME::initialize() resources->menu_up = ALARM; resources->menu_shadow = ALARM; resources->menu_highlighted = CwCyan; - resources->popupmenu_margin = 15; - resources->popupmenu_triangle_margin = 15; + resources->popupmenu_margin = xS(15); + resources->popupmenu_triangle_margin = xS(15); resources->listbox_title_color = TextFgBright; - resources->listbox_title_margin = 15; - resources->listbox_title_hotspot = 15; + resources->listbox_title_margin = xS(15); + resources->listbox_title_hotspot = xS(15); resources->listbox_border1 = TextBorderOut; resources->listbox_border2 = CwDarkGray; resources->listbox_border3 = CwDarkGray; @@ -124,7 +124,7 @@ void CAKEWALKTHEME::initialize() resources->listbox_bg = 0; resources->listbox_text = TextFg; resources->listbox_selected = CwCyan; - resources->filebox_margin = 130; + resources->filebox_margin = yS(130); resources->file_color = WHITE; resources->directory_color = ComicYellow; title_font = MEDIUMFONT; @@ -132,7 +132,7 @@ void CAKEWALKTHEME::initialize() recordgui_fixed_color = MeterGreen; recordgui_variable_color = MeterYellow; channel_position_color = MeterYellow; - resources->meter_title_w = 25; + resources->meter_title_w = xS(25); edit_font_color = ComicYellow; assetedit_color = TextFgBright; timebar_cursor_color = WHITE; @@ -374,7 +374,7 @@ void CAKEWALKTHEME::initialize() "mask_pstn_nrm_images"); resources->bar_data = new_image("bar", "bar.png"); resources->check = new_image("check", "check.png"); - resources->min_menu_w = 96; + resources->min_menu_w = xS(96); resources->menu_popup_bg = new_image("menu_popup_bg.png"); resources->menu_item_bg = new_image_set( 3, @@ -523,7 +523,7 @@ void CAKEWALKTHEME::initialize() "vscroll_right_up.png", "vscroll_right_hi.png", "vscroll_right_dn.png"); - resources->scroll_minhandle = 20; + resources->scroll_minhandle = xS(20); new_button( "prevtip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip"); @@ -538,14 +538,14 @@ void CAKEWALKTHEME::initialize() "editpanel_hi.png", "editpanel_dn.png", "swap_extents"); preferences_category_overlap = 0; preferencescategory_x = 0; - preferencescategory_y = 5; - preferencestitle_x = 5; - preferencestitle_y = 10; - preferencesoptions_x = 5; + preferencescategory_y = yS(5); + preferencestitle_x = xS(5); + preferencestitle_y = yS(10); + preferencesoptions_x = xS(5); preferencesoptions_y = 0; message_normal = resources->text_default; - mtransport_margin = 10; - toggle_margin = 10; + mtransport_margin = xS(10); + toggle_margin = xS(10); new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png", "pane"); new_image_set("xpane", 3, @@ -612,20 +612,20 @@ void CAKEWALKTHEME::initialize() timebar_view_data = new_image("timebar_view.png"); setformat_w = get_image("setformat_bg")->get_w(); setformat_h = get_image("setformat_bg")->get_h(); - setformat_x1 = 15; - setformat_x2 = 110; - setformat_x3 = 315; - setformat_x4 = 425; - setformat_y1 = 20; - setformat_y2 = 85; - setformat_y3 = 125; - setformat_margin = 30; - setformat_channels_x = 25; - setformat_channels_y = 242; - setformat_channels_w = 250; - setformat_channels_h = 250; - loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + 10; - browse_pad = 20; + setformat_x1 = xS(15); + setformat_x2 = xS(110); + setformat_x3 = xS(315); + setformat_x4 = xS(425); + setformat_y1 = yS(20); + setformat_y2 = yS(85); + setformat_y3 = yS(125); + setformat_margin = yS(30); + setformat_channels_x = xS(25); + setformat_channels_y = yS(242); + setformat_channels_w = xS(250); + setformat_channels_h = yS(250); + loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + yS(10); + browse_pad = yS(20); new_toggle("playpatch.png", "playpatch_up.png", "playpatch_hi.png", @@ -1021,12 +1021,12 @@ void CAKEWALKTHEME::initialize() } void CAKEWALKTHEME::get_vwindow_sizes(VWindowGUI *gui) { - int edit_w = EditPanel::calculate_w(mwindow, 0, 10); + int edit_w = EditPanel::calculate_w(mwindow, 0, xS(10)); int transport_w = PlayTransport::get_transport_width(mwindow) + toggle_margin; - vtimebar_h = 16; - int division_w = 30; - vtime_w = 140; - int vtime_border = 15; + vtimebar_h = yS(16); + int division_w = xS(30); + vtime_w = xS(140); + int vtime_border = xS(15); vmeter_y = widget_border; vmeter_h = mwindow->session->vwindow_h - cmeter_y - widget_border; int buttons_h; @@ -1056,9 +1056,9 @@ void CAKEWALKTHEME::get_vwindow_sizes(VWindowGUI *gui) vtransport_y = mwindow->session->vwindow_h - get_image_set("autokeyframe")[0]->get_h() - widget_border; - vdivision_x = 280; - vtime_x = vedit_x + 65; - vtime_y = vedit_y + 28; + vdivision_x = xS(280); + vtime_x = vedit_x + xS(65); + vtime_y = vedit_y + yS(28); } else { buttons_h = vtimebar_h + widget_border + @@ -1117,16 +1117,17 @@ void CAKEWALKTHEME::draw_mwindow_bg(MWindowGUI *gui) int x = mbuttons_x; x += 9 * get_image("play")->get_w(); x += mtransport_margin; + int xs2 = xS(2); gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 2 * get_image("arrow")->get_w() + toggle_margin; gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 2 * get_image("autokeyframe")->get_w() + toggle_margin; gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); gui->draw_3segmenth(0, mbuttons_y - 1 + get_image("mbutton_bg")->get_h(), @@ -1146,10 +1147,8 @@ void CAKEWALKTHEME::draw_mwindow_bg(MWindowGUI *gui) mtimebar_w, get_image("timebar_bg")); gui->set_color(CwDarkGray); - gui->draw_box(mzoom_x, - mzoom_y, - mwindow->session->mwindow_w, - 25); + gui->draw_box(mzoom_x, mzoom_y, + mwindow->session->mwindow_w, yS(25)); gui->draw_3segmenth(mzoom_x, mzoom_y, mzoom_w, @@ -1173,7 +1172,7 @@ void CAKEWALKTHEME::draw_cwindow_bg(CWindowGUI *gui) } else { gui->draw_3segmenth(cstatus_x, ccomposite_h, - cmeter_x - widget_border - cstatus_x + 100, + cmeter_x - widget_border - cstatus_x + xS(100), get_image("cbuttons_right")); } } @@ -1197,14 +1196,11 @@ void CAKEWALKTHEME::draw_vwindow_bg(VWindowGUI *gui) } else { gui->draw_3segmenth(vdivision_x, vcanvas_h, - vmeter_x - widget_border - vdivision_x + 100, + vmeter_x - widget_border - vdivision_x + xS(100), get_image("vbuttons_right")); } - gui->draw_3segmenth( - vtime_x - 5, - vtime_y + 0, - vtime_w + 10, - get_image("vclock")); + gui->draw_3segmenth(vtime_x - xS(5), vtime_y + 0, + vtime_w + xS(10), get_image("vclock")); } void CAKEWALKTHEME::draw_preferences_bg(PreferencesWindow *gui) { diff --git a/cinelerra-5.1/plugins/theme_hulk/hulktheme.C b/cinelerra-5.1/plugins/theme_hulk/hulktheme.C index d7333981..e77e343b 100644 --- a/cinelerra-5.1/plugins/theme_hulk/hulktheme.C +++ b/cinelerra-5.1/plugins/theme_hulk/hulktheme.C @@ -46,20 +46,11 @@ #include "vframe.h" #include "vwindowgui.h" - - - PluginClient* new_plugin(PluginServer *server) { return new HULKTHEMEMain(server); } - - - - - - HULKTHEMEMain::HULKTHEMEMain(PluginServer *server) : PluginTClient(server) { @@ -80,12 +71,6 @@ Theme* HULKTHEMEMain::new_theme() } - - - - - - HULKTHEME::HULKTHEME() : Theme() { @@ -125,7 +110,7 @@ void HULKTHEME::initialize() resources->popup_title_text = 0x001000; resources->menu_item_text = 0x001000; resources->menu_highlighted_fontcolor = WHITE; - resources->generic_button_margin = 30; + resources->generic_button_margin = xS(30); resources->pot_needle_color = resources->text_default; resources->pot_offset = 1; resources->progress_text = resources->text_default; @@ -136,13 +121,13 @@ void HULKTHEME::initialize() resources->menu_down = 0x4b4b4b; resources->menu_up = 0x4b4b4b; resources->menu_shadow = 0x202020; - resources->popupmenu_margin = 15; - resources->popupmenu_triangle_margin = 15; + resources->popupmenu_margin = xS(15); + resources->popupmenu_triangle_margin = xS(15); resources->listbox_title_color = 0x001000; - resources->listbox_title_margin = 20; - resources->listbox_title_hotspot = 20; + resources->listbox_title_margin = xS(20); + resources->listbox_title_hotspot = xS(20); resources->listbox_border1 = 0x1a1a1a; resources->listbox_border2 = 0x75b697; resources->listbox_border3 = 0x75b697; @@ -152,7 +137,7 @@ void HULKTHEME::initialize() resources->listbox_bg = 0; resources->listbox_text = 0x001000; - resources->filebox_margin = 130; + resources->filebox_margin = yS(130); resources->file_color = 0x001000; resources->directory_color = 0xa0a0ff; @@ -395,7 +380,7 @@ void HULKTHEME::initialize() resources->bar_data = new_image("bar", "bar.png"); resources->check = new_image("check", "check.png"); - resources->min_menu_w = 96; + resources->min_menu_w = xS(96); resources->menu_popup_bg = new_image("menu_popup_bg.png"); resources->menu_item_bg = new_image_set(3, "menuitem_up.png", @@ -527,7 +512,7 @@ void HULKTHEME::initialize() "vscroll_right_up.png", "vscroll_right_hi.png", "vscroll_right_dn.png"); - resources->scroll_minhandle = 20; + resources->scroll_minhandle = xS(20); new_button("prevtip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip"); @@ -545,17 +530,17 @@ void HULKTHEME::initialize() preferences_category_overlap = 0; preferencescategory_x = 0; - preferencescategory_y = 5; - preferencestitle_x = 5; - preferencestitle_y = 10; - preferencesoptions_x = 5; + preferencescategory_y = yS(5); + preferencestitle_x = xS(5); + preferencestitle_y = yS(10); + preferencesoptions_x = xS(5); preferencesoptions_y = 0; // MWindow message_normal = resources->text_default; audio_color = GREEN; - mtransport_margin = 10; - toggle_margin = 10; + mtransport_margin = xS(10); + toggle_margin = xS(10); new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png", "pane"); new_image_set("xpane", 3, "xpane_up.png", "xpane_hi.png", "xpane_dn.png"); @@ -606,23 +591,21 @@ void HULKTHEME::initialize() setformat_w = get_image("setformat_bg")->get_w(); setformat_h = get_image("setformat_bg")->get_h(); - setformat_x1 = 15; - setformat_x2 = 110; - - setformat_x3 = 315; - setformat_x4 = 425; - setformat_y1 = 20; - setformat_y2 = 85; - setformat_y3 = 125; - setformat_margin = 30; - setformat_channels_x = 25; - setformat_channels_y = 242; - setformat_channels_w = 250; - setformat_channels_h = 250; - - loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + 10; - browse_pad = 20; - + setformat_x1 = xS(15); + setformat_x2 = xS(110); + setformat_x3 = xS(315); + setformat_x4 = xS(425); + setformat_y1 = yS(20); + setformat_y2 = yS(85); + setformat_y3 = yS(125); + setformat_margin = xS(30); + setformat_channels_x = xS(25); + setformat_channels_y = yS(242); + setformat_channels_w = xS(250); + setformat_channels_h = yS(250); + + loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + yS(10); + browse_pad = yS(20); new_toggle("playpatch.png", "playpatch_up.png", @@ -934,7 +917,7 @@ void HULKTHEME::initialize() recordgui_variable_color = RED; channel_position_color = MEYELLOW; - resources->meter_title_w = 25; + resources->meter_title_w = xS(25); // (asset) edit info text color edit_font_color = YELLOW; @@ -976,18 +959,17 @@ void HULKTHEME::build_overlays() void HULKTHEME::draw_rwindow_bg(RecordGUI *gui) { // int y; -// int margin = 50; -// int margin2 = 80; -// gui->draw_9segment(recordgui_batch_x - margin, -// 0, +// int margin = xS(50); +// int margin2 = xS(80); +// gui->draw_9segment(recordgui_batch_x - margin, 0, // mwindow->session->rwindow_w - recordgui_status_x + margin, // recordgui_buttons_y, // rgui_batch); // gui->draw_3segmenth(recordgui_options_x - margin2, -// recordgui_buttons_y - 5, +// recordgui_buttons_y - yS(5), // mwindow->session->rwindow_w - recordgui_options_x + margin2, // rgui_controls); -// y = recordgui_buttons_y - 5 + rgui_controls->get_h(); +// y = recordgui_buttons_y - yS(5) + rgui_controls->get_h(); // gui->draw_9segment(0, // y, // mwindow->session->rwindow_w, @@ -997,27 +979,21 @@ void HULKTHEME::draw_rwindow_bg(RecordGUI *gui) void HULKTHEME::draw_rmonitor_bg(RecordMonitorGUI *gui) { -// int margin = 45; -// int panel_w = 300; +// int margin = xS(45); +// int panel_w = xS(300); // int x = rmonitor_meter_x - margin; // int w = mwindow->session->rmonitor_w - x; // if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w(); -// gui->clear_box(0, -// 0, +// gui->clear_box(0, 0, // mwindow->session->rmonitor_w, // mwindow->session->rmonitor_h); -// gui->draw_9segment(x, -// 0, +// gui->draw_9segment(x, 0, // w, // mwindow->session->rmonitor_h, // rmonitor_meters); } - - - - void HULKTHEME::draw_mwindow_bg(MWindowGUI *gui) { // Button bar @@ -1028,19 +1004,19 @@ void HULKTHEME::draw_mwindow_bg(MWindowGUI *gui) int x = mbuttons_x; x += 9 * get_image("play")->get_w(); x += mtransport_margin; // the control buttons - + int xs2 = xS(2); gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 2 * get_image("arrow")->get_w() + toggle_margin; // the mode buttons gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 3 * get_image("autokeyframe")->get_w() + toggle_margin; // the state toggle buttons gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); // Clock @@ -1050,10 +1026,8 @@ void HULKTHEME::draw_mwindow_bg(MWindowGUI *gui) get_image("clock_bg")); // Patchbay - gui->draw_3segmentv(patchbay_x, - patchbay_y, - patchbay_h, - get_image("patchbay_bg")); + gui->draw_3segmentv(patchbay_x, patchbay_y, + patchbay_h, get_image("patchbay_bg")); // Track canvas gui->set_color(BLACK); @@ -1063,17 +1037,13 @@ void HULKTHEME::draw_mwindow_bg(MWindowGUI *gui) mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ) - mtimebar_h); // Timebar - gui->draw_3segmenth(mtimebar_x, - mtimebar_y, - mtimebar_w, - get_image("timebar_bg")); + gui->draw_3segmenth(mtimebar_x, mtimebar_y, + mtimebar_w, get_image("timebar_bg")); // Zoombar gui->set_color(0x75b697); - gui->draw_box(mzoom_x, - mzoom_y, - mwindow->session->mwindow_w, - 25); + gui->draw_box(mzoom_x, mzoom_y, + mwindow->session->mwindow_w, yS(25)); // Scrollbar filler // gui->draw_vframe(get_image("mscroll_filler"), @@ -1081,10 +1051,8 @@ void HULKTHEME::draw_mwindow_bg(MWindowGUI *gui) // mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ)); // Status - gui->draw_3segmenth(mzoom_x, - mzoom_y, - mzoom_w, - get_image("statusbar")); + gui->draw_3segmenth(mzoom_x, mzoom_y, + mzoom_w, get_image("statusbar")); } @@ -1111,7 +1079,7 @@ void HULKTHEME::draw_cwindow_bg(CWindowGUI *gui) { gui->draw_3segmenth(cstatus_x, ccomposite_h, - cmeter_x - widget_border - cstatus_x + 100, + cmeter_x - widget_border - cstatus_x + xS(100), get_image("cbuttons_right")); } } @@ -1138,15 +1106,13 @@ void HULKTHEME::draw_vwindow_bg(VWindowGUI *gui) { gui->draw_3segmenth(vdivision_x, vcanvas_h, - vmeter_x - widget_border - vdivision_x + 100, + vmeter_x - widget_border - vdivision_x + xS(100), get_image("cbuttons_right")); } // Clock border - gui->draw_3segmenth(vtime_x - 20, - vtime_y - 1, - vtime_w + 40, - get_image("vclock")); + gui->draw_3segmenth(vtime_x - xS(20), vtime_y - 1, + vtime_w + 40, get_image("vclock")); } void HULKTHEME::draw_preferences_bg(PreferencesWindow *gui) diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_all_linear.png b/cinelerra-5.1/plugins/theme_hulk/mask_all_linear.png deleted file mode 100644 index 1f18bc8b..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_all_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_all_smooth.png b/cinelerra-5.1/plugins/theme_hulk/mask_all_smooth.png deleted file mode 100644 index 8eeff647..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_all_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_button_dn.png b/cinelerra-5.1/plugins/theme_hulk/mask_button_dn.png deleted file mode 100644 index 6290fe52..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_button_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_button_hi.png b/cinelerra-5.1/plugins/theme_hulk/mask_button_hi.png deleted file mode 100644 index 51f166c7..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_button_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_button_up.png b/cinelerra-5.1/plugins/theme_hulk/mask_button_up.png deleted file mode 100644 index bcbdc94d..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_button_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_crv_linear.png b/cinelerra-5.1/plugins/theme_hulk/mask_crv_linear.png deleted file mode 100644 index b595aba6..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_crv_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_crv_smooth.png b/cinelerra-5.1/plugins/theme_hulk/mask_crv_smooth.png deleted file mode 100644 index 8e002eaf..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_crv_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_pnt_linear.png b/cinelerra-5.1/plugins/theme_hulk/mask_pnt_linear.png deleted file mode 100644 index 8106a3ce..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_pnt_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_pnt_smooth.png b/cinelerra-5.1/plugins/theme_hulk/mask_pnt_smooth.png deleted file mode 100644 index 748b9748..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_pnt_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_prst_crc.png b/cinelerra-5.1/plugins/theme_hulk/mask_prst_crc.png deleted file mode 100644 index 43dd204a..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_prst_crc.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_prst_load.png b/cinelerra-5.1/plugins/theme_hulk/mask_prst_load.png deleted file mode 100644 index 7f90e2ca..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_prst_load.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_prst_ovl.png b/cinelerra-5.1/plugins/theme_hulk/mask_prst_ovl.png deleted file mode 100644 index b786d001..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_prst_ovl.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_prst_save.png b/cinelerra-5.1/plugins/theme_hulk/mask_prst_save.png deleted file mode 100644 index 4233ce69..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_prst_save.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_prst_sqr.png b/cinelerra-5.1/plugins/theme_hulk/mask_prst_sqr.png deleted file mode 100644 index 2d23514d..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_prst_sqr.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_prst_tri.png b/cinelerra-5.1/plugins/theme_hulk/mask_prst_tri.png deleted file mode 100644 index 600d13ac..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_prst_tri.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_prst_trsh.png b/cinelerra-5.1/plugins/theme_hulk/mask_prst_trsh.png deleted file mode 100644 index abccd6e1..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_prst_trsh.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_pstn_cen.png b/cinelerra-5.1/plugins/theme_hulk/mask_pstn_cen.png deleted file mode 100644 index ec4fc4f4..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_pstn_cen.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_pstn_nrm.png b/cinelerra-5.1/plugins/theme_hulk/mask_pstn_nrm.png deleted file mode 100644 index 4395c72a..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_pstn_nrm.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_scale_chkd.png b/cinelerra-5.1/plugins/theme_hulk/mask_scale_chkd.png deleted file mode 100644 index 5b3a5d35..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_scale_chkd.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_scale_chkdhi.png b/cinelerra-5.1/plugins/theme_hulk/mask_scale_chkdhi.png deleted file mode 100644 index 7988e0b3..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_scale_chkdhi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_scale_up.png b/cinelerra-5.1/plugins/theme_hulk/mask_scale_up.png deleted file mode 100644 index bcbdc94d..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_scale_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_scale_uphi.png b/cinelerra-5.1/plugins/theme_hulk/mask_scale_uphi.png deleted file mode 100644 index 51f166c7..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_scale_uphi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_scale_x.png b/cinelerra-5.1/plugins/theme_hulk/mask_scale_x.png deleted file mode 100644 index 35741632..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_scale_x.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_scale_xdown.png b/cinelerra-5.1/plugins/theme_hulk/mask_scale_xdown.png deleted file mode 100644 index f1875ee3..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_scale_xdown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_scale_xy.png b/cinelerra-5.1/plugins/theme_hulk/mask_scale_xy.png deleted file mode 100644 index 468815e2..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_scale_xy.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_scale_xydown.png b/cinelerra-5.1/plugins/theme_hulk/mask_scale_xydown.png deleted file mode 100644 index b5cdf91d..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_scale_xydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_scale_y.png b/cinelerra-5.1/plugins/theme_hulk/mask_scale_y.png deleted file mode 100644 index 6323ac59..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_scale_y.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/mask_scale_ydown.png b/cinelerra-5.1/plugins/theme_hulk/mask_scale_ydown.png deleted file mode 100644 index 921bcb02..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/mask_scale_ydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/unclear.png b/cinelerra-5.1/plugins/theme_hulk/unclear.png deleted file mode 100644 index 52309832..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/unclear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/unclear_dn.png b/cinelerra-5.1/plugins/theme_hulk/unclear_dn.png deleted file mode 100644 index 6290fe52..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/unclear_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/unclear_hi.png b/cinelerra-5.1/plugins/theme_hulk/unclear_hi.png deleted file mode 100644 index 51f166c7..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/unclear_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_hulk/unclear_up.png b/cinelerra-5.1/plugins/theme_hulk/unclear_up.png deleted file mode 100644 index bcbdc94d..00000000 Binary files a/cinelerra-5.1/plugins/theme_hulk/unclear_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_all_linear.png b/cinelerra-5.1/plugins/theme_neophyte/mask_all_linear.png deleted file mode 100644 index f6481eba..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_all_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_all_smooth.png b/cinelerra-5.1/plugins/theme_neophyte/mask_all_smooth.png deleted file mode 100644 index 369ddaaf..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_all_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_button_dn.png b/cinelerra-5.1/plugins/theme_neophyte/mask_button_dn.png deleted file mode 100644 index 482709c0..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_button_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_button_hi.png b/cinelerra-5.1/plugins/theme_neophyte/mask_button_hi.png deleted file mode 100644 index 54eec7a2..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_button_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_button_up.png b/cinelerra-5.1/plugins/theme_neophyte/mask_button_up.png deleted file mode 100644 index 312a2b26..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_button_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_crv_linear.png b/cinelerra-5.1/plugins/theme_neophyte/mask_crv_linear.png deleted file mode 100644 index 98f9a833..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_crv_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_crv_smooth.png b/cinelerra-5.1/plugins/theme_neophyte/mask_crv_smooth.png deleted file mode 100644 index 1feb15c9..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_crv_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_pnt_linear.png b/cinelerra-5.1/plugins/theme_neophyte/mask_pnt_linear.png deleted file mode 100644 index 8dd77d34..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_pnt_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_pnt_smooth.png b/cinelerra-5.1/plugins/theme_neophyte/mask_pnt_smooth.png deleted file mode 100644 index fee20de6..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_pnt_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_crc.png b/cinelerra-5.1/plugins/theme_neophyte/mask_prst_crc.png deleted file mode 100644 index 93f70938..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_crc.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_load.png b/cinelerra-5.1/plugins/theme_neophyte/mask_prst_load.png deleted file mode 100644 index 61b83323..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_load.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_ovl.png b/cinelerra-5.1/plugins/theme_neophyte/mask_prst_ovl.png deleted file mode 100644 index 04c715bb..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_ovl.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_save.png b/cinelerra-5.1/plugins/theme_neophyte/mask_prst_save.png deleted file mode 100644 index af16bf08..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_save.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_sqr.png b/cinelerra-5.1/plugins/theme_neophyte/mask_prst_sqr.png deleted file mode 100644 index 122d95f2..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_sqr.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_tri.png b/cinelerra-5.1/plugins/theme_neophyte/mask_prst_tri.png deleted file mode 100644 index 7308b9d5..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_tri.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_trsh.png b/cinelerra-5.1/plugins/theme_neophyte/mask_prst_trsh.png deleted file mode 100644 index 8737a2da..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_prst_trsh.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_pstn_cen.png b/cinelerra-5.1/plugins/theme_neophyte/mask_pstn_cen.png deleted file mode 100644 index f85de232..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_pstn_cen.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_pstn_nrm.png b/cinelerra-5.1/plugins/theme_neophyte/mask_pstn_nrm.png deleted file mode 100644 index 7429a5e1..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_pstn_nrm.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_chkd.png b/cinelerra-5.1/plugins/theme_neophyte/mask_scale_chkd.png deleted file mode 100644 index 848b1dde..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_chkd.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_chkdhi.png b/cinelerra-5.1/plugins/theme_neophyte/mask_scale_chkdhi.png deleted file mode 100644 index 074285ef..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_chkdhi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_up.png b/cinelerra-5.1/plugins/theme_neophyte/mask_scale_up.png deleted file mode 100644 index 312a2b26..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_uphi.png b/cinelerra-5.1/plugins/theme_neophyte/mask_scale_uphi.png deleted file mode 100644 index e3a504b4..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_uphi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_x.png b/cinelerra-5.1/plugins/theme_neophyte/mask_scale_x.png deleted file mode 100644 index 0bf4bee8..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_x.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_xdown.png b/cinelerra-5.1/plugins/theme_neophyte/mask_scale_xdown.png deleted file mode 100644 index f4e85917..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_xdown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_xy.png b/cinelerra-5.1/plugins/theme_neophyte/mask_scale_xy.png deleted file mode 100644 index 0064fbfd..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_xy.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_xydown.png b/cinelerra-5.1/plugins/theme_neophyte/mask_scale_xydown.png deleted file mode 100644 index d3f7ac42..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_xydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_y.png b/cinelerra-5.1/plugins/theme_neophyte/mask_scale_y.png deleted file mode 100644 index fc9e2216..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_y.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_ydown.png b/cinelerra-5.1/plugins/theme_neophyte/mask_scale_ydown.png deleted file mode 100644 index 7b916a86..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/mask_scale_ydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/neophyte.C b/cinelerra-5.1/plugins/theme_neophyte/neophyte.C index 120fb1dd..019db9de 100644 --- a/cinelerra-5.1/plugins/theme_neophyte/neophyte.C +++ b/cinelerra-5.1/plugins/theme_neophyte/neophyte.C @@ -148,7 +148,7 @@ void NEOPHYTETHEME::initialize() resources->menu_highlighted_fontcolor = CreamyWhiteBright; /* This indent is too global and the fullness ultimately depends * on the text. (Pref. top right, engl.: ~17) */ - resources->generic_button_margin = 20; // [15] + resources->generic_button_margin = xS(20); // [15] resources->pot_needle_color = CreamyWhite; // [resources->text_default] – marginal resources->pot_offset = 1; // only the needle resources->progress_text = resources->text_default; @@ -161,12 +161,12 @@ void NEOPHYTETHEME::initialize() resources->menu_shadow = ALARM; resources->menu_highlighted = BabyBlue; - resources->popupmenu_margin = 15; // indent, moves the button text to the right - resources->popupmenu_triangle_margin = 15; + resources->popupmenu_margin = xS(15); // indent, moves the button text to the right + resources->popupmenu_triangle_margin = xS(15); resources->listbox_title_color = CreamyWhiteBright; // columns header - resources->listbox_title_margin = 15; // [20] indent - resources->listbox_title_hotspot = 15; // [20] + resources->listbox_title_margin = xS(15); // [20] indent + resources->listbox_title_hotspot = xS(15); // [20] resources->listbox_border2 = BlackNineTwo; // as text_border resources->listbox_border1 = BLACK; @@ -182,7 +182,7 @@ void NEOPHYTETHEME::initialize() resources->listbox_text = CreamyWhite; resources->listbox_selected = 0x3d5477; // approximately matches column_hi - resources->filebox_margin = 130; // [130] + resources->filebox_margin = yS(130); // [130] resources->file_color = WHITE; resources->directory_color = BabyBlue; @@ -196,7 +196,7 @@ void NEOPHYTETHEME::initialize() recordgui_variable_color = RED; channel_position_color = ComicYellow; // Set Format, speaker numbers - resources->meter_title_w = 25; + resources->meter_title_w = xS(25); // (asset) edit info text color edit_font_color = ComicYellow; // ? ../../cinelerra/theme.h:282 @@ -475,7 +475,7 @@ void NEOPHYTETHEME::initialize() resources->bar_data = new_image("bar", "bar.png"); resources->check = new_image("check", "check.png"); - resources->min_menu_w = 96; + resources->min_menu_w = xS(96); resources->menu_popup_bg = new_image("menu_popup_bg.png"); resources->menu_item_bg = new_image_set( 3, @@ -649,17 +649,17 @@ void NEOPHYTETHEME::initialize() // Record windows preferences_category_overlap = 0; preferencescategory_x = 0; - preferencescategory_y = 5; - preferencestitle_x = 5; - preferencestitle_y = 10; - preferencesoptions_x = 5; + preferencescategory_y = yS(5); + preferencestitle_x = xS(5); + preferencestitle_y = yS(10); + preferencesoptions_x = xS(5); preferencesoptions_y = 0; // MWindow message_normal = resources->text_default; - mtransport_margin = 10; - toggle_margin = 10; + mtransport_margin = xS(10); + toggle_margin = xS(10); new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png", "pane"); @@ -745,21 +745,21 @@ void NEOPHYTETHEME::initialize() setformat_w = get_image("setformat_bg")->get_w(); setformat_h = get_image("setformat_bg")->get_h(); - setformat_x1 = 15; - setformat_x2 = 110; - setformat_x3 = 315; - setformat_x4 = 425; - setformat_y1 = 20; - setformat_y2 = 85; - setformat_y3 = 125; - setformat_margin = 30; - setformat_channels_x = 25; - setformat_channels_y = 242; - setformat_channels_w = 250; - setformat_channels_h = 250; - - loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + 10; - browse_pad = 20; + setformat_x1 = xS(15); + setformat_x2 = xS(110); + setformat_x3 = xS(315); + setformat_x4 = xS(425); + setformat_y1 = yS(20); + setformat_y2 = yS(85); + setformat_y3 = yS(125); + setformat_margin = xS(30); + setformat_channels_x = xS(25); + setformat_channels_y = yS(242); + setformat_channels_w = xS(250); + setformat_channels_h = yS(250); + + loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + yS(10); + browse_pad = yS(20); new_toggle("playpatch.png", "playpatch_up.png", @@ -1175,19 +1175,19 @@ void NEOPHYTETHEME::initialize() // Re-align the Clock. theme.c:931 void NEOPHYTETHEME::get_vwindow_sizes(VWindowGUI *gui) { - int edit_w = EditPanel::calculate_w(mwindow, 0, 10); + int edit_w = EditPanel::calculate_w(mwindow, 0, xS(10)); int transport_w = PlayTransport::get_transport_width(mwindow) + toggle_margin; - vtimebar_h = 16; // The height of the position indicator - int division_w = 30; + vtimebar_h = yS(16); // The height of the position indicator + int division_w = xS(30); /* For the deco, [150]-10. The remaining space should theoretically suffice for 999,999:59:59.960 hours. Total size: 140 x 26, where a height of 24 or 22 px would be nicer. */ - vtime_w = 140; + vtime_w = xS(140); /* Indent, flat. Larger indentation also puts the 35% view into the compact view. */ - int vtime_border = 15; + int vtime_border = xS(15); vmeter_y = widget_border; vmeter_h = mwindow->session->vwindow_h - cmeter_y - widget_border; @@ -1223,9 +1223,9 @@ void NEOPHYTETHEME::get_vwindow_sizes(VWindowGUI *gui) get_image_set("autokeyframe")[0]->get_h() - widget_border; - vdivision_x = 280; // field width, compact - vtime_x = vedit_x + 38; // concentric - vtime_y = vedit_y + 24; // vertical alignment + vdivision_x = xS(280); // field width, compact + vtime_x = vedit_x + xS(38); // concentric + vtime_y = vedit_y + yS(24); // vertical alignment } else { buttons_h = vtimebar_h + widget_border + @@ -1285,20 +1285,18 @@ void NEOPHYTETHEME::build_overlays() void NEOPHYTETHEME::draw_rwindow_bg(RecordGUI *gui) { // int y; - // int margin = 50; - // int margin2 = 80; - // gui->draw_9segment(recordgui_batch_x - margin, - // 0, + // int margin = xS(50); + // int margin2 = xS(80); + // gui->draw_9segment(recordgui_batch_x - margin, 0, // mwindow->session->rwindow_w - recordgui_status_x + margin, // recordgui_buttons_y, // rgui_batch); // gui->draw_3segmenth(recordgui_options_x - margin2, - // recordgui_buttons_y - 5, + // recordgui_buttons_y - yS(5), // mwindow->session->rwindow_w - recordgui_options_x + margin2, // rgui_controls); - // y = recordgui_buttons_y - 5 + rgui_controls->get_h(); - // gui->draw_9segment(0, - // y, + // y = recordgui_buttons_y - yS(5) + rgui_controls->get_h(); + // gui->draw_9segment(0, y, // mwindow->session->rwindow_w, // mwindow->session->rwindow_h - y, // rgui_list); @@ -1306,17 +1304,15 @@ void NEOPHYTETHEME::draw_rwindow_bg(RecordGUI *gui) void NEOPHYTETHEME::draw_rmonitor_bg(RecordMonitorGUI *gui) { - // int margin = 45; - // int panel_w = 300; + // int margin = xS(45); + // int panel_w = xS(300); // int x = rmonitor_meter_x - margin; // int w = mwindow->session->rmonitor_w - x; // if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w(); - // gui->clear_box(0, - // 0, + // gui->clear_box(0, 0, // mwindow->session->rmonitor_w, // mwindow->session->rmonitor_h); - // gui->draw_9segment(x, - // 0, + // gui->draw_9segment(x, 0, // w, // mwindow->session->rmonitor_h, // rmonitor_meters); @@ -1363,26 +1359,20 @@ void NEOPHYTETHEME::draw_mwindow_bg(MWindowGUI *gui) mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT), mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ) - mtimebar_h); // Timebar - gui->draw_3segmenth(mtimebar_x, - mtimebar_y, - mtimebar_w, - get_image("timebar_bg")); + gui->draw_3segmenth(mtimebar_x, mtimebar_y, + mtimebar_w, get_image("timebar_bg")); // Zoombar gui->set_color(BlackNineTwo); - gui->draw_box(mzoom_x, - mzoom_y, - mwindow->session->mwindow_w, - 25); + gui->draw_box(mzoom_x, mzoom_y, + mwindow->session->mwindow_w, yS(25)); // Scrollbar filler // gui->draw_vframe(get_image("mscroll_filler"), // mcanvas_x + mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT), // mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ)); // Status - gui->draw_3segmenth(mzoom_x, - mzoom_y, - mzoom_w, - get_image("statusbar")); + gui->draw_3segmenth(mzoom_x, mzoom_y, + mzoom_w, get_image("statusbar")); } void NEOPHYTETHEME::draw_cwindow_bg(CWindowGUI *gui) @@ -1403,42 +1393,34 @@ void NEOPHYTETHEME::draw_cwindow_bg(CWindowGUI *gui) mwindow->session->cwindow_h, get_image("cmeter_bg")); } else { - gui->draw_3segmenth(cstatus_x, - ccomposite_h, - cmeter_x - widget_border - cstatus_x + 100, - get_image("cbuttons_right")); + gui->draw_3segmenth(cstatus_x, ccomposite_h, + cmeter_x - widget_border - cstatus_x + xS(100), + get_image("cbuttons_right")); } } void NEOPHYTETHEME::draw_vwindow_bg(VWindowGUI *gui) { - gui->draw_3segmenth(0, - vcanvas_h, - vdivision_x, - get_image("vbuttons_left")); + gui->draw_3segmenth(0, vcanvas_h, + vdivision_x, get_image("vbuttons_left")); if(mwindow->edl->session->vwindow_meter) { - gui->draw_3segmenth(vdivision_x, - vcanvas_h, - vmeter_x - widget_border - vdivision_x, - get_image("vbuttons_right")); - gui->draw_9segment(vmeter_x - widget_border, - 0, - mwindow->session->vwindow_w - vmeter_x + widget_border, - mwindow->session->vwindow_h, - get_image("cmeter_bg")); + gui->draw_3segmenth(vdivision_x, vcanvas_h, + vmeter_x - widget_border - vdivision_x, get_image("vbuttons_right")); + gui->draw_9segment(vmeter_x - widget_border, 0, + mwindow->session->vwindow_w - vmeter_x + widget_border, + mwindow->session->vwindow_h, get_image("cmeter_bg")); } else { - gui->draw_3segmenth(vdivision_x, - vcanvas_h, - vmeter_x - widget_border - vdivision_x + 100, - get_image("vbuttons_right")); + gui->draw_3segmenth(vdivision_x, vcanvas_h, + vmeter_x - widget_border - vdivision_x + xS(100), + get_image("vbuttons_right")); } // Clock deco gui->draw_3segmenth( - vtime_x - 5, // -left, +right - vtime_y + 0, // -up, +down. Careful, move some of the buttons as well. - vtime_w + 10, // protruded l/r x*2 + vtime_x - xS(5), // -left, +right + vtime_y + 0, // -up, +down. Careful, move some of the buttons as well. + vtime_w + xS(10), // protruded l/r x*2 get_image("vclock")); } diff --git a/cinelerra-5.1/plugins/theme_neophyte/unclear.png b/cinelerra-5.1/plugins/theme_neophyte/unclear.png deleted file mode 100644 index c785fd8b..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/unclear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/unclear_dn.png b/cinelerra-5.1/plugins/theme_neophyte/unclear_dn.png deleted file mode 100644 index 482709c0..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/unclear_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/unclear_hi.png b/cinelerra-5.1/plugins/theme_neophyte/unclear_hi.png deleted file mode 100644 index 54eec7a2..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/unclear_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/unclear_up.png b/cinelerra-5.1/plugins/theme_neophyte/unclear_up.png deleted file mode 100644 index 312a2b26..00000000 Binary files a/cinelerra-5.1/plugins/theme_neophyte/unclear_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_all_linear.png b/cinelerra-5.1/plugins/theme_pinklady/mask_all_linear.png deleted file mode 100644 index 0f47ec5c..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_all_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_all_smooth.png b/cinelerra-5.1/plugins/theme_pinklady/mask_all_smooth.png deleted file mode 100644 index 83b80fc0..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_all_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_button_dn.png b/cinelerra-5.1/plugins/theme_pinklady/mask_button_dn.png deleted file mode 100644 index d9eef067..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_button_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_button_hi.png b/cinelerra-5.1/plugins/theme_pinklady/mask_button_hi.png deleted file mode 100644 index 0ff5bf47..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_button_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_button_up.png b/cinelerra-5.1/plugins/theme_pinklady/mask_button_up.png deleted file mode 100644 index a89301fb..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_button_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_crv_linear.png b/cinelerra-5.1/plugins/theme_pinklady/mask_crv_linear.png deleted file mode 100644 index c3ea87d8..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_crv_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_crv_smooth.png b/cinelerra-5.1/plugins/theme_pinklady/mask_crv_smooth.png deleted file mode 100644 index 5938a8c8..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_crv_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_pnt_linear.png b/cinelerra-5.1/plugins/theme_pinklady/mask_pnt_linear.png deleted file mode 100644 index e207cab9..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_pnt_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_pnt_smooth.png b/cinelerra-5.1/plugins/theme_pinklady/mask_pnt_smooth.png deleted file mode 100644 index 7e765435..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_pnt_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_crc.png b/cinelerra-5.1/plugins/theme_pinklady/mask_prst_crc.png deleted file mode 100644 index bde6e111..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_crc.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_load.png b/cinelerra-5.1/plugins/theme_pinklady/mask_prst_load.png deleted file mode 100644 index d2d2a738..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_load.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_ovl.png b/cinelerra-5.1/plugins/theme_pinklady/mask_prst_ovl.png deleted file mode 100644 index 0918e416..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_ovl.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_save.png b/cinelerra-5.1/plugins/theme_pinklady/mask_prst_save.png deleted file mode 100644 index cff9a58e..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_save.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_sqr.png b/cinelerra-5.1/plugins/theme_pinklady/mask_prst_sqr.png deleted file mode 100644 index bc81ab57..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_sqr.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_tri.png b/cinelerra-5.1/plugins/theme_pinklady/mask_prst_tri.png deleted file mode 100644 index 357a03d1..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_tri.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_trsh.png b/cinelerra-5.1/plugins/theme_pinklady/mask_prst_trsh.png deleted file mode 100644 index 114f529c..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_prst_trsh.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_pstn_cen.png b/cinelerra-5.1/plugins/theme_pinklady/mask_pstn_cen.png deleted file mode 100644 index da961aa8..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_pstn_cen.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_pstn_nrm.png b/cinelerra-5.1/plugins/theme_pinklady/mask_pstn_nrm.png deleted file mode 100644 index 0795095e..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_pstn_nrm.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_chkd.png b/cinelerra-5.1/plugins/theme_pinklady/mask_scale_chkd.png deleted file mode 100644 index f9fee16c..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_chkd.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_chkdhi.png b/cinelerra-5.1/plugins/theme_pinklady/mask_scale_chkdhi.png deleted file mode 100644 index dbda9c5a..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_chkdhi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_up.png b/cinelerra-5.1/plugins/theme_pinklady/mask_scale_up.png deleted file mode 100644 index a89301fb..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_uphi.png b/cinelerra-5.1/plugins/theme_pinklady/mask_scale_uphi.png deleted file mode 100644 index 0ff5bf47..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_uphi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_x.png b/cinelerra-5.1/plugins/theme_pinklady/mask_scale_x.png deleted file mode 100644 index e9c908a7..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_x.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_xdown.png b/cinelerra-5.1/plugins/theme_pinklady/mask_scale_xdown.png deleted file mode 100644 index 9a5a6b06..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_xdown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_xy.png b/cinelerra-5.1/plugins/theme_pinklady/mask_scale_xy.png deleted file mode 100644 index b9d72885..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_xy.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_xydown.png b/cinelerra-5.1/plugins/theme_pinklady/mask_scale_xydown.png deleted file mode 100644 index c7912c63..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_xydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_y.png b/cinelerra-5.1/plugins/theme_pinklady/mask_scale_y.png deleted file mode 100644 index 51fa90dd..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_y.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_ydown.png b/cinelerra-5.1/plugins/theme_pinklady/mask_scale_ydown.png deleted file mode 100644 index 2f7467dd..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/mask_scale_ydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C b/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C index d11aaa81..4e3d6b15 100644 --- a/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C +++ b/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C @@ -110,7 +110,7 @@ void PINKLADY::initialize() resources->popup_title_text = 0x1b0f11; resources->menu_item_text = 0x1b0f11; resources->menu_highlighted_fontcolor = WHITE; - resources->generic_button_margin = 30; + resources->generic_button_margin = xS(30); resources->pot_needle_color = resources->text_default; resources->pot_offset = 1; resources->progress_text = resources->text_default; @@ -121,13 +121,13 @@ void PINKLADY::initialize() resources->menu_down = 0x4b4b4b; resources->menu_up = 0x4b4b4b; resources->menu_shadow = 0x202020; - resources->popupmenu_margin = 15; - resources->popupmenu_triangle_margin = 15; + resources->popupmenu_margin = xS(15); + resources->popupmenu_triangle_margin = xS(15); resources->listbox_title_color = 0x1b0f11; - resources->listbox_title_margin = 20; - resources->listbox_title_hotspot = 20; + resources->listbox_title_margin = xS(20); + resources->listbox_title_hotspot = xS(20); resources->listbox_border1 = 0x1a1a1a; resources->listbox_border2 = 0xffb1d0; resources->listbox_border3 = 0xffb1d0; @@ -137,7 +137,7 @@ void PINKLADY::initialize() resources->listbox_bg = 0; resources->listbox_text = 0x1b0f11; - resources->filebox_margin = 130; + resources->filebox_margin = yS(130); resources->file_color = 0x1b0f11; resources->directory_color = 0xa0a0ff; @@ -380,7 +380,7 @@ void PINKLADY::initialize() resources->bar_data = new_image("bar", "bar.png"); resources->check = new_image("check", "check.png"); - resources->min_menu_w = 96; + resources->min_menu_w = xS(96); resources->menu_popup_bg = new_image("menu_popup_bg.png"); resources->menu_item_bg = new_image_set(3, "menuitem_up.png", @@ -512,7 +512,7 @@ void PINKLADY::initialize() "vscroll_right_up.png", "vscroll_right_hi.png", "vscroll_right_dn.png"); - resources->scroll_minhandle = 20; + resources->scroll_minhandle = xS(20); new_button("prevtip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip"); @@ -530,17 +530,17 @@ void PINKLADY::initialize() preferences_category_overlap = 0; preferencescategory_x = 0; - preferencescategory_y = 5; - preferencestitle_x = 5; - preferencestitle_y = 10; - preferencesoptions_x = 5; + preferencescategory_y = yS(5); + preferencestitle_x = xS(5); + preferencestitle_y = yS(10); + preferencesoptions_x = xS(5); preferencesoptions_y = 0; // MWindow message_normal = resources->text_default; audio_color = GREEN; - mtransport_margin = 10; - toggle_margin = 10; + mtransport_margin = xS(10); + toggle_margin = xS(10); new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png", "pane"); new_image_set("xpane", 3, "xpane_up.png", "xpane_hi.png", "xpane_dn.png"); @@ -591,23 +591,21 @@ void PINKLADY::initialize() setformat_w = get_image("setformat_bg")->get_w(); setformat_h = get_image("setformat_bg")->get_h(); - setformat_x1 = 15; - setformat_x2 = 110; - - setformat_x3 = 315; - setformat_x4 = 425; - setformat_y1 = 20; - setformat_y2 = 85; - setformat_y3 = 125; - setformat_margin = 30; - setformat_channels_x = 25; - setformat_channels_y = 242; - setformat_channels_w = 250; - setformat_channels_h = 250; - - loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + 10; - browse_pad = 20; - + setformat_x1 = xS(15); + setformat_x2 = xS(110); + setformat_x3 = xS(315); + setformat_x4 = xS(425); + setformat_y1 = yS(20); + setformat_y2 = yS(85); + setformat_y3 = yS(125); + setformat_margin = xS(30); + setformat_channels_x = xS(25); + setformat_channels_y = yS(242); + setformat_channels_w = xS(250); + setformat_channels_h = yS(250); + + loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + yS(10); + browse_pad = yS(20); new_toggle("playpatch.png", "playpatch_up.png", @@ -919,7 +917,7 @@ void PINKLADY::initialize() recordgui_variable_color = RED; channel_position_color = MEYELLOW; - resources->meter_title_w = 25; + resources->meter_title_w = xS(25); // (asset) edit info text color edit_font_color = YELLOW; @@ -958,18 +956,17 @@ void PINKLADY::build_overlays() void PINKLADY::draw_rwindow_bg(RecordGUI *gui) { // int y; -// int margin = 50; -// int margin2 = 80; -// gui->draw_9segment(recordgui_batch_x - margin, -// 0, +// int margin = xS(50); +// int margin2 = xS(80); +// gui->draw_9segment(recordgui_batch_x - margin, 0, // mwindow->session->rwindow_w - recordgui_status_x + margin, // recordgui_buttons_y, // rgui_batch); // gui->draw_3segmenth(recordgui_options_x - margin2, -// recordgui_buttons_y - 5, +// recordgui_buttons_y - yS(5), // mwindow->session->rwindow_w - recordgui_options_x + margin2, // rgui_controls); -// y = recordgui_buttons_y - 5 + rgui_controls->get_h(); +// y = recordgui_buttons_y - yS(5) + rgui_controls->get_h(); // gui->draw_9segment(0, // y, // mwindow->session->rwindow_w, @@ -979,27 +976,21 @@ void PINKLADY::draw_rwindow_bg(RecordGUI *gui) void PINKLADY::draw_rmonitor_bg(RecordMonitorGUI *gui) { -// int margin = 45; -// int panel_w = 300; +// int margin = xS(45); +// int panel_w = xS(300); // int x = rmonitor_meter_x - margin; // int w = mwindow->session->rmonitor_w - x; // if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w(); -// gui->clear_box(0, -// 0, +// gui->clear_box(0, 0, // mwindow->session->rmonitor_w, // mwindow->session->rmonitor_h); -// gui->draw_9segment(x, -// 0, +// gui->draw_9segment(x, 0, // w, // mwindow->session->rmonitor_h, // rmonitor_meters); } - - - - void PINKLADY::draw_mwindow_bg(MWindowGUI *gui) { // Button bar @@ -1010,32 +1001,28 @@ void PINKLADY::draw_mwindow_bg(MWindowGUI *gui) int x = mbuttons_x; x += 9 * get_image("play")->get_w(); x += mtransport_margin; // the control buttons - + int xs2 = xS(2); gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 2 * get_image("arrow")->get_w() + toggle_margin; // the mode buttons gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 3 * get_image("autokeyframe")->get_w() + toggle_margin; // the state toggle buttons gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); // Clock - gui->draw_3segmenth(0, - mbuttons_y - 1 + get_image("mbutton_bg")->get_h(), - get_image("patchbay_bg")->get_w(), - get_image("clock_bg")); + gui->draw_3segmenth(0, mbuttons_y - 1 + get_image("mbutton_bg")->get_h(), + get_image("patchbay_bg")->get_w(), get_image("clock_bg")); // Patchbay - gui->draw_3segmentv(patchbay_x, - patchbay_y, - patchbay_h, - get_image("patchbay_bg")); + gui->draw_3segmentv(patchbay_x, patchbay_y, + patchbay_h, get_image("patchbay_bg")); // Track canvas gui->set_color(BLACK); @@ -1045,17 +1032,13 @@ void PINKLADY::draw_mwindow_bg(MWindowGUI *gui) mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ) - mtimebar_h); // Timebar - gui->draw_3segmenth(mtimebar_x, - mtimebar_y, - mtimebar_w, - get_image("timebar_bg")); + gui->draw_3segmenth(mtimebar_x, mtimebar_y, + mtimebar_w, get_image("timebar_bg")); // Zoombar gui->set_color(0xffb1d0); - gui->draw_box(mzoom_x, - mzoom_y, - mwindow->session->mwindow_w, - 25); + gui->draw_box(mzoom_x, mzoom_y, + mwindow->session->mwindow_w, yS(25)); // Scrollbar filler // gui->draw_vframe(get_image("mscroll_filler"), @@ -1063,10 +1046,8 @@ void PINKLADY::draw_mwindow_bg(MWindowGUI *gui) // mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ)); // Status - gui->draw_3segmenth(mzoom_x, - mzoom_y, - mzoom_w, - get_image("statusbar")); + gui->draw_3segmenth(mzoom_x, mzoom_y, + mzoom_w, get_image("statusbar")); } @@ -1091,9 +1072,8 @@ void PINKLADY::draw_cwindow_bg(CWindowGUI *gui) } else { - gui->draw_3segmenth(cstatus_x, - ccomposite_h, - cmeter_x - widget_border - cstatus_x + 100, + gui->draw_3segmenth(cstatus_x, ccomposite_h, + cmeter_x - widget_border - cstatus_x + xS(100), get_image("cbuttons_right")); } } @@ -1106,29 +1086,24 @@ void PINKLADY::draw_vwindow_bg(VWindowGUI *gui) get_image("vbuttons_left")); if(mwindow->edl->session->vwindow_meter) { - gui->draw_3segmenth(vdivision_x, - vcanvas_h, + gui->draw_3segmenth(vdivision_x, vcanvas_h, vmeter_x - widget_border - vdivision_x, get_image("cbuttons_right")); - gui->draw_9segment(vmeter_x - widget_border, - 0, + gui->draw_9segment(vmeter_x - widget_border, 0, mwindow->session->vwindow_w - vmeter_x + widget_border, mwindow->session->vwindow_h, get_image("cmeter_bg")); } else { - gui->draw_3segmenth(vdivision_x, - vcanvas_h, - vmeter_x - widget_border - vdivision_x + 100, + gui->draw_3segmenth(vdivision_x, vcanvas_h, + vmeter_x - widget_border - vdivision_x + xS(100), get_image("cbuttons_right")); } // Clock border - gui->draw_3segmenth(vtime_x - 20, - vtime_y - 1, - vtime_w + 40, - get_image("vclock")); + gui->draw_3segmenth(vtime_x - xS(20), vtime_y - 1, + vtime_w + xS(40), get_image("vclock")); } void PINKLADY::draw_preferences_bg(PreferencesWindow *gui) diff --git a/cinelerra-5.1/plugins/theme_pinklady/unclear.png b/cinelerra-5.1/plugins/theme_pinklady/unclear.png deleted file mode 100644 index 1c21d1c7..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/unclear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/unclear_dn.png b/cinelerra-5.1/plugins/theme_pinklady/unclear_dn.png deleted file mode 100644 index d9eef067..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/unclear_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/unclear_hi.png b/cinelerra-5.1/plugins/theme_pinklady/unclear_hi.png deleted file mode 100644 index 0ff5bf47..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/unclear_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/unclear_up.png b/cinelerra-5.1/plugins/theme_pinklady/unclear_up.png deleted file mode 100644 index a89301fb..00000000 Binary files a/cinelerra-5.1/plugins/theme_pinklady/unclear_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_all_linear.png b/cinelerra-5.1/plugins/theme_suv/mask_all_linear.png deleted file mode 100644 index f6481eba..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_all_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_all_smooth.png b/cinelerra-5.1/plugins/theme_suv/mask_all_smooth.png deleted file mode 100644 index 369ddaaf..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_all_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_button_dn.png b/cinelerra-5.1/plugins/theme_suv/mask_button_dn.png deleted file mode 100644 index 3ce3ed80..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_button_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_button_hi.png b/cinelerra-5.1/plugins/theme_suv/mask_button_hi.png deleted file mode 100644 index 1ad1a999..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_button_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_button_up.png b/cinelerra-5.1/plugins/theme_suv/mask_button_up.png deleted file mode 100644 index d633ed4e..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_button_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_crv_linear.png b/cinelerra-5.1/plugins/theme_suv/mask_crv_linear.png deleted file mode 100644 index 98f9a833..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_crv_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_crv_smooth.png b/cinelerra-5.1/plugins/theme_suv/mask_crv_smooth.png deleted file mode 100644 index 1feb15c9..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_crv_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_pnt_linear.png b/cinelerra-5.1/plugins/theme_suv/mask_pnt_linear.png deleted file mode 100644 index 8dd77d34..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_pnt_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_pnt_smooth.png b/cinelerra-5.1/plugins/theme_suv/mask_pnt_smooth.png deleted file mode 100644 index fee20de6..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_pnt_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_prst_crc.png b/cinelerra-5.1/plugins/theme_suv/mask_prst_crc.png deleted file mode 100644 index 93f70938..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_prst_crc.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_prst_load.png b/cinelerra-5.1/plugins/theme_suv/mask_prst_load.png deleted file mode 100644 index 61b83323..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_prst_load.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_prst_ovl.png b/cinelerra-5.1/plugins/theme_suv/mask_prst_ovl.png deleted file mode 100644 index 04c715bb..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_prst_ovl.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_prst_save.png b/cinelerra-5.1/plugins/theme_suv/mask_prst_save.png deleted file mode 100644 index af16bf08..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_prst_save.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_prst_sqr.png b/cinelerra-5.1/plugins/theme_suv/mask_prst_sqr.png deleted file mode 100644 index 122d95f2..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_prst_sqr.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_prst_tri.png b/cinelerra-5.1/plugins/theme_suv/mask_prst_tri.png deleted file mode 100644 index 7308b9d5..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_prst_tri.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_prst_trsh.png b/cinelerra-5.1/plugins/theme_suv/mask_prst_trsh.png deleted file mode 100644 index 8737a2da..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_prst_trsh.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_pstn_cen.png b/cinelerra-5.1/plugins/theme_suv/mask_pstn_cen.png deleted file mode 100644 index f85de232..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_pstn_cen.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_pstn_nrm.png b/cinelerra-5.1/plugins/theme_suv/mask_pstn_nrm.png deleted file mode 100644 index 7429a5e1..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_pstn_nrm.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_scale_chkd.png b/cinelerra-5.1/plugins/theme_suv/mask_scale_chkd.png deleted file mode 100644 index 3ce3ed80..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_scale_chkd.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_scale_chkdhi.png b/cinelerra-5.1/plugins/theme_suv/mask_scale_chkdhi.png deleted file mode 100644 index eb64a6c3..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_scale_chkdhi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_scale_up.png b/cinelerra-5.1/plugins/theme_suv/mask_scale_up.png deleted file mode 100644 index d633ed4e..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_scale_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_scale_uphi.png b/cinelerra-5.1/plugins/theme_suv/mask_scale_uphi.png deleted file mode 100644 index 1ad1a999..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_scale_uphi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_scale_x.png b/cinelerra-5.1/plugins/theme_suv/mask_scale_x.png deleted file mode 100644 index 0bf4bee8..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_scale_x.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_scale_xdown.png b/cinelerra-5.1/plugins/theme_suv/mask_scale_xdown.png deleted file mode 100644 index 44dd6302..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_scale_xdown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_scale_xy.png b/cinelerra-5.1/plugins/theme_suv/mask_scale_xy.png deleted file mode 100644 index 0064fbfd..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_scale_xy.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_scale_xydown.png b/cinelerra-5.1/plugins/theme_suv/mask_scale_xydown.png deleted file mode 100644 index b9d1f281..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_scale_xydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_scale_y.png b/cinelerra-5.1/plugins/theme_suv/mask_scale_y.png deleted file mode 100644 index fc9e2216..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_scale_y.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/mask_scale_ydown.png b/cinelerra-5.1/plugins/theme_suv/mask_scale_ydown.png deleted file mode 100644 index c4f0e538..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/mask_scale_ydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/suv.C b/cinelerra-5.1/plugins/theme_suv/suv.C index c5a04f6b..251d2580 100644 --- a/cinelerra-5.1/plugins/theme_suv/suv.C +++ b/cinelerra-5.1/plugins/theme_suv/suv.C @@ -44,19 +44,11 @@ #include "vwindowgui.h" - - PluginClient* new_plugin(PluginServer *server) { return new SUVMain(server); } - - - - - - SUVMain::SUVMain(PluginServer *server) : PluginTClient(server) { @@ -75,13 +67,6 @@ Theme* SUVMain::new_theme() return theme; } - - - - - - - SUV::SUV() : Theme() { @@ -121,7 +106,7 @@ void SUV::initialize() resources->popup_title_text = 0xbfbfbf; resources->menu_item_text = 0xbfbfbf; resources->menu_highlighted_fontcolor = WHITE; - resources->generic_button_margin = 30; + resources->generic_button_margin = xS(30); resources->pot_needle_color = resources->text_default; resources->pot_offset = 1; resources->progress_text = resources->text_default; @@ -132,13 +117,13 @@ void SUV::initialize() resources->menu_down = 0x4b4b4b; resources->menu_up = 0x4b4b4b; resources->menu_shadow = 0x202020; - resources->popupmenu_margin = 15; - resources->popupmenu_triangle_margin = 20; + resources->popupmenu_margin = xS(15); + resources->popupmenu_triangle_margin = xS(20); resources->listbox_title_color = 0xbfbfbf; - resources->listbox_title_margin = 20; - resources->listbox_title_hotspot = 20; + resources->listbox_title_margin = xS(20); + resources->listbox_title_hotspot = xS(20); resources->listbox_border1 = 0x1a1a1a; resources->listbox_border2 = 0x373737; resources->listbox_border3 = 0x373737; @@ -148,7 +133,7 @@ void SUV::initialize() resources->listbox_bg = 0; resources->listbox_text = 0xbfbfbf; - resources->filebox_margin = 130; + resources->filebox_margin = yS(130); resources->file_color = 0xbfbfbf; resources->directory_color = 0xa0a0ff; @@ -391,7 +376,7 @@ void SUV::initialize() resources->bar_data = new_image("bar", "bar.png"); resources->check = new_image("check", "check.png"); - resources->min_menu_w = 96; + resources->min_menu_w = xS(96); resources->menu_popup_bg = new_image("menu_popup_bg.png"); resources->menu_item_bg = new_image_set(3, "menuitem_up.png", @@ -523,7 +508,7 @@ void SUV::initialize() "vscroll_right_up.png", "vscroll_right_hi.png", "vscroll_right_dn.png"); - resources->scroll_minhandle = 20; + resources->scroll_minhandle = xS(20); new_button("prevtip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip"); @@ -541,17 +526,17 @@ void SUV::initialize() preferences_category_overlap = 0; preferencescategory_x = 0; - preferencescategory_y = 5; - preferencestitle_x = 5; - preferencestitle_y = 10; - preferencesoptions_x = 5; + preferencescategory_y = yS(5); + preferencestitle_x = xS(5); + preferencestitle_y = yS(10); + preferencesoptions_x = xS(5); preferencesoptions_y = 0; // MWindow message_normal = resources->text_default; audio_color = GREEN; - mtransport_margin = 16; - toggle_margin = 16; + mtransport_margin = xS(16); + toggle_margin = xS(16); new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png", "pane"); new_image_set("xpane", 3, "xpane_up.png", "xpane_hi.png", "xpane_dn.png"); @@ -592,22 +577,22 @@ void SUV::initialize() setformat_w = get_image("setformat_bg")->get_w(); setformat_h = get_image("setformat_bg")->get_h(); - setformat_x1 = 15; - setformat_x2 = 100; + setformat_x1 = xS(15); + setformat_x2 = xS(100); - setformat_x3 = 315; - setformat_x4 = 415; - setformat_y1 = 20; - setformat_y2 = 85; - setformat_y3 = 125; - setformat_margin = 30; - setformat_channels_x = 25; - setformat_channels_y = 242; - setformat_channels_w = 250; - setformat_channels_h = 250; + setformat_x3 = xS(315); + setformat_x4 = xS(415); + setformat_y1 = yS(20); + setformat_y2 = yS(85); + setformat_y3 = yS(125); + setformat_margin = xS(30); + setformat_channels_x = xS(25); + setformat_channels_y = yS(242); + setformat_channels_w = xS(250); + setformat_channels_h = yS(250); - loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + 10; - browse_pad = 20; + loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + yS(10); + browse_pad = yS(20); new_toggle("playpatch.png", @@ -920,22 +905,13 @@ void SUV::initialize() recordgui_variable_color = RED; channel_position_color = MEYELLOW; - resources->meter_title_w = 25; + resources->meter_title_w = xS(25); // (asset) edit info text color edit_font_color = YELLOW; } -#define VWINDOW_METER_MARGIN 5 - - - - - - - - - +#define VWINDOW_METER_MARGIN xS(5) void SUV::build_bg_data() @@ -969,28 +945,21 @@ void SUV::build_overlays() } - - - - - - - void SUV::draw_rwindow_bg(RecordGUI *gui) { // int y; -// int margin = 50; -// int margin2 = 80; +// int margin = xS(50); +// int margin2 = xS(80); // gui->draw_9segment(recordgui_batch_x - margin, // 0, // mwindow->session->rwindow_w - recordgui_status_x + margin, // recordgui_buttons_y, // rgui_batch); // gui->draw_3segmenth(recordgui_options_x - margin2, -// recordgui_buttons_y - 5, +// recordgui_buttons_y - yS(5), // mwindow->session->rwindow_w - recordgui_options_x + margin2, // rgui_controls); -// y = recordgui_buttons_y - 5 + rgui_controls->get_h(); +// y = recordgui_buttons_y - yS(5) + rgui_controls->get_h(); // gui->draw_9segment(0, // y, // mwindow->session->rwindow_w, @@ -1000,27 +969,21 @@ void SUV::draw_rwindow_bg(RecordGUI *gui) void SUV::draw_rmonitor_bg(RecordMonitorGUI *gui) { -// int margin = 45; -// int panel_w = 300; +// int margin = xS(45); +// int panel_w = xS(300); // int x = rmonitor_meter_x - margin; // int w = mwindow->session->rmonitor_w - x; // if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w(); -// gui->clear_box(0, -// 0, +// gui->clear_box(0, 0, // mwindow->session->rmonitor_w, // mwindow->session->rmonitor_h); // gui->draw_9segment(x, -// 0, -// w, +// 0, w, // mwindow->session->rmonitor_h, // rmonitor_meters); } - - - - void SUV::draw_mwindow_bg(MWindowGUI *gui) { // Button bar @@ -1028,22 +991,23 @@ void SUV::draw_mwindow_bg(MWindowGUI *gui) gui->menu_w(), get_image("mbutton_bg")); int pdw = get_image("panel_divider")->get_w(); + int xs2 = xS(2); int x = mbuttons_x; x += 9 * get_image("play")->get_w(); x += mtransport_margin; // the control buttons gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 2 * get_image("arrow")->get_w() + toggle_margin; // the mode buttons gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 3 * get_image("autokeyframe")->get_w() + toggle_margin; // the state toggle buttons gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); // Clock @@ -1069,17 +1033,13 @@ void SUV::draw_mwindow_bg(MWindowGUI *gui) mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ) - mtimebar_h); // Timebar - gui->draw_3segmenth(mtimebar_x, - mtimebar_y, - mtimebar_w, - get_image("timebar_bg")); + gui->draw_3segmenth(mtimebar_x, mtimebar_y, + mtimebar_w, get_image("timebar_bg")); // Zoombar gui->set_color(0x373737); - gui->draw_box(mzoom_x, - mzoom_y, - mwindow->session->mwindow_w, - 25); + gui->draw_box(mzoom_x, mzoom_y, + mwindow->session->mwindow_w, yS(25)); // Scrollbar filler // gui->draw_vframe(get_image("mscroll_filler"), @@ -1087,12 +1047,8 @@ void SUV::draw_mwindow_bg(MWindowGUI *gui) // mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ)); // Status - gui->draw_3segmenth(mzoom_x, - mzoom_y, - mzoom_w, - get_image("statusbar")); - - + gui->draw_3segmenth(mzoom_x, mzoom_y, + mzoom_w, get_image("statusbar")); } void SUV::draw_cwindow_bg(CWindowGUI *gui) @@ -1117,7 +1073,7 @@ void SUV::draw_cwindow_bg(CWindowGUI *gui) { gui->draw_3segmenth(cstatus_x, ccomposite_h, - cmeter_x - widget_border - cstatus_x + 100, + cmeter_x - widget_border - cstatus_x + xS(100), get_image("cbuttons_right")); } } @@ -1144,14 +1100,14 @@ void SUV::draw_vwindow_bg(VWindowGUI *gui) { gui->draw_3segmenth(vdivision_x, vcanvas_h, - vmeter_x - widget_border - vdivision_x + 100, + vmeter_x - widget_border - vdivision_x + xS(100), get_image("cbuttons_right")); } // Clock border - gui->draw_3segmenth(vtime_x - 20, + gui->draw_3segmenth(vtime_x - xS(20), vtime_y - 1, - vtime_w + 40, + vtime_w + xS(40), get_image("vclock")); } diff --git a/cinelerra-5.1/plugins/theme_suv/unclear.png b/cinelerra-5.1/plugins/theme_suv/unclear.png deleted file mode 100644 index c785fd8b..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/unclear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/unclear_dn.png b/cinelerra-5.1/plugins/theme_suv/unclear_dn.png deleted file mode 100644 index 3ce3ed80..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/unclear_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/unclear_hi.png b/cinelerra-5.1/plugins/theme_suv/unclear_hi.png deleted file mode 100644 index 1ad1a999..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/unclear_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_suv/unclear_up.png b/cinelerra-5.1/plugins/theme_suv/unclear_up.png deleted file mode 100644 index d633ed4e..00000000 Binary files a/cinelerra-5.1/plugins/theme_suv/unclear_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_all_linear.png b/cinelerra-5.1/plugins/theme_unflat/mask_all_linear.png deleted file mode 100644 index fc26659d..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_all_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_all_smooth.png b/cinelerra-5.1/plugins/theme_unflat/mask_all_smooth.png deleted file mode 100644 index 045643c5..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_all_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_button_dn.png b/cinelerra-5.1/plugins/theme_unflat/mask_button_dn.png deleted file mode 100644 index 8bb6c13b..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_button_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_button_hi.png b/cinelerra-5.1/plugins/theme_unflat/mask_button_hi.png deleted file mode 100644 index 5f2cfe9c..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_button_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_button_up.png b/cinelerra-5.1/plugins/theme_unflat/mask_button_up.png deleted file mode 100644 index d64532fc..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_button_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_crv_linear.png b/cinelerra-5.1/plugins/theme_unflat/mask_crv_linear.png deleted file mode 100644 index b49d03a2..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_crv_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_crv_smooth.png b/cinelerra-5.1/plugins/theme_unflat/mask_crv_smooth.png deleted file mode 100644 index 7e1f41fd..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_crv_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_pnt_linear.png b/cinelerra-5.1/plugins/theme_unflat/mask_pnt_linear.png deleted file mode 100644 index 97d7c1f6..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_pnt_linear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_pnt_smooth.png b/cinelerra-5.1/plugins/theme_unflat/mask_pnt_smooth.png deleted file mode 100644 index 8e2e8c31..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_pnt_smooth.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_prst_crc.png b/cinelerra-5.1/plugins/theme_unflat/mask_prst_crc.png deleted file mode 100644 index 5b697f20..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_prst_crc.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_prst_load.png b/cinelerra-5.1/plugins/theme_unflat/mask_prst_load.png deleted file mode 100644 index 89c6fb5a..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_prst_load.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_prst_ovl.png b/cinelerra-5.1/plugins/theme_unflat/mask_prst_ovl.png deleted file mode 100644 index 73027f40..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_prst_ovl.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_prst_save.png b/cinelerra-5.1/plugins/theme_unflat/mask_prst_save.png deleted file mode 100644 index 77c1e803..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_prst_save.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_prst_sqr.png b/cinelerra-5.1/plugins/theme_unflat/mask_prst_sqr.png deleted file mode 100644 index 508a1e68..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_prst_sqr.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_prst_tri.png b/cinelerra-5.1/plugins/theme_unflat/mask_prst_tri.png deleted file mode 100644 index 17cc41a4..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_prst_tri.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_prst_trsh.png b/cinelerra-5.1/plugins/theme_unflat/mask_prst_trsh.png deleted file mode 100644 index 4ded9fec..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_prst_trsh.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_pstn_cen.png b/cinelerra-5.1/plugins/theme_unflat/mask_pstn_cen.png deleted file mode 100644 index 90a67db1..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_pstn_cen.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_pstn_nrm.png b/cinelerra-5.1/plugins/theme_unflat/mask_pstn_nrm.png deleted file mode 100644 index 9b4a3f67..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_pstn_nrm.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_scale_chkd.png b/cinelerra-5.1/plugins/theme_unflat/mask_scale_chkd.png deleted file mode 100644 index 924703e7..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_scale_chkd.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_scale_chkdhi.png b/cinelerra-5.1/plugins/theme_unflat/mask_scale_chkdhi.png deleted file mode 100644 index d3ff4341..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_scale_chkdhi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_scale_up.png b/cinelerra-5.1/plugins/theme_unflat/mask_scale_up.png deleted file mode 100644 index d64532fc..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_scale_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_scale_uphi.png b/cinelerra-5.1/plugins/theme_unflat/mask_scale_uphi.png deleted file mode 100644 index 5f2cfe9c..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_scale_uphi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_scale_x.png b/cinelerra-5.1/plugins/theme_unflat/mask_scale_x.png deleted file mode 100644 index a382b740..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_scale_x.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_scale_xdown.png b/cinelerra-5.1/plugins/theme_unflat/mask_scale_xdown.png deleted file mode 100644 index 2e78990c..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_scale_xdown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_scale_xy.png b/cinelerra-5.1/plugins/theme_unflat/mask_scale_xy.png deleted file mode 100644 index 3eb5b522..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_scale_xy.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_scale_xydown.png b/cinelerra-5.1/plugins/theme_unflat/mask_scale_xydown.png deleted file mode 100644 index 4d5fe054..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_scale_xydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_scale_y.png b/cinelerra-5.1/plugins/theme_unflat/mask_scale_y.png deleted file mode 100644 index cf4055de..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_scale_y.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/mask_scale_ydown.png b/cinelerra-5.1/plugins/theme_unflat/mask_scale_ydown.png deleted file mode 100644 index 58124295..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/mask_scale_ydown.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/unclear.png b/cinelerra-5.1/plugins/theme_unflat/unclear.png deleted file mode 100644 index aa7c7567..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/unclear.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/unclear_dn.png b/cinelerra-5.1/plugins/theme_unflat/unclear_dn.png deleted file mode 100644 index 8bb6c13b..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/unclear_dn.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/unclear_hi.png b/cinelerra-5.1/plugins/theme_unflat/unclear_hi.png deleted file mode 100644 index 5f2cfe9c..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/unclear_hi.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/unclear_up.png b/cinelerra-5.1/plugins/theme_unflat/unclear_up.png deleted file mode 100644 index d64532fc..00000000 Binary files a/cinelerra-5.1/plugins/theme_unflat/unclear_up.png and /dev/null differ diff --git a/cinelerra-5.1/plugins/theme_unflat/unflattheme.C b/cinelerra-5.1/plugins/theme_unflat/unflattheme.C index 7c381fb3..8f10237b 100644 --- a/cinelerra-5.1/plugins/theme_unflat/unflattheme.C +++ b/cinelerra-5.1/plugins/theme_unflat/unflattheme.C @@ -47,8 +47,6 @@ #include "vwindowgui.h" - - PluginClient* new_plugin(PluginServer *server) { return new UNFLATTHEMEMain(server); @@ -74,12 +72,6 @@ Theme* UNFLATTHEMEMain::new_theme() } - - - - - - UNFLATTHEME::UNFLATTHEME() : Theme() { @@ -119,7 +111,7 @@ void UNFLATTHEME::initialize() resources->popup_title_text = 0xbfbfbf; resources->menu_item_text = 0xbfbfbf; resources->menu_highlighted_fontcolor = WHITE; - resources->generic_button_margin = 30; + resources->generic_button_margin = xS(30); resources->pot_needle_color = resources->text_default; resources->pot_offset = 1; resources->progress_text = resources->text_default; @@ -130,13 +122,13 @@ void UNFLATTHEME::initialize() resources->menu_down = 0x4b4b4b; resources->menu_up = 0x4b4b4b; resources->menu_shadow = 0x202020; - resources->popupmenu_margin = 15; - resources->popupmenu_triangle_margin = 15; + resources->popupmenu_margin = xS(15); + resources->popupmenu_triangle_margin = xS(15); resources->listbox_title_color = 0xbfbfbf; - resources->listbox_title_margin = 20; - resources->listbox_title_hotspot = 20; + resources->listbox_title_margin = xS(20); + resources->listbox_title_hotspot = xS(20); resources->listbox_border1 = 0x1a1a1a; resources->listbox_border2 = 0x333333; resources->listbox_border3 = 0x333333; @@ -146,7 +138,7 @@ void UNFLATTHEME::initialize() resources->listbox_bg = 0; resources->listbox_text = 0xbfbfbf; - resources->filebox_margin = 130; + resources->filebox_margin = yS(130); resources->file_color = 0xbfbfbf; resources->directory_color = 0xa0a0ff; @@ -389,7 +381,7 @@ void UNFLATTHEME::initialize() resources->bar_data = new_image("bar", "bar.png"); resources->check = new_image("check", "check.png"); - resources->min_menu_w = 96; + resources->min_menu_w = xS(96); resources->menu_popup_bg = new_image("menu_popup_bg.png"); resources->menu_item_bg = new_image_set(3, "menuitem_up.png", @@ -521,7 +513,7 @@ void UNFLATTHEME::initialize() "vscroll_right_up.png", "vscroll_right_hi.png", "vscroll_right_dn.png"); - resources->scroll_minhandle = 20; + resources->scroll_minhandle = xS(20); new_button("prevtip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip"); @@ -539,17 +531,17 @@ void UNFLATTHEME::initialize() preferences_category_overlap = 0; preferencescategory_x = 0; - preferencescategory_y = 5; - preferencestitle_x = 5; - preferencestitle_y = 10; - preferencesoptions_x = 5; + preferencescategory_y = yS(5); + preferencestitle_x = xS(5); + preferencestitle_y = yS(10); + preferencesoptions_x = xS(5); preferencesoptions_y = 0; // MWindow message_normal = resources->text_default; audio_color = GREEN; - mtransport_margin = 10; - toggle_margin = 10; + mtransport_margin = xS(10); + toggle_margin = xS(10); new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png", "pane"); new_image_set("xpane", 3, "xpane_up.png", "xpane_hi.png", "xpane_dn.png"); @@ -600,23 +592,21 @@ void UNFLATTHEME::initialize() setformat_w = get_image("setformat_bg")->get_w(); setformat_h = get_image("setformat_bg")->get_h(); - setformat_x1 = 15; - setformat_x2 = 110; - - setformat_x3 = 315; - setformat_x4 = 425; - setformat_y1 = 20; - setformat_y2 = 85; - setformat_y3 = 125; - setformat_margin = 30; - setformat_channels_x = 25; - setformat_channels_y = 242; - setformat_channels_w = 250; - setformat_channels_h = 250; - - loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + 10; - browse_pad = 20; - + setformat_x1 = xS(15); + setformat_x2 = xS(110); + setformat_x3 = xS(315); + setformat_x4 = xS(425); + setformat_y1 = yS(20); + setformat_y2 = yS(85); + setformat_y3 = yS(125); + setformat_margin = xS(30); + setformat_channels_x = xS(25); + setformat_channels_y = yS(242); + setformat_channels_w = xS(250); + setformat_channels_h = yS(250); + + loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + yS(10); + browse_pad = yS(20); new_toggle("playpatch.png", "playpatch_up.png", @@ -845,8 +835,6 @@ void UNFLATTHEME::initialize() new_button("stop.png", transport_up, transport_hi, transport_dn, "stop"); new_button("stop.png", transport_up, transport_hi, transport_dn, "stoprec"); - - // CWindow icons new_image("cwindow_inactive", "cwindow_inactive.png"); new_image("cwindow_active", "cwindow_active.png"); @@ -865,10 +853,6 @@ void UNFLATTHEME::initialize() "preferencesbutton_uphi.png", "preferencesbutton_dnlo.png"); - - - - new_image_set("color3way_point", 3, "color3way_up.png", @@ -928,7 +912,7 @@ void UNFLATTHEME::initialize() recordgui_variable_color = RED; channel_position_color = MEYELLOW; - resources->meter_title_w = 25; + resources->meter_title_w = xS(25); // (asset) edit info text color edit_font_color = YELLOW; @@ -967,18 +951,17 @@ void UNFLATTHEME::build_overlays() void UNFLATTHEME::draw_rwindow_bg(RecordGUI *gui) { // int y; -// int margin = 50; -// int margin2 = 80; -// gui->draw_9segment(recordgui_batch_x - margin, -// 0, +// int margin = xS(50); +// int margin2 = xS(80); +// gui->draw_9segment(recordgui_batch_x - margin, 0, // mwindow->session->rwindow_w - recordgui_status_x + margin, // recordgui_buttons_y, // rgui_batch); // gui->draw_3segmenth(recordgui_options_x - margin2, -// recordgui_buttons_y - 5, +// recordgui_buttons_y - yS(5), // mwindow->session->rwindow_w - recordgui_options_x + margin2, // rgui_controls); -// y = recordgui_buttons_y - 5 + rgui_controls->get_h(); +// y = recordgui_buttons_y - yS(5) + rgui_controls->get_h(); // gui->draw_9segment(0, // y, // mwindow->session->rwindow_w, @@ -988,27 +971,21 @@ void UNFLATTHEME::draw_rwindow_bg(RecordGUI *gui) void UNFLATTHEME::draw_rmonitor_bg(RecordMonitorGUI *gui) { -// int margin = 45; -// int panel_w = 300; +// int margin = xS(45); +// int panel_w = xS(300); // int x = rmonitor_meter_x - margin; // int w = mwindow->session->rmonitor_w - x; // if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w(); -// gui->clear_box(0, -// 0, +// gui->clear_box(0, 0, // mwindow->session->rmonitor_w, // mwindow->session->rmonitor_h); -// gui->draw_9segment(x, -// 0, +// gui->draw_9segment(x, 0, // w, // mwindow->session->rmonitor_h, // rmonitor_meters); } - - - - void UNFLATTHEME::draw_mwindow_bg(MWindowGUI *gui) { // Button bar @@ -1020,31 +997,28 @@ void UNFLATTHEME::draw_mwindow_bg(MWindowGUI *gui) x += 9 * get_image("play")->get_w(); x += mtransport_margin; // the control buttons + int xs2 = xS(2); gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 2 * get_image("arrow")->get_w() + toggle_margin; // the mode buttons gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); x += 3 * get_image("autokeyframe")->get_w() + toggle_margin; // the state toggle buttons gui->draw_vframe(get_image("panel_divider"), - x - toggle_margin / 2 - pdw / 2 + 2, + x - toggle_margin / 2 - pdw / 2 + xs2, mbuttons_y - 1); // Clock - gui->draw_3segmenth(0, - mbuttons_y - 1 + get_image("mbutton_bg")->get_h(), - get_image("patchbay_bg")->get_w(), - get_image("clock_bg")); + gui->draw_3segmenth(0, mbuttons_y - 1 + get_image("mbutton_bg")->get_h(), + get_image("patchbay_bg")->get_w(), get_image("clock_bg")); // Patchbay - gui->draw_3segmentv(patchbay_x, - patchbay_y, - patchbay_h, - get_image("patchbay_bg")); + gui->draw_3segmentv(patchbay_x, patchbay_y, + patchbay_h, get_image("patchbay_bg")); // Track canvas gui->set_color(BLACK); @@ -1054,17 +1028,13 @@ void UNFLATTHEME::draw_mwindow_bg(MWindowGUI *gui) mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ) - mtimebar_h); // Timebar - gui->draw_3segmenth(mtimebar_x, - mtimebar_y, - mtimebar_w, - get_image("timebar_bg")); + gui->draw_3segmenth(mtimebar_x, mtimebar_y, + mtimebar_w, get_image("timebar_bg")); // Zoombar gui->set_color(0x333333); - gui->draw_box(mzoom_x, - mzoom_y, - mwindow->session->mwindow_w, - 25); + gui->draw_box(mzoom_x, mzoom_y, + mwindow->session->mwindow_w, yS(25)); // Scrollbar filler // gui->draw_vframe(get_image("mscroll_filler"), @@ -1072,10 +1042,8 @@ void UNFLATTHEME::draw_mwindow_bg(MWindowGUI *gui) // mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ)); // Status - gui->draw_3segmenth(mzoom_x, - mzoom_y, - mzoom_w, - get_image("statusbar")); + gui->draw_3segmenth(mzoom_x, mzoom_y, + mzoom_w, get_image("statusbar")); } @@ -1088,21 +1056,16 @@ void UNFLATTHEME::draw_cwindow_bg(CWindowGUI *gui) if(mwindow->edl->session->cwindow_meter) { - gui->draw_3segmenth(cstatus_x, - ccomposite_h, - cmeter_x - widget_border - cstatus_x, - get_image("cbuttons_right")); - gui->draw_9segment(cmeter_x - widget_border, - 0, + gui->draw_3segmenth(cstatus_x, ccomposite_h, + cmeter_x - widget_border - cstatus_x, get_image("cbuttons_right")); + gui->draw_9segment(cmeter_x - widget_border, 0, mwindow->session->cwindow_w - cmeter_x + widget_border, - mwindow->session->cwindow_h, - get_image("cmeter_bg")); + mwindow->session->cwindow_h, get_image("cmeter_bg")); } else { - gui->draw_3segmenth(cstatus_x, - ccomposite_h, - cmeter_x - widget_border - cstatus_x + 100, + gui->draw_3segmenth(cstatus_x, ccomposite_h, + cmeter_x - widget_border - cstatus_x + xS(100), get_image("cbuttons_right")); } } @@ -1115,29 +1078,22 @@ void UNFLATTHEME::draw_vwindow_bg(VWindowGUI *gui) get_image("vbuttons_left")); if(mwindow->edl->session->vwindow_meter) { - gui->draw_3segmenth(vdivision_x, - vcanvas_h, - vmeter_x - widget_border - vdivision_x, - get_image("cbuttons_right")); - gui->draw_9segment(vmeter_x - widget_border, - 0, + gui->draw_3segmenth(vdivision_x, vcanvas_h, + vmeter_x - widget_border - vdivision_x, get_image("cbuttons_right")); + gui->draw_9segment(vmeter_x - widget_border, 0, mwindow->session->vwindow_w - vmeter_x + widget_border, - mwindow->session->vwindow_h, - get_image("cmeter_bg")); + mwindow->session->vwindow_h, get_image("cmeter_bg")); } else { - gui->draw_3segmenth(vdivision_x, - vcanvas_h, - vmeter_x - widget_border - vdivision_x + 100, + gui->draw_3segmenth(vdivision_x, vcanvas_h, + vmeter_x - widget_border - vdivision_x + xS(100), get_image("cbuttons_right")); } // Clock border - gui->draw_3segmenth(vtime_x - 20, - vtime_y - 1, - vtime_w + 40, - get_image("vclock")); + gui->draw_3segmenth(vtime_x - xS(20), vtime_y - 1, + vtime_w + xS(40), get_image("vclock")); } diff --git a/cinelerra-5.1/plugins/threshold/thresholdwindow.C b/cinelerra-5.1/plugins/threshold/thresholdwindow.C index 7a22ba33..9612ab13 100644 --- a/cinelerra-5.1/plugins/threshold/thresholdwindow.C +++ b/cinelerra-5.1/plugins/threshold/thresholdwindow.C @@ -25,8 +25,8 @@ #include "threshold.h" #include "thresholdwindow.h" -#define COLOR_W 100 -#define COLOR_H 30 +#define COLOR_W xS(100) +#define COLOR_H yS(30) @@ -428,7 +428,7 @@ int ThresholdHighColorThread::handle_new_color(int output, int alpha) ThresholdWindow::ThresholdWindow(ThresholdMain *plugin) -: PluginClientWindow(plugin, 450, 450, 450, 450, 1) +: PluginClientWindow(plugin, xS(450), yS(450), xS(450), yS(450), 1) { this->plugin = plugin; this->min = 0; @@ -449,46 +449,48 @@ ThresholdWindow::~ThresholdWindow() void ThresholdWindow::create_objects() { - int x = 10; - int y = 10; + int xs10 = xS(10), xs30 = xS(30), xs100 = xS(100); + int ys10 = yS(10), ys160 = yS(160); + int x = xs10; + int y = ys10; add_subwindow(canvas = new ThresholdCanvas(plugin, this, x, y, - get_w() - x - 10, - get_h() - 160)); + get_w() - x - xs10, + get_h() - ys160)); canvas->draw(); - y += canvas->get_h() + 10; + y += canvas->get_h() + ys10; add_subwindow(plot = new ThresholdPlot(plugin, x, y)); - y += plot->get_h() + 10; + y += plot->get_h() + ys10; add_subwindow(low_color = new ThresholdLowColorButton(plugin, this, x, y)); - low_color_x = x + 10; - low_color_y = y + low_color->get_h() + 10; - x += low_color->get_w() + 10; + low_color_x = x + xs10; + low_color_y = y + low_color->get_h() + ys10; + x += low_color->get_w() + xs10; add_subwindow(mid_color = new ThresholdMidColorButton(plugin, this, x, y)); - mid_color_x = x + 10; - mid_color_y = y + mid_color->get_h() + 10; - x += mid_color->get_w() + 10; + mid_color_x = x + xs10; + mid_color_y = y + mid_color->get_h() + ys10; + x += mid_color->get_w() + xs10; add_subwindow(high_color = new ThresholdHighColorButton(plugin, this, x, y)); - high_color_x = x + 10; - high_color_y = y + high_color->get_h() + 10; + high_color_x = x + xs10; + high_color_y = y + high_color->get_h() + ys10; - y += low_color->get_h() + COLOR_H + 10 + 10; + y += low_color->get_h() + COLOR_H + ys10 + ys10; - x = 30; + x = xs30; BC_Title * min_title; add_subwindow(min_title = new BC_Title(x, y, _("Min:"))); - x += min_title->get_w() + 10; + x += min_title->get_w() + xs10; min = new ThresholdMin(plugin, this, x, y, - 100); + xs100); min->create_objects(); min->set_increment(0.1); @@ -496,12 +498,12 @@ void ThresholdWindow::create_objects() x = mid_color->get_x() + mid_color->get_w() / 2; BC_Title * max_title; add_subwindow(max_title = new BC_Title(x, y, _("Max:"))); - x += max_title->get_w() + 10; + x += max_title->get_w() + xs10; max = new ThresholdMax(plugin, this, x, y, - 100); + xs100); max->create_objects(); max->set_increment(0.1); diff --git a/cinelerra-5.1/plugins/timeavg/timeavgwindow.C b/cinelerra-5.1/plugins/timeavg/timeavgwindow.C index 90ac8e38..cac4e5d1 100644 --- a/cinelerra-5.1/plugins/timeavg/timeavgwindow.C +++ b/cinelerra-5.1/plugins/timeavg/timeavgwindow.C @@ -29,7 +29,7 @@ TimeAvgWindow::TimeAvgWindow(TimeAvgMain *client) - : PluginClientWindow(client, 250, 400, 250, 400, 0) + : PluginClientWindow(client, xS(250), yS(400), xS(250), yS(400), 0) { this->client = client; } @@ -40,53 +40,55 @@ TimeAvgWindow::~TimeAvgWindow() void TimeAvgWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10), ys30 = yS(30); + int x = xs10, y = ys10; BC_Bar *bar; BC_Title *title; add_tool(title = new BC_Title(x, y, _("Frame count:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; add_tool(total_frames = new TimeAvgSlider(client, x, y)); - y += 30; + y += ys30; add_tool(paranoid = new TimeAvgParanoid(client, x, y)); - y += 30; + y += ys30; add_tool(no_subtract = new TimeAvgNoSubtract(client, x, y)); - y += 30; - add_tool(bar = new BC_Bar(x, y, get_w() - x * 2)); - y += bar->get_h() + 5; + y += ys30; + add_tool(bar = new BC_Bar(x, y, get_w() - x * xS(2))); + y += bar->get_h() + ys5; add_tool(avg = new TimeAvgAvg(client, this, x, y)); - y += 30; + y += ys30; add_tool(accum = new TimeAvgAccum(client, this, x, y)); - y += 30; - add_tool(bar = new BC_Bar(x, y, get_w() - x * 2)); - y += bar->get_h() + 5; + y += ys30; + add_tool(bar = new BC_Bar(x, y, get_w() - x * xS(2))); + y += bar->get_h() + ys5; add_tool(replace = new TimeAvgReplace(client, this, x, y)); - y += 30; + y += ys30; add_tool(new BC_Title(x, y, _("Threshold:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; add_tool(threshold = new TimeThresholdSlider(client, x, y)); - y += 30; + y += ys30; add_tool(new BC_Title(x, y, _("Border:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; add_tool(border = new TimeBorderSlider(client, x, y)); - y += 30; + y += ys30; - add_tool(bar = new BC_Bar(x, y, get_w() - x * 2)); - y += bar->get_h() + 5; + add_tool(bar = new BC_Bar(x, y, get_w() - x * xS(2))); + y += bar->get_h() + ys5; add_tool(greater = new TimeAvgGreater(client, this, x, y)); - y += 30; + y += ys30; add_tool(less = new TimeAvgLess(client, this, x, y)); - y += 30; + y += ys30; update_toggles(); show_window(); @@ -125,13 +127,7 @@ void TimeAvgWindow::update_toggles() TimeAvgSlider::TimeAvgSlider(TimeAvgMain *client, int x, int y) - : BC_ISlider(x, - y, - 0, - 190, - 200, - 1, - MAX_FRAMES, + : BC_ISlider(x, y, 0, xS(190),yS(200), 1,MAX_FRAMES, client->config.frames) { this->client = client; @@ -151,13 +147,7 @@ int TimeAvgSlider::handle_event() TimeThresholdSlider::TimeThresholdSlider(TimeAvgMain *client, int x, int y) - : BC_ISlider(x, - y, - 0, - 190, - 200, - 1, - 255, + : BC_ISlider(x, y, 0, xS(190),yS(200), 1,255, client->config.threshold) { this->client = client; @@ -176,13 +166,7 @@ int TimeThresholdSlider::handle_event() TimeBorderSlider::TimeBorderSlider(TimeAvgMain *client, int x, int y) - : BC_ISlider(x, - y, - 0, - 190, - 200, - 0, - 8, + : BC_ISlider(x, y, 0, xS(190),yS(200), 0,8, client->config.border) { this->client = client; diff --git a/cinelerra-5.1/plugins/timefront/timefront.C b/cinelerra-5.1/plugins/timefront/timefront.C index 47a70059..eb2d83d5 100644 --- a/cinelerra-5.1/plugins/timefront/timefront.C +++ b/cinelerra-5.1/plugins/timefront/timefront.C @@ -120,10 +120,10 @@ void TimeFrontConfig::interpolate(TimeFrontConfig &prev, TimeFrontWindow::TimeFrontWindow(TimeFrontMain *plugin) : PluginClientWindow(plugin, - 350, - 290, - 350, - 290, + xS(350), + yS(290), + xS(350), + yS(290), 0) { this->plugin = plugin; @@ -150,28 +150,30 @@ TimeFrontWindow::~TimeFrontWindow() void TimeFrontWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys10 = yS(10), ys35 = yS(35), ys40 = yS(40), ys140 = yS(140); + int x = xs10, y = ys10; BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Type:"))); add_subwindow(shape = new TimeFrontShape(plugin, this, - x + title->get_w() + 10, + x + title->get_w() + xs10, y)); shape->create_objects(); - y += 40; + y += ys40; shape_x = x; shape_y = y; - y += 140; + y += ys140; add_subwindow(title = new BC_Title(x, y, _("Time range:"))); - add_subwindow(frame_range = new TimeFrontFrameRange(plugin, x + title->get_w() + 10, y)); - frame_range_x = x + frame_range->get_w() + 10; + add_subwindow(frame_range = new TimeFrontFrameRange(plugin, x + title->get_w() + xs10, y)); + frame_range_x = x + frame_range->get_w() + xs10; frame_range_y = y; - y += 35; + y += ys35; update_shape(); add_subwindow(invert = new TimeFrontInvert(plugin, x, y)); - add_subwindow(show_grayscale = new TimeFrontShowGrayscale(plugin, x+ 100, y)); + add_subwindow(show_grayscale = new TimeFrontShowGrayscale(plugin, x+ xS(100), y)); show_window(); @@ -199,23 +201,23 @@ void TimeFrontWindow::update_shape() if(!angle) { add_subwindow(angle_title = new BC_Title(x, y, _("Angle:"))); - add_subwindow(angle = new TimeFrontAngle(plugin, x + angle_title->get_w() + 10, y)); + add_subwindow(angle = new TimeFrontAngle(plugin, x + angle_title->get_w() + xS(10), y)); } if(!rate){ - y = shape_y + 40; + y = shape_y + yS(40); add_subwindow(rate_title = new BC_Title(x, y, _("Rate:"))); add_subwindow(rate = new TimeFrontRate(plugin, - x + rate_title->get_w() + 10, + x + rate_title->get_w() + xS(10), y)); rate->create_objects(); - y += 40; + y += yS(40); add_subwindow(in_radius_title = new BC_Title(x, y, _("Inner radius:"))); - add_subwindow(in_radius = new TimeFrontInRadius(plugin, x + in_radius_title->get_w() + 10, y)); - y += 30; + add_subwindow(in_radius = new TimeFrontInRadius(plugin, x + in_radius_title->get_w() + xS(10), y)); + y += yS(30); add_subwindow(out_radius_title = new BC_Title(x, y, _("Outer radius:"))); - add_subwindow(out_radius = new TimeFrontOutRadius(plugin, x + out_radius_title->get_w() + 10, y)); - y += 35; + add_subwindow(out_radius = new TimeFrontOutRadius(plugin, x + out_radius_title->get_w() + xS(10), y)); + y += yS(35); } } else @@ -233,32 +235,32 @@ void TimeFrontWindow::update_shape() { add_subwindow(center_x_title = new BC_Title(x, y, _("Center X:"))); add_subwindow(center_x = new TimeFrontCenterX(plugin, - x + center_x_title->get_w() + 10, + x + center_x_title->get_w() + xS(10), y)); - x += center_x_title->get_w() + 10 + center_x->get_w() + 10; + x += center_x_title->get_w() + xS(10) + center_x->get_w() + xS(10); add_subwindow(center_y_title = new BC_Title(x, y, _("Center Y:"))); add_subwindow(center_y = new TimeFrontCenterY(plugin, - x + center_y_title->get_w() + 10, + x + center_y_title->get_w() + xS(10), y)); } if(!rate) { - y = shape_y + 40; + y = shape_y + yS(40); x = shape_x; add_subwindow(rate_title = new BC_Title(x, y, _("Rate:"))); add_subwindow(rate = new TimeFrontRate(plugin, - x + rate_title->get_w() + 10, + x + rate_title->get_w() + xS(10), y)); rate->create_objects(); - y += 40; + y += yS(40); add_subwindow(in_radius_title = new BC_Title(x, y, _("Inner radius:"))); - add_subwindow(in_radius = new TimeFrontInRadius(plugin, x + in_radius_title->get_w() + 10, y)); - y += 30; + add_subwindow(in_radius = new TimeFrontInRadius(plugin, x + in_radius_title->get_w() + xS(10), y)); + y += yS(30); add_subwindow(out_radius_title = new BC_Title(x, y, _("Outer radius:"))); - add_subwindow(out_radius = new TimeFrontOutRadius(plugin, x + out_radius_title->get_w() + 10, y)); - y += 35; + add_subwindow(out_radius = new TimeFrontOutRadius(plugin, x + out_radius_title->get_w() + xS(10), y)); + y += yS(35); } } else if(plugin->config.shape == TimeFrontConfig::OTHERTRACK) @@ -292,7 +294,7 @@ void TimeFrontWindow::update_shape() add_subwindow(track_usage_title = new BC_Title(x, y, _("As timefront use:"))); add_subwindow(track_usage = new TimeFrontTrackUsage(plugin, this, - x + track_usage_title->get_w() + 10, + x + track_usage_title->get_w() + xS(10), y)); track_usage->create_objects(); @@ -349,7 +351,7 @@ TimeFrontShape::TimeFrontShape(TimeFrontMain *plugin, TimeFrontWindow *gui, int x, int y) - : BC_PopupMenu(x, y, 230, to_text(plugin->config.shape), 1) + : BC_PopupMenu(x, y, xS(230), to_text(plugin->config.shape), 1) { this->plugin = plugin; this->gui = gui; @@ -397,7 +399,7 @@ int TimeFrontShape::handle_event() TimeFrontTrackUsage::TimeFrontTrackUsage(TimeFrontMain *plugin, TimeFrontWindow *gui, int x, int y) - : BC_PopupMenu(x, y, 140, to_text(plugin->config.track_usage), 1) + : BC_PopupMenu(x, y, xS(140), to_text(plugin->config.track_usage), 1) { this->plugin = plugin; this->gui = gui; @@ -489,11 +491,7 @@ int TimeFrontAngle::handle_event() TimeFrontRate::TimeFrontRate(TimeFrontMain *plugin, int x, int y) - : BC_PopupMenu(x, - y, - 155, - to_text(plugin->config.rate), - 1) + : BC_PopupMenu(x, y, xS(155), to_text(plugin->config.rate), 1) { this->plugin = plugin; } @@ -536,8 +534,8 @@ TimeFrontInRadius::TimeFrontInRadius(TimeFrontMain *plugin, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (float)0, (float)100, (float)plugin->config.in_radius) @@ -557,8 +555,8 @@ TimeFrontOutRadius::TimeFrontOutRadius(TimeFrontMain *plugin, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (float)0, (float)100, (float)plugin->config.out_radius) @@ -577,8 +575,8 @@ TimeFrontFrameRange::TimeFrontFrameRange(TimeFrontMain *plugin, int x, int y) : BC_ISlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (int)1, (int)255, (int)plugin->config.frame_range) diff --git a/cinelerra-5.1/plugins/timestretch/timestretch.C b/cinelerra-5.1/plugins/timestretch/timestretch.C index 780c452a..0653a9e2 100644 --- a/cinelerra-5.1/plugins/timestretch/timestretch.C +++ b/cinelerra-5.1/plugins/timestretch/timestretch.C @@ -49,7 +49,7 @@ REGISTER_PLUGIN(TimeStretch) TimeStretchFraction::TimeStretchFraction(TimeStretch *plugin, int x, int y) - : BC_TextBox(x, y, 100, 1, (float)(1.0 / plugin->scale)) + : BC_TextBox(x, y, xS(100), 1, (float)(1.0 / plugin->scale)) { this->plugin = plugin; } @@ -118,12 +118,12 @@ int TimeStretchTime::handle_event() TimeStretchWindow::TimeStretchWindow(TimeStretch *plugin, int x, int y) : BC_Window(_(PROGRAM_NAME ": Time stretch"), - x - 160, - y - 75, - 320, - 200, - 320, - 200, + x - xS(160), + y - yS(75), + xS(320), + yS(200), + xS(320), + yS(200), 0, 0, 1) @@ -138,7 +138,7 @@ TimeStretchWindow::~TimeStretchWindow() void TimeStretchWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); BC_Title *title; add_subwindow(title = new BC_Title(x, y, _("Fraction of original speed:"))); diff --git a/cinelerra-5.1/plugins/timestretchrt/timestretchrt.C b/cinelerra-5.1/plugins/timestretchrt/timestretchrt.C index 1761782b..c84dca49 100644 --- a/cinelerra-5.1/plugins/timestretchrt/timestretchrt.C +++ b/cinelerra-5.1/plugins/timestretchrt/timestretchrt.C @@ -93,10 +93,10 @@ void TimeStretchRTConfig::boundaries() TimeStretchRTWindow::TimeStretchRTWindow(TimeStretchRT *plugin) : PluginClientWindow(plugin, - 210, - 200, - 200, - 210, + xS(210), + yS(200), + xS(200), + yS(210), 0) { this->plugin = plugin; @@ -108,7 +108,7 @@ TimeStretchRTWindow::~TimeStretchRTWindow() void TimeStretchRTWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); int margin = plugin->get_theme()->widget_border; BC_Title *title = 0; diff --git a/cinelerra-5.1/plugins/titler/titler.C b/cinelerra-5.1/plugins/titler/titler.C index c1e46f20..d9489cb3 100644 --- a/cinelerra-5.1/plugins/titler/titler.C +++ b/cinelerra-5.1/plugins/titler/titler.C @@ -105,8 +105,8 @@ TitleConfig::TitleConfig() wtext = 0; wsize = 0; wlen = 0; title_x = title_y = 0.0; title_w = title_h = 0; - window_w = 860; - window_h = 460; + window_w = xS(860); + window_h = yS(460); next_keyframe_position = 0; prev_keyframe_position = 0; timecode = 0; diff --git a/cinelerra-5.1/plugins/titler/titlerwindow.C b/cinelerra-5.1/plugins/titler/titlerwindow.C index ba93e199..4b91787c 100644 --- a/cinelerra-5.1/plugins/titler/titlerwindow.C +++ b/cinelerra-5.1/plugins/titler/titlerwindow.C @@ -56,7 +56,8 @@ static const int timeunit_formats[] = TitleWindow::TitleWindow(TitleMain *client) : PluginClientWindow(client, - client->config.window_w, client->config.window_h, 100, 100, 1) + client->config.window_w, client->config.window_h, + xS(100), yS(100), 1) { //printf("TitleWindow::TitleWindow %d %d %d\n", __LINE__, client->config.window_w, client->config.window_h); this->client = client; @@ -141,12 +142,12 @@ TitleWindow::~TitleWindow() void TitleWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); int margin = client->get_theme()->widget_border; char string[BCTEXTLEN]; -#define COLOR_W 50 -#define COLOR_H 30 +#define COLOR_W xS(50) +#define COLOR_H yS(30) client->build_previews(this); sizes.append(new BC_ListBoxItem("8")); @@ -244,20 +245,20 @@ void TitleWindow::create_objects() int x2 = x1 + size->get_w(), y2 = y1 + size->get_h() + margin; add_subwindow(size_tumbler = new TitleSizeTumble(client, this, x2, y1+margin)); - add_tool(pitch_title = new BC_Title(x-5, y2+margin, _("Pitch:"))); + add_tool(pitch_title = new BC_Title(x-xS(5), y2+margin, _("Pitch:"))); pitch = new TitlePitch(client, this, x1, y2+margin, &client->config.line_pitch); pitch->create_objects(); - int x3 = x2 + size_tumbler->get_w() + 50; + int x3 = x2 + size_tumbler->get_w() + xS(50); int y3 = pitch->get_y() + pitch->get_h(); add_tool(style_title = new BC_Title(x=x3, y, _("Style:"))); - add_tool(italic = new TitleItalic(client, this, x, y + 20)); + add_tool(italic = new TitleItalic(client, this, x, y + yS(20))); int w1 = italic->get_w(); - add_tool(bold = new TitleBold(client, this, x, y + 50)); + add_tool(bold = new TitleBold(client, this, x, y + yS(50))); if( bold->get_w() > w1 ) w1 = bold->get_w(); - add_tool(drag = new TitleDrag(client, this, x, y + 80)); + add_tool(drag = new TitleDrag(client, this, x, y + yS(80))); drag->create_objects(); if( drag->get_w() > w1 ) w1 = drag->get_w(); if( client->config.drag ) { @@ -265,25 +266,25 @@ void TitleWindow::create_objects() eprintf("drag enabled, but compositor already grabbed\n"); } - add_tool(alias = new TitleAlias(client, this, x, y+110)); + add_tool(alias = new TitleAlias(client, this, x, y+yS(110))); if( alias->get_w() > w1 ) w1 = drag->get_w(); x += w1 + margin; - add_tool(justify_title = new BC_Title(x+50, y, _("Justify:"))); - add_tool(left = new TitleLeft(client, this, x, y + 20)); + add_tool(justify_title = new BC_Title(x+xS(50), y, _("Justify:"))); + add_tool(left = new TitleLeft(client, this, x, y + yS(20))); w1 = left->get_w(); - add_tool(center = new TitleCenter(client, this, x, y + 50)); + add_tool(center = new TitleCenter(client, this, x, y + yS(50))); if( center->get_w() > w1 ) w1 = center->get_w(); - add_tool(right = new TitleRight(client, this, x, y + 80)); + add_tool(right = new TitleRight(client, this, x, y + yS(80))); if( right->get_w() > w1 ) w1 = right->get_w(); x += w1 + margin; - add_tool(top = new TitleTop(client, this, x, y + 20)); - add_tool(mid = new TitleMid(client, this, x, y + 50)); - add_tool(bottom= new TitleBottom(client, this, x, y + 80)); + add_tool(top = new TitleTop(client, this, x, y + yS(20))); + add_tool(mid = new TitleMid(client, this, x, y + yS(50))); + add_tool(bottom= new TitleBottom(client, this, x, y + yS(80))); x = margin; - y = y3+10; + y = y3+yS(10); w1 = BC_Title::calculate_w(this, _("X:")); if( (x1 = BC_Title::calculate_w(this, _("Y:"))) > w1 ) w1 = x1; @@ -312,55 +313,55 @@ void TitleWindow::create_objects() title_h->create_objects(); x1 += title_h->get_w(); - x = x1+2*margin; + x = x1+xS(2)*margin; add_tool(motion_title = new BC_Title(x1=x, y, _("Motion:"))); x1 += motion_title->get_w()+margin; motion = new TitleMotion(client, this, x1, y); motion->create_objects(); add_tool(loop = new TitleLoop(client, this, x, y1)); - x = margin; y = y1 + loop->get_h()+20; + x = margin; y = y1 + loop->get_h()+yS(20); add_tool(dropshadow_title = new BC_Title(x, y, _("Drop shadow:"))); w1 = dropshadow_title->get_w(); - dropshadow = new TitleDropShadow(client, this, x, y + 20); + dropshadow = new TitleDropShadow(client, this, x, y + yS(20)); dropshadow->create_objects(); if( dropshadow->get_w() > w1 ) w1 = dropshadow->get_w(); x += w1 + margin; add_tool(fadein_title = new BC_Title(x, y, _("Fade in (sec):"))); w1 = fadein_title->get_w(); - add_tool(fade_in = new TitleFade(client, this, &client->config.fade_in, x, y + 20)); + add_tool(fade_in = new TitleFade(client, this, &client->config.fade_in, x, y + yS(20))); if( fade_in->get_w() > w1 ) w1 = fade_in->get_w(); x += w1 + margin; add_tool(fadeout_title = new BC_Title(x, y, _("Fade out (sec):"))); w1 = fadeout_title->get_w(); - add_tool(fade_out = new TitleFade(client, this, &client->config.fade_out, x, y + 20)); + add_tool(fade_out = new TitleFade(client, this, &client->config.fade_out, x, y + yS(20))); if( fade_out->get_w() > w1 ) w1 = fade_out->get_w(); x += w1 + margin; add_tool(speed_title = new BC_Title(x, y, _("Speed:"))); w1 = speed_title->get_w(); - y += speed_title->get_h() + 5; y1 = y; + y += speed_title->get_h() + yS(5); y1 = y; speed = new TitleSpeed(client, this, x, y); speed->create_objects(); if( speed->get_w() > w1 ) w1 = speed->get_w(); x += w1 + margin; - y2 = y + speed->get_h() + 10; + y2 = y + speed->get_h() + yS(10); - add_tool(color_button_title = new BC_Title(x3, y1+10, _("Color:"))); - x1 = x3 + color_button_title->get_w() + 30; + add_tool(color_button_title = new BC_Title(x3, y1+yS(10), _("Color:"))); + x1 = x3 + color_button_title->get_w() + xS(30); add_tool(color_button = new TitleColorButton(client, this, x1, y1)); - y1 += color_button->get_h() + 10; - add_tool(outline_button_title = new BC_Title(x3, y1+10, _("Outline:"))); + y1 += color_button->get_h() + yS(10); + add_tool(outline_button_title = new BC_Title(x3, y1+yS(10), _("Outline:"))); add_tool(outline_button = new TitleOutlineColorButton(client, this, x1, y1)); - x = 10; y = y2; + x = yS(10); y = y2; add_tool(outline_title = new BC_Title(x, y, _("Outline:"))); y1 = y + outline_title->get_h() + margin; outline = new TitleOutline(client, this, x, y1); outline->create_objects(); - x += outline->get_w() + 2*margin; + x += outline->get_w() + xS(2)*margin; #ifdef USE_STROKER add_tool(stroker_title = new BC_Title(x, y, _("Stroker:"))); stroker = new TitleStroker(client, this, x, y1); @@ -381,7 +382,7 @@ void TitleWindow::create_objects() timecode_format->create_objects(); y += timecode_format->get_h() + margin; - x = 10; + x = xS(10); add_tool(background = new TitleBackground(client, this, x, y)); x += background->get_w() + margin; add_tool(background_path = new TitleBackgroundPath(client, this, x, y)); @@ -389,19 +390,19 @@ void TitleWindow::create_objects() add_tool(background_browse = new BrowseButton( client->server->mwindow->theme, this, background_path, x, y, "", _("background media"), _("Select background media path"))); - x += background_browse->get_w() + 3*margin; + x += background_browse->get_w() + xS(3)*margin; add_tool(loop_playback = new TitleLoopPlayback(client, this, x, y)); - y += loop_playback->get_h() + 10; + y += loop_playback->get_h() + yS(10); - x = 10; + x = xS(10); add_tool(text_title = new BC_Title(x, y, _("Text:"))); - x += text_title->get_w() + 20; - int wid = BC_Title::calculate_w(this,"0")*10; + x += text_title->get_w() + xS(20); + int wid = BC_Title::calculate_w(this,"0")*xS(10); add_tool(text_chars = new TitleTextChars(x,y,wid)); y += text_title->get_h() + margin; x = margin; - text = new TitleText(client, this, x, y, get_w()-margin - x, get_h() - y - 10); + text = new TitleText(client, this, x, y, get_w()-margin - x, get_h() - y - yS(10)); text->create_objects(); add_tool(cur_popup = new TitleCurPopup(client, this)); @@ -457,8 +458,8 @@ int TitleWindow::resize_event(int w, int h) fade_out->reposition_window(fade_out->get_x(), fade_out->get_y()); text_title->reposition_window(text_title->get_x(), text_title->get_y()); timecode->reposition_window(timecode->get_x(), timecode->get_y()); - text->reposition_window(text->get_x(), text->get_y(), w - text->get_x() - 10, - BC_TextBox::pixels_to_rows(this, MEDIUMFONT, h - text->get_y() - 10)); + text->reposition_window(text->get_x(), text->get_y(), w - text->get_x() - xS(10), + BC_TextBox::pixels_to_rows(this, MEDIUMFONT, h - text->get_y() - yS(10))); justify_title->reposition_window(justify_title->get_x(), justify_title->get_y()); left->reposition_window(left->get_x(), left->get_y()); center->reposition_window(center->get_x(), center->get_y()); @@ -729,7 +730,7 @@ int TitleItalic::handle_event() TitleSize::TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text) - : BC_PopupTextBox(window, &window->sizes, text, x, y, 64, 300) + : BC_PopupTextBox(window, &window->sizes, text, x, y, xS(64), yS(300)) { this->client = client; this->window = window; @@ -753,7 +754,7 @@ void TitleSize::update(int size) TitlePitch:: TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value) - : BC_TumbleTextBox(window, *value, 0, INT_MAX, x, y, 64) + : BC_TumbleTextBox(window, *value, 0, INT_MAX, x, y, xS(64)) { this->client = client; this->window = window; @@ -824,7 +825,7 @@ void TitleOutlineColorButton::handle_done_event(int result) TitleMotion::TitleMotion(TitleMain *client, TitleWindow *window, int x, int y) : BC_PopupTextBox(window, &window->paths, client->motion_to_text(client->config.motion_strategy), - x, y, 120, 100) + x, y, xS(120), yS(100)) { this->client = client; this->window = window; @@ -863,7 +864,7 @@ int TitleTimecode::handle_event() TitleTimecodeFormat::TitleTimecodeFormat(TitleMain *client, TitleWindow *window, int x, int y, int tw, const char *text) - : BC_PopupMenu(x, y, BC_PopupMenu::calculate_w(tw)+10, text, 1) + : BC_PopupMenu(x, y, BC_PopupMenu::calculate_w(tw)+xS(10), text, 1) { this->client = client; this->window = window; @@ -900,7 +901,7 @@ int TitleTimecodeFormat::update(int timecode_format) TitleFade::TitleFade(TitleMain *client, TitleWindow *window, double *value, int x, int y) - : BC_TextBox(x, y, 80, 1, (float)*value) + : BC_TextBox(x, y, xS(80), 1, (float)*value) { this->client = client; this->window = window; @@ -949,7 +950,7 @@ void TitleWindow::check_style(const char *font_name, int update) TitleFont::TitleFont(TitleMain *client, TitleWindow *window, int x, int y) : BC_PopupTextBox(window, &window->fonts, client->config.font, - x, y, 340, 300, LISTBOX_ICON_LIST) + x, y, xS(340), yS(300), LISTBOX_ICON_LIST) { this->client = client; this->window = window; @@ -1012,7 +1013,7 @@ int TitleTextChars::update(int n) TitleDropShadow::TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y) : BC_TumbleTextBox(window, client->config.dropshadow, - -1000, 1000, x, y, 70) + -1000, 1000, x, y, xS(70)) { this->client = client; this->window = window; @@ -1027,7 +1028,7 @@ int TitleDropShadow::handle_event() TitleOutline::TitleOutline(TitleMain *client, TitleWindow *window, int x, int y) : BC_TumbleTextBox(window, client->config.outline_size, - 0.f, 1000.f, x, y, 70) + 0.f, 1000.f, x, y, xS(70)) { this->client = client; this->window = window; @@ -1043,7 +1044,7 @@ int TitleOutline::handle_event() TitleStroker::TitleStroker(TitleMain *client, TitleWindow *window, int x, int y) : BC_TumbleTextBox(window, client->config.stroke_width, - 0.f, 1000.f, x, y, 70) + 0.f, 1000.f, x, y, xS(70)) { this->client = client; this->window = window; @@ -1063,7 +1064,7 @@ int TitleStroker::handle_event() TitleX::TitleX(TitleMain *client, TitleWindow *window, int x, int y) : BC_TumbleTextBox(window, client->config.title_x, - -32767.f, 32767.f, x, y, 50) + -32767.f, 32767.f, x, y, xS(50)) { this->client = client; this->window = window; @@ -1078,7 +1079,7 @@ int TitleX::handle_event() TitleY::TitleY(TitleMain *client, TitleWindow *window, int x, int y) : BC_TumbleTextBox(window, client->config.title_y, - -32767.f, 32767.f, x, y, 50) + -32767.f, 32767.f, x, y, xS(50)) { this->client = client; this->window = window; @@ -1093,7 +1094,7 @@ int TitleY::handle_event() TitleW::TitleW(TitleMain *client, TitleWindow *window, int x, int y) : BC_TumbleTextBox(window, client->config.title_w, - 0, 32767, x, y, 50) + 0, 32767, x, y, xS(50)) { this->client = client; this->window = window; @@ -1107,7 +1108,7 @@ int TitleW::handle_event() TitleH::TitleH(TitleMain *client, TitleWindow *window, int x, int y) : BC_TumbleTextBox(window, client->config.title_h, - 0, 32767, x, y, 50) + 0, 32767, x, y, xS(50)) { this->client = client; this->window = window; @@ -1121,7 +1122,7 @@ int TitleH::handle_event() TitleSpeed::TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y) : BC_TumbleTextBox(window, client->config.pixels_per_second, - 0.f, 1000.f, x, y, 100) + 0.f, 1000.f, x, y, xS(100)) { this->client = client; this->window = window; @@ -1279,7 +1280,7 @@ int TitleBackground::handle_event() } TitleBackgroundPath::TitleBackgroundPath(TitleMain *client, TitleWindow *window, int x, int y) - : BC_TextBox(x, y, 240, 1, client->config.background_path) + : BC_TextBox(x, y, xS(240), 1, client->config.background_path) { this->client = client; this->window = window; @@ -1445,7 +1446,7 @@ int TitleCurSubMenuItem::handle_event() case POPUP_FONT: { int px, py; window->get_pop_cursor(px ,py); - window->fonts_popup->activate(px, py, 300,200); + window->fonts_popup->activate(px, py, xS(300),yS(200)); return 1; } case POPUP_COLOR: { window->color_popup->activate(); @@ -1556,7 +1557,7 @@ BC_Window *TitlePngPopup::new_gui() int x, y; mwindow->gui->get_abs_cursor(x, y); BC_Window *gui = new BrowseButtonWindow(mwindow->theme, - x-25, y-100, window, "", _("Png file"), _("Png path"), 0); + x-xS(25), y-yS(100), window, "", _("Png file"), _("Png path"), 0); gui->create_objects(); return gui; } diff --git a/cinelerra-5.1/plugins/tracer/tracerwindow.C b/cinelerra-5.1/plugins/tracer/tracerwindow.C index e9b730fc..cff76598 100644 --- a/cinelerra-5.1/plugins/tracer/tracerwindow.C +++ b/cinelerra-5.1/plugins/tracer/tracerwindow.C @@ -36,11 +36,11 @@ #include "theme.h" #include "track.h" -#define COLOR_W 50 -#define COLOR_H 30 +#define COLOR_W xS(50) +#define COLOR_H yS(30) TracerNum::TracerNum(TracerWindow *gui, int x, int y, float output) - : BC_TumbleTextBox(gui, output, -32767.0f, 32767.0f, x, y, 120) + : BC_TumbleTextBox(gui, output, -32767.0f, 32767.0f, x, y, xS(120)) { this->gui = gui; set_increment(1); @@ -85,7 +85,7 @@ int TracerPointY::handle_event() } TracerWindow::TracerWindow(Tracer *plugin) - : PluginClientWindow(plugin, 400, 420, 400, 420, 0) + : PluginClientWindow(plugin, xS(400), yS(420), xS(400), yS(420), 0) { this->plugin = plugin; this->title_x = 0; this->point_x = 0; @@ -108,7 +108,7 @@ TracerWindow::~TracerWindow() void TracerWindow::create_objects() { - int x = 10, y = 10; + int x = xS(10), y = yS(10); int margin = plugin->get_theme()->widget_border; int hot_point = plugin->config.selected; add_subwindow(title_x = new BC_Title(x, y, _("X:"))); @@ -129,35 +129,35 @@ void TracerWindow::create_objects() add_subwindow(del_point = new TracerDelPoint(this, plugin, x1, y)); x1 += del_point->get_w() + margin; add_subwindow(point_dn = new TracerPointDn(this, x1, y)); - y += point_y->get_h() + margin + 10; + y += point_y->get_h() + margin + yS(10); add_subwindow(drag = new TracerDrag(this, x, y)); if( plugin->config.drag ) { if( !grab(plugin->server->mwindow->cwindow->gui) ) eprintf("drag enabled, but compositor already grabbed\n"); } - x1 = x + drag->get_w() + margin + 20; + x1 = x + drag->get_w() + margin + xS(20); add_subwindow(draw = new TracerDraw(this, x1, y)); - x1 += draw->get_w() + margin + 20; + x1 += draw->get_w() + margin + xS(20); add_subwindow(fill = new TracerFill(this, x1, y)); - x1 += drag->get_w() + margin + 20; - int y1 = y + 3; + x1 += drag->get_w() + margin + xS(20); + int y1 = y + yS(3); add_subwindow(reset = new TracerReset(this, plugin, x1, y1)); y1 += reset->get_h() + margin; add_subwindow(invert = new TracerInvert(this, plugin, x1, y1)); - y += drag->get_h() + margin + 15; + y += drag->get_h() + margin + yS(15); - x1 = x + 80; + x1 = x + xS(80); add_subwindow(title_r = new BC_Title(x, y, _("Feather:"))); - add_subwindow(feather = new TracerFeather(this, x1, y, 150)); + add_subwindow(feather = new TracerFeather(this, x1, y, xS(150))); y += feather->get_h() + margin; add_subwindow(title_s = new BC_Title(x, y, _("Radius:"))); - add_subwindow(radius = new TracerRadius(this, x1, y, 150)); - y += radius->get_h() + margin + 5; + add_subwindow(radius = new TracerRadius(this, x1, y, xS(150))); + y += radius->get_h() + margin + yS(5); add_subwindow(point_list = new TracerPointList(this, plugin, x, y)); point_list->update(plugin->config.selected); - y += point_list->get_h() + 10; + y += point_list->get_h() + yS(10); add_subwindow(new BC_Title(x, y, _( "Btn1: select/drag point\n" @@ -355,12 +355,12 @@ void TracerWindow::done_event(int result) } TracerPointList::TracerPointList(TracerWindow *gui, Tracer *plugin, int x, int y) - : BC_ListBox(x, y, 360, 130, LISTBOX_TEXT) + : BC_ListBox(x, y, xS(360), yS(130), LISTBOX_TEXT) { this->gui = gui; this->plugin = plugin; - titles[PT_X] = _("X"); widths[PT_X] = 90; - titles[PT_Y] = _("Y"); widths[PT_Y] = 90; + titles[PT_X] = _("X"); widths[PT_X] = xS(90); + titles[PT_Y] = _("Y"); widths[PT_Y] = yS(90); } TracerPointList::~TracerPointList() { @@ -595,7 +595,7 @@ int TracerRadius::handle_event() } TracerNewPoint::TracerNewPoint(TracerWindow *gui, Tracer *plugin, int x, int y) - : BC_GenericButton(x, y, 80, _("New")) + : BC_GenericButton(x, y, xS(80), _("New")) { this->gui = gui; this->plugin = plugin; @@ -612,7 +612,7 @@ int TracerNewPoint::handle_event() } TracerDelPoint::TracerDelPoint(TracerWindow *gui, Tracer *plugin, int x, int y) - : BC_GenericButton(x, y, 80, C_("Del")) + : BC_GenericButton(x, y, xS(80), C_("Del")) { this->gui = gui; this->plugin = plugin; diff --git a/cinelerra-5.1/plugins/translate/translatewin.C b/cinelerra-5.1/plugins/translate/translatewin.C index 7f01b30c..6bd1142f 100644 --- a/cinelerra-5.1/plugins/translate/translatewin.C +++ b/cinelerra-5.1/plugins/translate/translatewin.C @@ -39,10 +39,10 @@ TranslateWin::TranslateWin(TranslateMain *client) : PluginClientWindow(client, - 300, - 250, - 300, - 250, + xS(300), + yS(250), + xS(300), + yS(250), 0) { this->client = client; @@ -54,59 +54,61 @@ TranslateWin::~TranslateWin() void TranslateWin::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs150 = xS(150); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(40); + int x = xs10, y = ys10; add_tool(new BC_Title(x, y, _("In X:"))); - y += 20; + y += ys20; in_x = new TranslateCoord(this, client, x, y, &client->config.in_x); in_x->create_objects(); - y += 30; + y += ys30; add_tool(new BC_Title(x, y, _("In Y:"))); - y += 20; + y += ys20; in_y = new TranslateCoord(this, client, x, y, &client->config.in_y); in_y->create_objects(); - y += 30; + y += ys30; add_tool(new BC_Title(x, y, _("In W:"))); - y += 20; + y += ys20; in_w = new TranslateCoord(this, client, x, y, &client->config.in_w); in_w->create_objects(); - y += 30; + y += ys30; add_tool(new BC_Title(x, y, _("In H:"))); - y += 20; + y += ys20; in_h = new TranslateCoord(this, client, x, y, &client->config.in_h); in_h->create_objects(); - y += 40; + y += ys40; add_tool(reset = new TranslateReset(client, this, x, y)); - x += 150; - y = 10; + x += xs150; + y = ys10; add_tool(new BC_Title(x, y, _("Out X:"))); - y += 20; + y += ys20; out_x = new TranslateCoord(this, client, x, y, &client->config.out_x); out_x->create_objects(); - y += 30; + y += ys30; add_tool(new BC_Title(x, y, _("Out Y:"))); - y += 20; + y += ys20; out_y = new TranslateCoord(this, client, x, y, &client->config.out_y); out_y->create_objects(); - y += 30; + y += ys30; add_tool(new BC_Title(x, y, _("Out W:"))); - y += 20; + y += ys20; out_w = new TranslateCoord(this, client, x, y, &client->config.out_w); out_w->create_objects(); - y += 30; + y += ys30; add_tool(new BC_Title(x, y, _("Out H:"))); - y += 20; + y += ys20; out_h = new TranslateCoord(this, client, x, y, &client->config.out_h); out_h->create_objects(); - y += 30; + y += ys30; show_window(); flush(); @@ -138,7 +140,7 @@ TranslateCoord::TranslateCoord(TranslateWin *win, (int)10000, x, y, - 100) + xS(100)) { //printf("TranslateWidth::TranslateWidth %f\n", client->config.w); this->client = client; diff --git a/cinelerra-5.1/plugins/unsharp/unsharpwindow.C b/cinelerra-5.1/plugins/unsharp/unsharpwindow.C index 18a0403d..495eb82a 100644 --- a/cinelerra-5.1/plugins/unsharp/unsharpwindow.C +++ b/cinelerra-5.1/plugins/unsharp/unsharpwindow.C @@ -27,7 +27,7 @@ UnsharpWindow::UnsharpWindow(UnsharpMain *plugin) - : PluginClientWindow(plugin, 285, 170, 285, 170, 0) + : PluginClientWindow(plugin, xS(285), yS(170), xS(285), yS(170), 0) { this->plugin = plugin; } @@ -38,30 +38,32 @@ UnsharpWindow::~UnsharpWindow() void UnsharpWindow::create_objects() { - int x = 10, y = 10, x1 = 90; - int x2 = 0; int clrBtn_w = 50; - int defaultBtn_w = 100; + int xs10 = xS(10), xs50 = xS(50), xs90 = xS(90), xs100 = xS(100); + int ys10 = yS(10), ys40 = yS(40), ys50 = yS(50); + int x = xs10, y = ys10, x1 = xs90; + int x2 = 0; int clrBtn_w = xs50; + int defaultBtn_w = xs100; BC_Title *title; - add_subwindow(title = new BC_Title(x, y + 10, _("Radius:"))); + add_subwindow(title = new BC_Title(x, y + ys10, _("Radius:"))); add_subwindow(radius = new UnsharpRadius(plugin, x + x1, y)); - x2 = 285 - 10 - clrBtn_w; - add_subwindow(radiusClr = new UnsharpSliderClr(plugin, this, x2, y + 10, clrBtn_w, RESET_RADIUS)); + x2 = xS(285) - xs10 - clrBtn_w; + add_subwindow(radiusClr = new UnsharpSliderClr(plugin, this, x2, y + ys10, clrBtn_w, RESET_RADIUS)); - y += 40; - add_subwindow(title = new BC_Title(x, y + 10, _("Amount:"))); + y += ys40; + add_subwindow(title = new BC_Title(x, y + ys10, _("Amount:"))); add_subwindow(amount = new UnsharpAmount(plugin, x + x1, y)); - add_subwindow(amountClr = new UnsharpSliderClr(plugin, this, x2, y + 10, clrBtn_w, RESET_AMOUNT)); + add_subwindow(amountClr = new UnsharpSliderClr(plugin, this, x2, y + ys10, clrBtn_w, RESET_AMOUNT)); - y += 40; - add_subwindow(title = new BC_Title(x, y + 10, _("Threshold:"))); + y += ys40; + add_subwindow(title = new BC_Title(x, y + ys10, _("Threshold:"))); add_subwindow(threshold = new UnsharpThreshold(plugin, x + x1, y)); - add_subwindow(thresholdClr = new UnsharpSliderClr(plugin, this, x2, y + 10, clrBtn_w, RESET_THRESHOLD)); + add_subwindow(thresholdClr = new UnsharpSliderClr(plugin, this, x2, y + ys10, clrBtn_w, RESET_THRESHOLD)); - y += 50; + y += ys50; add_subwindow(reset = new UnsharpReset(plugin, this, x, y)); add_subwindow(default_settings = new UnsharpDefaultSettings(plugin, this, - (285 - 10 - defaultBtn_w), y, defaultBtn_w)); + (xS(285) - xs10 - defaultBtn_w), y, defaultBtn_w)); show_window(); flush(); diff --git a/cinelerra-5.1/plugins/vocoder/vocoder.C b/cinelerra-5.1/plugins/vocoder/vocoder.C index 5987558e..df916021 100644 --- a/cinelerra-5.1/plugins/vocoder/vocoder.C +++ b/cinelerra-5.1/plugins/vocoder/vocoder.C @@ -270,10 +270,10 @@ int VocoderBands::handle_event() VocoderWindow::VocoderWindow(Vocoder *plugin) : PluginClientWindow(plugin, - 320, - 150, - 320, - 150, + xS(320), + yS(150), + xS(320), + yS(150), 0) { this->plugin = plugin; diff --git a/cinelerra-5.1/plugins/wave/wave.C b/cinelerra-5.1/plugins/wave/wave.C index c5f0c3f3..b3825fad 100644 --- a/cinelerra-5.1/plugins/wave/wave.C +++ b/cinelerra-5.1/plugins/wave/wave.C @@ -156,8 +156,8 @@ WaveAmplitude::WaveAmplitude(WaveEffect *plugin, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (float)0, (float)100, plugin->config.amplitude) @@ -177,8 +177,8 @@ WavePhase::WavePhase(WaveEffect *plugin, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (float)0, (float)360, plugin->config.phase) @@ -196,8 +196,8 @@ WaveLength::WaveLength(WaveEffect *plugin, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (float)0, (float)50, plugin->config.wavelength) @@ -270,7 +270,7 @@ int WaveSliderClr::handle_event() WaveWindow::WaveWindow(WaveEffect *plugin) - : PluginClientWindow(plugin, 385, 140, 385, 140, 0) + : PluginClientWindow(plugin, xS(385), yS(140), xS(385), yS(140), 0) { this->plugin = plugin; } @@ -281,36 +281,38 @@ WaveWindow::~WaveWindow() void WaveWindow::create_objects() { - int x = 10, y = 10, x1 = 115; - int x2 = 0; int clrBtn_w = 50; - int defaultBtn_w = 100; + int xs10 = xS(10), xs50 = xS(50), xs100 = xS(100), xs115 = xS(115); + int ys10 = yS(10), ys30 = yS(30), ys40 = yS(40); + int x = xs10, y = ys10, x1 = xs115; + int x2 = 0; int clrBtn_w = xs50; + int defaultBtn_w = xs100; // add_subwindow(new BC_Title(x, y, _("Mode:"))); // add_subwindow(smear = new WaveSmear(plugin, this, x1, y)); -// y += 20; +// y += ys20; // add_subwindow(blacken = new WaveBlacken(plugin, this, x1, y)); -// y += 30; +// y += ys30; // add_subwindow(reflective = new WaveReflective(plugin, x1, y)); -// y += 30; +// y += ys30; add_subwindow(new BC_Title(x, y, _("Amplitude:"))); add_subwindow(amplitude = new WaveAmplitude(plugin, x1, y)); - x2 = x1 + amplitude->get_w() + 10; + x2 = x1 + amplitude->get_w() + xs10; add_subwindow(amplitudeClr = new WaveSliderClr(plugin, this, x2, y, clrBtn_w, RESET_AMPLITUDE)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Phase:"))); add_subwindow(phase = new WavePhase(plugin, x1, y)); add_subwindow(phaseClr = new WaveSliderClr(plugin, this, x2, y, clrBtn_w, RESET_PHASE)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Wavelength:"))); add_subwindow(wavelength = new WaveLength(plugin, x1, y)); add_subwindow(wavelengthClr = new WaveSliderClr(plugin, this, x2, y, clrBtn_w, RESET_WAVELENGTH)); - y += 40; + y += ys40; add_subwindow(reset = new WaveReset(plugin, this, x, y)); add_subwindow(default_settings = new WaveDefaultSettings(plugin, this, - (385 - 10 - defaultBtn_w), y, defaultBtn_w)); + (xS(385) - xs10 - defaultBtn_w), y, defaultBtn_w)); show_window(); flush(); diff --git a/cinelerra-5.1/plugins/whirl/whirl.C b/cinelerra-5.1/plugins/whirl/whirl.C index ed84243d..ac598991 100644 --- a/cinelerra-5.1/plugins/whirl/whirl.C +++ b/cinelerra-5.1/plugins/whirl/whirl.C @@ -289,7 +289,7 @@ void WhirlConfig::interpolate(WhirlConfig &prev, WhirlWindow::WhirlWindow(WhirlEffect *plugin) - : PluginClientWindow(plugin, 280, 195, 280, 195, 0) + : PluginClientWindow(plugin, xS(280), yS(195), xS(280), yS(195), 0) { this->plugin = plugin; } @@ -298,33 +298,34 @@ WhirlWindow::WhirlWindow(WhirlEffect *plugin) void WhirlWindow::create_objects() { - int x = 10, y = 10; - int x1 = 0; int clrBtn_w = 50; - int defaultBtn_w = 100; + int xs10 = xS(10), xs50 = xS(50), xs100 = xS(100); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys35 = yS(35); + int x = xs10, y = ys10; + int x1 = 0; int clrBtn_w = xs50; + int defaultBtn_w = xs100; add_subwindow(new BC_Title(x, y, _("Radius"))); - y += 20; + y += ys20; add_subwindow(radius = new WhirlRadius(plugin, x, y)); - x1 = x + radius->get_w() + 10; + x1 = x + radius->get_w() + xs10; add_subwindow(radiusClr = new WhirlSliderClr(plugin, this, x1, y, clrBtn_w, RESET_RADIUS)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Pinch"))); - y += 20; + y += ys20; add_subwindow(pinch = new WhirlPinch(plugin, x, y)); add_subwindow(pinchClr = new WhirlSliderClr(plugin, this, x1, y, clrBtn_w, RESET_PINCH)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Angle"))); - y += 20; + y += ys20; add_subwindow(angle = new WhirlAngle(plugin, x, y)); add_subwindow(angleClr = new WhirlSliderClr(plugin, this, x1, y, clrBtn_w, RESET_ANGLE)); - y += 35; + y += ys35; add_subwindow(reset = new WhirlReset(plugin, this, x, y)); add_subwindow(default_settings = new WhirlDefaultSettings(plugin, this, - (280 - 10 - defaultBtn_w), y, defaultBtn_w)); - + (xS(280) - xs10 - defaultBtn_w), y, defaultBtn_w)); show_window(); flush(); } @@ -364,8 +365,8 @@ WhirlAngle::WhirlAngle(WhirlEffect *plugin, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (float)0, (float)360, plugin->config.angle) @@ -386,8 +387,8 @@ WhirlPinch::WhirlPinch(WhirlEffect *plugin, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (float)0, (float)MAXPINCH, plugin->config.pinch) @@ -408,8 +409,8 @@ WhirlRadius::WhirlRadius(WhirlEffect *plugin, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), (float)0, (float)MAXRADIUS, plugin->config.radius) @@ -880,8 +881,8 @@ void WhirlUnit::process_package(LoadPackage *package) double pinch = plugin->config.pinch / MAXPINCH; double cx, cy; int ix, iy; - double cen_x = (double)(w - 1) / 2.0; - double cen_y = (double)(h - 1) / 2.0; + double cen_x = (double)(w-1) / 2.0; + double cen_y = (double)(h-1) / 2.0; double radius = MAX(w, h); double radius3 = plugin->config.radius / MAXRADIUS; double radius2 = radius * radius * radius3; diff --git a/cinelerra-5.1/plugins/whirl/whirlwindow.C b/cinelerra-5.1/plugins/whirl/whirlwindow.C index 3efb108d..6643b370 100644 --- a/cinelerra-5.1/plugins/whirl/whirlwindow.C +++ b/cinelerra-5.1/plugins/whirl/whirlwindow.C @@ -31,7 +31,7 @@ WhirlWindow::WhirlWindow(WhirlMain *client) - : PluginClientWindow(client, 210, 170, 200, 170, 0) + : PluginClientWindow(client, xS(210), yS(170), xS(200), yS(170), 0) { this->client = client; } WhirlWindow::~WhirlWindow() @@ -46,26 +46,28 @@ WhirlWindow::~WhirlWindow() void WhirlWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10), xs80 = xS(80); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys35 = yS(35); + int x = xs10, y = ys10; add_tool(new BC_Title(x, y, _("Angle"))); - add_tool(automation[0] = new AutomatedFn(client, this, x + 80, y, 0)); - y += 20; + add_tool(automation[0] = new AutomatedFn(client, this, x + xs80, y, 0)); + y += ys20; add_tool(angle_slider = new AngleSlider(client, x, y)); - y += 35; + y += ys35; add_tool(new BC_Title(x, y, _("Pinch"))); - add_tool(automation[1] = new AutomatedFn(client, this, x + 80, y, 1)); - y += 20; + add_tool(automation[1] = new AutomatedFn(client, this, x + xs80, y, 1)); + y += ys20; add_tool(pinch_slider = new PinchSlider(client, x, y)); - y += 35; + y += ys35; add_tool(new BC_Title(x, y, _("Radius"))); - add_tool(automation[2] = new AutomatedFn(client, this, x + 80, y, 2)); - y += 20; + add_tool(automation[2] = new AutomatedFn(client, this, x + xs80, y, 2)); + y += ys20; add_tool(radius_slider = new RadiusSlider(client, x, y)); } AngleSlider::AngleSlider(WhirlMain *client, int x, int y) - : BC_ISlider(x, y, 190, 30, 200, client->angle, -MAXANGLE, MAXANGLE, DKGREY, BLACK, 1) + : BC_ISlider(x, y, xS(190), yS(30), xS(200), client->angle, -MAXANGLE, MAXANGLE, DKGREY, BLACK, 1) { this->client = client; } @@ -80,8 +82,7 @@ int AngleSlider::handle_event() } PinchSlider::PinchSlider(WhirlMain *client, int x, int y) - : BC_ISlider(x, y, 190, 30, 200, client->pinch, -MAXPINCH, MAXPINCH, DKGREY, BLACK, 1) -{ + : BC_ISlider(x, y, xS(190), yS(30), xS(200), client->pinch, -MAXPINCH, MAXPINCH, DKGREY, BLACK, 1) this->client = client; } PinchSlider::~PinchSlider() @@ -95,7 +96,7 @@ int PinchSlider::handle_event() } RadiusSlider::RadiusSlider(WhirlMain *client, int x, int y) - : BC_ISlider(x, y, 190, 30, 200, client->radius, 0, MAXRADIUS, DKGREY, BLACK, 1) + : BC_ISlider(x, y, xS(190), yS(30), xS(200), client->radius, 0, MAXRADIUS, DKGREY, BLACK, 1) { this->client = client; } diff --git a/cinelerra-5.1/plugins/wipe/wipe.C b/cinelerra-5.1/plugins/wipe/wipe.C index 6b26694a..a0420640 100644 --- a/cinelerra-5.1/plugins/wipe/wipe.C +++ b/cinelerra-5.1/plugins/wipe/wipe.C @@ -92,10 +92,10 @@ int WipeRight::handle_event() WipeWindow::WipeWindow(WipeMain *plugin) : PluginClientWindow(plugin, - 320, - 50, - 320, - 50, + xS(320), + yS(50), + xS(320), + yS(50), 0) { this->plugin = plugin; diff --git a/cinelerra-5.1/plugins/yuv/yuv.C b/cinelerra-5.1/plugins/yuv/yuv.C index 868137f8..6e6bd86f 100644 --- a/cinelerra-5.1/plugins/yuv/yuv.C +++ b/cinelerra-5.1/plugins/yuv/yuv.C @@ -190,8 +190,8 @@ YUVLevel::YUVLevel(YUVEffect *plugin, float *output, int x, int y) : BC_FSlider(x, y, 0, - 200, - 200, + xS(200), + yS(200), -MAXVALUE, MAXVALUE, *output) @@ -249,32 +249,34 @@ int YUVSliderClr::handle_event() YUVWindow::YUVWindow(YUVEffect *plugin) - : PluginClientWindow(plugin, 310, 135, 310, 135, 0) + : PluginClientWindow(plugin, xS(310), yS(135), xS(310), yS(135), 0) { this->plugin = plugin; } void YUVWindow::create_objects() { - int x = 10, y = 10, x1 = 40; - int x2 = 0; int clrBtn_w = 50; + int xs10 = xS(10), xs40 = xS(40), xs50 = xS(50); + int ys10 = yS(10), ys30 = yS(30), ys35 = yS(35); + int x = xs10, y = ys10, x1 = xs40; + int x2 = 0; int clrBtn_w = xs50; add_subwindow(new BC_Title(x, y, _("Y:"))); add_subwindow(this->y = new YUVLevel(plugin, &plugin->config.y, x1, y)); - x2 = x1 + this->y->get_w() + 10; + x2 = x1 + this->y->get_w() + xs10; add_subwindow(yClr = new YUVSliderClr(plugin, this, x2, y, clrBtn_w, RESET_Y_SLIDER)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("U:"))); add_subwindow(u = new YUVLevel(plugin, &plugin->config.u, x1, y)); add_subwindow(uClr = new YUVSliderClr(plugin, this, x2, y, clrBtn_w, RESET_U_SLIDER)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("V:"))); add_subwindow(v = new YUVLevel(plugin, &plugin->config.v, x1, y)); add_subwindow(vClr = new YUVSliderClr(plugin, this, x2, y, clrBtn_w, RESET_V_SLIDER)); - y += 35; + y += ys35; add_subwindow(reset = new YUVReset(plugin, this, x, y)); show_window(); diff --git a/cinelerra-5.1/plugins/yuv411/yuv411win.C b/cinelerra-5.1/plugins/yuv411/yuv411win.C index 6b729291..056f68bf 100644 --- a/cinelerra-5.1/plugins/yuv411/yuv411win.C +++ b/cinelerra-5.1/plugins/yuv411/yuv411win.C @@ -3,7 +3,7 @@ #include "language.h" yuv411Window::yuv411Window(yuv411Main *client) - : PluginClientWindow(client, 250, 255, 250, 255, 0) + : PluginClientWindow(client, xS(250), yS(255), xS(250), yS(255), 0) { this->client = client; } @@ -14,35 +14,37 @@ yuv411Window::~yuv411Window() void yuv411Window::create_objects() { - int x = 10, y = 10, x1=90; + int xs10 = xS(10), xs90 = xS(90); + int ys10 = yS(10), ys30 = yS(30), ys35 = yS(35); + int x = xs10, y = ys10, x1=xs90; add_tool(avg_vertical = new yuv411Toggle(client, &(client->config.avg_vertical), _("Vertical average"), x, y)); - y += 30; + y += ys30; add_tool(int_horizontal = new yuv411Toggle(client, &(client->config.int_horizontal), _("Horizontal interpolate"), x, y)); - y += 30; + y += ys30; add_tool(inpainting = new yuv411Toggle(client, &(client->config.inpainting), _("Inpainting method"), x, y)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Offset:"))); add_subwindow(offset=new yuv411Offset(client,x1,y)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Threshold:"))); add_subwindow(thresh=new yuv411Thresh(client,x1,y)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Bias:"))); add_subwindow(bias=new yuv411Bias(client,x1,y)); - y += 30; - add_subwindow(reset = new yuv411Reset(client, this, x, y+35)); + y += ys30; + add_subwindow(reset = new yuv411Reset(client, this, x, y+ys35)); show_window(); flush(); @@ -85,7 +87,7 @@ int yuv411Toggle::handle_event() } yuv411Offset::yuv411Offset(yuv411Main *client, int x, int y) - : BC_FSlider(x, y, 0, 100, 100, (float)0, (float)2, + : BC_FSlider(x, y, 0, xS(100), yS(100), (float)0, (float)2, (float)client->config.offset) { this->client = client; @@ -99,7 +101,7 @@ int yuv411Offset::handle_event() } yuv411Thresh::yuv411Thresh(yuv411Main *client, int x, int y) - : BC_FSlider(x, y, 0, 100, 100, (float)1, (float)100, + : BC_FSlider(x, y, 0, xS(100), yS(100), (float)1, (float)100, (float)client->config.thresh) { this->client = client; @@ -113,7 +115,7 @@ int yuv411Thresh::handle_event() } yuv411Bias::yuv411Bias(yuv411Main *client, int x, int y) - : BC_FSlider(x, y, 0, 100, 100, (float)0, (float)25, + : BC_FSlider(x, y, 0, xS(100), yS(100), (float)0, (float)25, (float)client->config.bias) { this->client = client; diff --git a/cinelerra-5.1/plugins/yuvshift/yuvshift.C b/cinelerra-5.1/plugins/yuvshift/yuvshift.C index 0f0b85b6..fe5a0c9a 100644 --- a/cinelerra-5.1/plugins/yuvshift/yuvshift.C +++ b/cinelerra-5.1/plugins/yuvshift/yuvshift.C @@ -97,7 +97,7 @@ void YUVShiftConfig::interpolate(YUVShiftConfig &prev, #define MAXVALUE 100 YUVShiftLevel::YUVShiftLevel(YUVShiftEffect *plugin, int *output, int x, int y) - : BC_ISlider(x, y, 0, 200, 200, -MAXVALUE, MAXVALUE, *output) + : BC_ISlider(x, y, 0, xS(200), yS(200), -MAXVALUE, MAXVALUE, *output) { this->plugin = plugin; this->output = output; @@ -152,47 +152,49 @@ int YUVShiftSliderClr::handle_event() YUVShiftWindow::YUVShiftWindow(YUVShiftEffect *plugin) - : PluginClientWindow(plugin, 320, 230, 320, 230, 0) + : PluginClientWindow(plugin, xS(320), yS(230), xS(320), yS(230), 0) { this->plugin = plugin; } void YUVShiftWindow::create_objects() { - int x = 10, y = 10, x1 = 50; - int x2 = 0; int clrBtn_w = 50; + int xs10 = xS(10), xs50 = xS(50); + int ys10 = yS(10), ys30 = yS(30), ys40 = yS(40); + int x = xs10, y = ys10, x1 = xs50; + int x2 = 0; int clrBtn_w = xs50; add_subwindow(new BC_Title(x, y, _("Y_dx:"))); add_subwindow(y_dx = new YUVShiftLevel(plugin, &plugin->config.y_dx, x1, y)); - x2 = x1 + y_dx->get_w() + 10; + x2 = x1 + y_dx->get_w() + xs10; add_subwindow(y_dxClr = new YUVShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_Y_DX)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Y_dy:"))); add_subwindow(y_dy = new YUVShiftLevel(plugin, &plugin->config.y_dy, x1, y)); add_subwindow(y_dyClr = new YUVShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_Y_DY)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("U_dx:"))); add_subwindow(u_dx = new YUVShiftLevel(plugin, &plugin->config.u_dx, x1, y)); add_subwindow(u_dxClr = new YUVShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_U_DX)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("U_dy:"))); add_subwindow(u_dy = new YUVShiftLevel(plugin, &plugin->config.u_dy, x1, y)); add_subwindow(u_dyClr = new YUVShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_U_DY)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("V_dx:"))); add_subwindow(v_dx = new YUVShiftLevel(plugin, &plugin->config.v_dx, x1, y)); add_subwindow(v_dxClr = new YUVShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_V_DX)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("V_dy:"))); add_subwindow(v_dy = new YUVShiftLevel(plugin, &plugin->config.v_dy, x1, y)); add_subwindow(v_dyClr = new YUVShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_V_DY)); - y += 40; + y += ys40; add_subwindow(reset = new YUVShiftReset(plugin, this, x, y)); show_window(); diff --git a/cinelerra-5.1/plugins/zoom/zoom.C b/cinelerra-5.1/plugins/zoom/zoom.C index a7e26353..f962b613 100644 --- a/cinelerra-5.1/plugins/zoom/zoom.C +++ b/cinelerra-5.1/plugins/zoom/zoom.C @@ -74,10 +74,10 @@ int ZoomLimit::handle_event() ZoomWindow::ZoomWindow(ZoomMain *plugin) : PluginClientWindow(plugin, - 250, - 125, - 250, - 125, + xS(250), + yS(125), + xS(250), + yS(125), 0) { this->plugin = plugin; @@ -104,7 +104,7 @@ void ZoomWindow::create_objects() &plugin->max_magnification_x, x, y, - get_w() - window_border * 2 - widget_border - BC_Tumbler::calculate_w()); + get_w() - window_border * xS(2) - widget_border - BC_Tumbler::calculate_w()); limit_x->create_objects(); y += limit_x->get_h() + widget_border; add_subwindow(title = new BC_Title(x, y, _("Y Magnification:"))); @@ -114,7 +114,7 @@ void ZoomWindow::create_objects() &plugin->max_magnification_y, x, y, - get_w() - window_border * 2 - widget_border - BC_Tumbler::calculate_w()); + get_w() - window_border * xS(2) - widget_border - BC_Tumbler::calculate_w()); limit_y->create_objects(); show_window(); @@ -134,8 +134,8 @@ ZoomMain::ZoomMain(PluginServer *server) { overlayer = 0; temp = 0; - max_magnification_x = 10; - max_magnification_y = 10; + max_magnification_x = xS(10); + max_magnification_y = yS(10); } ZoomMain::~ZoomMain() diff --git a/cinelerra-5.1/plugins/zoomblur/zoomblur.C b/cinelerra-5.1/plugins/zoomblur/zoomblur.C index 0d40b7ca..e93c100c 100644 --- a/cinelerra-5.1/plugins/zoomblur/zoomblur.C +++ b/cinelerra-5.1/plugins/zoomblur/zoomblur.C @@ -37,8 +37,8 @@ void ZoomBlurConfig::reset(int clear) { switch(clear) { case RESET_ALL : - x = 50; - y = 50; + x = xS(50); + y = yS(50); radius = 0; steps = 1; r = 1; @@ -46,9 +46,9 @@ void ZoomBlurConfig::reset(int clear) b = 1; a = 1; break; - case RESET_XSLIDER : x = 50; + case RESET_XSLIDER : x = xS(50); break; - case RESET_YSLIDER : y = 50; + case RESET_YSLIDER : y = yS(50); break; case RESET_RADIUS : radius = 0; break; @@ -56,8 +56,8 @@ void ZoomBlurConfig::reset(int clear) break; case RESET_DEFAULT_SETTINGS : default: - x = 50; - y = 50; + x = xS(50); + y = yS(50); radius = 10; steps = 10; r = 1; @@ -124,10 +124,10 @@ void ZoomBlurConfig::interpolate(ZoomBlurConfig &prev, ZoomBlurWindow::ZoomBlurWindow(ZoomBlurMain *plugin) : PluginClientWindow(plugin, - 280, - 370, - 280, - 370, + xS(280), + yS(370), + xS(280), + yS(370), 0) { this->plugin = plugin; @@ -139,46 +139,48 @@ ZoomBlurWindow::~ZoomBlurWindow() void ZoomBlurWindow::create_objects() { - int x = 10, y = 10; - int x1 = 0; int clrBtn_w = 50; - int defaultBtn_w = 100; + int xs10 = xS(10), xs50 = xS(50), xs100 = xS(100); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(40); + int x = xs10, y = ys10; + int x1 = 0; int clrBtn_w = xs50; + int defaultBtn_w = xs100; add_subwindow(new BC_Title(x, y, _("X:"))); - y += 20; + y += ys20; add_subwindow(this->x = new ZoomBlurSize(plugin, x, y, &plugin->config.x, 0, 100)); - x1 = x + this->x->get_w() + 10; + x1 = x + this->x->get_w() + xs10; add_subwindow(xClr = new ZoomBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_XSLIDER)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Y:"))); - y += 20; + y += ys20; add_subwindow(this->y = new ZoomBlurSize(plugin, x, y, &plugin->config.y, 0, 100)); add_subwindow(yClr = new ZoomBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_YSLIDER)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Radius:"))); - y += 20; + y += ys20; add_subwindow(radius = new ZoomBlurSize(plugin, x, y, &plugin->config.radius, -100, 100)); add_subwindow(radiusClr = new ZoomBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_RADIUS)); - y += 30; + y += ys30; add_subwindow(new BC_Title(x, y, _("Steps:"))); - y += 20; + y += ys20; add_subwindow(steps = new ZoomBlurSize(plugin, x, y, &plugin->config.steps, 1, 100)); add_subwindow(stepsClr = new ZoomBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_STEPS)); - y += 30; + y += ys30; add_subwindow(r = new ZoomBlurToggle(plugin, x, y, &plugin->config.r, _("Red"))); - y += 30; + y += ys30; add_subwindow(g = new ZoomBlurToggle(plugin, x, y, &plugin->config.g, _("Green"))); - y += 30; + y += ys30; add_subwindow(b = new ZoomBlurToggle(plugin, x, y, &plugin->config.b, _("Blue"))); - y += 30; + y += ys30; add_subwindow(a = new ZoomBlurToggle(plugin, x, y, &plugin->config.a, _("Alpha"))); - y += 40; + y += ys40; add_subwindow(reset = new ZoomBlurReset(plugin, this, x, y)); add_subwindow(default_settings = new ZoomBlurDefaultSettings(plugin, this, - (280 - 10 - defaultBtn_w), y, defaultBtn_w)); + (xS(280) - xS(10) - defaultBtn_w), y, defaultBtn_w)); show_window(); flush(); @@ -250,7 +252,7 @@ ZoomBlurSize::ZoomBlurSize(ZoomBlurMain *plugin, int *output, int min, int max) - : BC_ISlider(x, y, 0, 200, 200, min, max, *output) + : BC_ISlider(x, y, 0, xS(200), yS(200), min, max, *output) { this->plugin = plugin; this->output = output;