X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmouse_cursors.h;h=8cd98ac32c9befb51d978c503bfc8d4bfcbab340;hb=9010262bed21611f2db652d16f63e4af4380259d;hp=bf93e1ad78b396e75ca571dff788f2404ed383fb;hpb=f758ed0f4123605235dc83c70d5fdef2e8aa8947;p=ardour.git diff --git a/gtk2_ardour/mouse_cursors.h b/gtk2_ardour/mouse_cursors.h index bf93e1ad78..8cd98ac32c 100644 --- a/gtk2_ardour/mouse_cursors.h +++ b/gtk2_ardour/mouse_cursors.h @@ -30,10 +30,16 @@ class MouseCursors public: MouseCursors (); + void set_cursor_set (const std::string& name); + std::string cursor_set() const { return _cursor_set; } + Gdk::Cursor* cross_hair; + Gdk::Cursor* scissors; Gdk::Cursor* trimmer; Gdk::Cursor* right_side_trim; + Gdk::Cursor* anchored_right_side_trim; Gdk::Cursor* left_side_trim; + Gdk::Cursor* anchored_left_side_trim; Gdk::Cursor* right_side_trim_left_only; Gdk::Cursor* left_side_trim_right_only; Gdk::Cursor* fade_in; @@ -66,6 +72,24 @@ public: Gdk::Cursor* move; 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" + */ + + static bool is_invalid (Gdk::Cursor* c) { if (!_invalid) { create_invalid(); } return c == _invalid; } + static Gdk::Cursor* invalid_cursor() { if (!_invalid) { create_invalid(); } 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); + static Gdk::Cursor* _invalid; + static void create_invalid (); }; #endif /* __gtk2_ardour_mouse_cursors__ */