frames = 0;
hex = 0;
feet = 0;
+ layout_scale = 0;
thumbnails = 0;
thumbnail_size = 0;
+ vicon_size = 0;
}
AppearancePrefs::~AppearancePrefs()
delete frames;
delete hex;
delete feet;
+ delete layout_scale;
delete thumbnails;
delete thumbnail_size;
+ delete vicon_size;
}
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();
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,
TimeFormatFrames *frames;
TimeFormatFeet *feet;
TimeFormatSeconds *seconds;
+ ViewLayoutScale *layout_scale;
ViewThumbnails *thumbnails;
ViewThumbnailSize *thumbnail_size;
ViewViconSize *vicon_size;
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:
class ViewThemeItem;
class ViewPluginIcons;
class ViewPluginIconItem;
+class ViewLayoutScale;
class ViewThumbnails;
class ViewThumbnailSize;
class ViewViconSize;
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;
}
-
-
-
-
-#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)
return 1;
}
-
-
-
-
-
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)
void FFOptionsVideoDialog::update_options(const char *options)
{
+ vid_config->lock_window("FFOptionsVideoDialog::update_options");
vid_config->video_options->update(options);
+ vid_config->unlock_window();
}
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
}
}
-
+ 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 ||
filenames.remove_all_objects();
Units::finit();
+ BC_WindowBase::finit_resources();
time_t et; time(&et);
long dt = et - st;
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;
if( display_info.xinerama_geometry(s, x, y, w, h) )
continue;
if( !y && !x ) {
- left_w = w;
+ left_w = w; left_h = h;
break;
}
}
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;
//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);
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);
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;
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);
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));
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);
// 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
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
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;
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)
{
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)
{
}
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)
{
}
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)
{
}
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;
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();
class SecTumbler;
class TimeTextBox;
-#define DEFAULT_TIMEW 200
+#define DEFAULT_TIMEW xS(200)
#endif
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;
#include "bctoggle.h"
#include "bccolors.h"
+#define BCPOPUPLISTBOX_W xS(25)
+#define BCPOPUPLISTBOX_H yS(25)
class BC_ListBoxYScroll;
class BC_ListBoxXScroll;
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;
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;
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);
// 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();
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);
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)
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;
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();
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) {
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 ||
!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);
}
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()
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;
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++)
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++)
{
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();
// 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.
{
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);
BlurWindow::BlurWindow(BlurMain *client)
: PluginClientWindow(client,
- xS(200),
+ xS(210),
yS(360),
- xS(200),
+ xS(210),
yS(360),
0)
{
DecimateWindow::DecimateWindow(Decimate *plugin)
: PluginClientWindow(plugin,
xS(210),
- yS(160),
+ yS(100),
xS(200),
- yS(160),
+ yS(100),
0)
{
this->plugin = plugin;
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;
SelTempAvgWindow::SelTempAvgWindow(SelTempAvgMain *client)
: PluginClientWindow(client,
xS(310),
- yS(540),
- xS(300),
- yS(540),
+ yS(480),
+ xS(310),
+ yS(480),
0)
{
this->client = client;
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));
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;
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;
}
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;
}
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;
}
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;
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;
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));
EdgeWindow::EdgeWindow(Edge *plugin)
: PluginClientWindow(plugin,
xS(320),
- yS(120),
+ yS(70),
xS(320),
- yS(120),
+ yS(70),
0)
{
this->plugin = plugin;
FrameFieldWindow::FrameFieldWindow(FrameField *plugin)
: PluginClientWindow(plugin,
xS(210),
- yS(160),
+ yS(100),
xS(200),
- yS(160),
+ yS(100),
0)
{
this->plugin = plugin;
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;
}
}
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;
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;
#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;
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;
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;
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;
}
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;
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;
}
IVTCWindow::IVTCWindow(IVTCMain *client)
: PluginClientWindow(client,
xS(210),
- yS(230),
+ yS(200),
xS(210),
- yS(230),
+ yS(200),
0)
{
this->client = client;
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;
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;
}
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;
PhotoScaleWindow::PhotoScaleWindow(PhotoScaleMain *plugin)
: PluginClientWindow(plugin,
xS(250),
- yS(200),
+ yS(140),
xS(250),
- yS(200),
+ yS(140),
0)
{
this->plugin = plugin;
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;
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();
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;
}
int y)
: BC_PopupMenu(x,
y,
- xS(150),
+ xS(180),
RerouteConfig::operation_to_text(plugin->config.operation),
1)
{
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;
-
/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
}
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 : "" );
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;
}
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;