Reenable the correct sort column and type when redisplaying regions
[ardour.git] / gtk2_ardour / mouse_cursors.cc
index e8b168630e3229289068d29420ec23d8d43fd51f..31247511ed38cd11dccf88f961be2451e9f31a3d 100644 (file)
@@ -1,21 +1,22 @@
 /*
-    Copyright (C) 2000-2010 Paul Davis
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
+ * Copyright (C) 2010-2012 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2012-2015 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2014-2017 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
 
 #include <gdkmm/cursor.h>
 
@@ -27,6 +28,8 @@
 
 using namespace ARDOUR_UI_UTILS;
 
+Gdk::Cursor* MouseCursors::_invalid = 0;
+
 MouseCursors::MouseCursors ()
        : cross_hair (0)
        , scissors (0)
@@ -42,7 +45,6 @@ MouseCursors::MouseCursors ()
        , selector (0)
        , grabber (0)
        , grabber_note (0)
-       , grabber_edit_point (0)
        , zoom_in (0)
        , zoom_out (0)
        , time_fx (0)
@@ -70,6 +72,11 @@ MouseCursors::MouseCursors ()
 {
 }
 
+MouseCursors::~MouseCursors ()
+{
+       drop_all ();
+}
+
 void
 MouseCursors::drop_all ()
 {
@@ -87,7 +94,6 @@ MouseCursors::drop_all ()
        delete selector; selector = 0;
        delete grabber; grabber = 0;
        delete grabber_note; grabber_note = 0;
-       delete grabber_edit_point; grabber_edit_point = 0;
        delete zoom_in; zoom_in = 0;
        delete zoom_out; zoom_out = 0;
        delete time_fx; time_fx = 0;
@@ -135,6 +141,7 @@ MouseCursors::set_cursor_set (const std::string& name)
        using namespace Gdk;
 
        drop_all ();
+       Gtkmm2ext::CursorInfo::drop_cursor_info();
        _cursor_set = name;
 
        std::string hotspot_info_path = get_icon_path ("hotspots", _cursor_set, false);
@@ -144,8 +151,8 @@ MouseCursors::set_cursor_set (const std::string& name)
        }
 
        /* these will throw exceptions if their images cannot be found.
-          
-          the default hotspot coordinates will be overridden by any 
+
+          the default hotspot coordinates will be overridden by any
           data found by Gtkmm2ext::Cursors::load_cursor_info(). the values
           here from the set of cursors used by Ardour; new cursor/icon
           sets should come with a hotspot info file.
@@ -156,7 +163,6 @@ MouseCursors::set_cursor_set (const std::string& name)
        scissors = make_cursor ("scissors", 5, 0);
        grabber = make_cursor ("grabber", 5, 0);
        grabber_note = make_cursor ("grabber_note", 5, 10);
-       grabber_edit_point = make_cursor ("grabber_edit_point", 5, 17);
        left_side_trim = make_cursor ("trim_left_cursor", 5, 11);
        anchored_left_side_trim = make_cursor ("anchored_trim_left_cursor", 5, 11);
        right_side_trim = make_cursor ("trim_right_cursor", 23, 11);
@@ -211,3 +217,12 @@ MouseCursors::set_cursor_set (const std::string& name)
        midi_erase = new Cursor (DRAPED_BOX);
        up_down = new Cursor (SB_V_DOUBLE_ARROW);
 }
+
+void
+MouseCursors::create_invalid()
+{
+       char pix[4] = { 0, 0, 0, 0 };
+       Glib::RefPtr<Gdk::Bitmap> bits = Gdk::Bitmap::create (pix, 2, 2);
+       Gdk::Color c;
+       _invalid = new Gdk::Cursor (bits, bits, c, c, 0, 0);
+}