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 23 /** @file mouse_cursors.h 24 * Handling of bitmaps to be used for mouse cursors. 25 * 26 * Held centrally by the Editor because some cursors are used in several places. 27 */ 28 29 class MouseCursors 30 { 31 public: 32 MouseCursors (); 33 ~MouseCursors (); 34 35 void set_cursor_set (const std::string& name); cursor_set()36 std::string cursor_set() const { return _cursor_set; } 37 38 Gdk::Cursor* cross_hair; 39 Gdk::Cursor* scissors; 40 Gdk::Cursor* trimmer; 41 Gdk::Cursor* right_side_trim; 42 Gdk::Cursor* anchored_right_side_trim; 43 Gdk::Cursor* left_side_trim; 44 Gdk::Cursor* anchored_left_side_trim; 45 Gdk::Cursor* right_side_trim_left_only; 46 Gdk::Cursor* left_side_trim_right_only; 47 Gdk::Cursor* fade_in; 48 Gdk::Cursor* fade_out; 49 Gdk::Cursor* selector; 50 Gdk::Cursor* grabber; 51 Gdk::Cursor* grabber_note; 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 is_invalid(Gdk::Cursor * c)84 static bool is_invalid (Gdk::Cursor* c) { if (!_invalid) { create_invalid(); } return c == _invalid; } invalid_cursor()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__ */ 97