add layout_scale preference, scaling cleanup, rework init bc_resources, init tip_info...
authorGood Guy <good1.2guy@gmail.com>
Wed, 23 Oct 2019 23:13:42 +0000 (17:13 -0600)
committerGood Guy <good1.2guy@gmail.com>
Wed, 23 Oct 2019 23:13:42 +0000 (17:13 -0600)
44 files changed:
cinelerra-5.1/cinelerra/appearanceprefs.C
cinelerra-5.1/cinelerra/appearanceprefs.h
cinelerra-5.1/cinelerra/appearanceprefs.inc
cinelerra-5.1/cinelerra/awindowgui.C
cinelerra-5.1/cinelerra/confirmsave.C
cinelerra-5.1/cinelerra/fileffmpeg.C
cinelerra-5.1/cinelerra/main.C
cinelerra-5.1/cinelerra/mainsession.C
cinelerra-5.1/cinelerra/preferences.C
cinelerra-5.1/cinelerra/preferences.h
cinelerra-5.1/cinelerra/preferencesthread.C
cinelerra-5.1/cinelerra/recordbatches.C
cinelerra-5.1/cinelerra/signalstatus.C
cinelerra-5.1/cinelerra/timeentry.C
cinelerra-5.1/cinelerra/timeentry.inc
cinelerra-5.1/guicast/bclistbox.C
cinelerra-5.1/guicast/bclistbox.h
cinelerra-5.1/guicast/bcresources.C
cinelerra-5.1/guicast/bcresources.h
cinelerra-5.1/guicast/bcwindowbase.C
cinelerra-5.1/guicast/bcwindowbase.h
cinelerra-5.1/guicast/errorbox.h
cinelerra-5.1/plugins/blur/blurwindow.C
cinelerra-5.1/plugins/decimate/decimate.C
cinelerra-5.1/plugins/delayvideo/delayvideo.C
cinelerra-5.1/plugins/denoiseseltempavg/seltempavgwindow.C
cinelerra-5.1/plugins/descratch/descratch.C
cinelerra-5.1/plugins/diffkey/diffkey.C
cinelerra-5.1/plugins/edge/edgewindow.C
cinelerra-5.1/plugins/framefield/framefield.C
cinelerra-5.1/plugins/freezeframe/freezeframe.C
cinelerra-5.1/plugins/histeq/histeq.C
cinelerra-5.1/plugins/histogram_bezier/bistogramwindow.C
cinelerra-5.1/plugins/interpolate/interpolate.C
cinelerra-5.1/plugins/invertvideo/invert.C
cinelerra-5.1/plugins/ivtc/ivtcwindow.C
cinelerra-5.1/plugins/loopvideo/loopvideo.C
cinelerra-5.1/plugins/overlay/overlay.C
cinelerra-5.1/plugins/perspective/perspective.C
cinelerra-5.1/plugins/photoscale/photoscale.C
cinelerra-5.1/plugins/radialblur/radialblur.C
cinelerra-5.1/plugins/reroute/reroute.C
cinelerra-5.1/plugins/reversevideo/reversevideo.C
cinelerra-5.1/plugins/svg/svgwin.C

index 840dccc6a3a175f0d8e114d0722b1064ea770193..ddca255e88b005ebd1b9b94c78a2ee2b1023c406 100644 (file)
@@ -42,8 +42,10 @@ AppearancePrefs::AppearancePrefs(MWindow *mwindow, PreferencesWindow *pwindow)
        frames = 0;
        hex = 0;
        feet = 0;
+       layout_scale = 0;
        thumbnails = 0;
        thumbnail_size = 0;
+       vicon_size = 0;
 }
 
 AppearancePrefs::~AppearancePrefs()
@@ -54,8 +56,10 @@ AppearancePrefs::~AppearancePrefs()
        delete frames;
        delete hex;
        delete feet;
+       delete layout_scale;
        delete thumbnails;
        delete thumbnail_size;
+       delete vicon_size;
 }
 
 
@@ -92,6 +96,11 @@ void AppearancePrefs::create_objects()
 
        int x2 = x1 + xS(160), y2 = y;
        y = y1;
+
+       add_subwindow(new BC_Title(x1, y, _("Layout Scale:")));
+       layout_scale = new ViewLayoutScale(pwindow, this, x2, y);
+       layout_scale->create_objects();
+       y += layout_scale->get_h() + ys5;
        add_subwindow(new BC_Title(x1, y, _("View thumbnail size:")));
        thumbnail_size = new ViewThumbnailSize(pwindow, this, x2, y);
        thumbnail_size->create_objects();
@@ -422,6 +431,24 @@ int ViewPluginIconItem::handle_event()
        return 1;
 }
 
+ViewLayoutScale::ViewLayoutScale(PreferencesWindow *pwindow,
+               AppearancePrefs *aprefs, int x, int y)
+ : BC_TumbleTextBox(aprefs,
+       pwindow->thread->preferences->layout_scale,
+       0.f, 10.f, x, y, xS(80), 2)
+{
+       this->pwindow = pwindow;
+       this->aprefs = aprefs;
+       set_increment(0.1);
+}
+
+int ViewLayoutScale::handle_event()
+{
+       float v = atof(get_text());
+       pwindow->thread->preferences->layout_scale = v;
+       return 1;
+}
+
 
 ViewThumbnails::ViewThumbnails(int x,
        int y,
index 4b705b2c3c176bcdd772be30f4ed1b47eb802f23..2099c0548902eb88635b94f5cedf2a81c06e5115 100644 (file)
@@ -47,6 +47,7 @@ public:
        TimeFormatFrames *frames;
        TimeFormatFeet *feet;
        TimeFormatSeconds *seconds;
+       ViewLayoutScale *layout_scale;
        ViewThumbnails *thumbnails;
        ViewThumbnailSize *thumbnail_size;
        ViewViconSize *vicon_size;
@@ -170,6 +171,16 @@ public:
        ViewPluginIcons *popup;
 };
 
+class ViewLayoutScale : public BC_TumbleTextBox
+{
+public:
+       ViewLayoutScale(PreferencesWindow *pwindow,
+               AppearancePrefs *aprefs, int x, int y);
+       int handle_event();
+       AppearancePrefs *aprefs;
+       PreferencesWindow *pwindow;
+};
+
 class ViewThumbnails : public BC_CheckBox
 {
 public:
index c5e7daaaeda00cb8f89ce3c3ac4c1d56b7fd70f0..644c2bc19cacba7b06566887950099bcced67fcf 100644 (file)
@@ -35,6 +35,7 @@ class ViewTheme;
 class ViewThemeItem;
 class ViewPluginIcons;
 class ViewPluginIconItem;
+class ViewLayoutScale;
 class ViewThumbnails;
 class ViewThumbnailSize;
 class ViewViconSize;
index 03c8f22132266cb337352178e5910869503436cb..d5531ac0b69a31e4ffa33d6d2ff6175f4c639640 100644 (file)
@@ -1304,6 +1304,7 @@ AWindowGUI::AWindowGUI(MWindow *mwindow, AWindow *awindow)
        vicon_audio = 0;
        vicon_drawing = AVICON_FULL_PLAY;
        play_off = 0;
+       tip_info = 0;
        displayed_folder = AW_NO_FOLDER;
        new_folder_thread = 0;
        modify_folder_thread = 0;
index 7fdc98da827000368081469ebb91d13326e12a20..02fa7bbcb13e9c1a6a10c4887b6b8c78c9e5d648 100644 (file)
@@ -84,13 +84,8 @@ int ConfirmSave::test_files(MWindow *mwindow, ArrayList<char*> *paths)
 }
 
 
-
-
-
-
-#define CSW_W 320
-#define CSW_H 120
-
+#define CSW_W xS(400)
+#define CSW_H yS(150)
 
 ConfirmSaveWindow::ConfirmSaveWindow(MWindow *mwindow,
        ArrayList<BC_ListBoxItem*> *list)
@@ -144,8 +139,3 @@ int ConfirmSaveWindow::resize_event(int w, int h)
        return 1;
 }
 
