+typedef uint32_t wchr_t;
+
+static inline size_t wstrlen(const wchr_t *s)
+{
+ size_t len = 0;
+ while( s[len] ) ++len;
+ return len;
+}
+
+static inline wchr_t *wstrncpy(wchr_t *dest, const wchr_t *src, size_t n)
+{
+ for( wchr_t *dp=dest; n>0 && (*dp++=*src++); --n );
+ return dest;
+}
+
+
virtual int selection_clear_event() { return 0; }
// Only if opengl is enabled
virtual int expose_event() { return 0; };
virtual int selection_clear_event() { return 0; }
// Only if opengl is enabled
virtual int expose_event() { return 0; };
-// 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);
int get_opengl_server_version();
int flash(int x, int y, int w, int h, int flush = 1);
BC_MenuBar* add_menubar(BC_MenuBar *menu_bar);
BC_WindowBase* add_subwindow(BC_WindowBase *subwindow);
BC_MenuBar* add_menubar(BC_MenuBar *menu_bar);
BC_WindowBase* add_subwindow(BC_WindowBase *subwindow);
int get_text_descent(int font);
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_descent(int font);
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);
+ int get_text_width(int font, const wchr_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);
void draw_text_line(int x, int y, const char *text, int len, BC_Pixmap *pixmap = 0);
void draw_xft_text(int x, int y, const char *text, int len,
BC_Pixmap *pixmap = 0, int is_utf8 = 0);
void draw_text_line(int x, int y, const char *text, int len, BC_Pixmap *pixmap = 0);
void draw_xft_text(int x, int y, const char *text, int len,
BC_Pixmap *pixmap = 0, int is_utf8 = 0);
- void draw_xft_text(int x, int y, const wchar_t *text,
+ void draw_xft_text(int x, int y, const wchr_t *text,
int length, BC_Pixmap *pixmap);
int draw_single_text(int draw, int font,
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);
+ int x, int y, const wchr_t *text, int length = -1, BC_Pixmap *pixmap = 0);
void draw_center_text(int x, int y, const char *text, int length = -1);
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_line(int x1, int y1, int x2, int y2, BC_Pixmap *pixmap = 0);
void draw_polygon(ArrayList<int> *x, ArrayList<int> *y, BC_Pixmap *pixmap = 0);
void fill_polygon(ArrayList<int> *x, ArrayList<int> *y, BC_Pixmap *pixmap = 0);
void draw_rectangle(int x, int y, int w, int h);
void draw_polygon(ArrayList<int> *x, ArrayList<int> *y, BC_Pixmap *pixmap = 0);
void fill_polygon(ArrayList<int> *x, ArrayList<int> *y, BC_Pixmap *pixmap = 0);
void draw_rectangle(int x, int y, int w, int h);
void slide_down(int distance);
void flicker(int n=3, int ms=66);
void focus();
void slide_down(int distance);
void flicker(int n=3, int ms=66);
void focus();
int show_tooltip(int w=-1, int h=-1) { return show_tooltip(0, -1, -1, w, h); }
int hide_tooltip();
int set_icon(VFrame *data);
int show_tooltip(int w=-1, int h=-1) { return show_tooltip(0, -1, -1, w, h); }
int hide_tooltip();
int set_icon(VFrame *data);
Cursor create_grab_cursor();
// Get width of a single line. Used by get_text_width
int get_single_text_width(int font, const char *text, int length);
Cursor create_grab_cursor();
// Get width of a single line. Used by get_text_width
int get_single_text_width(int font, const char *text, int length);
XFontSet get_fontset(int font);
XFontSet get_curr_fontset(void);
void set_fontset(int font);
XFontSet get_fontset(int font);
XFontSet get_curr_fontset(void);
void set_fontset(int font);