1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDropTarget class
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
11 #pragma implementation "dnd.h"
16 #if wxUSE_DRAG_AND_DROP
18 #include "wx/window.h"
20 #include "wx/gdicmn.h"
26 #include <gdk/gdkprivate.h>
28 #include <gtk/gtkdnd.h>
29 #include <gtk/gtkselection.h>
31 //-----------------------------------------------------------------------------
33 //-----------------------------------------------------------------------------
35 extern void wxapp_install_idle_handler();
38 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
43 extern void wxapp_install_thread_wakeup();
44 extern void wxapp_uninstall_thread_wakeup();
47 //----------------------------------------------------------------------------
49 //----------------------------------------------------------------------------
51 extern bool g_blockEventsOnDrag
;
53 //----------------------------------------------------------------------------
55 //----------------------------------------------------------------------------
58 static char * page_xpm
[] = {
59 /* width height ncolors chars_per_pixel */
68 " ................... ",
69 " .XXXXXXXXXXXXXXXXX.. ",
70 " .XXXXXXXXXXXXXXXXX.o. ",
71 " .XXXXXXXXXXXXXXXXX.oo. ",
72 " .XXXXXXXXXXXXXXXXX.ooo. ",
73 " .XXXXXXXXXXXXXXXXX.oooo. ",
74 " .XXXXXXXXXXXXXXXXX....... ",
75 " .XXXXXOOOOOOOOOOXXXooooo. ",
76 " .XXXXXXXXXXXXXXXXXXooooo. ",
77 " .XXXXXOOOOOOOOOOXXXXXXXX. ",
78 " .XXXXXXXXXXXXXXXXXXXXXXX. ",
79 " .XXXXXXXOOOOOOOOOXXXXXXX. ",
80 " .XXXXXXXXXXXXXXXXXXXXXXX. ",
81 " .XXXXXXOOOOOOOOOOXXXXXXX. ",
82 " .XXXXXXXXXXXXXXXXXXXXXXX. ",
83 " .XXXXXOOOOOOOOOOXXXXXXXX. ",
84 " .XXXXXXXXXXXXXXXXXXXXXXX. ",
85 " .XXXXXXXOOOOOOOOOXXXXXXX. ",
86 " .XXXXXXXXXXXXXXXXXXXXXXX. ",
87 " .XXXXXXOOOOOOOOOOXXXXXXX. ",
88 " .XXXXXXXXXXXXXXXXXXXXXXX. ",
89 " .XXXXXOOOOOOOOOOXXXXXXXX. ",
90 " .XXXXXXXXXXXXXXXXXXXXXXX. ",
91 " .XXXXXXOOOOOOOOOOXXXXXXX. ",
92 " .XXXXXXXXXXXXXXXXXXXXXXX. ",
93 " .XXXXXOOOOOOOXXXXXXXXXXX. ",
94 " .XXXXXXXXXXXXXXXXXXXXXXX. ",
95 " .XXXXXXXXXXXXXXXXXXXXXXX. ",
96 " .XXXXXXXXXXXXXXXXXXXXXXX. ",
97 " .XXXXXXXXXXXXXXXXXXXXXXX. ",
98 " .XXXXXXXXXXXXXXXXXXXXXXX. ",
99 " ......................... "};
103 // ----------------------------------------------------------------------------
105 // ----------------------------------------------------------------------------
107 static void target_drag_leave( GtkWidget
*WXUNUSED(widget
),
108 GdkDragContext
*context
,
109 guint
WXUNUSED(time
),
110 wxDropTarget
*drop_target
)
112 if (g_isIdle
) wxapp_install_idle_handler();
114 /* inform the wxDropTarget about the current GdkDragContext.
115 this is only valid for the duration of this call */
116 drop_target
->SetDragContext( context
);
118 /* we don't need return values. this event is just for
120 drop_target
->OnLeave();
122 /* this has to be done because GDK has no "drag_enter" event */
123 drop_target
->m_firstMotion
= TRUE
;
125 /* after this, invalidate the drop_target's GdkDragContext */
126 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
129 // ----------------------------------------------------------------------------
131 // ----------------------------------------------------------------------------
133 static gboolean
target_drag_motion( GtkWidget
*WXUNUSED(widget
),
134 GdkDragContext
*context
,
138 wxDropTarget
*drop_target
)
140 if (g_isIdle
) wxapp_install_idle_handler();
142 /* Owen Taylor: "if the coordinates not in a drop zone,
143 return FALSE, otherwise call gtk_drag_status() and
146 /* inform the wxDropTarget about the current GdkDragContext.
147 this is only valid for the duration of this call */
148 drop_target
->SetDragContext( context
);
151 if ( context
->suggested_action
== GDK_ACTION_COPY
)
156 if (drop_target
->m_firstMotion
)
158 /* the first "drag_motion" event substitutes a "drag_enter" event */
159 result
= drop_target
->OnEnter( x
, y
, result
);
163 /* give program a chance to react (i.e. to say no by returning FALSE) */
164 result
= drop_target
->OnDragOver( x
, y
, result
);
167 bool ret
= wxIsDragResultOk( result
);
170 GdkDragAction action
;
171 if (result
== wxDragCopy
)
172 action
= GDK_ACTION_COPY
;
174 action
= GDK_ACTION_MOVE
;
176 gdk_drag_status( context
, action
, time
);
179 /* after this, invalidate the drop_target's GdkDragContext */
180 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
182 /* this has to be done because GDK has no "drag_enter" event */
183 drop_target
->m_firstMotion
= FALSE
;
188 // ----------------------------------------------------------------------------
190 // ----------------------------------------------------------------------------
192 static gboolean
target_drag_drop( GtkWidget
*widget
,
193 GdkDragContext
*context
,
197 wxDropTarget
*drop_target
)
199 if (g_isIdle
) wxapp_install_idle_handler();
201 /* Owen Taylor: "if the drop is not in a drop zone,
202 return FALSE, otherwise, if you aren't accepting
203 the drop, call gtk_drag_finish() with success == FALSE
204 otherwise call gtk_drag_data_get()" */
206 // printf( "drop.\n" );
208 /* this seems to make a difference between not accepting
209 due to wrong target area and due to wrong format. let
210 us hope that this is not required.. */
212 /* inform the wxDropTarget about the current GdkDragContext.
213 this is only valid for the duration of this call */
214 drop_target
->SetDragContext( context
);
216 /* inform the wxDropTarget about the current drag widget.
217 this is only valid for the duration of this call */
218 drop_target
->SetDragWidget( widget
);
220 /* inform the wxDropTarget about the current drag time.
221 this is only valid for the duration of this call */
222 drop_target
->SetDragTime( time
);
225 wxDragResult result = wxDragMove;
226 if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy;
229 /* reset the block here as someone might very well
230 show a dialog as a reaction to a drop and this
231 wouldn't work without events */
232 g_blockEventsOnDrag
= FALSE
;
234 bool ret
= drop_target
->OnDrop( x
, y
);
238 wxLogDebug( wxT( "Drop target: OnDrop returned FALSE") );
240 /* cancel the whole thing */
241 gtk_drag_finish( context
,
242 FALSE
, /* no success */
243 FALSE
, /* don't delete data on dropping side */
248 wxLogDebug( wxT( "Drop target: OnDrop returned TRUE") );
251 /* disable GUI threads */
252 wxapp_uninstall_thread_wakeup();
255 GdkAtom format
= drop_target
->GetMatchingPair();
259 GdkDragAction action = GDK_ACTION_MOVE;
260 if (result == wxDragCopy) action == GDK_ACTION_COPY;
261 context->action = action;
263 /* this should trigger an "drag_data_received" event */
264 gtk_drag_get_data( widget
,
270 /* re-enable GUI threads */
271 wxapp_install_thread_wakeup();
275 /* after this, invalidate the drop_target's GdkDragContext */
276 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
278 /* after this, invalidate the drop_target's drag widget */
279 drop_target
->SetDragWidget( (GtkWidget
*) NULL
);
281 /* this has to be done because GDK has no "drag_enter" event */
282 drop_target
->m_firstMotion
= TRUE
;
287 // ----------------------------------------------------------------------------
288 // "drag_data_received"
289 // ----------------------------------------------------------------------------
291 static void target_drag_data_received( GtkWidget
*WXUNUSED(widget
),
292 GdkDragContext
*context
,
295 GtkSelectionData
*data
,
296 guint
WXUNUSED(info
),
298 wxDropTarget
*drop_target
)
300 if (g_isIdle
) wxapp_install_idle_handler();
302 /* Owen Taylor: "call gtk_drag_finish() with
305 if ((data
->length
<= 0) || (data
->format
!= 8))
307 /* negative data length and non 8-bit data format
308 qualifies for junk */
309 gtk_drag_finish (context
, FALSE
, FALSE
, time
);
314 wxLogDebug( wxT( "Drop target: data received event") );
316 /* inform the wxDropTarget about the current GtkSelectionData.
317 this is only valid for the duration of this call */
318 drop_target
->SetDragData( data
);
321 if ( context
->suggested_action
== GDK_ACTION_COPY
)
326 if ( wxIsDragResultOk( drop_target
->OnData( x
, y
, result
) ) )
328 wxLogDebug( wxT( "Drop target: OnData returned TRUE") );
330 /* tell GTK that data transfer was successfull */
331 gtk_drag_finish( context
, TRUE
, FALSE
, time
);
335 wxLogDebug( wxT( "Drop target: OnData returned FALSE") );
337 /* tell GTK that data transfer was not successfull */
338 gtk_drag_finish( context
, FALSE
, FALSE
, time
);
341 /* after this, invalidate the drop_target's drag data */
342 drop_target
->SetDragData( (GtkSelectionData
*) NULL
);
345 //----------------------------------------------------------------------------
347 //----------------------------------------------------------------------------
349 wxDropTarget::wxDropTarget( wxDataObject
*data
)
350 : wxDropTargetBase( data
)
352 m_firstMotion
= TRUE
;
353 m_dragContext
= (GdkDragContext
*) NULL
;
354 m_dragWidget
= (GtkWidget
*) NULL
;
355 m_dragData
= (GtkSelectionData
*) NULL
;
359 wxDragResult
wxDropTarget::OnDragOver( wxCoord
WXUNUSED(x
),
363 // GetMatchingPair() checks for m_dataObject too, no need to do it here
365 // disable the debug message from GetMatchingPair() - there are too many
371 return (GetMatchingPair() != (GdkAtom
) 0) ? def
: wxDragNone
;
374 bool wxDropTarget::OnDrop( wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
) )
379 return (GetMatchingPair() != (GdkAtom
) 0);
382 wxDragResult
wxDropTarget::OnData( wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
),
388 if (GetMatchingPair() == (GdkAtom
) 0)
391 return GetData() ? def
: wxDragNone
;
394 GdkAtom
wxDropTarget::GetMatchingPair()
402 GList
*child
= m_dragContext
->targets
;
405 GdkAtom formatAtom
= (GdkAtom
) GPOINTER_TO_INT(child
->data
);
406 wxDataFormat
format( formatAtom
);
409 wxLogDebug( wxT("Drop target: drag has format: %s"), format
.GetId().c_str() );
412 if (m_dataObject
->IsSupportedFormat( format
))
421 bool wxDropTarget::GetData()
429 wxDataFormat
dragFormat( m_dragData
->target
);
431 if (!m_dataObject
->IsSupportedFormat( dragFormat
))
434 m_dataObject
->SetData( dragFormat
, (size_t)m_dragData
->length
, (const void*)m_dragData
->data
);
439 void wxDropTarget::UnregisterWidget( GtkWidget
*widget
)
441 wxCHECK_RET( widget
!= NULL
, wxT("unregister widget is NULL") );
443 gtk_drag_dest_unset( widget
);
445 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
446 GTK_SIGNAL_FUNC(target_drag_leave
), (gpointer
) this );
448 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
449 GTK_SIGNAL_FUNC(target_drag_motion
), (gpointer
) this );
451 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
452 GTK_SIGNAL_FUNC(target_drag_drop
), (gpointer
) this );
454 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
455 GTK_SIGNAL_FUNC(target_drag_data_received
), (gpointer
) this );
458 void wxDropTarget::RegisterWidget( GtkWidget
*widget
)
460 wxCHECK_RET( widget
!= NULL
, wxT("register widget is NULL") );
462 /* gtk_drag_dest_set() determines what default behaviour we'd like
463 GTK to supply. we don't want to specify out targets (=formats)
464 or actions in advance (i.e. not GTK_DEST_DEFAULT_MOTION and
465 not GTK_DEST_DEFAULT_DROP). instead we react individually to
466 "drag_motion" and "drag_drop" events. this makes it possible
467 to allow dropping on only a small area. we should set
468 GTK_DEST_DEFAULT_HIGHLIGHT as this will switch on the nice
469 highlighting if dragging over standard controls, but this
470 seems to be broken without the other two. */
472 gtk_drag_dest_set( widget
,
473 (GtkDestDefaults
) 0, /* no default behaviour */
474 (GtkTargetEntry
*) NULL
, /* we don't supply any formats here */
475 0, /* number of targets = 0 */
476 (GdkDragAction
) 0 ); /* we don't supply any actions here */
478 gtk_signal_connect( GTK_OBJECT(widget
), "drag_leave",
479 GTK_SIGNAL_FUNC(target_drag_leave
), (gpointer
) this );
481 gtk_signal_connect( GTK_OBJECT(widget
), "drag_motion",
482 GTK_SIGNAL_FUNC(target_drag_motion
), (gpointer
) this );
484 gtk_signal_connect( GTK_OBJECT(widget
), "drag_drop",
485 GTK_SIGNAL_FUNC(target_drag_drop
), (gpointer
) this );
487 gtk_signal_connect( GTK_OBJECT(widget
), "drag_data_received",
488 GTK_SIGNAL_FUNC(target_drag_data_received
), (gpointer
) this );
491 //----------------------------------------------------------------------------
493 //----------------------------------------------------------------------------
496 source_drag_data_get (GtkWidget
*WXUNUSED(widget
),
497 GdkDragContext
*WXUNUSED(context
),
498 GtkSelectionData
*selection_data
,
499 guint
WXUNUSED(info
),
500 guint
WXUNUSED(time
),
501 wxDropSource
*drop_source
)
503 if (g_isIdle
) wxapp_install_idle_handler();
505 wxDataFormat
format( selection_data
->target
);
507 wxLogDebug( wxT("Drop source: format requested: %s"), format
.GetId().c_str() );
509 drop_source
->m_retValue
= wxDragCancel
;
511 wxDataObject
*data
= drop_source
->GetDataObject();
515 wxLogDebug( wxT("Drop source: no data object") );
519 if (!data
->IsSupportedFormat(format
))
521 wxLogDebug( wxT("Drop source: unsupported format") );
525 if (data
->GetDataSize(format
) == 0)
527 wxLogDebug( wxT("Drop source: empty data") );
531 size_t size
= data
->GetDataSize(format
);
533 // printf( "data size: %d.\n", (int)data_size );
535 guchar
*d
= new guchar
[size
];
537 if (!data
->GetDataHere( format
, (void*)d
))
544 /* disable GUI threads */
545 wxapp_uninstall_thread_wakeup();
548 gtk_selection_data_set( selection_data
,
549 selection_data
->target
,
555 /* enable GUI threads */
556 wxapp_install_thread_wakeup();
562 //----------------------------------------------------------------------------
563 // "drag_data_delete"
564 //----------------------------------------------------------------------------
566 static void source_drag_data_delete( GtkWidget
*WXUNUSED(widget
),
567 GdkDragContext
*WXUNUSED(context
),
568 wxDropSource
*WXUNUSED(drop_source
) )
571 wxapp_install_idle_handler();
573 // printf( "Drag source: drag_data_delete\n" );
576 //----------------------------------------------------------------------------
578 //----------------------------------------------------------------------------
580 static void source_drag_begin( GtkWidget
*WXUNUSED(widget
),
581 GdkDragContext
*WXUNUSED(context
),
582 wxDropSource
*WXUNUSED(drop_source
) )
585 wxapp_install_idle_handler();
587 // printf( "Drag source: drag_begin.\n" );
590 //----------------------------------------------------------------------------
592 //----------------------------------------------------------------------------
594 static void source_drag_end( GtkWidget
*WXUNUSED(widget
),
595 GdkDragContext
*WXUNUSED(context
),
596 wxDropSource
*drop_source
)
598 if (g_isIdle
) wxapp_install_idle_handler();
600 // printf( "Drag source: drag_end.\n" );
602 drop_source
->m_waiting
= FALSE
;
605 //-----------------------------------------------------------------------------
606 // "configure_event" from m_iconWindow
607 //-----------------------------------------------------------------------------
610 gtk_dnd_window_configure_callback( GtkWidget
*WXUNUSED(widget
), GdkEventConfigure
*WXUNUSED(event
), wxDropSource
*source
)
613 wxapp_install_idle_handler();
615 wxDragResult action
= wxDragNone
;
616 if (source
->m_dragContext
->action
== GDK_ACTION_COPY
) action
= wxDragCopy
;
617 if (source
->m_dragContext
->action
== GDK_ACTION_MOVE
) action
= wxDragMove
;
619 source
->GiveFeedback( action
);
624 //---------------------------------------------------------------------------
626 //---------------------------------------------------------------------------
628 wxDropSource::wxDropSource(wxWindow
*win
,
629 const wxIcon
&iconCopy
,
630 const wxIcon
&iconMove
,
631 const wxIcon
&iconNone
)
635 m_iconWindow
= (GtkWidget
*) NULL
;
638 m_widget
= win
->m_widget
;
639 if (win
->m_wxwindow
) m_widget
= win
->m_wxwindow
;
641 m_retValue
= wxDragCancel
;
643 SetIcons(iconCopy
, iconMove
, iconNone
);
646 wxDropSource::wxDropSource(wxDataObject
& data
,
648 const wxIcon
&iconCopy
,
649 const wxIcon
&iconMove
,
650 const wxIcon
&iconNone
)
656 m_iconWindow
= (GtkWidget
*) NULL
;
659 m_widget
= win
->m_widget
;
660 if (win
->m_wxwindow
) m_widget
= win
->m_wxwindow
;
662 m_retValue
= wxDragCancel
;
664 SetIcons(iconCopy
, iconMove
, iconNone
);
667 void wxDropSource::SetIcons(const wxIcon
&iconCopy
,
668 const wxIcon
&iconMove
,
669 const wxIcon
&iconNone
)
671 m_iconCopy
= iconCopy
;
672 m_iconMove
= iconMove
;
673 m_iconNone
= iconNone
;
675 if ( !m_iconCopy
.Ok() )
676 m_iconCopy
= wxIcon(page_xpm
);
677 if ( !m_iconMove
.Ok() )
678 m_iconMove
= m_iconCopy
;
679 if ( !m_iconNone
.Ok() )
680 m_iconNone
= m_iconCopy
;
683 wxDropSource::~wxDropSource()
687 void wxDropSource::PrepareIcon( int action
, GdkDragContext
*context
)
689 // get the right icon to display
691 if ( action
& GDK_ACTION_MOVE
)
693 else if ( action
& GDK_ACTION_COPY
)
699 if ( icon
->GetMask() )
700 mask
= icon
->GetMask()->GetBitmap();
702 mask
= (GdkBitmap
*)NULL
;
704 GdkPixmap
*pixmap
= icon
->GetPixmap();
707 gdk_window_get_size (pixmap
, &width
, &height
);
709 GdkColormap
*colormap
= gtk_widget_get_colormap( m_widget
);
711 gtk_widget_push_visual (gdk_colormap_get_visual (colormap
));
713 gtk_widget_push_colormap (colormap
);
715 m_iconWindow
= gtk_window_new (GTK_WINDOW_POPUP
);
716 gtk_widget_set_events (m_iconWindow
, GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
);
717 gtk_widget_set_app_paintable (GTK_WIDGET (m_iconWindow
), TRUE
);
720 gtk_widget_pop_visual ();
722 gtk_widget_pop_colormap ();
724 gtk_widget_set_usize (m_iconWindow
, width
, height
);
725 gtk_widget_realize (m_iconWindow
);
727 gtk_signal_connect( GTK_OBJECT(m_iconWindow
), "configure_event",
728 GTK_SIGNAL_FUNC(gtk_dnd_window_configure_callback
), (gpointer
)this );
730 gdk_window_set_back_pixmap (m_iconWindow
->window
, pixmap
, FALSE
);
733 gtk_widget_shape_combine_mask (m_iconWindow
, mask
, 0, 0);
735 gtk_drag_set_icon_widget( context
, m_iconWindow
, 0, 0 );
738 wxDragResult
wxDropSource::DoDragDrop( bool allowMove
)
740 wxASSERT_MSG( m_data
, wxT("Drop source: no data") );
743 return (wxDragResult
) wxDragNone
;
745 if (m_data
->GetFormatCount() == 0)
746 return (wxDragResult
) wxDragNone
;
749 if (g_blockEventsOnDrag
)
750 return (wxDragResult
) wxDragNone
;
753 g_blockEventsOnDrag
= TRUE
;
759 GtkTargetList
*target_list
= gtk_target_list_new( (GtkTargetEntry
*) NULL
, 0 );
761 wxDataFormat
*array
= new wxDataFormat
[ m_data
->GetFormatCount() ];
762 m_data
->GetAllFormats( array
);
763 for (size_t i
= 0; i
< m_data
->GetFormatCount(); i
++)
765 GdkAtom atom
= array
[i
];
766 wxLogDebug( wxT("Drop source: Supported atom %s"), gdk_atom_name( atom
) );
767 gtk_target_list_add( target_list
, atom
, 0, 0 );
771 GdkEventMotion event
;
772 event
.window
= m_widget
->window
;
775 GdkModifierType state
;
776 gdk_window_get_pointer( event
.window
, &x
, &y
, &state
);
780 event
.time
= (guint32
)GDK_CURRENT_TIME
;
782 /* GTK wants to know which button was pressed which caused the dragging */
783 int button_number
= 0;
784 if (event
.state
& GDK_BUTTON1_MASK
) button_number
= 1;
785 else if (event
.state
& GDK_BUTTON2_MASK
) button_number
= 2;
786 else if (event
.state
& GDK_BUTTON3_MASK
) button_number
= 3;
789 /* disable GUI threads */
790 wxapp_uninstall_thread_wakeup();
793 /* don't start dragging if no button is down */
796 GdkDragAction action
= GDK_ACTION_COPY
;
797 if (allowMove
) action
= (GdkDragAction
)(GDK_ACTION_MOVE
|GDK_ACTION_COPY
);
798 GdkDragContext
*context
= gtk_drag_begin( m_widget
,
801 button_number
, /* number of mouse button which started drag */
802 (GdkEvent
*) &event
);
804 m_dragContext
= context
;
806 PrepareIcon( action
, context
);
808 while (m_waiting
) gtk_main_iteration();
810 if (context
->action
== GDK_ACTION_COPY
)
811 m_retValue
= wxDragCopy
;
812 if (context
->action
== GDK_ACTION_MOVE
)
813 m_retValue
= wxDragMove
;
817 /* re-enable GUI threads */
818 wxapp_install_thread_wakeup();
821 g_blockEventsOnDrag
= FALSE
;
828 void wxDropSource::RegisterWindow()
830 if (!m_widget
) return;
832 gtk_signal_connect( GTK_OBJECT(m_widget
), "drag_data_get",
833 GTK_SIGNAL_FUNC (source_drag_data_get
), (gpointer
) this);
834 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_data_delete",
835 GTK_SIGNAL_FUNC (source_drag_data_delete
), (gpointer
) this );
836 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_begin",
837 GTK_SIGNAL_FUNC (source_drag_begin
), (gpointer
) this );
838 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_end",
839 GTK_SIGNAL_FUNC (source_drag_end
), (gpointer
) this );
843 void wxDropSource::UnregisterWindow()
845 if (!m_widget
) return;
847 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
848 GTK_SIGNAL_FUNC(source_drag_data_get
), (gpointer
) this );
849 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
850 GTK_SIGNAL_FUNC(source_drag_data_delete
), (gpointer
) this );
851 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
852 GTK_SIGNAL_FUNC(source_drag_begin
), (gpointer
) this );
853 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
854 GTK_SIGNAL_FUNC(source_drag_end
), (gpointer
) this );
858 // wxUSE_DRAG_AND_DROP