-
-
-
-
-
index 2e812301c7a63796a980bc7a708b21efa8a18362..bfd7ed69b839a38568918c41c7852d65c607a171 100644 (file)
@@ -1649,7 +1649,9 @@ FFOptionsAudioDialog::~FFOptionsAudioDialog()
 
 void FFOptionsAudioDialog::update_options(const char *options)
 {
+       aud_config->lock_window("FFOptionsAudioDialog::update_options");
        aud_config->audio_options->update(options);
+       aud_config->unlock_window();
 }
 
 FFOptionsVideoDialog::FFOptionsVideoDialog(FFMPEGConfigVideo *vid_config)
@@ -1664,7 +1666,9 @@ FFOptionsVideoDialog::~FFOptionsVideoDialog()
 
 void FFOptionsVideoDialog::update_options(const char *options)
 {
+       vid_config->lock_window("FFOptionsVideoDialog::update_options");
        vid_config->video_options->update(options);
+       vid_config->unlock_window();
 }
 
 
index 6833425d0b7d1d30aafc08c945f3e25fbb3475d1..6e0b6d5e7422a3027b107139ef71e8dd52bf692c 100644 (file)
@@ -121,6 +121,25 @@ public:
 
 long cin_timezone;
 
+static float get_layout_scale()
+{
+       char config_path[BCTEXTLEN];
+       sprintf(config_path,"%s/%s", File::get_config_path(), CONFIG_FILE);
+       FILE *fp = fopen(config_path,"r");
+       if( !fp ) return 0;
+       float scale = 0;
+       char line[BCTEXTLEN];
+       line[BCTEXTLEN-1] = 0;
+       while( fgets(line, BCTEXTLEN-1, fp) ) {
+               if( !strncmp(line, "LAYOUT_SCALE ",12+1) ) {
+                       scale = atof(line+12);
+                       break;
+               }
+       }
+       fclose(fp);
+       return scale;
+}
+
 int main(int argc, char *argv[])
 {
 // handle command line arguments first
@@ -258,7 +277,10 @@ int main(int argc, char *argv[])
                }
        }
 
-
+       float scale = operation == DO_GUI ?
+               get_layout_scale() : 1;
+       // runs XInitThreads
+       BC_WindowBase::init_resources(scale);
 
        if( operation == DO_GUI ||
            operation == DO_DEAMON || operation == DO_DEAMON_FG ||
@@ -401,6 +423,7 @@ DISABLE_BUFFER
 
        filenames.remove_all_objects();
        Units::finit();
+       BC_WindowBase::finit_resources();
 
        time_t et; time(&et);
        long dt = et - st;
index 16a20fe891fd8a2dd958677294daaeec51308380..e0a8a8265f57752e73b347788500a9f8b4a3b116 100644 (file)
@@ -201,7 +201,7 @@ void MainSession::default_window_positions(int window_config)
        int border_bottom = display_info.get_bottom_border();
 
        int dual_head = screens > 1 ? 1 : 0;
-       int left_w = 0, right_w = root_w;
+       int left_w = 0, left_h = 0, right_w = 0;
        int xin_screens = display_info.get_xinerama_screens();
        if( xin_screens > 1 ) {
                dual_head = 1;
@@ -210,7 +210,7 @@ void MainSession::default_window_positions(int window_config)
                        if( display_info.xinerama_geometry(s, x, y, w, h) )
                                continue;
                        if( !y && !x ) {
-                               left_w = w;
+                               left_w = w;  left_h = h;
                                break;
                        }
                }
@@ -229,14 +229,13 @@ void MainSession::default_window_positions(int window_config)
                                root_w = right_w;
                        }
                        else {
-                       // use same aspect ratio to compute left height
                                root_w = left_w;
-                               root_h = (root_w*root_h) / right_w;
+                               root_h = left_h;
                        }
                }
        }
 // Wider than 16:9, narrower than dual head
