From: Good Guy Date: Thu, 17 Aug 2017 22:19:27 +0000 (-0600) Subject: rework bcresources static vframe initializers, add CIN_XSYNCH X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=commitdiff_plain;h=2264753cd1968c95829dc01d3d9c394eacff34dc rework bcresources static vframe initializers, add CIN_XSYNCH --- diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C index e370cbe7..6aedde55 100644 --- a/cinelerra-5.1/guicast/bcresources.C +++ b/cinelerra-5.1/guicast/bcresources.C @@ -233,50 +233,116 @@ int BC_Resources::get_machine_cpus() return cpus; } +void BC_Resources::new_vframes(int n, VFrame *vframes[], ...) +{ + va_list ap; + va_start(ap, vframes); + for( int i=0; i= 0 ) delete vframes[n]; } diff --git a/cinelerra-5.1/guicast/bcresources.h b/cinelerra-5.1/guicast/bcresources.h index ce8e2403..8e518e49 100644 --- a/cinelerra-5.1/guicast/bcresources.h +++ b/cinelerra-5.1/guicast/bcresources.h @@ -360,38 +360,40 @@ public: static int find_font_by_char(FT_ULong char_code, char *path_new, const FT_Face oldface); static void dump_fonts(FILE *fp = stdout); + static void new_vframes(int n, VFrame *vframes[], ...); + static void del_vframes(VFrame *vframes[], int n); // default images - static VFrame *default_type_to_icon[]; + static VFrame *default_type_to_icon[6]; static VFrame *default_bar; - static VFrame *default_cancel_images[]; - static VFrame *default_ok_images[]; - static VFrame *default_usethis_images[]; + static VFrame *default_cancel_images[3]; + static VFrame *default_ok_images[3]; + static VFrame *default_usethis_images[3]; #if 0 - static VFrame *default_checkbox_images[]; - static VFrame *default_radial_images[]; - static VFrame *default_label_images[]; + static VFrame *default_checkbox_images[5]; + static VFrame *default_radial_images[5]; + static VFrame *default_label_images[5]; #endif - static VFrame *default_menuitem_data[]; - static VFrame *default_menubar_data[]; + static VFrame *default_menuitem_data[3]; + static VFrame *default_menubar_data[3]; static VFrame *default_menu_popup_bg; static VFrame *default_menu_bar_bg; static VFrame *default_check_image; - static VFrame *default_filebox_text_images[]; - static VFrame *default_filebox_icons_images[]; - static VFrame *default_filebox_updir_images[]; - static VFrame *default_filebox_newfolder_images[]; - static VFrame *default_filebox_rename_images[]; - static VFrame *default_filebox_delete_images[]; - static VFrame *default_filebox_reload_images[]; - static VFrame *default_listbox_button[]; + static VFrame *default_filebox_text_images[3]; + static VFrame *default_filebox_icons_images[3]; + static VFrame *default_filebox_updir_images[3]; + static VFrame *default_filebox_newfolder_images[3]; + static VFrame *default_filebox_rename_images[3]; + static VFrame *default_filebox_delete_images[3]; + static VFrame *default_filebox_reload_images[3]; + static VFrame *default_listbox_button[4]; static VFrame *default_listbox_bg; - static VFrame *default_listbox_expand[]; - static VFrame *default_listbox_column[]; + static VFrame *default_listbox_expand[5]; + static VFrame *default_listbox_column[3]; static VFrame *default_listbox_up; static VFrame *default_listbox_dn; - static VFrame *default_pot_images[]; - static VFrame *default_progress_images[]; - static VFrame *default_medium_7segment[]; + static VFrame *default_pot_images[3]; + static VFrame *default_progress_images[2]; + static VFrame *default_medium_7segment[20]; // Make VFrame use shm int vframe_shm; diff --git a/cinelerra-5.1/guicast/bcwindowbase.C b/cinelerra-5.1/guicast/bcwindowbase.C index 006bca30..fae98cb1 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.C +++ b/cinelerra-5.1/guicast/bcwindowbase.C @@ -684,6 +684,15 @@ Display* BC_WindowBase::init_display(const char *display_name) } } } + + static int xsynch = -1; + if( xsynch < 0 ) { + const char *cp = getenv("CIN_XSYNCH"); + xsynch = !cp ? 0 : atoi(cp); + } + if( xsynch > 0 ) + XSynchronize(display, True); + return display; }