From f2352c6df585d817b3613145ec81446f917dcc21 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Sun, 2 Mar 2025 16:06:45 +1300 Subject: Filled holes in FLTK.Static API --- body/c_fl_static.cpp | 154 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 120 insertions(+), 34 deletions(-) (limited to 'body/c_fl_static.cpp') diff --git a/body/c_fl_static.cpp b/body/c_fl_static.cpp index 31cb3af..5dd90e2 100644 --- a/body/c_fl_static.cpp +++ b/body/c_fl_static.cpp @@ -12,16 +12,47 @@ -void fl_static_add_awake_handler(void * h, void * f) { - Fl::add_awake_handler_(reinterpret_cast(h),f); +void fl_static_box_draw_marshal(void * f, int x, int y, int w, int h, unsigned int t) { + reinterpret_cast(f)(x, y, w, h, static_cast(t)); } -void fl_static_get_awake_handler(void * &h, void * &f) { - Fl::get_awake_handler_(reinterpret_cast(h),f); + + + +const char * const fl_help_usage_string_ptr = Fl::help; + + + + +int fl_static_arg(int c, void * v, int &i) { + return Fl::arg(c, static_cast(v), i); +} + +void fl_static_args(int c, void * v) { + Fl::args(c, static_cast(v)); +} + +int fl_static_args2(int c, void * v, int &i, void * h) { + return Fl::args(c, static_cast(v), i, reinterpret_cast(h)); +} + + + + +int fl_static_add_awake_handler(void * h, void * f) { + return Fl::add_awake_handler_(reinterpret_cast(h), f); +} + +int fl_static_get_awake_handler(void * &h, void * &f) { + return Fl::get_awake_handler_(reinterpret_cast(h), f); } -void fl_static_awake() { - Fl::awake(); +int fl_static_awake2(void * h, void * f) { + return Fl::awake(reinterpret_cast(h), f); +} + +void fl_static_awake(void * msg) { + Fl::awake(msg); } void fl_static_lock() { @@ -36,52 +67,56 @@ void fl_static_unlock() { void fl_static_add_check(void * h, void * f) { - Fl::add_check(reinterpret_cast(h),f); + Fl::add_check(reinterpret_cast(h), f); } int fl_static_has_check(void * h, void * f) { - return Fl::has_check(reinterpret_cast(h),f); + return Fl::has_check(reinterpret_cast(h), f); } void fl_static_remove_check(void * h, void * f) { - Fl::remove_check(reinterpret_cast(h),f); + Fl::remove_check(reinterpret_cast(h), f); } void fl_static_add_timeout(double s, void * h, void * f) { - Fl::add_timeout(s,reinterpret_cast(h),f); + Fl::add_timeout(s, reinterpret_cast(h), f); } int fl_static_has_timeout(void * h, void * f) { - return Fl::has_timeout(reinterpret_cast(h),f); + return Fl::has_timeout(reinterpret_cast(h), f); } void fl_static_remove_timeout(void * h, void * f) { - Fl::remove_timeout(reinterpret_cast(h),f); + Fl::remove_timeout(reinterpret_cast(h), f); } void fl_static_repeat_timeout(double s, void * h, void * f) { - Fl::repeat_timeout(s,reinterpret_cast(h),f); + Fl::repeat_timeout(s, reinterpret_cast(h), f); } void fl_static_add_clipboard_notify(void * h, void * f) { - Fl::add_clipboard_notify(reinterpret_cast(h),f); + Fl::add_clipboard_notify(reinterpret_cast(h), f); +} + +void fl_static_remove_clipboard_notify(void * h) { + Fl::remove_clipboard_notify(reinterpret_cast(h)); } void fl_static_add_fd(int d, void * h, void * f) { - Fl::add_fd(d,reinterpret_cast(h),f); + Fl::add_fd(d,reinterpret_cast(h), f); } void fl_static_add_fd2(int d, int m, void * h, void * f) { - Fl::add_fd(d,m,reinterpret_cast(h),f); + Fl::add_fd(d,m,reinterpret_cast(h), f); } void fl_static_remove_fd(int d) { @@ -89,49 +124,73 @@ void fl_static_remove_fd(int d) { } void fl_static_remove_fd2(int d, int m) { - Fl::remove_fd(d,m); + Fl::remove_fd(d, m); } void fl_static_add_idle(void * h, void * f) { - Fl::add_idle(reinterpret_cast(h),f); + Fl::add_idle(reinterpret_cast(h), f); } int fl_static_has_idle(void * h, void * f) { - return Fl::has_idle(reinterpret_cast(h),f); + return Fl::has_idle(reinterpret_cast(h), f); } void fl_static_remove_idle(void * h, void * f) { - Fl::remove_idle(reinterpret_cast(h),f); + Fl::remove_idle(reinterpret_cast(h), f); } +unsigned int fl_static_get_color2(unsigned int c) { + return Fl::get_color(c); +} + void fl_static_get_color(unsigned int c, unsigned char &r, unsigned char &g, unsigned char &b) { - Fl::get_color(c,r,g,b); + Fl::get_color(c, r, g, b); +} + +void fl_static_set_color2(unsigned int t, unsigned int f) { + Fl::set_color(t, f); } void fl_static_set_color(unsigned int c, unsigned char r, unsigned char g, unsigned char b) { - Fl::set_color(c,r,g,b); + Fl::set_color(c, r, g, b); } void fl_static_free_color(unsigned int c, int b) { - Fl::free_color(c,b); + Fl::free_color(c, b); +} + +unsigned int fl_static_get_box_color(unsigned int t) { + return Fl::box_color(static_cast(t)); +} + +void fl_static_set_box_color(unsigned int t) { + Fl::set_box_color(static_cast(t)); +} + +void fl_static_own_colormap() { + Fl::own_colormap(); } void fl_static_foreground(unsigned int r, unsigned int g, unsigned int b) { - Fl::foreground(r,g,b); + Fl::foreground(r, g, b); } void fl_static_background(unsigned int r, unsigned int g, unsigned int b) { - Fl::background(r,g,b); + Fl::background(r, g, b); } void fl_static_background2(unsigned int r, unsigned int g, unsigned int b) { - Fl::background2(r,g,b); + Fl::background2(r, g, b); +} + +void fl_static_get_system_colors() { + Fl::get_system_colors(); } @@ -146,7 +205,11 @@ const char * fl_static_get_font_name(int f) { } void fl_static_set_font(int t, int f) { - Fl::set_font(t,f); + Fl::set_font(static_cast(t), static_cast(f)); +} + +void fl_static_set_font2(int t, char * s) { + Fl::set_font(static_cast(t), s); } int fl_static_get_font_sizes(int f, int * &a) { @@ -180,10 +243,20 @@ int fl_static_box_dy(int b) { return Fl::box_dy(static_cast(b)); } +void * fl_static_get_boxtype(int t) { + return reinterpret_cast(Fl::get_boxtype(static_cast(t))); +} + void fl_static_set_boxtype(int t, int f) { Fl::set_boxtype(static_cast(t),static_cast(f)); } +void fl_static_set_boxtype2(int t, void * f, + unsigned char dx, unsigned char dy, unsigned char dw, unsigned char dh) +{ + Fl::set_boxtype(static_cast(t), reinterpret_cast(f), dx, dy, dw, dh); +} + int fl_static_draw_box_active() { return Fl::draw_box_active(); } @@ -191,8 +264,16 @@ int fl_static_draw_box_active() { +void fl_static_set_labeltype(int k, void * d, void * m) { + Fl::set_labeltype(static_cast(k), + reinterpret_cast(d), reinterpret_cast(m)); +} + + + + void fl_static_copy(const char * t, int l, int k) { - Fl::copy(t,l,k); + Fl::copy(t, l, k); } void fl_static_paste(void * r, int s) { @@ -205,11 +286,15 @@ void fl_static_selection(void * o, char * t, int l) { Fl::selection(ref, t, l); } +int fl_static_clipboard_contains(const char * k) { + return Fl::clipboard_contains(k); +} + -void fl_static_dnd() { - Fl::dnd(); +int fl_static_dnd() { + return Fl::dnd(); } int fl_static_get_dnd_text_ops() { @@ -234,8 +319,8 @@ void fl_static_disable_im() { -void fl_static_default_atclose(void * w) { - Fl::default_atclose(static_cast(w), 0); +void fl_static_default_atclose(void * w, void * u) { + Fl::default_atclose(static_cast(w), u); } void * fl_static_get_first_window() { @@ -277,6 +362,7 @@ int fl_static_is_scheme(const char *n) { } void fl_static_reload_scheme() { + // this always returns 1 for some reason so we can ignore the return value Fl::reload_scheme(); } @@ -284,11 +370,11 @@ void fl_static_reload_scheme() { int fl_static_get_option(int o) { - return Fl::option(static_cast(o)); + return Fl::option(static_cast(o)) ? 1 : 0; } void fl_static_set_option(int o, int t) { - Fl::option(static_cast(o),t); + Fl::option(static_cast(o), t!=0); } -- cgit