-       if( screens < 2 && (float)root_w / root_h > 1.8 ) {
+       else if( screens < 2 && (float)root_w / root_h > 1.8 ) {
                dual_head = 1;
                switch( root_h ) {
                case 600:  right_w = 800;   break;
@@ -432,7 +431,7 @@ int MainSession::load_defaults(BC_Hash *defaults)
 //printf("MainSession::load_defaults 1\n");
 
 // Other windows
-       afolders_w = defaults->get("ABINS_W", 200);
+       afolders_w = defaults->get("ABINS_W", xS(200));
 
        bwindow_w = defaults->get("BWINDOW_W", bwindow_w);
        bwindow_h = defaults->get("BWINDOW_H", bwindow_h);
@@ -470,19 +469,19 @@ int MainSession::load_defaults(BC_Hash *defaults)
 
        cwindow_controls = defaults->get("CWINDOW_CONTROLS", cwindow_controls);
 
-       plugindialog_w = defaults->get("PLUGINDIALOG_W", 510);
-       plugindialog_h = defaults->get("PLUGINDIALOG_H", 415);
-//     presetdialog_w = defaults->get("PRESETDIALOG_W", 510);
-//     presetdialog_h = defaults->get("PRESETDIALOG_H", 415);
-       keyframedialog_w = defaults->get("KEYFRAMEDIALOG_W", 320);
-       keyframedialog_h = defaults->get("KEYFRAMEDIALOG_H", 415);
-       keyframedialog_column1 = defaults->get("KEYFRAMEDIALOG_COLUMN1", 150);
-       keyframedialog_column2 = defaults->get("KEYFRAMEDIALOG_COLUMN2", 100);
+       plugindialog_w = defaults->get("PLUGINDIALOG_W", xS(510));
+       plugindialog_h = defaults->get("PLUGINDIALOG_H", yS(415));
+//     presetdialog_w = defaults->get("PRESETDIALOG_W", xS(510));
+//     presetdialog_h = defaults->get("PRESETDIALOG_H", yS(415));
+       keyframedialog_w = defaults->get("KEYFRAMEDIALOG_W", xS(320));
+       keyframedialog_h = defaults->get("KEYFRAMEDIALOG_H", yS(415));
+       keyframedialog_column1 = defaults->get("KEYFRAMEDIALOG_COLUMN1", xS(150));
+       keyframedialog_column2 = defaults->get("KEYFRAMEDIALOG_COLUMN2", xS(100));
        keyframedialog_all = defaults->get("KEYFRAMEDIALOG_ALL", 0);
-       menueffect_w = defaults->get("MENUEFFECT_W", 580);
-       menueffect_h = defaults->get("MENUEFFECT_H", 350);
-       transitiondialog_w = defaults->get("TRANSITIONDIALOG_W", 320);
-       transitiondialog_h = defaults->get("TRANSITIONDIALOG_H", 512);
+       menueffect_w = defaults->get("MENUEFFECT_W", xS(580));
+       menueffect_h = defaults->get("MENUEFFECT_H", yS(350));
+       transitiondialog_w = defaults->get("TRANSITIONDIALOG_W", xS(320));
+       transitiondialog_h = defaults->get("TRANSITIONDIALOG_H", yS(512));
 
        current_tip = defaults->get("CURRENT_TIP", current_tip);
        actual_frame_rate = defaults->get("ACTUAL_FRAME_RATE", (float)-1);
index a3ebc48f576b14f786b2c402daf697b9ff4a1769..c9153a95b21917bb503eb17de49cdffa8001fd65 100644 (file)
@@ -69,6 +69,7 @@ Preferences::Preferences()
        trap_sigsegv = 1;
        trap_sigintr = 1;
        awindow_picon_h = 50;
+       layout_scale = 0; // auto scale
        vicon_size = 50;
        vicon_color_mode = VICON_COLOR_MODE_LOW;
        theme[0] = 0;
@@ -180,6 +181,7 @@ void Preferences::copy_from(Preferences *that)
        keyframe_reticle = that->keyframe_reticle;
        perpetual_session = that->perpetual_session;
        awindow_picon_h = that->awindow_picon_h;
+       layout_scale = that->layout_scale;
        vicon_size = that->vicon_size;
        vicon_color_mode = that->vicon_color_mode;
        strcpy(theme, that->theme);
@@ -329,6 +331,7 @@ int Preferences::load_defaults(BC_Hash *defaults)
        trap_sigintr = defaults->get("TRAP_SIGINTR", trap_sigintr);
 
        awindow_picon_h = defaults->get("AWINDOW_PICON_H", awindow_picon_h);
+       layout_scale = defaults->get("LAYOUT_SCALE",layout_scale);
        vicon_size = defaults->get("VICON_SIZE",vicon_size);
        vicon_color_mode = defaults->get("VICON_COLOR_MODE",vicon_color_mode);
        strcpy(theme, _(DEFAULT_THEME));
@@ -478,6 +481,7 @@ int Preferences::save_defaults(BC_Hash *defaults)
        defaults->update("TRAP_SIGSEGV", trap_sigsegv);
        defaults->update("TRAP_SIGINTR", trap_sigintr);
        defaults->update("AWINDOW_PICON_H", awindow_picon_h);
+       defaults->update("LAYOUT_SCALE",layout_scale);
        defaults->update("VICON_SIZE",vicon_size);
        defaults->update("VICON_COLOR_MODE",vicon_color_mode);
        defaults->update("THEME", theme);
index edb28712e4182bf556fa7eadfe66f47a38578aa3..bbd41964d608a16504ea23c2daa6d4a7aeea0154 100644 (file)
@@ -95,6 +95,7 @@ public:
 // media thumbnail size
        int awindow_picon_h;
        int vicon_size, vicon_color_mode;
+       float layout_scale;
 // Title of theme
        char theme[BCTEXTLEN];
 // plugin icon set
index 2e90892602e8e1faac227f4410af62064923fdc6..23494e709b54e2c5bf5fba93c734bf5962e789ea 100644 (file)
@@ -237,6 +237,7 @@ int PreferencesThread::apply_settings()
        if( strcmp(preferences->theme, mwindow->preferences->theme) ||
            strcmp(preferences->plugin_icons, mwindow->preferences->plugin_icons) ||
            preferences->awindow_picon_h != mwindow->preferences->awindow_picon_h ||
+           preferences->layout_scale != mwindow->preferences->layout_scale ||
            preferences->vicon_size != mwindow->preferences->vicon_size ||
            preferences->vicon_color_mode != mwindow->preferences->vicon_color_mode )
                mwindow->restart_status = -1;  // reconstruct/restart program
index a9f5114e15600541e9aa4106ddc4d16cbfd2b454..6ed37423549b17f1322eff846b0611da7491f4e0 100644 (file)
@@ -39,7 +39,7 @@ load_defaults(ChannelDB * channeldb, Record * record)
        for(int i = 0; i < BATCH_COLUMNS; i++) {
                batch_titles[i] = _(default_batch_titles[i]);
                sprintf(string, "BATCH_COLUMNWIDTH_%d", i);
-               column_widths[i] = defaults->get(string, default_columnwidth[i]);
+               column_widths[i] = defaults->get(string, xS(default_columnwidth[i]));
        }
        int total_batches = defaults->get("TOTAL_BATCHES", 1);
        if(total_batches < 1) total_batches = 1;
@@ -335,7 +335,7 @@ set_row_color(int row, int color)
 
 RecordBatchesGUI::Dir::
 Dir(RecordBatches &batches, const char *dir, int x, int y)
- : BC_TextBox(x, y, 200, 1, dir),
+ : BC_TextBox(x, y, xS(200), 1, dir),
    batches(batches),
    directory(batches.default_directory)
 {
@@ -380,7 +380,7 @@ load_dirs(const char *dir)
 
 RecordBatchesGUI::Path::
 Path(RecordBatches &batches, int x, int y)
- : BC_TextBox(x, y, 200, 1, batches.get_editing_batch()->asset->path),
+ : BC_TextBox(x, y, xS(200), 1, batches.get_editing_batch()->asset->path),
    batches(batches)
 {
 }
@@ -437,7 +437,7 @@ RecordBatchesGUI::Source::
 Source(BC_Window *win, RecordBatches &batches, int x, int y)
  : BC_PopupTextBox(win, &sources,
                 batches.get_editing_batch()->get_source_text(),
-                x, y, 200, 200),
+                x, y, xS(200), yS(200)),
    batches(batches)
 {
 }
@@ -452,7 +452,7 @@ handle_event()
 
 RecordBatchesGUI::News::
 News(RecordBatches &batches, int x, int y)
- : BC_TextBox(x, y, 200, 1, batches.get_editing_batch()->news),
+ : BC_TextBox(x, y, xS(200), 1, batches.get_editing_batch()->news),
    batches(batches)
 {
 }
index 8e22161869f5a5b910519cb01459ae33da28325b..c002ecc62d97db1e74f37ade070ca52dea0a4e3c 100644 (file)
@@ -10,7 +10,7 @@
 
 
 SignalStatus::SignalStatus(BC_WindowBase *wdw, int x, int y)
- : BC_SubWindow(x, y, 100, 35)
+ : BC_SubWindow(x, y, xS(100), yS(35))
 {
        this->wdw = wdw;
        dvb_input = 0;
index f8ccf00017502db398ca7c61a1688ff5b816a091..1f01f721a2e913adde1d4a2df6e107cebed7970f 100644 (file)
@@ -88,7 +88,7 @@ void TimeEntry::create_objects()
        char string[BCTEXTLEN];
 
        if(output_day) {
-               day_text = new DayText(this, x, y, 50,
+               day_text = new DayText(this, x, y, xS(50),
                        day_table, TOTAL_DAYS, day_table[*output_day]);
                gui->add_subwindow(day_text);
                x += day_text->get_w();
index b20a9e7729328b073b5fc4727d70160fab61f477..6b05157233f960ec2752f0976d46df0985d8a204 100644 (file)
@@ -29,6 +29,6 @@ class TimeEntryTumbler;
 class SecTumbler;
 class TimeTextBox;
 
-#define DEFAULT_TIMEW 200
+#define DEFAULT_TIMEW xS(200)
 
 #endif
index 8ef0ab0b376247d7443d960cf9cefbec7cd41ee9..18d93c99668d63042e2621d5603dd01089afce86 100644 (file)
@@ -1780,12 +1780,13 @@ int BC_ListBox::get_scrollbars()
 
 int BC_ListBox::get_w()
 {
-       return is_popup ? button_images[0]->get_w() + xS(1) : popup_w;
+       return is_popup ? BCPOPUPLISTBOX_W : popup_w;
 }
 int BC_ListBox::get_h()
 {
-       return is_popup ? button_images[0]->get_h() + yS(1) : popup_h;
+       return is_popup ? BCPOPUPLISTBOX_H : 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;
index e1e991a57c3c311f1edb2ac9204a3f7f34787f4b..ce34ffc49a1b4b57a0cfc0af075d6280af943b07 100644 (file)
@@ -29,6 +29,8 @@
 #include "bctoggle.h"
 #include "bccolors.h"
 
+#define BCPOPUPLISTBOX_W xS(25)
+#define BCPOPUPLISTBOX_H yS(25)
 
 class BC_ListBoxYScroll;
 class BC_ListBoxXScroll;
index 2683bd20ba0d6407ef2147eb56b05dcc25683184..667192920626c4ab7151d63cf6d3c3376db9c842 100644 (file)
@@ -362,27 +362,17 @@ VFrame *BC_Resources::default_vscroll_data[10] = { 0, };
 VFrame *BC_Resources::default_hscroll_data[10] = { 0, };
 VFrame *BC_Resources::default_icon_img = 0;
 
-BC_Resources::BC_Resources()
+BC_Resources::BC_Resources(float x_scale, float y_scale)
 {
+       BC_WindowBase::resources = this;
        synchronous = 0;
        vframe_shm = 0;
-       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");
+       if( x_scale <= 0 ) x_scale = 1;
+       if( y_scale <= 0 ) y_scale = x_scale;
+       this->x_scale = x_scale;
+       this->y_scale = y_scale;
+       float default_scale = bmin(x_scale, y_scale);
+       const char *env = getenv("BC_FONT_DEBUG");
        font_debug = env ? atoi(env) : 0;
        env = getenv("BC_FONT_SCALE");
        font_scale = env ? atof(env) : default_scale;
index 888ab4ed37c82cfbe3576e33c5bbf236b5761986..ae87652a9192ca039ea05aba3b2f0535dce20a02 100644 (file)
@@ -55,7 +55,8 @@ typedef struct
 class BC_Resources
 {
 public:
-       BC_Resources(); // The window parameter is used to get the display information initially
+// The window parameter is used to get the display information initially
+       BC_Resources(float x_scale, float y_scale);
        ~BC_Resources();
 
         friend class BC_WindowBase;
index ad25943b3ae97e540d83c0dc06e33248d46f37e4..0d9f95d4eede1a54100c45376e4b53a00fae282f 100644 (file)
@@ -70,7 +70,7 @@ BC_ResizeCall::BC_ResizeCall(int w, int h)
 
 
 int BC_WindowBase::shm_completion_event = -1;
-BC_Resources BC_WindowBase::resources;
+BC_Resources *BC_WindowBase::resources = 0;
 Window XGroupLeader = 0;
 
 Mutex BC_KeyboardHandlerLock::keyboard_listener_mutex("keyboard_listener",0);
@@ -473,7 +473,7 @@ int BC_WindowBase::create_window(BC_WindowBase *parent_window, const char *title
 // This must be done before fonts to know if antialiasing is available.
                init_colors();
 // get the resources
-               if(resources.use_shm < 0) resources.initialize_display(this);
+               if(resources->use_shm < 0) resources->initialize_display(this);
                x_correction = BC_DisplayInfo::get_left_border();
                y_correction = BC_DisplayInfo::get_top_border();
 
@@ -486,7 +486,7 @@ int BC_WindowBase::create_window(BC_WindowBase *parent_window, const char *title
                if(this->y < 0) this->y = 0;
 
                if(this->bg_color == -1)
-                       this->bg_color = resources.get_bg_color();
+                       this->bg_color = resources->get_bg_color();
 
 // printf("bcwindowbase 1 %s\n", title);
 // if(window_type == MAIN_WINDOW) sleep(1);
@@ -576,7 +576,7 @@ int BC_WindowBase::create_window(BC_WindowBase *parent_window, const char *title
                        KeyPressMask | KeyReleaseMask;
 
                if(this->bg_color == -1)
-                       this->bg_color = resources.get_bg_color();
+                       this->bg_color = resources->get_bg_color();
                attr.background_pixel = top_level->get_color(bg_color);
                attr.colormap = top_level->cmap;
                if(top_level->is_hourglass)
@@ -1031,12 +1031,12 @@ if( debug && event->type != ClientMessage ) {
                        drag_y1 = cursor_y - get_resources()->drag_radius;
                        drag_y2 = cursor_y + get_resources()->drag_radius;
 
-                       if((long)(button_time3 - button_time1) < resources.double_click * 2)
+                       if((long)(button_time3 - button_time1) < resources->double_click * 2)
                        {
                                triple_click = 1;
                                button_time3 = button_time2 = button_time1 = 0;
                        }
-                       if((long)(button_time3 - button_time2) < resources.double_click)
+                       if((long)(button_time3 - button_time2) < resources->double_click)
                        {
                                double_click = 1;
 //                             button_time3 = button_time2 = button_time1 = 0;
@@ -2295,21 +2295,21 @@ int BC_WindowBase::init_gc()
 
 int BC_WindowBase::init_fonts()
 {
-       if( !(smallfont = XLoadQueryFont(display, _(resources.small_font))) )
-               if( !(smallfont = XLoadQueryFont(display, _(resources.small_font2))) )
+       if( !(smallfont = XLoadQueryFont(display, _(resources->small_font))) )
+               if( !(smallfont = XLoadQueryFont(display, _(resources->small_font2))) )
                        smallfont = XLoadQueryFont(display, "fixed");
-       if( !(mediumfont = XLoadQueryFont(display, _(resources.medium_font))) )
-               if( !(mediumfont = XLoadQueryFont(display, _(resources.medium_font2))) )
+       if( !(mediumfont = XLoadQueryFont(display, _(resources->medium_font))) )
+               if( !(mediumfont = XLoadQueryFont(display, _(resources->medium_font2))) )
                        mediumfont = XLoadQueryFont(display, "fixed");
-       if( !(largefont = XLoadQueryFont(display, _(resources.large_font))) )
-               if( !(largefont = XLoadQueryFont(display, _(resources.large_font2))) )
+       if( !(largefont = XLoadQueryFont(display, _(resources->large_font))) )
+               if( !(largefont = XLoadQueryFont(display, _(resources->large_font2))) )
                        largefont = XLoadQueryFont(display, "fixed");
-       if( !(bigfont = XLoadQueryFont(display, _(resources.big_font))) )
-               if( !(bigfont = XLoadQueryFont(display, _(resources.big_font2))) )
+       if( !(bigfont = XLoadQueryFont(display, _(resources->big_font))) )
+               if( !(bigfont = XLoadQueryFont(display, _(resources->big_font2))) )
                        bigfont = XLoadQueryFont(display, "fixed");
 
-       if((clockfont = XLoadQueryFont(display, _(resources.clock_font))) == NULL)
-               if((clockfont = XLoadQueryFont(display, _(resources.clock_font2))) == NULL)
+       if((clockfont = XLoadQueryFont(display, _(resources->clock_font))) == NULL)
+               if((clockfont = XLoadQueryFont(display, _(resources->clock_font2))) == NULL)
                        clockfont = XLoadQueryFont(display, "fixed");
 
        init_xft();
@@ -2319,19 +2319,19 @@ int BC_WindowBase::init_fonts()
                int n;
 
 // FIXME: should check the m,d,n values
-               smallfontset = XCreateFontSet(display, resources.small_fontset, &m, &n, &d);
+               smallfontset = XCreateFontSet(display, resources->small_fontset, &m, &n, &d);
                if( !smallfontset )
                        smallfontset = XCreateFontSet(display, "fixed,*", &m, &n, &d);
-               mediumfontset = XCreateFontSet(display, resources.medium_fontset, &m, &n, &d);
+               mediumfontset = XCreateFontSet(display, resources->medium_fontset, &m, &n, &d);
                if( !mediumfontset )
                        mediumfontset = XCreateFontSet(display, "fixed,*", &m, &n, &d);
-               largefontset = XCreateFontSet(display, resources.large_fontset, &m, &n, &d);
+               largefontset = XCreateFontSet(display, resources->large_fontset, &m, &n, &d);
                if( !largefontset )
                        largefontset = XCreateFontSet(display, "fixed,*", &m, &n, &d);
-               bigfontset = XCreateFontSet(display, resources.big_fontset, &m, &n, &d);
+               bigfontset = XCreateFontSet(display, resources->big_fontset, &m, &n, &d);
                if( !bigfontset )
                        bigfontset = XCreateFontSet(display, "fixed,*", &m, &n, &d);
-               clockfontset = XCreateFontSet(display, resources.clock_fontset, &m, &n, &d);
+               clockfontset = XCreateFontSet(display, resources->clock_fontset, &m, &n, &d);
                if( !clockfontset )
                        clockfontset = XCreateFontSet(display, "fixed,*", &m, &n, &d);
                if(clockfontset && bigfontset && largefontset && mediumfontset && smallfontset) {
@@ -2355,54 +2355,54 @@ void BC_WindowBase::init_xft()
 static Mutex xft_init_lock("BC_WindowBase::xft_init_lock", 0);
 xft_init_lock.lock("BC_WindowBase::init_xft");
        if(!(smallfont_xft =
-               (resources.small_font_xft[0] == '-' ?
-                       xftFontOpenXlfd(display, screen, resources.small_font_xft) :
-                       xftFontOpenName(display, screen, resources.small_font_xft))) )
+               (resources->small_font_xft[0] == '-' ?
+                       xftFontOpenXlfd(display, screen, resources->small_font_xft) :
+                       xftFontOpenName(display, screen, resources->small_font_xft))) )
                if(!(smallfont_xft =
-                       xftFontOpenXlfd(display, screen, resources.small_font_xft2)))
+                       xftFontOpenXlfd(display, screen, resources->small_font_xft2)))
                        smallfont_xft = xftFontOpenXlfd(display, screen, "fixed");
        if(!(mediumfont_xft =
-               (resources.medium_font_xft[0] == '-' ?
-                       xftFontOpenXlfd(display, screen, resources.medium_font_xft) :
-                       xftFontOpenName(display, screen, resources.medium_font_xft))) )
+               (resources->medium_font_xft[0] == '-' ?
+                       xftFontOpenXlfd(display, screen, resources->medium_font_xft) :
+                       xftFontOpenName(display, screen, resources->medium_font_xft))) )
                if(!(mediumfont_xft =
-                       xftFontOpenXlfd(display, screen, resources.medium_font_xft2)))
+                       xftFontOpenXlfd(display, screen, resources->medium_font_xft2)))
                        mediumfont_xft = xftFontOpenXlfd(display, screen, "fixed");
        if(!(largefont_xft =
-               (resources.large_font_xft[0] == '-' ?
-                       xftFontOpenXlfd(display, screen, resources.large_font_xft) :
-                       xftFontOpenName(display, screen, resources.large_font_xft))) )
+               (resources->large_font_xft[0] == '-' ?
+                       xftFontOpenXlfd(display, screen, resources->large_font_xft) :
+                       xftFontOpenName(display, screen, resources->large_font_xft))) )
                if(!(largefont_xft =
-                       xftFontOpenXlfd(display, screen, resources.large_font_xft2)))
+                       xftFontOpenXlfd(display, screen, resources->large_font_xft2)))
                        largefont_xft = xftFontOpenXlfd(display, screen, "fixed");
        if(!(bigfont_xft =
-               (resources.big_font_xft[0] == '-' ?
-                       xftFontOpenXlfd(display, screen, resources.big_font_xft) :
-                       xftFontOpenName(display, screen, resources.big_font_xft))) )
+               (resources->big_font_xft[0] == '-' ?
+                       xftFontOpenXlfd(display, screen, resources->big_font_xft) :
+                       xftFontOpenName(display, screen, resources->big_font_xft))) )
                if(!(bigfont_xft =
-                       xftFontOpenXlfd(display, screen, resources.big_font_xft2)))
+                       xftFontOpenXlfd(display, screen, resources->big_font_xft2)))
                        bigfont_xft = xftFontOpenXlfd(display, screen, "fixed");
        if(!(clockfont_xft =
-               (resources.clock_font_xft[0] == '-' ?
-                       xftFontOpenXlfd(display, screen, resources.clock_font_xft) :
-                       xftFontOpenName(display, screen, resources.clock_font_xft))) )
+               (resources->clock_font_xft[0] == '-' ?
+                       xftFontOpenXlfd(display, screen, resources->clock_font_xft) :
+                       xftFontOpenName(display, screen, resources->clock_font_xft))) )
                clockfont_xft = xftFontOpenXlfd(display, screen, "fixed");
 
 
        if(!(bold_smallfont_xft =
-               (resources.small_b_font_xft[0] == '-' ?
-                       xftFontOpenXlfd(display, screen, resources.small_b_font_xft) :
-                       xftFontOpenName(display, screen, resources.small_b_font_xft))) )
+               (resources->small_b_font_xft[0] == '-' ?
+                       xftFontOpenXlfd(display, screen, resources->small_b_font_xft) :
+                       xftFontOpenName(display, screen, resources->small_b_font_xft))) )
                bold_smallfont_xft = xftFontOpenXlfd(display, screen, "fixed");
        if(!(bold_mediumfont_xft =
-               (resources.medium_b_font_xft[0] == '-' ?
-                       xftFontOpenXlfd(display, screen, resources.medium_b_font_xft) :
-                       xftFontOpenName(display, screen, resources.medium_b_font_xft))) )
+               (resources->medium_b_font_xft[0] == '-' ?
+                       xftFontOpenXlfd(display, screen, resources->medium_b_font_xft) :
+                       xftFontOpenName(display, screen, resources->medium_b_font_xft))) )
                bold_mediumfont_xft = xftFontOpenXlfd(display, screen, "fixed");
        if(!(bold_largefont_xft =
-               (resources.large_b_font_xft[0] == '-' ?
-                       xftFontOpenXlfd(display, screen, resources.large_b_font_xft) :
-                       xftFontOpenName(display, screen, resources.large_b_font_xft))) )
+               (resources->large_b_font_xft[0] == '-' ?
+                       xftFontOpenXlfd(display, screen, resources->large_b_font_xft) :
+                       xftFontOpenName(display, screen, resources->large_b_font_xft))) )
                bold_largefont_xft = xftFontOpenXlfd(display, screen, "fixed");
 
        if( !smallfont_xft || !mediumfont_xft || !largefont_xft || !bigfont_xft ||
@@ -2410,14 +2410,14 @@ xft_init_lock.lock("BC_WindowBase::init_xft");
            !clockfont_xft ) {
                printf("BC_WindowBase::init_fonts: no xft fonts found:"
                        " %s=%p\n %s=%p\n %s=%p\n %s=%p\n %s=%p\n %s=%p\n %s=%p\n %s=%p\n",
-                       resources.small_font_xft, smallfont_xft,
-                       resources.medium_font_xft, mediumfont_xft,
-                       resources.large_font_xft, largefont_xft,
-                       resources.big_font_xft, bigfont_xft,
-                       resources.clock_font_xft, clockfont_xft,
-                       resources.small_b_font_xft, bold_smallfont_xft,
-                       resources.medium_b_font_xft, bold_mediumfont_xft,
-                       resources.large_b_font_xft, bold_largefont_xft);
+                       resources->small_font_xft, smallfont_xft,
+                       resources->medium_font_xft, mediumfont_xft,
+                       resources->large_font_xft, largefont_xft,
+                       resources->big_font_xft, bigfont_xft,
+                       resources->clock_font_xft, clockfont_xft,
+                       resources->small_b_font_xft, bold_smallfont_xft,
+                       resources->medium_b_font_xft, bold_mediumfont_xft,
+                       resources->large_b_font_xft, bold_largefont_xft);
                get_resources()->use_xft = 0;
                exit(1);
        }
