Add some convenient public editor methods (for lua-bindings)
[ardour.git] / gtk2_ardour / mouse_cursors.h
1 /*
2     Copyright (C) 2000-2010 Paul Davis
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __gtk2_ardour_mouse_cursors__
21 #define __gtk2_ardour_mouse_cursors__
22
23 /** @file Handling of bitmaps to be used for mouse cursors.
24  *
25  *  Held centrally by the Editor because some cursors are used in several places.
26  */
27
28 class MouseCursors
29 {
30 public:
31         MouseCursors ();
32         ~MouseCursors ();
33
34         void set_cursor_set (const std::string& name);
35         std::string cursor_set() const { return _cursor_set; }
36
37         Gdk::Cursor* cross_hair;
38         Gdk::Cursor* scissors;
39         Gdk::Cursor* trimmer;
40         Gdk::Cursor* right_side_trim;
41         Gdk::Cursor* anchored_right_side_trim;
42         Gdk::Cursor* left_side_trim;
43         Gdk::Cursor* anchored_left_side_trim;
44         Gdk::Cursor* right_side_trim_left_only;
45         Gdk::Cursor* left_side_trim_right_only;
46         Gdk::Cursor* fade_in;
47         Gdk::Cursor* fade_out;
48         Gdk::Cursor* selector;
49         Gdk::Cursor* grabber;
50         Gdk::Cursor* grabber_note;
51         Gdk::Cursor* grabber_edit_point;
52         Gdk::Cursor* zoom_in;
53         Gdk::Cursor* zoom_out;
54         Gdk::Cursor* time_fx;
55         Gdk::Cursor* fader;
56         Gdk::Cursor* speaker;
57         Gdk::Cursor* midi_pencil;
58         Gdk::Cursor* midi_select;
59         Gdk::Cursor* midi_resize;
60         Gdk::Cursor* midi_erase;
61         Gdk::Cursor* up_down;
62         Gdk::Cursor* wait;
63         Gdk::Cursor* timebar;
64         Gdk::Cursor* transparent;
65         Gdk::Cursor* resize_left;
66         Gdk::Cursor* resize_top_left;
67         Gdk::Cursor* resize_top;
68         Gdk::Cursor* resize_top_right;
69         Gdk::Cursor* resize_right;
70         Gdk::Cursor* resize_bottom_right;
71         Gdk::Cursor* resize_bottom;
72         Gdk::Cursor* resize_bottom_left;
73         Gdk::Cursor* move;
74         Gdk::Cursor* expand_left_right;
75         Gdk::Cursor* expand_up_down;
76
77         /* This cursor is not intended to be used directly, it just
78            serves as an out-of-bounds value when we need to indicate
79            "no cursor". NULL/0 doesn't work for this, because it
80            is actually a valid value for a Gdk::Cursor - it indicates
81            "use the parent window's cursor"
82         */
83
84         static bool is_invalid (Gdk::Cursor* c) { if (!_invalid) { create_invalid(); } return c == _invalid; }
85         static Gdk::Cursor* invalid_cursor() { if (!_invalid) { create_invalid(); } return _invalid; }
86
87     private:
88         std::string _cursor_set;
89         void drop_all ();
90
91         Gdk::Cursor* make_cursor (const char* name, int hotspot_x = 0, int hotspot_y = 0);
92         static Gdk::Cursor* _invalid;
93         static void create_invalid ();
94 };
95
96 #endif /* __gtk2_ardour_mouse_cursors__ */