-}
-
-wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
-{
- if (gdk_dnd.dnd_grabbed) return (wxDragResult) wxDragNone;
- if (gdk_dnd.drag_really) return (wxDragResult) wxDragNone;
-
- wxASSERT_MSG( m_data, "wxDragSource: no data" );
-
- if (!m_data) return (wxDragResult) wxDragNone;
-
- static GtkWidget *drag_icon = (GtkWidget*) NULL;
- static GtkWidget *drop_icon = (GtkWidget*) NULL;
-
- GdkPoint hotspot_1 = {0,-5 };
-
- if (!drag_icon)
- {
- drag_icon = shape_create_icon ( m_stopIcon,
- 440, 140, 0,0, GTK_WINDOW_POPUP);
-
- gtk_signal_connect (GTK_OBJECT (drag_icon), "destroy",
- GTK_SIGNAL_FUNC(gtk_widget_destroyed),
- &drag_icon);
-
- gtk_widget_hide (drag_icon);
- }
-
- GdkPoint hotspot_2 = {-5,-5};
-
- if (!drop_icon)
- {
- drop_icon = shape_create_icon ( m_goIcon,
- 440, 140, 0,0, GTK_WINDOW_POPUP);
-
- gtk_signal_connect (GTK_OBJECT (drop_icon), "destroy",
- GTK_SIGNAL_FUNC(gtk_widget_destroyed),
- &drop_icon);
-
- gtk_widget_hide (drop_icon);
- }
-
-
- gdk_dnd_set_drag_shape( drag_icon->window,
- &hotspot_1,
- drop_icon->window,
- &hotspot_2);
-
-
- GdkWindowPrivate *wp = (GdkWindowPrivate*) m_widget->window;
-
- RegisterWindow();
-
- gdk_dnd.drag_perhaps = TRUE;
-
- gdk_dnd.dnd_drag_start.x = 5;
- gdk_dnd.dnd_drag_start.y = 5;
- gdk_dnd.real_sw = wp;
-
- if (gdk_dnd.drag_startwindows)
- {
- g_free( gdk_dnd.drag_startwindows );
- gdk_dnd.drag_startwindows = (GdkWindow **) NULL;
- }
- gdk_dnd.drag_numwindows = gdk_dnd.drag_really = 0;
-
- XWindowAttributes dnd_winattr;
- XGetWindowAttributes( gdk_display, wp->xwindow, &dnd_winattr );
- wp->dnd_drag_savedeventmask = dnd_winattr.your_event_mask;
-
- gdk_dnd_drag_addwindow( m_widget->window );
-
- GdkEventDragBegin ev;
- ev.type = GDK_DRAG_BEGIN;
- ev.window = m_widget->window;
- ev.u.allflags = 0;
- ev.u.flags.protocol_version = DND_PROTOCOL_VERSION;
-
- gdk_event_put( (GdkEvent*)&ev );
-
- XGrabPointer( gdk_display, wp->xwindow, False,
- ButtonMotionMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
- GrabModeAsync, GrabModeAsync, gdk_root_window, None, CurrentTime );
-
- gdk_dnd_set_drag_cursors( m_defaultCursor.GetCursor(), m_goaheadCursor.GetCursor() );
-
- gdk_dnd.dnd_grabbed = TRUE;
- gdk_dnd.drag_really = 1;
-
- int x = 0;
- int y = 0;
- wxGetMousePosition( &x, &y );
-
- gdk_dnd_display_drag_cursor( x, y, FALSE, TRUE );
-
- gs_currentDropSource = this;
-
- while (gdk_dnd.drag_really || gdk_dnd.drag_perhaps) wxYield();
-
- gs_currentDropSource = (wxDropSource*) NULL;
-
- UnregisterWindow();
-
- g_blockEventsOnDrag = FALSE;
-
- return m_retValue;
-}