@@ -3622,12 +3622,12 @@ int BC_WindowBase::get_color_model()
 
 BC_Resources* BC_WindowBase::get_resources()
 {
-       return &BC_WindowBase::resources;
+       return BC_WindowBase::resources;
 }
 
 BC_Synchronous* BC_WindowBase::get_synchronous()
 {
-       return BC_WindowBase::resources.get_synchronous();
+       return BC_WindowBase::resources->get_synchronous();
 }
 
 int BC_WindowBase::get_bg_color()
@@ -4283,6 +4283,32 @@ int BC_WindowBase::set_icon(VFrame *data)
        return 0;
 }
 
+void BC_WindowBase::init_resources(float scale)
+{
+       if( resources ) return;
+       XInitThreads();
+       const char *env = getenv("BC_SCALE");
+       if( env ) scale = atof(env);
+       float x_scale = 1, y_scale = 1;
+       if( scale <= 0 ) {
+               BC_DisplayInfo info;
+               int wx, wy, ww, wh;
+               int cins = info.xinerama_big_screen();
+               if( !info.xinerama_geometry(cins, wx, wy, ww, wh) ) {
+                       if( (x_scale = ww/1920.) < 1 ) x_scale = 1;
+                       if( (y_scale = wh/1080.) < 1 ) y_scale = 1;
+               }
+       }
+       else
+               x_scale = y_scale = scale;
+       // constructor sets BC_WindowBase::resources
+       new BC_Resources(x_scale, y_scale);
+}
+void BC_WindowBase::finit_resources()
+{
+       delete resources;  resources = 0;
+}
+
 int BC_WindowBase::set_w(int w)
 {
        this->w = w;
@@ -4297,7 +4323,6 @@ int BC_WindowBase::set_h(int h)
 
 int BC_WindowBase::load_defaults(BC_Hash *defaults)
 {
-       BC_Resources *resources = get_resources();
        char string[BCTEXTLEN];
        int newest_id = - 1;
        for(int i = 0; i < FILEBOX_HISTORY_SIZE; i++)
@@ -4330,7 +4355,6 @@ int BC_WindowBase::load_defaults(BC_Hash *defaults)
 
 int BC_WindowBase::save_defaults(BC_Hash *defaults)
 {
-       BC_Resources *resources = get_resources();
        char string[BCTEXTLEN];
        for(int i = 0; i < FILEBOX_HISTORY_SIZE; i++)
        {
index a39010981dc17e99d628e1dd5c37c7ca2a478863..36add9c76656825749f2cf2851b4fdd95c12ad0d 100644 (file)
@@ -203,6 +203,8 @@ public:
        virtual int grab_event(XEvent *event) { return 0; };
        virtual void create_objects() { return; };
 
+       static void init_resources(float scale);
+       static void finit_resources();
        int get_window_type() { return window_type; }
 // Wait until event loop is running
        void init_wait();
@@ -729,7 +731,7 @@ private:
 // Whether the window has the focus
        int has_focus;
 
-       static BC_Resources resources;
+       static BC_Resources *resources;
 
 #ifndef SINGLE_THREAD
 // Array of repeaters for multiple repeating objects.
index 96efa72e08fa583771ac62a9763af0eda81a913a..d72225e8b69a09f1db8ed0656628f37522bdcc42 100644 (file)
@@ -28,10 +28,8 @@ class ErrorBox : public BC_Window
 {
 public:
        ErrorBox(const char *title,
-               int x = (int)BC_INFINITY,
-               int y = (int)BC_INFINITY,
-               int w = 400,
-               int h = 120);
+               int x = (int)BC_INFINITY, int y = (int)BC_INFINITY,
+               int w = xS(400), int h = yS(120));
        virtual ~ErrorBox();
 
        void create_objects(const char *text);
index f5a534c91fc306438c59e971ff1b5c8dc793a8f2..44ba304eff827fd552bbf6e4eea8e556e8257acb 100644 (file)
@@ -31,9 +31,9 @@
 
 BlurWindow::BlurWindow(BlurMain *client)
  : PluginClientWindow(client,
-       xS(200),
+       xS(210),
        yS(360),
-       xS(200),
+       xS(210),
        yS(360),
        0)
 {
index cd2dd7e74db6edad5881ab54430b77e387cc1fb6..cdf347eb3d3a476006298665abe13de9479a652d 100644 (file)
@@ -211,9 +211,9 @@ int DecimateConfig::equivalent(DecimateConfig *config)
 DecimateWindow::DecimateWindow(Decimate *plugin)
  : PluginClientWindow(plugin,
        xS(210),
-       yS(160),
+       yS(100),
        xS(200),
-       yS(160),
+       yS(100),
        0)
 {
        this->plugin = plugin;
index 3aaa853068d1cd30d3a552d646cb2febf2edb3cc..644f1e8f9f8a7fed726369b12a4a6451913a4b24 100644 (file)
@@ -71,10 +71,10 @@ void DelayVideoConfig::interpolate(DelayVideoConfig &prev,
 
 DelayVideoWindow::DelayVideoWindow(DelayVideo *plugin)
  : PluginClientWindow(plugin,
-       xS(210),
-       yS(120),
-       xS(210),
-       yS(120),
+       xS(190),
+       yS(70),
+       xS(190),
+       yS(70),
        0)
 {
        this->plugin = plugin;
index 42c92d7028e2076959f1f4b971947d5524ab82ef..d8e51ba9db6480c81237fab5630bde9efc41f11c 100644 (file)
@@ -31,9 +31,9 @@
 SelTempAvgWindow::SelTempAvgWindow(SelTempAvgMain *client)
  : PluginClientWindow(client,
        xS(310),
-       yS(540),
-       xS(300),
-       yS(540),
+       yS(480),
+       xS(310),
+       yS(480),
        0)
 {
        this->client = client;
@@ -45,70 +45,72 @@ SelTempAvgWindow::~SelTempAvgWindow()
 
 void SelTempAvgWindow::create_objects()
 {
-       int x1 = 10, x2 = 40, x3 = 80, x4 = 175, x5 = 260, y = 10;
+       int xs10 = xS(10), xs20 = xS(20), xs40 = xS(40), xs80 = xS(80), xs175=xS(175), xs260=xS(260);
+       int ys10 = yS(10), ys20 = yS(20), ys25 = yS(25), ys30 = yS(30), ys35 = yS(35);
+       int x1 = xs10, x2 = xs40, x3 = xs80, x4 = xs175, x5 = xs260, y = ys10;
 
        add_tool(new BC_Title(x1, y, _("Frames to average")));
-       y += 20;
+       y += ys20;
        add_tool(total_frames = new SelTempAvgSlider(client, x1, y));
-       y += 20;
+       y += ys20;
 
        add_tool(new BC_Title(x1, y, _("Use Method:")));
-       y += 20;
+       y += ys20;
 
        add_tool(method_none = new SelTempAvgMethodRadial(client, this, x1, y, SelTempAvgConfig::METHOD_NONE, _("None ")));
-       y += 20;
+       y += ys20;
 
        add_tool(method_seltempavg = new SelTempAvgMethodRadial(client, this, x1, y, SelTempAvgConfig::METHOD_SELTEMPAVG, _("Selective Temporal Averaging: ")));
-       y += 25;
+       y += ys25;
 
        add_tool(new BC_Title(x3, y, _("Av. Thres.")));
        add_tool(new BC_Title(x4, y, _("S.D. Thres.")));
        add_tool(new BC_Title(x5, y, _("Mask")));
-       y += 25;
+       y += ys25;
 
        add_tool(new BC_Title(x2, y, _("R / Y")));
         add_tool(avg_threshold_RY = new SelTempAvgThreshSlider(client, x3, y, AVG_RY,client->config.avg_threshold_RY));
         add_tool(std_threshold_RY = new SelTempAvgThreshSlider(client, x4, y, STD_RY,client->config.std_threshold_RY));
         add_tool(mask_RY = new SelTempAvgMask(client, x5, y, MASK_RY, client->config.mask_RY));
 
-       y += 25;
+       y += ys25;
        add_tool(new BC_Title(x2, y, _("G / U")));
         add_tool(avg_threshold_GU = new SelTempAvgThreshSlider(client, x3, y, AVG_GU,client->config.avg_threshold_GU));
         add_tool(std_threshold_GU = new SelTempAvgThreshSlider(client, x4, y, STD_GU,client->config.std_threshold_GU));
         add_tool(mask_GU = new SelTempAvgMask(client, x5, y, MASK_GU,client->config.mask_GU));
 
-       y += 25;
+       y += ys25;
        add_tool(new BC_Title(x2, y, _("B / V")));
         add_tool(avg_threshold_BV = new SelTempAvgThreshSlider(client, x3, y, AVG_BV,client->config.avg_threshold_BV));
         add_tool(std_threshold_BV = new SelTempAvgThreshSlider(client, x4, y, STD_BV,client->config.std_threshold_BV));
         add_tool(mask_BV = new SelTempAvgMask(client, x5, y, MASK_BV,client->config.mask_BV));
 
-       y += 30;
+       y += ys30;
        add_tool(method_average = new SelTempAvgMethodRadial(client, this, x1, y, SelTempAvgConfig::METHOD_AVERAGE, _("Average")));
-       y += 20;
+       y += ys20;
        add_tool(method_stddev = new SelTempAvgMethodRadial(client, this, x1, y, SelTempAvgConfig::METHOD_STDDEV, _("Standard Deviation")));
 
-       y += 35;
+       y += ys35;
        add_tool(new BC_Title(x1, y, _("First frame in average:")));
-       y += 20;
+       y += ys20;
        add_tool(offset_fixed = new SelTempAvgOffsetRadial(client, this, x1, y, SelTempAvgConfig::OFFSETMODE_FIXED, _("Fixed offset: ")));
         add_tool(offset_fixed_value = new SelTempAvgOffsetValue(client, x4, y));
-       y += 25;
+       y += ys25;
 
        add_tool(offset_restartmarker = new SelTempAvgOffsetRadial(client, this, x1, y, SelTempAvgConfig::OFFSETMODE_RESTARTMARKERSYS, _("Restart marker system:")));
-       add_tool(offset_restartmarker_pos = new BC_TextBox(x4+20, y, 100, 1, ""));
+       add_tool(offset_restartmarker_pos = new BC_TextBox(x4+xs20, y, 100, 1, ""));
        offset_restartmarker_pos->disable();
-       y += 20;
-       add_tool(offset_restartmarker_keyframe = new SelTempAvgStartKeyframe(client, x2 + 10, y));
+       y += ys20;
+       add_tool(offset_restartmarker_keyframe = new SelTempAvgStartKeyframe(client, x2 + xs10, y));
 
-       y += 35;
+       y += ys35;
 
        add_tool(new BC_Title(x1, y, _("Other Options:")));
-       y += 20;
+       y += ys20;
        add_tool(paranoid = new SelTempAvgParanoid(client, x1, y));
-       y += 25;
+       y += ys25;
        add_tool(no_subtract = new SelTempAvgNoSubtract(client, x1, y));
-       y += 30;
+       y += ys30;
        add_tool(new BC_Title(x2, y, _("Gain:")));
         add_tool(gain = new SelTempAvgGainValue(client, x3, y));
 
@@ -121,7 +123,7 @@ void SelTempAvgWindow::create_objects()
 
 
 SelTempAvgThreshSlider::SelTempAvgThreshSlider(SelTempAvgMain *client, int x, int y, int id, float currentval)
-  : BC_TextBox(x,y, 80, 1, currentval)
+  : BC_TextBox(x,y, xS(80), 1, currentval)
 {
   //   float val;
   //   int   ival;
@@ -164,7 +166,7 @@ int SelTempAvgThreshSlider::handle_event()
 
 
 SelTempAvgOffsetValue::SelTempAvgOffsetValue(SelTempAvgMain *client, int x, int y)
-  : BC_TextBox(x,y, 80, 1, client->config.offset_fixed_value)
+  : BC_TextBox(x,y, xS(80), 1, client->config.offset_fixed_value)
 {
        this->client = client;
 }
@@ -182,7 +184,7 @@ int SelTempAvgOffsetValue::handle_event()
 
 
 SelTempAvgGainValue::SelTempAvgGainValue(SelTempAvgMain *client, int x, int y)
-  : BC_TextBox(x,y, 80, 1, client->config.gain)
+  : BC_TextBox(x,y, xS(80), 1, client->config.gain)
 {
        this->client = client;
 }
@@ -204,7 +206,7 @@ int SelTempAvgGainValue::handle_event()
 
 
 SelTempAvgSlider::SelTempAvgSlider(SelTempAvgMain *client, int x, int y)
- : BC_ISlider(x, y, 0, 190, 200, 1, MAX_FRAMES, client->config.frames)
+ : BC_ISlider(x, y, 0, xS(280), yS(200), 1, MAX_FRAMES, client->config.frames)
 {
        this->client = client;
 }
index b48c4d0e17badfbbd8683703557cdf043461fe9d..027c560d0fc7ef2203ca78702a982fee8f7eb356 100644 (file)
@@ -486,7 +486,7 @@ DeScratchWindow::~DeScratchWindow()
 void DeScratchWindow::create_objects()
 {
        int xs10 = xS(10), xs15 = xS(15), xs16 = xS(16);
-       int ys10 = yS(10), ys15 = yS(15), ys30 = yS(30);
+       int ys10 = yS(10), ys15 = yS(15);
        int x = xs10, y = ys10;
        plugin->load_configuration();
        DeScratchConfig &config = plugin->config;
index fb8bc99b858a4699981702c405c29296b350d32c..2c0aef77cd537e9d2afcb7c765e59d4615bfff4d 100644 (file)
@@ -289,7 +289,7 @@ DiffKeyGUI::~DiffKeyGUI()
 
 void DiffKeyGUI::create_objects()
 {
-       int xs10 = xS(10);
+       int xs10 = xS(10), xs38 = xS(38);
        int ys10 = yS(10);
        int x = xs10, y = ys10;
        BC_Title *title;
@@ -299,9 +299,9 @@ void DiffKeyGUI::create_objects()
        x = xs10;
        y += threshold->get_h() + ys10;
        add_subwindow(title = new BC_Title(x, y, _("Slope:")));
-       x += title->get_w() + xs10;
+       x += title->get_w() + xs38;
        add_subwindow(slope = new DiffKeySlope(plugin, x, y));
-       x = xs10;
+       x = xs38;
        y += slope->get_h() + ys10;
        add_subwindow(do_value = new DiffKeyDoValue(plugin, x, y));
 
index 0a143a3a4c047c4233480a32fcdb7b9a01030b78..eaae3b984af0bb2ded75e0f916d892f7256ec471 100644 (file)
@@ -28,9 +28,9 @@
 EdgeWindow::EdgeWindow(Edge *plugin)
  : PluginClientWindow(plugin,
        xS(320),
-       yS(120),
+       yS(70),
        xS(320),
-       yS(120),
+       yS(70),
        0)
 {
        this->plugin = plugin;
index da36db3f237d2d6bc58aad6d210424f39499dd0d..b30ab8c5596c65d1d7d66c1c93eb3147a009b202 100644 (file)
@@ -188,9 +188,9 @@ int FrameFieldConfig::equivalent(FrameFieldConfig &src)
 FrameFieldWindow::FrameFieldWindow(FrameField *plugin)
  : PluginClientWindow(plugin,
        xS(210),
-       yS(160),
+       yS(100),
        xS(200),
-       yS(160),
+       yS(100),
        0)
 {
        this->plugin = plugin;
index 4a364306d5327811028769b9c77e25cb099522f4..5d8bfe832944dbb269f78bb7dce9064b21dc7f7e 100644 (file)
@@ -75,7 +75,7 @@ void FreezeFrameConfig::interpolate(FreezeFrameConfig &prev,
 
 
 FreezeFrameWindow::FreezeFrameWindow(FreezeFrameMain *client)
- : PluginClientWindow(client, xS(260), yS(100), xS(260), yS(100), 0)
+ : PluginClientWindow(client, xS(160), yS(40), xS(160), yS(40), 0)
 {
        this->client = client;
 }
index 8477ed8296524d079d407ea65f1925a50971d487..8148f116d1a8ed85c69fdd1d26635ea5e14f2216 100644 (file)
@@ -239,7 +239,7 @@ int HistEqPlot::handle_event()
 }
 
 HistEqBlend::HistEqBlend(HistEqWindow *gui, HistEqMain *plugin, int x, int y)
- : BC_FSlider(x, y, 0, xS(150), yS(200), 0, xS(1.0), plugin->config.blend, 0)
+ : BC_FSlider(x, y, 0, xS(150), yS(200), 0, 1.0, plugin->config.blend, 0)
 {
         this->gui = gui;
         this->plugin = plugin;
@@ -258,7 +258,7 @@ int HistEqBlend::handle_event()
 
 
 HistEqGain::HistEqGain(HistEqWindow *gui, HistEqMain *plugin, int x, int y)
- : BC_FSlider(x, y, 0, xS(150), yS(200), 0, xS(1.0), plugin->config.gain, 0)
+ : BC_FSlider(x, y, 0, xS(150), yS(200), 0, 1.0, plugin->config.gain, 0)
 {
         this->gui = gui;
         this->plugin = plugin;
index fd5429cda031efa2ca8562682a2025102ffc6d49..5fa84032d07e3f94ad6cf85fc736606f043901c6 100644 (file)
@@ -32,7 +32,7 @@
 #include <string.h>
 
 HistogramWindow::HistogramWindow(HistogramMain *plugin)
- : PluginClientWindow(plugin, xS(440), yS(480), xS(440), yS(480), 0)
+ : PluginClientWindow(plugin, xS(480), yS(480), xS(480), yS(480), 0)
 {
        this->plugin = plugin;
        max_picon = 0;
@@ -830,7 +830,7 @@ void HistogramInputText::update()
 
 HistogramSmoothMode::HistogramSmoothMode(HistogramMain*plugin,
        HistogramWindow *gui, int x, int y)
- : BC_PopupMenu(x, y, xS(120), to_text(plugin->config.smoothMode), 1)
+ : BC_PopupMenu(x, y, xS(180), to_text(plugin->config.smoothMode), 1)
 {
        this->plugin = plugin;
        this->gui = gui;
index 05c8565cbf5afe18f667fc9a19f1dcca411d9352..345f08b6cfee576391112dc6415001b3810be659 100644 (file)
@@ -42,15 +42,7 @@ InterpolatePixelsOffset::InterpolatePixelsOffset(InterpolatePixelsWindow *window
        int x,
        int y,
        int *output)
- : BC_ISlider(x,
-       y,
-       0,
-       xS(50),
-       yS(50),
-       0,
-       1,
-       *output,
-       0)
+ : BC_ISlider(x, y, 0, xS(50), yS(50), 0, 1, *output, 0)
 {
        this->window = window;
        this->output = output;
@@ -74,11 +66,7 @@ int InterpolatePixelsOffset::handle_event()
 
 InterpolatePixelsWindow::InterpolatePixelsWindow(InterpolatePixelsMain *client)
  : PluginClientWindow(client,
-       xS(200),
-       yS(100),
-       xS(200),
-       yS(100),
-       0)
+       xS(200), yS(70), xS(200), yS(70), 0)
 {
        this->client = client;
 }
@@ -89,7 +77,7 @@ InterpolatePixelsWindow::~InterpolatePixelsWindow()
 
 void InterpolatePixelsWindow::create_objects()
 {
-       int xs5 = xS(5), xs10 = xS(10), xs50 = xS(50);
+       int xs5 = xS(5), xs10 = xS(10);
        int ys5 = yS(5), ys10 = yS(10);
        int x = xs10, y = ys10;
 
index 13ee8dd899523414def9f60683e0673cd7b2802b..4eaf830b0cfdbad775fac229f8f69c731c7b2764 100644 (file)
@@ -157,7 +157,7 @@ int InvertVideoEnable::handle_event()
 
 
 InvertVideoWindow::InvertVideoWindow(InvertVideoEffect *plugin)
- : PluginClientWindow(plugin, xS(200), yS(130), xS(200), yS(130), 0)
+ : PluginClientWindow(plugin, xS(150), yS(130), xS(150), yS(130), 0)
 {
        this->plugin = plugin;
 }
index d3b996649d3cda9bc47624e95474e7447dc2aefb..f015fd5e0618e8ce057a673fa39e39dffd3a3cc0 100644 (file)
@@ -43,9 +43,9 @@ static const char *pattern_text[] =
 IVTCWindow::IVTCWindow(IVTCMain *client)
  : PluginClientWindow(client,
        xS(210),
-       yS(230),
+       yS(200),
        xS(210),
-       yS(230),
+       yS(200),
        0)
 {
        this->client = client;
index dd20c24a1acc363165c9ad09597d0f8a2cb162f9..d6cfdad8bc14cf4f8ce195ae660a52617779db5b 100644 (file)
@@ -100,10 +100,10 @@ LoopVideoConfig::LoopVideoConfig()
 
 LoopVideoWindow::LoopVideoWindow(LoopVideo *plugin)
  : PluginClientWindow(plugin,
-       xS(210),
-       yS(160),
-       xS(200),
-       yS(160),
+       xS(160),
+       yS(70),
+       xS(160),
+       yS(70),
        0)
 {
        this->plugin = plugin;
index 8bc8db56ba98a4061afbd0d086dd2e99769a4ebf..ae9087815b7a664b7b592602f7e14bc95dcac9da 100644 (file)
@@ -183,12 +183,7 @@ const char* OverlayConfig::output_to_text(int output_layer)
 
 
 OverlayWindow::OverlayWindow(Overlay *plugin)
- : PluginClientWindow(plugin,
-       xS(300),
-       yS(160),
-       xS(300),
-       yS(160),
-       0)
+ : PluginClientWindow(plugin, xS(300), yS(100), xS(300), yS(100), 0)
 {
        this->plugin = plugin;
 }
index c98e9b06baa5d9b2ce589bc20c297eddd9512d35..6ad79e5f89f5ea583a1a7a651dd30ba8ee07a858 100644 (file)
@@ -33,9 +33,9 @@ REGISTER_PLUGIN(PerspectiveMain)
 PerspectiveConfig::PerspectiveConfig()
 {
        x1 = 0;    y1 = 0;
-       x2 = xS(100);  y2 = 0;
-       x3 = xS(100);  y3 = yS(100);
-       x4 = 0;    y4 = yS(100);
+       x2 = 100;  y2 = 0;
+       x3 = 100;  y3 = 100;
+       x4 = 0;    y4 = 100;
        mode = AffineEngine::PERSPECTIVE;
        smoothing = AffineEngine::AF_DEFAULT;
        window_w = PERSPECTIVE_WIDTH;
index 55f515f2df3508f2026cf196734fd46a639007ee..790539f67bc66a64475cc5bd8fbd900067858eaa 100644 (file)
@@ -40,9 +40,9 @@
 PhotoScaleWindow::PhotoScaleWindow(PhotoScaleMain *plugin)
  : PluginClientWindow(plugin,
        xS(250),
-       yS(200),
+       yS(140),
        xS(250),
-       yS(200),
+       yS(140),
        0)
 {
        this->plugin = plugin;
index 8f25f176b358eaa6a110f6cf71f9c5f4e2bac30d..7524a9fd1a027834b923c78670e957f5a857a180 100644 (file)
@@ -126,10 +126,10 @@ void RadialBlurConfig::interpolate(RadialBlurConfig &prev,
 
 RadialBlurWindow::RadialBlurWindow(RadialBlurMain *plugin)
  : PluginClientWindow(plugin,
-       xS(280),
-       yS(370),
-       xS(280),
-       yS(370),
+       xS(250),
+       yS(380),
+       xS(250),
+       yS(380),
        0)
 {
        this->plugin = plugin;
@@ -182,7 +182,7 @@ void RadialBlurWindow::create_objects()
        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));
+               (xS(250) - xS(10) - defaultBtn_w), y, defaultBtn_w));
 
        show_window();
        flush();
index 6b05b592ed180b21db479b74ec715172f534113f..3f5cabd2f7f91f573e97ec82260318c8c540699c 100644 (file)
@@ -176,7 +176,7 @@ const char* RerouteConfig::output_to_text(int output_track)
 
 
 RerouteWindow::RerouteWindow(Reroute *plugin)
- : PluginClientWindow(plugin, xS(300), yS(160), 0, 0, 1)
+ : PluginClientWindow(plugin, xS(300), yS(70), 0, 0, 1)
 {
        this->plugin = plugin;
 }
@@ -223,7 +223,7 @@ RerouteOperation::RerouteOperation(Reroute *plugin,
        int y)
  : BC_PopupMenu(x,
        y,
-       xS(150),
+       xS(180),
        RerouteConfig::operation_to_text(plugin->config.operation),
        1)
 {
index 4fba53123dadf6d4de27299f29e7e0239b58cdc2..a8d737cb20565859b54321c07c7533889c3241bc 100644 (file)
@@ -102,10 +102,10 @@ ReverseVideoConfig::ReverseVideoConfig()
 
 ReverseVideoWindow::ReverseVideoWindow(ReverseVideo *plugin)
  : PluginClientWindow(plugin,
-       xS(210),
-       yS(160),
-       xS(200),
-       yS(160),
+       xS(160),
+       yS(40),
+       xS(160),
+       yS(40),
        0)
 {
        this->plugin = plugin;
index e5f5b920a95f97df0bde24c4d0d69cf9dae752e6..09cbca7b440102cbbeba0fe3348757b401212c82 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  * CINELERRA
  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
@@ -212,7 +211,9 @@ void NewSvgButton::run()
                }
                new_window = new NewSvgWindow(client, window, directory);
                new_window->create_objects();
+               new_window->lock_window("NewSvgButton::run");
                new_window->update_filter("*.svg");
+               new_window->unlock_window();
                result = new_window->run_window();
                const char *filepath = new_window->get_path(0);
                strcpy(filename, filepath ? filepath : "" );
@@ -340,9 +341,9 @@ void EditSvgButton::run()
                        if( ret != sizeof(fifo_buf) ) continue;
                        switch( fifo_buf.action ) {
                        case 1: break;
-                       case 2: printf(_("Inkscape has exited\n"));
+                       case 2: // printf(_("Inkscape has exited\n"));
                                break;
-                       case 3: printf(_("Plugin window has closed\n"));
+                       case 3: // printf(_("Plugin window has closed\n"));
                                done = 1;
                                break;
                        }
@@ -432,7 +433,7 @@ NewSvgWindow::~NewSvgWindow() {}
 
 
 DpiValue::DpiValue(SvgWin *win, SvgMain *client, int x, int y, float *value)
- : BC_TumbleTextBox(win, *value, (float)10, (float)1000, x, y, 100)
+ : BC_TumbleTextBox(win, *value, 10.f, 1000.f, x, y, xS(100), 2)
 {
 //printf("SvgWidth::SvgWidth %f\n", client->config.w);
        this->client = client;