1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk1/dnd.cpp
3 // Purpose: wxDropTarget class
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
13 #if wxUSE_DRAG_AND_DROP
22 #include "wx/window.h"
23 #include "wx/gdicmn.h"
26 #include "wx/gtk1/private.h"
28 #include <gdk/gdkprivate.h>
30 #include <gtk/gtkdnd.h>
31 #include <gtk/gtkselection.h>
33 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
37 extern void wxapp_install_idle_handler();
40 //-----------------------------------------------------------------------------
42 //-----------------------------------------------------------------------------
47 //----------------------------------------------------------------------------
49 //----------------------------------------------------------------------------
51 extern bool g_blockEventsOnDrag
;
53 // the flags used for the last DoDragDrop()
54 static long gs_flagsForDrag
= 0;
56 // the trace mask we use with wxLogTrace() - call
57 // wxLog::AddTraceMask(TRACE_DND) to enable the trace messages from here
58 // (there are quite a few of them, so don't enable this by default)
59 static const wxChar
*TRACE_DND
= _T("dnd");
61 extern GdkEvent
*g_lastMouseEvent
;
63 extern int g_lastButtonNumber
;
65 //----------------------------------------------------------------------------
67 //----------------------------------------------------------------------------
69 /* Copyright (c) Julian Smart */
70 static const char * page_xpm
[] = {
71 /* columns rows colors chars-per-pixel */
120 " 56477<<<<8<<9&:X ",
121 " 59642%&*=-;<09&:5 ",
122 " 5q9642%&*=-<<<<<# ",
123 " 5qqw777<<<<<88:>+ ",
124 " erqq9642%&*=t;::+ ",
125 " eyrqq9642%&*=t;:O ",
126 " eyywwww777<<<<t;O ",
127 " e0yyrqq9642%&*=to ",
128 " e00yyrqq9642%&*=o ",
129 " eu0wwwwwww777<&*X ",
130 " euu00yyrqq9642%&X ",
131 " eiuu00yyrqq9642%X ",
132 " eiiwwwwwwwwww742$ ",
133 " eiiiuu00yyrqq964$ ",
134 " eiiiiuu00yyrqq96$ ",
135 " eiiiiiuu00yyrqq95 ",
136 " eiiiiiiuu00yyrqq5 ",
137 " eeeeeeeeeeeeee55e ",
146 // ============================================================================
148 // ============================================================================
150 // ----------------------------------------------------------------------------
151 // convert between GTK+ and wxWidgets DND constants
152 // ----------------------------------------------------------------------------
154 static wxDragResult
ConvertFromGTK(long action
)
158 case GDK_ACTION_COPY
:
161 case GDK_ACTION_LINK
:
164 case GDK_ACTION_MOVE
:
171 // ----------------------------------------------------------------------------
173 // ----------------------------------------------------------------------------
176 static void target_drag_leave( GtkWidget
*WXUNUSED(widget
),
177 GdkDragContext
*context
,
178 guint
WXUNUSED(time
),
179 wxDropTarget
*drop_target
)
181 if (g_isIdle
) wxapp_install_idle_handler();
183 /* inform the wxDropTarget about the current GdkDragContext.
184 this is only valid for the duration of this call */
185 drop_target
->SetDragContext( context
);
187 /* we don't need return values. this event is just for
189 drop_target
->OnLeave();
191 /* this has to be done because GDK has no "drag_enter" event */
192 drop_target
->m_firstMotion
= true;
194 /* after this, invalidate the drop_target's GdkDragContext */
195 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
199 // ----------------------------------------------------------------------------
201 // ----------------------------------------------------------------------------
204 static gboolean
target_drag_motion( GtkWidget
*WXUNUSED(widget
),
205 GdkDragContext
*context
,
209 wxDropTarget
*drop_target
)
211 if (g_isIdle
) wxapp_install_idle_handler();
213 /* Owen Taylor: "if the coordinates not in a drop zone,
214 return FALSE, otherwise call gtk_drag_status() and
217 /* inform the wxDropTarget about the current GdkDragContext.
218 this is only valid for the duration of this call */
219 drop_target
->SetDragContext( context
);
221 // GTK+ always supposes that we want to copy the data by default while we
222 // might want to move it, so examine not only suggested_action - which is
223 // only good if we don't have our own preferences - but also the actions
226 if (drop_target
->GetDefaultAction() == wxDragNone
)
228 // use default action set by wxDropSource::DoDragDrop()
229 if ( (gs_flagsForDrag
& wxDrag_DefaultMove
) == wxDrag_DefaultMove
&&
230 (context
->actions
& GDK_ACTION_MOVE
) )
232 // move is requested by the program and allowed by GTK+ - do it, even
233 // though suggested_action may be currently wxDragCopy
236 else // use whatever GTK+ says we should
238 result
= ConvertFromGTK(context
->suggested_action
);
240 if ( (result
== wxDragMove
) && !(gs_flagsForDrag
& wxDrag_AllowMove
) )
242 // we're requested to move but we can't
247 else if (drop_target
->GetDefaultAction() == wxDragMove
&&
248 (context
->actions
& GDK_ACTION_MOVE
))
254 if (context
->actions
& GDK_ACTION_COPY
)
256 else if (context
->actions
& GDK_ACTION_MOVE
)
262 if (drop_target
->m_firstMotion
)
264 /* the first "drag_motion" event substitutes a "drag_enter" event */
265 result
= drop_target
->OnEnter( x
, y
, result
);
269 /* give program a chance to react (i.e. to say no by returning FALSE) */
270 result
= drop_target
->OnDragOver( x
, y
, result
);
273 bool ret
= wxIsDragResultOk( result
);
276 GdkDragAction action
;
277 if (result
== wxDragCopy
)
278 action
= GDK_ACTION_COPY
;
279 else if (result
== wxDragLink
)
280 action
= GDK_ACTION_LINK
;
282 action
= GDK_ACTION_MOVE
;
284 gdk_drag_status( context
, action
, time
);
287 /* after this, invalidate the drop_target's GdkDragContext */
288 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
290 /* this has to be done because GDK has no "drag_enter" event */
291 drop_target
->m_firstMotion
= false;
297 // ----------------------------------------------------------------------------
299 // ----------------------------------------------------------------------------
302 static gboolean
target_drag_drop( GtkWidget
*widget
,
303 GdkDragContext
*context
,
307 wxDropTarget
*drop_target
)
309 if (g_isIdle
) wxapp_install_idle_handler();
311 /* Owen Taylor: "if the drop is not in a drop zone,
312 return FALSE, otherwise, if you aren't accepting
313 the drop, call gtk_drag_finish() with success == FALSE
314 otherwise call gtk_drag_data_get()" */
316 // printf( "drop.\n" );
318 /* this seems to make a difference between not accepting
319 due to wrong target area and due to wrong format. let
320 us hope that this is not required.. */
322 /* inform the wxDropTarget about the current GdkDragContext.
323 this is only valid for the duration of this call */
324 drop_target
->SetDragContext( context
);
326 /* inform the wxDropTarget about the current drag widget.
327 this is only valid for the duration of this call */
328 drop_target
->SetDragWidget( widget
);
330 /* inform the wxDropTarget about the current drag time.
331 this is only valid for the duration of this call */
332 drop_target
->SetDragTime( time
);
335 wxDragResult result = wxDragMove;
336 if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy;
339 /* reset the block here as someone might very well
340 show a dialog as a reaction to a drop and this
341 wouldn't work without events */
342 g_blockEventsOnDrag
= false;
344 bool ret
= drop_target
->OnDrop( x
, y
);
348 wxLogTrace(TRACE_DND
, wxT( "Drop target: OnDrop returned FALSE") );
350 /* cancel the whole thing */
351 gtk_drag_finish( context
,
352 FALSE
, /* no success */
353 FALSE
, /* don't delete data on dropping side */
358 wxLogTrace(TRACE_DND
, wxT( "Drop target: OnDrop returned TRUE") );
361 /* disable GUI threads */
364 GdkAtom format
= drop_target
->GetMatchingPair();
366 // this does happen somehow, see bug 555111
367 wxCHECK_MSG( format
, FALSE
, _T("no matching GdkAtom for format?") );
370 GdkDragAction action = GDK_ACTION_MOVE;
371 if (result == wxDragCopy) action == GDK_ACTION_COPY;
372 context->action = action;
374 /* this should trigger an "drag_data_received" event */
375 gtk_drag_get_data( widget
,
381 /* re-enable GUI threads */
385 /* after this, invalidate the drop_target's GdkDragContext */
386 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
388 /* after this, invalidate the drop_target's drag widget */
389 drop_target
->SetDragWidget( (GtkWidget
*) NULL
);
391 /* this has to be done because GDK has no "drag_enter" event */
392 drop_target
->m_firstMotion
= true;
398 // ----------------------------------------------------------------------------
399 // "drag_data_received"
400 // ----------------------------------------------------------------------------
403 static void target_drag_data_received( GtkWidget
*WXUNUSED(widget
),
404 GdkDragContext
*context
,
407 GtkSelectionData
*data
,
408 guint
WXUNUSED(info
),
410 wxDropTarget
*drop_target
)
412 if (g_isIdle
) wxapp_install_idle_handler();
414 /* Owen Taylor: "call gtk_drag_finish() with
417 if ((data
->length
<= 0) || (data
->format
!= 8))
419 /* negative data length and non 8-bit data format
420 qualifies for junk */
421 gtk_drag_finish (context
, FALSE
, FALSE
, time
);
426 wxLogTrace(TRACE_DND
, wxT( "Drop target: data received event") );
428 /* inform the wxDropTarget about the current GtkSelectionData.
429 this is only valid for the duration of this call */
430 drop_target
->SetDragData( data
);
432 wxDragResult result
= ConvertFromGTK(context
->action
);
434 if ( wxIsDragResultOk( drop_target
->OnData( x
, y
, result
) ) )
436 wxLogTrace(TRACE_DND
, wxT( "Drop target: OnData returned TRUE") );
438 /* tell GTK that data transfer was successful */
439 gtk_drag_finish( context
, TRUE
, FALSE
, time
);
443 wxLogTrace(TRACE_DND
, wxT( "Drop target: OnData returned FALSE") );
445 /* tell GTK that data transfer was not successful */
446 gtk_drag_finish( context
, FALSE
, FALSE
, time
);
449 /* after this, invalidate the drop_target's drag data */
450 drop_target
->SetDragData( (GtkSelectionData
*) NULL
);
454 //----------------------------------------------------------------------------
456 //----------------------------------------------------------------------------
458 wxDropTarget::wxDropTarget( wxDataObject
*data
)
459 : wxDropTargetBase( data
)
461 m_firstMotion
= true;
462 m_dragContext
= (GdkDragContext
*) NULL
;
463 m_dragWidget
= (GtkWidget
*) NULL
;
464 m_dragData
= (GtkSelectionData
*) NULL
;
468 wxDragResult
wxDropTarget::OnDragOver( wxCoord
WXUNUSED(x
),
472 // GetMatchingPair() checks for m_dataObject too, no need to do it here
474 // disable the debug message from GetMatchingPair() - there are too many
480 return (GetMatchingPair() != (GdkAtom
) 0) ? def
: wxDragNone
;
483 bool wxDropTarget::OnDrop( wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
) )
488 return (GetMatchingPair() != (GdkAtom
) 0);
491 wxDragResult
wxDropTarget::OnData( wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
),
497 if (GetMatchingPair() == (GdkAtom
) 0)
500 return GetData() ? def
: wxDragNone
;
503 GdkAtom
wxDropTarget::GetMatchingPair()
511 GList
*child
= m_dragContext
->targets
;
514 GdkAtom formatAtom
= GPOINTER_TO_INT(child
->data
);
515 wxDataFormat
format( formatAtom
);
518 wxLogTrace(TRACE_DND
, wxT("Drop target: drag has format: %s"),
519 format
.GetId().c_str());
522 if (m_dataObject
->IsSupportedFormat( format
))
531 bool wxDropTarget::GetData()
539 wxDataFormat
dragFormat( m_dragData
->target
);
541 if (!m_dataObject
->IsSupportedFormat( dragFormat
))
544 m_dataObject
->SetData( dragFormat
, (size_t)m_dragData
->length
, (const void*)m_dragData
->data
);
549 void wxDropTarget::UnregisterWidget( GtkWidget
*widget
)
551 wxCHECK_RET( widget
!= NULL
, wxT("unregister widget is NULL") );
553 gtk_drag_dest_unset( widget
);
555 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
556 GTK_SIGNAL_FUNC(target_drag_leave
), (gpointer
) this );
558 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
559 GTK_SIGNAL_FUNC(target_drag_motion
), (gpointer
) this );
561 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
562 GTK_SIGNAL_FUNC(target_drag_drop
), (gpointer
) this );
564 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
565 GTK_SIGNAL_FUNC(target_drag_data_received
), (gpointer
) this );
568 void wxDropTarget::RegisterWidget( GtkWidget
*widget
)
570 wxCHECK_RET( widget
!= NULL
, wxT("register widget is NULL") );
572 /* gtk_drag_dest_set() determines what default behaviour we'd like
573 GTK to supply. we don't want to specify out targets (=formats)
574 or actions in advance (i.e. not GTK_DEST_DEFAULT_MOTION and
575 not GTK_DEST_DEFAULT_DROP). instead we react individually to
576 "drag_motion" and "drag_drop" events. this makes it possible
577 to allow dropping on only a small area. we should set
578 GTK_DEST_DEFAULT_HIGHLIGHT as this will switch on the nice
579 highlighting if dragging over standard controls, but this
580 seems to be broken without the other two. */
582 gtk_drag_dest_set( widget
,
583 (GtkDestDefaults
) 0, /* no default behaviour */
584 (GtkTargetEntry
*) NULL
, /* we don't supply any formats here */
585 0, /* number of targets = 0 */
586 (GdkDragAction
) 0 ); /* we don't supply any actions here */
588 gtk_signal_connect( GTK_OBJECT(widget
), "drag_leave",
589 GTK_SIGNAL_FUNC(target_drag_leave
), (gpointer
) this );
591 gtk_signal_connect( GTK_OBJECT(widget
), "drag_motion",
592 GTK_SIGNAL_FUNC(target_drag_motion
), (gpointer
) this );
594 gtk_signal_connect( GTK_OBJECT(widget
), "drag_drop",
595 GTK_SIGNAL_FUNC(target_drag_drop
), (gpointer
) this );
597 gtk_signal_connect( GTK_OBJECT(widget
), "drag_data_received",
598 GTK_SIGNAL_FUNC(target_drag_data_received
), (gpointer
) this );
601 //----------------------------------------------------------------------------
603 //----------------------------------------------------------------------------
607 source_drag_data_get (GtkWidget
*WXUNUSED(widget
),
608 GdkDragContext
*WXUNUSED(context
),
609 GtkSelectionData
*selection_data
,
610 guint
WXUNUSED(info
),
611 guint
WXUNUSED(time
),
612 wxDropSource
*drop_source
)
614 if (g_isIdle
) wxapp_install_idle_handler();
616 wxDataFormat
format( selection_data
->target
);
618 wxLogTrace(TRACE_DND
, wxT("Drop source: format requested: %s"),
619 format
.GetId().c_str());
621 drop_source
->m_retValue
= wxDragCancel
;
623 wxDataObject
*data
= drop_source
->GetDataObject();
627 wxLogTrace(TRACE_DND
, wxT("Drop source: no data object") );
631 if (!data
->IsSupportedFormat(format
))
633 wxLogTrace(TRACE_DND
, wxT("Drop source: unsupported format") );
637 if (data
->GetDataSize(format
) == 0)
639 wxLogTrace(TRACE_DND
, wxT("Drop source: empty data") );
643 size_t size
= data
->GetDataSize(format
);
645 // printf( "data size: %d.\n", (int)data_size );
647 guchar
*d
= new guchar
[size
];
649 if (!data
->GetDataHere( format
, (void*)d
))
656 /* disable GUI threads */
659 gtk_selection_data_set( selection_data
,
660 selection_data
->target
,
666 /* enable GUI threads */
673 //----------------------------------------------------------------------------
674 // "drag_data_delete"
675 //----------------------------------------------------------------------------
678 static void source_drag_data_delete( GtkWidget
*WXUNUSED(widget
),
679 GdkDragContext
*context
,
680 wxDropSource
*WXUNUSED(drop_source
) )
683 wxapp_install_idle_handler();
685 // printf( "Drag source: drag_data_delete\n" );
689 //----------------------------------------------------------------------------
691 //----------------------------------------------------------------------------
694 static void source_drag_begin( GtkWidget
*WXUNUSED(widget
),
695 GdkDragContext
*WXUNUSED(context
),
696 wxDropSource
*WXUNUSED(drop_source
) )
699 wxapp_install_idle_handler();
701 // printf( "Drag source: drag_begin.\n" );
705 //----------------------------------------------------------------------------
707 //----------------------------------------------------------------------------
710 static void source_drag_end( GtkWidget
*WXUNUSED(widget
),
711 GdkDragContext
*WXUNUSED(context
),
712 wxDropSource
*drop_source
)
714 if (g_isIdle
) wxapp_install_idle_handler();
716 // printf( "Drag source: drag_end.\n" );
718 drop_source
->m_waiting
= false;
722 //-----------------------------------------------------------------------------
723 // "configure_event" from m_iconWindow
724 //-----------------------------------------------------------------------------
728 gtk_dnd_window_configure_callback( GtkWidget
*WXUNUSED(widget
), GdkEventConfigure
*WXUNUSED(event
), wxDropSource
*source
)
731 wxapp_install_idle_handler();
733 source
->GiveFeedback( ConvertFromGTK(source
->m_dragContext
->action
) );
739 //---------------------------------------------------------------------------
741 //---------------------------------------------------------------------------
743 wxDropSource::wxDropSource(wxWindow
*win
,
744 const wxIcon
&iconCopy
,
745 const wxIcon
&iconMove
,
746 const wxIcon
&iconNone
)
750 m_iconWindow
= (GtkWidget
*) NULL
;
753 m_widget
= win
->m_widget
;
754 if (win
->m_wxwindow
) m_widget
= win
->m_wxwindow
;
756 m_retValue
= wxDragCancel
;
758 SetIcons(iconCopy
, iconMove
, iconNone
);
761 wxDropSource::wxDropSource(wxDataObject
& data
,
763 const wxIcon
&iconCopy
,
764 const wxIcon
&iconMove
,
765 const wxIcon
&iconNone
)
771 m_iconWindow
= (GtkWidget
*) NULL
;
774 m_widget
= win
->m_widget
;
775 if (win
->m_wxwindow
) m_widget
= win
->m_wxwindow
;
777 m_retValue
= wxDragCancel
;
779 SetIcons(iconCopy
, iconMove
, iconNone
);
782 void wxDropSource::SetIcons(const wxIcon
&iconCopy
,
783 const wxIcon
&iconMove
,
784 const wxIcon
&iconNone
)
786 m_iconCopy
= iconCopy
;
787 m_iconMove
= iconMove
;
788 m_iconNone
= iconNone
;
790 if ( !m_iconCopy
.Ok() )
791 m_iconCopy
= wxIcon(page_xpm
);
792 if ( !m_iconMove
.Ok() )
793 m_iconMove
= m_iconCopy
;
794 if ( !m_iconNone
.Ok() )
795 m_iconNone
= m_iconCopy
;
798 wxDropSource::~wxDropSource()
802 void wxDropSource::PrepareIcon( int action
, GdkDragContext
*context
)
804 // get the right icon to display
806 if ( action
& GDK_ACTION_MOVE
)
808 else if ( action
& GDK_ACTION_COPY
)
814 if ( icon
->GetMask() )
815 mask
= icon
->GetMask()->GetBitmap();
817 mask
= (GdkBitmap
*)NULL
;
819 GdkPixmap
*pixmap
= icon
->GetPixmap();
822 gdk_window_get_size (pixmap
, &width
, &height
);
824 GdkColormap
*colormap
= gtk_widget_get_colormap( m_widget
);
825 gtk_widget_push_visual (gdk_colormap_get_visual (colormap
));
826 gtk_widget_push_colormap (colormap
);
828 m_iconWindow
= gtk_window_new (GTK_WINDOW_POPUP
);
829 gtk_widget_set_events (m_iconWindow
, GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
);
830 gtk_widget_set_app_paintable (GTK_WIDGET (m_iconWindow
), TRUE
);
832 gtk_widget_pop_visual ();
833 gtk_widget_pop_colormap ();
835 gtk_widget_set_usize (m_iconWindow
, width
, height
);
836 gtk_widget_realize (m_iconWindow
);
838 gtk_signal_connect( GTK_OBJECT(m_iconWindow
), "configure_event",
839 GTK_SIGNAL_FUNC(gtk_dnd_window_configure_callback
), (gpointer
)this );
841 gdk_window_set_back_pixmap (m_iconWindow
->window
, pixmap
, FALSE
);
844 gtk_widget_shape_combine_mask (m_iconWindow
, mask
, 0, 0);
846 gtk_drag_set_icon_widget( context
, m_iconWindow
, 0, 0 );
849 wxDragResult
wxDropSource::DoDragDrop(int flags
)
851 wxCHECK_MSG( m_data
&& m_data
->GetFormatCount(), wxDragNone
,
852 wxT("Drop source: no data") );
855 if (g_blockEventsOnDrag
)
859 g_blockEventsOnDrag
= true;
865 GtkTargetList
*target_list
= gtk_target_list_new( (GtkTargetEntry
*) NULL
, 0 );
867 wxDataFormat
*array
= new wxDataFormat
[ m_data
->GetFormatCount() ];
868 m_data
->GetAllFormats( array
);
869 size_t count
= m_data
->GetFormatCount();
870 for (size_t i
= 0; i
< count
; i
++)
872 GdkAtom atom
= array
[i
];
873 wxLogTrace(TRACE_DND
, wxT("Drop source: Supported atom %s"), gdk_atom_name( atom
));
874 gtk_target_list_add( target_list
, atom
, 0, 0 );
878 /* don't start dragging if no button is down */
879 if (g_lastButtonNumber
)
881 int action
= GDK_ACTION_COPY
;
882 if ( flags
& wxDrag_AllowMove
)
883 action
|= GDK_ACTION_MOVE
;
885 // VZ: as we already use g_blockEventsOnDrag it shouldn't be that bad
886 // to use a global to pass the flags to the drop target but I'd
887 // surely prefer a better way to do it
888 gs_flagsForDrag
= flags
;
890 GdkDragContext
*context
= gtk_drag_begin( m_widget
,
892 (GdkDragAction
)action
,
893 g_lastButtonNumber
, // number of mouse button which started drag
894 (GdkEvent
*) g_lastMouseEvent
);
896 m_dragContext
= context
;
898 PrepareIcon( action
, context
);
901 gtk_main_iteration();
903 m_retValue
= ConvertFromGTK(context
->action
);
904 if ( m_retValue
== wxDragNone
)
905 m_retValue
= wxDragCancel
;
908 g_blockEventsOnDrag
= false;
915 void wxDropSource::RegisterWindow()
917 if (!m_widget
) return;
919 gtk_signal_connect( GTK_OBJECT(m_widget
), "drag_data_get",
920 GTK_SIGNAL_FUNC (source_drag_data_get
), (gpointer
) this);
921 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_data_delete",
922 GTK_SIGNAL_FUNC (source_drag_data_delete
), (gpointer
) this );
923 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_begin",
924 GTK_SIGNAL_FUNC (source_drag_begin
), (gpointer
) this );
925 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_end",
926 GTK_SIGNAL_FUNC (source_drag_end
), (gpointer
) this );
930 void wxDropSource::UnregisterWindow()
932 if (!m_widget
) return;
934 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
935 GTK_SIGNAL_FUNC(source_drag_data_get
), (gpointer
) this );
936 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
937 GTK_SIGNAL_FUNC(source_drag_data_delete
), (gpointer
) this );
938 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
939 GTK_SIGNAL_FUNC(source_drag_begin
), (gpointer
) this );
940 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
941 GTK_SIGNAL_FUNC(source_drag_end
), (gpointer
) this );
945 // wxUSE_DRAG_AND_DROP