fix crash when copy'ing latent plugins
[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
33         void set_cursor_set (const std::string& name);
34         std::string cursor_set() const { return _cursor_set; }
35
36         Gdk::Cursor* cross_hair;
37         Gdk::Cursor* scissors;
38         Gdk::Cursor* trimmer;
39         Gdk::Cursor* right_side_trim;
40         Gdk::Cursor* anchored_right_side_trim;
41         Gdk::Cursor* left_side_trim;
42         Gdk::Cursor* anchored_left_side_trim;
43         Gdk::Cursor* right_side_trim_left_only;
44         Gdk::Cursor* left_side_trim_right_only;
45         Gdk::Cursor* fade_in;
46         Gdk::Cursor* fade_out;
47         Gdk::Cursor* selector;
48         Gdk::Cursor* grabber;
49         Gdk::Cursor* grabber_note;
50         Gdk::Cursor* grabber_edit_point;
51         Gdk::Cursor* zoom_in;
52         Gdk::Cursor* zoom_out;
53         Gdk::Cursor* time_fx;
54         Gdk::Cursor* fader;
55         Gdk::Cursor* speaker;
56         Gdk::Cursor* midi_pencil;
57         Gdk::Cursor* midi_select;
58         Gdk::Cursor* midi_resize;
59         Gdk::Cursor* midi_erase;
60         Gdk::Cursor* up_down;
61         Gdk::Cursor* wait;
62         Gdk::Cursor* timebar;
63         Gdk::Cursor* transparent;
64         Gdk::Cursor* resize_left;
65         Gdk::Cursor* resize_top_left;
66         Gdk::Cursor* resize_top;
67         Gdk::Cursor* resize_top_right;
68         Gdk::Cursor* resize_right;
69         Gdk::Cursor* resize_bottom_right;
70         Gdk::Cursor* resize_bottom;
71         Gdk::Cursor* resize_bottom_left;
72         Gdk::Cursor* move;
73         Gdk::Cursor* expand_left_right;
74         Gdk::Cursor* expand_up_down;
75
76         /* This cursor is not intended to be used directly, it just
77            serves as an out-of-bounds value when we need to indicate
78            "no cursor". NULL/0 doesn't work for this, because it
79            is actually a valid value for a Gdk::Cursor - it indicates
80            "use the parent window's cursor"
81         */
82
83         static bool is_invalid (Gdk::Cursor* c) { if (!_invalid) { create_invalid(); } return c == _invalid; }
84         static Gdk::Cursor* invalid_cursor() { if (!_invalid) { create_invalid(); } return _invalid; }
85
86     private:
87         std::string _cursor_set;
88         void drop_all ();
89
90         Gdk::Cursor* make_cursor (const char* name, int hotspot_x = 0, int hotspot_y = 0);
91         static Gdk::Cursor* _invalid;
92         static void create_invalid ();
93 };
94
95 #endif /* __gtk2_ardour_mouse_cursors__ */