From 49f2a539cdc77b504ddef00162625531b659c767 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Mon, 6 Jan 2025 23:46:40 +1300 Subject: Revised Browser subhierarchy, mostly protected method bindings --- src/c_fl_select_browser.cpp | 122 +++++++------------------------------------- 1 file changed, 18 insertions(+), 104 deletions(-) (limited to 'src/c_fl_select_browser.cpp') diff --git a/src/c_fl_select_browser.cpp b/src/c_fl_select_browser.cpp index ef1a671..78e7412 100644 --- a/src/c_fl_select_browser.cpp +++ b/src/c_fl_select_browser.cpp @@ -55,29 +55,11 @@ public: friend const char * fl_select_browser_item_text(SELECTBROWSER b, void * item); friend void fl_select_browser_item_draw(SELECTBROWSER b, void * item, int x, int y, int w, int h); - friend int fl_select_browser_lineno(SELECTBROWSER b, void * item); - - friend void * fl_select_browser_selection(SELECTBROWSER c); - friend int fl_select_browser_displayed2(SELECTBROWSER c, void * i); - friend void * fl_select_browser_find_item(SELECTBROWSER c, int y); - friend void * fl_select_browser_top(SELECTBROWSER c); - - friend void fl_select_browser_bbox(SELECTBROWSER c, int &x, int &y, int &w, int &h); - friend int fl_select_browser_leftedge(SELECTBROWSER c); - friend void fl_select_browser_redraw_line(SELECTBROWSER c, void * i); - friend void fl_select_browser_redraw_lines(SELECTBROWSER c); - friend int fl_select_browser_full_width(SELECTBROWSER c); friend int fl_select_browser_full_height(SELECTBROWSER c); friend int fl_select_browser_incr_height(SELECTBROWSER c); friend int fl_select_browser_item_quick_height(SELECTBROWSER c, void * i); - friend void fl_select_browser_new_list(SELECTBROWSER b); - friend void fl_select_browser_inserting(SELECTBROWSER b, void * a1, void * a2); - friend void fl_select_browser_deleting(SELECTBROWSER b, void * item); - friend void fl_select_browser_replacing(SELECTBROWSER b, void * a1, void * a2); - friend void fl_select_browser_swapping(SELECTBROWSER b, void * a1, void * a2); - friend void fl_select_browser_draw(SELECTBROWSER b); int handle(int e); @@ -199,152 +181,84 @@ void free_fl_select_browser(SELECTBROWSER b) { // These have to be reimplemented due to relying on custom class extensions int fl_select_browser_full_height(SELECTBROWSER c) { - return reinterpret_cast(c)->Fl_Browser::full_height(); + return reinterpret_cast(c)->Fl_Select_Browser::full_height(); } int fl_select_browser_incr_height(SELECTBROWSER c) { - return reinterpret_cast(c)->Fl_Browser::incr_height(); + return reinterpret_cast(c)->Fl_Select_Browser::incr_height(); } int fl_select_browser_item_width(SELECTBROWSER b, void * item) { - return reinterpret_cast(b)->item_width(item); + return reinterpret_cast(b)->Fl_Select_Browser::item_width(item); } int fl_select_browser_item_height(SELECTBROWSER b, void * item) { - return reinterpret_cast(b)->item_height(item); + return reinterpret_cast(b)->Fl_Select_Browser::item_height(item); } void * fl_select_browser_item_first(SELECTBROWSER b) { - return reinterpret_cast(b)->item_first(); + return reinterpret_cast(b)->Fl_Select_Browser::item_first(); } void * fl_select_browser_item_last(SELECTBROWSER b) { - return reinterpret_cast(b)->item_last(); + return reinterpret_cast(b)->Fl_Select_Browser::item_last(); } void * fl_select_browser_item_next(SELECTBROWSER b, void * item) { - return reinterpret_cast(b)->item_next(item); + return reinterpret_cast(b)->Fl_Select_Browser::item_next(item); } void * fl_select_browser_item_prev(SELECTBROWSER b, void * item) { - return reinterpret_cast(b)->item_prev(item); + return reinterpret_cast(b)->Fl_Select_Browser::item_prev(item); } void * fl_select_browser_item_at(SELECTBROWSER b, int index) { - return reinterpret_cast(b)->item_at(index); + return reinterpret_cast(b)->Fl_Select_Browser::item_at(index); } void fl_select_browser_item_select(SELECTBROWSER b, void * item, int val) { - reinterpret_cast(b)->item_select(item, val); + reinterpret_cast(b)->Fl_Select_Browser::item_select(item, val); } int fl_select_browser_item_selected(SELECTBROWSER b, void * item) { - return reinterpret_cast(b)->item_selected(item); + return reinterpret_cast(b)->Fl_Select_Browser::item_selected(item); } void fl_select_browser_item_swap(SELECTBROWSER b, void * x, void * y) { - reinterpret_cast(b)->item_swap(x, y); + reinterpret_cast(b)->Fl_Select_Browser::item_swap(x, y); } const char * fl_select_browser_item_text(SELECTBROWSER b, void * item) { - return reinterpret_cast(b)->item_text(item); + return reinterpret_cast(b)->Fl_Select_Browser::item_text(item); } void fl_select_browser_item_draw(SELECTBROWSER b, void * item, int x, int y, int w, int h) { - reinterpret_cast(b)->item_draw(item, x, y, w, h); -} - - - - -int fl_select_browser_lineno(SELECTBROWSER b, void * item) { - return reinterpret_cast(b)->lineno(item); -} - - - - -void * fl_select_browser_selection(SELECTBROWSER c) { - return reinterpret_cast(c)->selection(); -} - -int fl_select_browser_displayed2(SELECTBROWSER c, void * i) { - return reinterpret_cast(c)->Fl_Browser_::displayed(i); -} - -void * fl_select_browser_find_item(SELECTBROWSER c, int y) { - return reinterpret_cast(c)->find_item(y); -} - -void * fl_select_browser_top(SELECTBROWSER c) { - return reinterpret_cast(c)->top(); -} - - - - -void fl_select_browser_bbox(SELECTBROWSER c, int &x, int &y, int &w, int &h) { - reinterpret_cast(c)->bbox(x, y, w, h); -} - -int fl_select_browser_leftedge(SELECTBROWSER c) { - return reinterpret_cast(c)->leftedge(); -} - -void fl_select_browser_redraw_line(SELECTBROWSER c, void * i) { - reinterpret_cast(c)->redraw_line(i); -} - -void fl_select_browser_redraw_lines(SELECTBROWSER c) { - reinterpret_cast(c)->redraw_lines(); + reinterpret_cast(b)->Fl_Select_Browser::item_draw(item, x, y, w, h); } int fl_select_browser_full_width(SELECTBROWSER c) { - return reinterpret_cast(c)->Fl_Browser::full_width(); + return reinterpret_cast(c)->Fl_Select_Browser::full_width(); } int fl_select_browser_item_quick_height(SELECTBROWSER c, void * i) { - return reinterpret_cast(c)->Fl_Browser::item_quick_height(i); -} - - - - -void fl_select_browser_new_list(SELECTBROWSER b) { - reinterpret_cast(b)->new_list(); -} - -void fl_select_browser_inserting(SELECTBROWSER b, void * a1, void * a2) { - reinterpret_cast(b)->inserting(a1, a2); -} - -void fl_select_browser_deleting(SELECTBROWSER b, void * item) { - reinterpret_cast(b)->deleting(item); -} - -void fl_select_browser_replacing(SELECTBROWSER b, void * a1, void * a2) { - reinterpret_cast(b)->replacing(a1, a2); -} - -void fl_select_browser_swapping(SELECTBROWSER b, void * a1, void * a2) { - reinterpret_cast(b)->swapping(a1, a2); + return reinterpret_cast(c)->Fl_Select_Browser::item_quick_height(i); } void fl_select_browser_draw(SELECTBROWSER b) { - reinterpret_cast(b)->Fl_Browser::draw(); + reinterpret_cast(b)->Fl_Select_Browser::draw(); } int fl_select_browser_handle(SELECTBROWSER b, int e) { - return reinterpret_cast(b)->Fl_Browser::handle(e); + return reinterpret_cast(b)->Fl_Select_Browser::handle(e); } -- cgit