X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcwindowbase.h;h=6acffd1d5d79afeb44d7b12ecdb7090cd0bbc522;hb=033efab12586e8086014c814a5360f211d228ac3;hp=ca73b39e61c696d37648cf3243243475ece56daa;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/guicast/bcwindowbase.h b/cinelerra-5.1/guicast/bcwindowbase.h index ca73b39e..6acffd1d 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.h +++ b/cinelerra-5.1/guicast/bcwindowbase.h @@ -97,7 +97,9 @@ #include #endif - +// scaled x,y unit +#define xS(v) (BC_WindowBase::get_resources()->x_scale*(v)) +#define yS(v) (BC_WindowBase::get_resources()->y_scale*(v)) #ifdef HAVE_GL //typedef void* GLXContext; @@ -173,6 +175,7 @@ public: friend class BC_Tumbler; friend class BC_Window; friend class BC_WindowEvents; + friend class Shuttle; // Main loop int run_window(); @@ -200,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(); @@ -236,10 +241,9 @@ public: void disable_opengl(); void flip_opengl(); -// Calls the BC_Synchronous version of the function with the window_id. -// Not run in OpenGL thread because it has its own lock. - unsigned int get_shader(char *title, int *got_it); - void put_shader(unsigned int handle, char *title); +// Calls the BC_Synchronous version of the function + int get_shader(unsigned int *handle, const char *vert, const char *frag); + void put_shader(unsigned int handle, const char *vert, const char *frag); int get_opengl_server_version(); int flash(int x, int y, int w, int h, int flush = 1); @@ -250,6 +254,7 @@ public: int lock_window(const char *location = 0); int unlock_window(); int get_window_lock(); + int break_lock(); BC_MenuBar* add_menubar(BC_MenuBar *menu_bar); BC_WindowBase* add_subwindow(BC_WindowBase *subwindow); @@ -310,6 +315,7 @@ public: int get_dragging(); wchar_t* get_wkeystring(int *length = 0); int get_keypress(); + int get_keysym() { return keysym; } #ifdef X_HAVE_UTF8_STRING char* get_keypress_utf8(); #endif @@ -336,6 +342,8 @@ public: int get_text_height(int font, const char *text = 0); int get_text_width(int font, const char *text, int length = -1); int get_text_width(int font, const wchar_t *text, int length = -1); +// truncate the text with ... & return a new string + char *get_truncated_text(int font, const char *text, int max_w); BC_Clipboard* get_clipboard(); void set_dragging(int value); int set_w(int w); @@ -401,8 +409,6 @@ public: int length, BC_Pixmap *pixmap); int draw_single_text(int draw, int font, int x, int y, const wchar_t *text, int length = -1, BC_Pixmap *pixmap = 0); -// truncate the text to a ... version that fits in the width, using the current_font - void truncate_text(char *result, const char *text, int w); void draw_center_text(int x, int y, const char *text, int length = -1); void draw_line(int x1, int y1, int x2, int y2, BC_Pixmap *pixmap = 0); void draw_polygon(ArrayList *x, ArrayList *y, BC_Pixmap *pixmap = 0); @@ -570,6 +576,7 @@ private: int allocate_color_table(); int init_gc(); int init_fonts(); + void init_glyphs(); void init_xft(); void init_im(); void finit_im(); @@ -583,7 +590,7 @@ private: XFontSet get_fontset(int font); XFontSet get_curr_fontset(void); void set_fontset(int font); - int dispatch_event(XEvent *event); + int dispatch_event(); int get_key_masks(unsigned int key_state); @@ -725,7 +732,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.