Ardour  9.0-pre0-582-g084a23a80d
mouse_cursors.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2014-2017 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef __gtk2_ardour_mouse_cursors__
21 #define __gtk2_ardour_mouse_cursors__
22 
29 #include <gdkmm/cursor.h>
30 
31 #include <string>
32 
34 {
35 public:
38 
39  void set_cursor_set (const std::string& name);
40  std::string cursor_set() const { return _cursor_set; }
41 
43 
81 
82  /* This cursor is not intended to be used directly, it just
83  serves as an out-of-bounds value when we need to indicate
84  "no cursor". NULL/0 doesn't work for this, because it
85  is actually a valid value for a Gdk::Cursor - it indicates
86  "use the parent window's cursor"
87  */
88 
89  static bool is_invalid (Gdk::Cursor* c) { if (!_invalid) { create_invalid(); } return c == _invalid; }
90  static Gdk::Cursor* invalid_cursor() { if (!_invalid) { create_invalid(); } return _invalid; }
91 
92  private:
93  std::vector<Gdk::Cursor*> cursors;
94  std::string _cursor_set;
95  void drop_all ();
96 
97  Gdk::Cursor* make_cursor (const char* name, int hotspot_x = 0, int hotspot_y = 0);
99  static void create_invalid ();
100 };
101 
102 #endif /* __gtk2_ardour_mouse_cursors__ */
Gdk::Cursor * right_side_trim
Definition: mouse_cursors.h:47
Gdk::Cursor * midi_resize
Definition: mouse_cursors.h:64
Gdk::Cursor * resize_bottom_left
Definition: mouse_cursors.h:77
Gdk::Cursor * cross_hair
Definition: mouse_cursors.h:44
static void create_invalid()
Gdk::Cursor * transparent
Definition: mouse_cursors.h:69
Gdk::Cursor * fader
Definition: mouse_cursors.h:61
Gdk::Cursor * fade_in
Definition: mouse_cursors.h:53
Gdk::Cursor * left_side_trim
Definition: mouse_cursors.h:49
Gdk::Cursor * grabber
Definition: mouse_cursors.h:56
Gdk::Cursor * anchored_left_side_trim
Definition: mouse_cursors.h:50
Gdk::Cursor * resize_top_left
Definition: mouse_cursors.h:71
Gdk::Cursor * resize_top_right
Definition: mouse_cursors.h:73
Gdk::Cursor * left_side_trim_right_only
Definition: mouse_cursors.h:52
Gdk::Cursor * midi_pencil
Definition: mouse_cursors.h:62
Gdk::Cursor * resize_bottom_right
Definition: mouse_cursors.h:75
void set_cursor_set(const std::string &name)
Gdk::Cursor * wait
Definition: mouse_cursors.h:67
Gdk::Cursor * zoom_out
Definition: mouse_cursors.h:59
Gdk::Cursor * expand_up_down
Definition: mouse_cursors.h:80
Gdk::Cursor * zoom_in
Definition: mouse_cursors.h:58
std::string cursor_set() const
Definition: mouse_cursors.h:40
Gdk::Cursor * resize_right
Definition: mouse_cursors.h:74
Gdk::Cursor * scissors
Definition: mouse_cursors.h:45
Gdk::Cursor * anchored_right_side_trim
Definition: mouse_cursors.h:48
Gdk::Cursor * expand_left_right
Definition: mouse_cursors.h:79
Gdk::Cursor * resize_left
Definition: mouse_cursors.h:70
void drop_all()
Gdk::Cursor * grabber_note
Definition: mouse_cursors.h:57
Gdk::Cursor * make_cursor(const char *name, int hotspot_x=0, int hotspot_y=0)
Gdk::Cursor * from_gdk_cursor(GdkCursor *)
Gdk::Cursor * fade_out
Definition: mouse_cursors.h:54
std::vector< Gdk::Cursor * > cursors
Definition: mouse_cursors.h:93
Gdk::Cursor * midi_erase
Definition: mouse_cursors.h:65
Gdk::Cursor * resize_top
Definition: mouse_cursors.h:72
Gdk::Cursor * timebar
Definition: mouse_cursors.h:68
static bool is_invalid(Gdk::Cursor *c)
Definition: mouse_cursors.h:89
static Gdk::Cursor * _invalid
Definition: mouse_cursors.h:98
std::string _cursor_set
Definition: mouse_cursors.h:94
Gdk::Cursor * midi_select
Definition: mouse_cursors.h:63
Gdk::Cursor * selector
Definition: mouse_cursors.h:55
Gdk::Cursor * up_down
Definition: mouse_cursors.h:66
Gdk::Cursor * resize_bottom
Definition: mouse_cursors.h:76
Gdk::Cursor * move
Definition: mouse_cursors.h:78
Gdk::Cursor * time_fx
Definition: mouse_cursors.h:60
Gdk::Cursor * trimmer
Definition: mouse_cursors.h:46
static Gdk::Cursor * invalid_cursor()
Definition: mouse_cursors.h:90
Gdk::Cursor * right_side_trim_left_only
Definition: mouse_cursors.h:51
GtkImageIconNameData name
Definition: gtkimage.h:6