summaryrefslogtreecommitdiff
path: root/gtk2_ardour/mouse_cursors.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-01-23 15:15:29 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2015-01-23 15:19:36 -0500
commit90c1e0ffd284f0383073a63c5b2b83208c4f49d9 (patch)
tree594647be1eeb1fe60708d513d788bf823061b9c9 /gtk2_ardour/mouse_cursors.h
parentfe08965d91b9dd8a71604118e4d967d624e87f03 (diff)
allow use of null pointer as a valid cursor (implies using cursor of parent window)
Diffstat (limited to 'gtk2_ardour/mouse_cursors.h')
-rw-r--r--gtk2_ardour/mouse_cursors.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk2_ardour/mouse_cursors.h b/gtk2_ardour/mouse_cursors.h
index 6c5c94b5e9..756b2657d9 100644
--- a/gtk2_ardour/mouse_cursors.h
+++ b/gtk2_ardour/mouse_cursors.h
@@ -73,11 +73,22 @@ public:
Gdk::Cursor* expand_left_right;
Gdk::Cursor* expand_up_down;
+ /* This cursor is not intended to be used directly, it just
+ serves as an out-of-bounds value when we need to indicate
+ "no cursor". NULL/0 doesn't work for this, because it
+ is actually a valid value for a Gdk::Cursor - it indicates
+ "use the parent window's cursor"
+ */
+
+ bool is_invalid (Gdk::Cursor* c) const { return c == _invalid; }
+ Gdk::Cursor* invalid_cursor() const { return _invalid; }
+
private:
std::string _cursor_set;
void drop_all ();
Gdk::Cursor* make_cursor (const char* name, int hotspot_x = 0, int hotspot_y = 0);
+ Gdk::Cursor* _invalid;
};
#endif /* __gtk2_ardour_mouse_cursors__ */