merge with master
[ardour.git] / libs / gtkmm2ext / gtkmm2ext / dndvbox.h
index 2f09779e710ef858a584fdbab7643cc4cb1a559b..232b5b50a7597f4bd4d51940f20a260fef98773c 100644 (file)
 */
 
 #include <gtkmm/box.h>
+
+#include "gtkmm2ext/visibility.h"
 #include "gtkmm2ext/widget_state.h"
 
 namespace Gtkmm2ext {
 
 /** Parent class for children of a DnDVBox */  
-class DnDVBoxChild
+class LIBGTKMM2EXT_API DnDVBoxChild
 {
 public:
        virtual ~DnDVBoxChild () {}
@@ -43,7 +45,7 @@ public:
 
 /** A VBox whose contents can be dragged and dropped */
 template <class T>
-class DnDVBox : public Gtk::EventBox
+class LIBGTKMM2EXT_API DnDVBox : public Gtk::EventBox
 {
 public:
        DnDVBox () : _active (0), _drag_icon (0), _expecting_unwanted_button_event (false), _placeholder (0)
@@ -57,8 +59,8 @@ public:
                        Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK
                        );
 
-               signal_button_press_event().connect (bind (mem_fun (*this, &DnDVBox::button_press), (T *) 0));
-               signal_button_release_event().connect (bind (mem_fun (*this, &DnDVBox::button_release), (T *) 0));
+               signal_button_press_event().connect (sigc::bind (mem_fun (*this, &DnDVBox::button_press), (T *) 0));
+               signal_button_release_event().connect (sigc::bind (mem_fun (*this, &DnDVBox::button_release), (T *) 0));
                signal_drag_motion().connect (mem_fun (*this, &DnDVBox::drag_motion));
                signal_drag_leave().connect (mem_fun (*this, &DnDVBox::drag_leave));
 
@@ -296,7 +298,7 @@ private:
                /* make up an icon for the drag */
                _drag_icon = new Gtk::Window (Gtk::WINDOW_POPUP);
                
-               Gtk::Allocation a = child->widget().get_allocation ();
+               Gtk::Allocation a = child->action_widget().get_allocation ();
                _drag_icon->set_size_request (a.get_width(), a.get_height());
                
                _drag_icon->signal_expose_event().connect (sigc::mem_fun (*this, &DnDVBox::icon_expose));
@@ -326,7 +328,7 @@ private:
 
                cairo_t* cr = gdk_cairo_create (_drag_icon->get_window()->gobj ());
 
-               Glib::RefPtr<Gdk::Pixmap> p = _drag_child->widget().get_snapshot();
+               Glib::RefPtr<Gdk::Pixmap> p = _drag_child->action_widget().get_snapshot();
                gdk_cairo_set_source_pixmap (cr, p->gobj(), 0, 0);
                cairo_rectangle (cr, 0, 0, w, h);
                cairo_fill (cr);
@@ -351,7 +353,7 @@ private:
 
                        /* dropped from ourselves onto ourselves */
 
-                       T* child = *((T **) selection_data.get_data());
+                       T* child = *((T * const *) selection_data.get_data());
 
                        if (drop.first == 0) {
                                _internal_vbox.reorder_child (child->widget(), -1);
@@ -571,8 +573,9 @@ private:
        {
                typename std::list<T*>::iterator x = find (_selection.begin(), _selection.end(), child);
                if (x != _selection.end()) {
+                       T* c = *x;
                        _selection.erase (x);
-                       setup_child_state (*x);
+                       setup_child_state (c);
                }
        }