diff --git a/fltk b/fltk index 1f5472a..214b133 160000 --- a/fltk +++ b/fltk @@ -1 +1 @@ -Subproject commit 1f5472a7d37af7909c1daa37bb5aee7296df170a +Subproject commit 214b133298f4a1b31e9b6ab89392fcd574fa6691 diff --git a/include/cfl_macros.h b/include/cfl_macros.h index 02b8516..104e68a 100644 --- a/include/cfl_macros.h +++ b/include/cfl_macros.h @@ -102,6 +102,7 @@ typedef void (*custom_draw_callback)(Fl_Widget *, void *); void widget##_set_deletion_callback( \ widget *self, void (*)(Fl_Widget *, void *), void *data); \ widget *widget##_from_dyn_ptr(Fl_Widget *ptr); \ + widget *widget##_from_derived_dyn_ptr(Fl_Widget *ptr); \ void widget##_super_draw(Fl_Widget *ptr, int flag); \ void widget##_super_draw_first(Fl_Widget *ptr, int flag); @@ -406,6 +407,9 @@ typedef void (*custom_draw_callback)(Fl_Widget *, void *); widget *widget##_from_dyn_ptr(Fl_Widget *ptr) { \ return widget##_Derived::from_dyn_ptr(ptr); \ } \ + widget *widget##_from_derived_dyn_ptr(Fl_Widget *ptr) { \ + return widget##_Derived::from_derived_dyn_ptr(ptr); \ + } \ void widget##_super_draw(Fl_Widget *self, int flag) { \ ((widget##_Derived *)self)->super_draw = flag; \ } \ diff --git a/include/cfl_widget.hpp b/include/cfl_widget.hpp index 49e091d..c2f585f 100644 --- a/include/cfl_widget.hpp +++ b/include/cfl_widget.hpp @@ -53,6 +53,10 @@ struct Widget_Derived : public T { return dynamic_cast(ptr); } + static Widget_Derived *from_derived_dyn_ptr(Fl_Widget *ptr) { + return dynamic_cast(ptr); + } + void widget_resize(int x, int y, int w, int h) { Fl_Widget::resize(x, y, w, h); this->redraw();