diff options
author | Robin Gareus <robin@gareus.org> | 2017-02-17 18:26:30 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-02-17 18:58:11 +0100 |
commit | 3b8348f0099134aeded08cc797b2c7a1efb76507 (patch) | |
tree | 10550f2d2b62bdc5d10d6cf1a1b3cfae89837b7e /gtk2_ardour/ardour_button.h | |
parent | 22d676c7b6141700cb8470128dc75710fa2fba01 (diff) |
Implement icon-render callback in ArdourButton
Diffstat (limited to 'gtk2_ardour/ardour_button.h')
-rw-r--r-- | gtk2_ardour/ardour_button.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk2_ardour/ardour_button.h b/gtk2_ardour/ardour_button.h index a659c1ec85..1ad6306ae1 100644 --- a/gtk2_ardour/ardour_button.h +++ b/gtk2_ardour/ardour_button.h @@ -41,9 +41,12 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable unused = 0x10, Menu = 0x20, Inactive = 0x40, // no _action is defined AND state is not used - VectorIcon = 0x80, // tentative, see commit message + VectorIcon = 0x80, + IconRenderCallback = 0x100, }; + typedef void (* rendercallback_t) (cairo_t*, int, int, uint32_t, void*); + static Element default_elements; static Element led_default_elements; static Element just_led_default_elements; @@ -75,6 +78,7 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable Gtkmm2ext::ArdourIcon::Icon icon() const { return _icon; } void set_icon (Gtkmm2ext::ArdourIcon::Icon); + void set_icon (rendercallback_t, void*); void set_corner_radius (float); @@ -147,6 +151,8 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable bool _markup; Element _elements; Gtkmm2ext::ArdourIcon::Icon _icon; + rendercallback_t _icon_render_cb; + void* _icon_render_cb_data; Tweaks _tweaks; BindingProxy binding_proxy; |