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;
57 // the trace mask we use with wxLogTrace() - call
58 // wxLog::AddTraceMask(TRACE_DND) to enable the trace messages from here
59 // (there are quite a few of them, so don't enable this by default)
60 static const wxChar
*TRACE_DND
= _T("dnd");
63 // global variables because GTK+ DnD want to have the
64 // mouse event that caused it
65 extern GdkEvent
*g_lastMouseEvent
;
66 extern int g_lastButtonNumber
;
68 //----------------------------------------------------------------------------
70 //----------------------------------------------------------------------------
72 /* Copyright (c) Julian Smart */
73 static const char * page_xpm
[] = {
74 /* columns rows colors chars-per-pixel */
123 " 56477<<<<8<<9&:X ",
124 " 59642%&*=-;<09&:5 ",
125 " 5q9642%&*=-<<<<<# ",
126 " 5qqw777<<<<<88:>+ ",
127 " erqq9642%&*=t;::+ ",
128 " eyrqq9642%&*=t;:O ",
129 " eyywwww777<<<<t;O ",
130 " e0yyrqq9642%&*=to ",
131 " e00yyrqq9642%&*=o ",
132 " eu0wwwwwww777<&*X ",
133 " euu00yyrqq9642%&X ",
134 " eiuu00yyrqq9642%X ",
135 " eiiwwwwwwwwww742$ ",
136 " eiiiuu00yyrqq964$ ",
137 " eiiiiuu00yyrqq96$ ",
138 " eiiiiiuu00yyrqq95 ",
139 " eiiiiiiuu00yyrqq5 ",
140 " eeeeeeeeeeeeee55e ",
149 // ============================================================================
151 // ============================================================================
153 // ----------------------------------------------------------------------------
154 // convert between GTK+ and wxWidgets DND constants
155 // ----------------------------------------------------------------------------
157 static wxDragResult
ConvertFromGTK(long action
)
161 case GDK_ACTION_COPY
:
164 case GDK_ACTION_LINK
:
167 case GDK_ACTION_MOVE
:
174 // ----------------------------------------------------------------------------
176 // ----------------------------------------------------------------------------
179 static void target_drag_leave( GtkWidget
*WXUNUSED(widget
),
180 GdkDragContext
*context
,
181 guint
WXUNUSED(time
),
182 wxDropTarget
*drop_target
)
184 if (g_isIdle
) wxapp_install_idle_handler();
186 /* inform the wxDropTarget about the current GdkDragContext.
187 this is only valid for the duration of this call */
188 drop_target
->SetDragContext( context
);
190 /* we don't need return values. this event is just for
192 drop_target
->OnLeave();
194 /* this has to be done because GDK has no "drag_enter" event */
195 drop_target
->m_firstMotion
= true;
197 /* after this, invalidate the drop_target's GdkDragContext */
198 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
202 // ----------------------------------------------------------------------------
204 // ----------------------------------------------------------------------------
207 static gboolean
target_drag_motion( GtkWidget
*WXUNUSED(widget
),
208 GdkDragContext
*context
,
212 wxDropTarget
*drop_target
)
214 if (g_isIdle
) wxapp_install_idle_handler();
216 /* Owen Taylor: "if the coordinates not in a drop zone,
217 return FALSE, otherwise call gtk_drag_status() and
220 /* inform the wxDropTarget about the current GdkDragContext.
221 this is only valid for the duration of this call */
222 drop_target
->SetDragContext( context
);
224 // GTK+ always supposes that we want to copy the data by default while we
225 // might want to move it, so examine not only suggested_action - which is
226 // only good if we don't have our own preferences - but also the actions
229 if (drop_target
->GetDefaultAction() == wxDragNone
)
231 // use default action set by wxDropSource::DoDragDrop()
232 if ( (gs_flagsForDrag
& wxDrag_DefaultMove
) == wxDrag_DefaultMove
&&
233 (context
->actions
& GDK_ACTION_MOVE
) )
235 // move is requested by the program and allowed by GTK+ - do it, even
236 // though suggested_action may be currently wxDragCopy
239 else // use whatever GTK+ says we should
241 result
= ConvertFromGTK(context
->suggested_action
);
243 if ( (result
== wxDragMove
) && !(gs_flagsForDrag
& wxDrag_AllowMove
) )
245 // we're requested to move but we can't
250 else if (drop_target
->GetDefaultAction() == wxDragMove
&&
251 (context
->actions
& GDK_ACTION_MOVE
))
257 if (context
->actions
& GDK_ACTION_COPY
)
259 else if (context
->actions
& GDK_ACTION_MOVE
)
265 if (drop_target
->m_firstMotion
)
267 /* the first "drag_motion" event substitutes a "drag_enter" event */
268 result
= drop_target
->OnEnter( x
, y
, result
);
272 /* give program a chance to react (i.e. to say no by returning FALSE) */
273 result
= drop_target
->OnDragOver( x
, y
, result
);
276 bool ret
= wxIsDragResultOk( result
);
279 GdkDragAction action
;
280 if (result
== wxDragCopy
)
281 action
= GDK_ACTION_COPY
;
282 else if (result
== wxDragLink
)
283 action
= GDK_ACTION_LINK
;
285 action
= GDK_ACTION_MOVE
;
287 gdk_drag_status( context
, action
, time
);
290 /* after this, invalidate the drop_target's GdkDragContext */
291 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
293 /* this has to be done because GDK has no "drag_enter" event */
294 drop_target
->m_firstMotion
= false;
300 // ----------------------------------------------------------------------------
302 // ----------------------------------------------------------------------------
305 static gboolean
target_drag_drop( GtkWidget
*widget
,
306 GdkDragContext
*context
,
310 wxDropTarget
*drop_target
)
312 if (g_isIdle
) wxapp_install_idle_handler();
314 /* Owen Taylor: "if the drop is not in a drop zone,
315 return FALSE, otherwise, if you aren't accepting
316 the drop, call gtk_drag_finish() with success == FALSE
317 otherwise call gtk_drag_data_get()" */
319 // printf( "drop.\n" );
321 /* this seems to make a difference between not accepting
322 due to wrong target area and due to wrong format. let
323 us hope that this is not required.. */
325 /* inform the wxDropTarget about the current GdkDragContext.
326 this is only valid for the duration of this call */
327 drop_target
->SetDragContext( context
);
329 /* inform the wxDropTarget about the current drag widget.
330 this is only valid for the duration of this call */
331 drop_target
->SetDragWidget( widget
);
333 /* inform the wxDropTarget about the current drag time.
334 this is only valid for the duration of this call */
335 drop_target
->SetDragTime( time
);
338 wxDragResult result = wxDragMove;
339 if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy;
342 /* reset the block here as someone might very well
343 show a dialog as a reaction to a drop and this
344 wouldn't work without events */
345 g_blockEventsOnDrag
= false;
347 bool ret
= drop_target
->OnDrop( x
, y
);
351 wxLogTrace(TRACE_DND
, wxT( "Drop target: OnDrop returned FALSE") );
353 /* cancel the whole thing */
354 gtk_drag_finish( context
,
355 FALSE
, /* no success */
356 FALSE
, /* don't delete data on dropping side */
361 wxLogTrace(TRACE_DND
, wxT( "Drop target: OnDrop returned TRUE") );
364 /* disable GUI threads */
367 GdkAtom format
= drop_target
->GetMatchingPair();
369 // this does happen somehow, see bug 555111
370 wxCHECK_MSG( format
, FALSE
, _T("no matching GdkAtom for format?") );
373 GdkDragAction action = GDK_ACTION_MOVE;
374 if (result == wxDragCopy) action == GDK_ACTION_COPY;
375 context->action = action;
377 /* this should trigger an "drag_data_received" event */
378 gtk_drag_get_data( widget
,
384 /* re-enable GUI threads */
388 /* after this, invalidate the drop_target's GdkDragContext */
389 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
391 /* after this, invalidate the drop_target's drag widget */
392 drop_target
->SetDragWidget( (GtkWidget
*) NULL
);
394 /* this has to be done because GDK has no "drag_enter" event */
395 drop_target
->m_firstMotion
= true;
401 // ----------------------------------------------------------------------------
402 // "drag_data_received"
403 // ----------------------------------------------------------------------------
406 static void target_drag_data_received( GtkWidget
*WXUNUSED(widget
),
407 GdkDragContext
*context
,
410 GtkSelectionData
*data
,
411 guint
WXUNUSED(info
),
413 wxDropTarget
*drop_target
)
415 if (g_isIdle
) wxapp_install_idle_handler();
417 /* Owen Taylor: "call gtk_drag_finish() with
420 if ((data
->length
<= 0) || (data
->format
!= 8))
422 /* negative data length and non 8-bit data format
423 qualifies for junk */
424 gtk_drag_finish (context
, FALSE
, FALSE
, time
);
429 wxLogTrace(TRACE_DND
, wxT( "Drop target: data received event") );
431 /* inform the wxDropTarget about the current GtkSelectionData.
432 this is only valid for the duration of this call */
433 drop_target
->SetDragData( data
);
435 wxDragResult result
= ConvertFromGTK(context
->action
);
437 if ( wxIsDragResultOk( drop_target
->OnData( x
, y
, result
) ) )
439 wxLogTrace(TRACE_DND
, wxT( "Drop target: OnData returned TRUE") );
441 /* tell GTK that data transfer was successful */
442 gtk_drag_finish( context
, TRUE
, FALSE
, time
);
446 wxLogTrace(TRACE_DND
, wxT( "Drop target: OnData returned FALSE") );
448 /* tell GTK that data transfer was not successful */
449 gtk_drag_finish( context
, FALSE
, FALSE
, time
);
452 /* after this, invalidate the drop_target's drag data */
453 drop_target
->SetDragData( (GtkSelectionData
*) NULL
);
457 //----------------------------------------------------------------------------
459 //----------------------------------------------------------------------------
461 wxDropTarget::wxDropTarget( wxDataObject
*data
)
462 : wxDropTargetBase( data
)
464 m_firstMotion
= true;
465 m_dragContext
= (GdkDragContext
*) NULL
;
466 m_dragWidget
= (GtkWidget
*) NULL
;
467 m_dragData
= (GtkSelectionData
*) NULL
;
471 wxDragResult
wxDropTarget::OnDragOver( wxCoord
WXUNUSED(x
),
475 // GetMatchingPair() checks for m_dataObject too, no need to do it here
477 // disable the debug message from GetMatchingPair() - there are too many
483 return (GetMatchingPair() != (GdkAtom
) 0) ? def
: wxDragNone
;
486 bool wxDropTarget::OnDrop( wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
) )
491 return (GetMatchingPair() != (GdkAtom
) 0);
494 wxDragResult
wxDropTarget::OnData( wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
),
500 if (GetMatchingPair() == (GdkAtom
) 0)
503 return GetData() ? def
: wxDragNone
;
506 GdkAtom
wxDropTarget::GetMatchingPair()
514 GList
*child
= m_dragContext
->targets
;
517 GdkAtom formatAtom
= GPOINTER_TO_INT(child
->data
);
518 wxDataFormat
format( formatAtom
);
521 wxLogTrace(TRACE_DND
, wxT("Drop target: drag has format: %s"),
522 format
.GetId().c_str());
525 if (m_dataObject
->IsSupportedFormat( format
))
534 bool wxDropTarget::GetData()
542 wxDataFormat
dragFormat( m_dragData
->target
);
544 if (!m_dataObject
->IsSupportedFormat( dragFormat
))
547 m_dataObject
->SetData( dragFormat
, (size_t)m_dragData
->length
, (const void*)m_dragData
->data
);
552 void wxDropTarget::UnregisterWidget( GtkWidget
*widget
)
554 wxCHECK_RET( widget
!= NULL
, wxT("unregister widget is NULL") );
556 gtk_drag_dest_unset( widget
);
558 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
559 GTK_SIGNAL_FUNC(target_drag_leave
), (gpointer
) this );
561 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
562 GTK_SIGNAL_FUNC(target_drag_motion
), (gpointer
) this );
564 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
565 GTK_SIGNAL_FUNC(target_drag_drop
), (gpointer
) this );
567 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
568 GTK_SIGNAL_FUNC(target_drag_data_received
), (gpointer
) this );
571 void wxDropTarget::RegisterWidget( GtkWidget
*widget
)
573 wxCHECK_RET( widget
!= NULL
, wxT("register widget is NULL") );
575 /* gtk_drag_dest_set() determines what default behaviour we'd like
576 GTK to supply. we don't want to specify out targets (=formats)
577 or actions in advance (i.e. not GTK_DEST_DEFAULT_MOTION and
578 not GTK_DEST_DEFAULT_DROP). instead we react individually to
579 "drag_motion" and "drag_drop" events. this makes it possible
580 to allow dropping on only a small area. we should set
581 GTK_DEST_DEFAULT_HIGHLIGHT as this will switch on the nice
582 highlighting if dragging over standard controls, but this
583 seems to be broken without the other two. */
585 gtk_drag_dest_set( widget
,
586 (GtkDestDefaults
) 0, /* no default behaviour */
587 (GtkTargetEntry
*) NULL
, /* we don't supply any formats here */
588 0, /* number of targets = 0 */
589 (GdkDragAction
) 0 ); /* we don't supply any actions here */
591 gtk_signal_connect( GTK_OBJECT(widget
), "drag_leave",
592 GTK_SIGNAL_FUNC(target_drag_leave
), (gpointer
) this );
594 gtk_signal_connect( GTK_OBJECT(widget
), "drag_motion",
595 GTK_SIGNAL_FUNC(target_drag_motion
), (gpointer
) this );
597 gtk_signal_connect( GTK_OBJECT(widget
), "drag_drop",
598 GTK_SIGNAL_FUNC(target_drag_drop
), (gpointer
) this );
600 gtk_signal_connect( GTK_OBJECT(widget
), "drag_data_received",
601 GTK_SIGNAL_FUNC(target_drag_data_received
), (gpointer
) this );
604 //----------------------------------------------------------------------------
606 //----------------------------------------------------------------------------
610 source_drag_data_get (GtkWidget
*WXUNUSED(widget
),
611 GdkDragContext
*WXUNUSED(context
),
612 GtkSelectionData
*selection_data
,
613 guint
WXUNUSED(info
),
614 guint
WXUNUSED(time
),
615 wxDropSource
*drop_source
)
617 if (g_isIdle
) wxapp_install_idle_handler();
619 wxDataFormat
format( selection_data
->target
);
621 wxLogTrace(TRACE_DND
, wxT("Drop source: format requested: %s"),
622 format
.GetId().c_str());
624 drop_source
->m_retValue
= wxDragCancel
;
626 wxDataObject
*data
= drop_source
->GetDataObject();
630 wxLogTrace(TRACE_DND
, wxT("Drop source: no data object") );
634 if (!data
->IsSupportedFormat(format
))
636 wxLogTrace(TRACE_DND
, wxT("Drop source: unsupported format") );
640 if (data
->GetDataSize(format
) == 0)
642 wxLogTrace(TRACE_DND
, wxT("Drop source: empty data") );
646 size_t size
= data
->GetDataSize(format
);
648 // printf( "data size: %d.\n", (int)data_size );
650 guchar
*d
= new guchar
[size
];
652 if (!data
->GetDataHere( format
, (void*)d
))
659 /* disable GUI threads */
662 gtk_selection_data_set( selection_data
,
663 selection_data
->target
,
669 /* enable GUI threads */
676 //----------------------------------------------------------------------------
677 // "drag_data_delete"
678 //----------------------------------------------------------------------------
681 static void source_drag_data_delete( GtkWidget
*WXUNUSED(widget
),
682 GdkDragContext
*context
,
683 wxDropSource
*WXUNUSED(drop_source
) )
686 wxapp_install_idle_handler();
688 // printf( "Drag source: drag_data_delete\n" );
692 //----------------------------------------------------------------------------
694 //----------------------------------------------------------------------------
697 static void source_drag_begin( GtkWidget
*WXUNUSED(widget
),
698 GdkDragContext
*WXUNUSED(context
),
699 wxDropSource
*WXUNUSED(drop_source
) )
702 wxapp_install_idle_handler();
704 // printf( "Drag source: drag_begin.\n" );
708 //----------------------------------------------------------------------------
710 //----------------------------------------------------------------------------
713 static void source_drag_end( GtkWidget
*WXUNUSED(widget
),
714 GdkDragContext
*WXUNUSED(context
),
715 wxDropSource
*drop_source
)
717 if (g_isIdle
) wxapp_install_idle_handler();
719 // printf( "Drag source: drag_end.\n" );
721 drop_source
->m_waiting
= false;
725 //-----------------------------------------------------------------------------
726 // "configure_event" from m_iconWindow
727 //-----------------------------------------------------------------------------
731 gtk_dnd_window_configure_callback( GtkWidget
*WXUNUSED(widget
), GdkEventConfigure
*WXUNUSED(event
), wxDropSource
*source
)
734 wxapp_install_idle_handler();
736 source
->GiveFeedback( ConvertFromGTK(source
->m_dragContext
->action
) );
742 //---------------------------------------------------------------------------
744 //---------------------------------------------------------------------------
746 wxDropSource::wxDropSource(wxWindow
*win
,
747 const wxIcon
&iconCopy
,
748 const wxIcon
&iconMove
,
749 const wxIcon
&iconNone
)
753 m_iconWindow
= (GtkWidget
*) NULL
;
756 m_widget
= win
->m_widget
;
757 if (win
->m_wxwindow
) m_widget
= win
->m_wxwindow
;
759 m_retValue
= wxDragCancel
;
761 SetIcons(iconCopy
, iconMove
, iconNone
);
764 wxDropSource::wxDropSource(wxDataObject
& data
,
766 const wxIcon
&iconCopy
,
767 const wxIcon
&iconMove
,
768 const wxIcon
&iconNone
)
774 m_iconWindow
= (GtkWidget
*) NULL
;
777 m_widget
= win
->m_widget
;
778 if (win
->m_wxwindow
) m_widget
= win
->m_wxwindow
;
780 m_retValue
= wxDragCancel
;
782 SetIcons(iconCopy
, iconMove
, iconNone
);
785 void wxDropSource::SetIcons(const wxIcon
&iconCopy
,
786 const wxIcon
&iconMove
,
787 const wxIcon
&iconNone
)
789 m_iconCopy
= iconCopy
;
790 m_iconMove
= iconMove
;
791 m_iconNone
= iconNone
;
793 if ( !m_iconCopy
.Ok() )
794 m_iconCopy
= wxIcon(page_xpm
);
795 if ( !m_iconMove
.Ok() )
796 m_iconMove
= m_iconCopy
;
797 if ( !m_iconNone
.Ok() )
798 m_iconNone
= m_iconCopy
;
801 wxDropSource::~wxDropSource()
805 void wxDropSource::PrepareIcon( int action
, GdkDragContext
*context
)
807 // get the right icon to display
809 if ( action
& GDK_ACTION_MOVE
)
811 else if ( action
& GDK_ACTION_COPY
)
817 if ( icon
->GetMask() )
818 mask
= icon
->GetMask()->GetBitmap();
820 mask
= (GdkBitmap
*)NULL
;
822 GdkPixmap
*pixmap
= icon
->GetPixmap();
825 gdk_window_get_size (pixmap
, &width
, &height
);
827 GdkColormap
*colormap
= gtk_widget_get_colormap( m_widget
);
828 gtk_widget_push_visual (gdk_colormap_get_visual (colormap
));
829 gtk_widget_push_colormap (colormap
);
831 m_iconWindow
= gtk_window_new (GTK_WINDOW_POPUP
);
832 gtk_widget_set_events (m_iconWindow
, GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
);
833 gtk_widget_set_app_paintable (GTK_WIDGET (m_iconWindow
), TRUE
);
835 gtk_widget_pop_visual ();
836 gtk_widget_pop_colormap ();
838 gtk_widget_set_usize (m_iconWindow
, width
, height
);
839 gtk_widget_realize (m_iconWindow
);
841 gtk_signal_connect( GTK_OBJECT(m_iconWindow
), "configure_event",
842 GTK_SIGNAL_FUNC(gtk_dnd_window_configure_callback
), (gpointer
)this );
844 gdk_window_set_back_pixmap (m_iconWindow
->window
, pixmap
, FALSE
);
847 gtk_widget_shape_combine_mask (m_iconWindow
, mask
, 0, 0);
849 gtk_drag_set_icon_widget( context
, m_iconWindow
, 0, 0 );
852 wxDragResult
wxDropSource::DoDragDrop(int flags
)
854 wxCHECK_MSG( m_data
&& m_data
->GetFormatCount(), wxDragNone
,
855 wxT("Drop source: no data") );
858 if (g_blockEventsOnDrag
)
861 // don't start dragging if no button is down
862 if (g_lastButtonNumber
== 0)
865 // we can only start a drag after a mouse event
866 if (g_lastMouseEvent
== NULL
)
870 g_blockEventsOnDrag
= true;
876 GtkTargetList
*target_list
= gtk_target_list_new( (GtkTargetEntry
*) NULL
, 0 );
878 wxDataFormat
*array
= new wxDataFormat
[ m_data
->GetFormatCount() ];
879 m_data
->GetAllFormats( array
);
880 size_t count
= m_data
->GetFormatCount();
881 for (size_t i
= 0; i
< count
; i
++)
883 GdkAtom atom
= array
[i
];
884 wxLogTrace(TRACE_DND
, wxT("Drop source: Supported atom %s"), gdk_atom_name( atom
));
885 gtk_target_list_add( target_list
, atom
, 0, 0 );
889 int action
= GDK_ACTION_COPY
;
890 if ( flags
& wxDrag_AllowMove
)
891 action
|= GDK_ACTION_MOVE
;
893 // VZ: as we already use g_blockEventsOnDrag it shouldn't be that bad
894 // to use a global to pass the flags to the drop target but I'd
895 // surely prefer a better way to do it
896 gs_flagsForDrag
= flags
;
898 GdkDragContext
*context
= gtk_drag_begin( m_widget
,
900 (GdkDragAction
)action
,
901 g_lastButtonNumber
, // number of mouse button which started drag
902 (GdkEvent
*) g_lastMouseEvent
);
904 m_dragContext
= context
;
906 PrepareIcon( action
, context
);
909 gtk_main_iteration();
911 m_retValue
= ConvertFromGTK(context
->action
);
912 if ( m_retValue
== wxDragNone
)
913 m_retValue
= wxDragCancel
;
915 g_blockEventsOnDrag
= false;
922 void wxDropSource::RegisterWindow()
924 if (!m_widget
) return;
926 gtk_signal_connect( GTK_OBJECT(m_widget
), "drag_data_get",
927 GTK_SIGNAL_FUNC (source_drag_data_get
), (gpointer
) this);
928 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_data_delete",
929 GTK_SIGNAL_FUNC (source_drag_data_delete
), (gpointer
) this );
930 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_begin",
931 GTK_SIGNAL_FUNC (source_drag_begin
), (gpointer
) this );
932 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_end",
933 GTK_SIGNAL_FUNC (source_drag_end
), (gpointer
) this );
937 void wxDropSource::UnregisterWindow()
939 if (!m_widget
) return;
941 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
942 GTK_SIGNAL_FUNC(source_drag_data_get
), (gpointer
) this );
943 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
944 GTK_SIGNAL_FUNC(source_drag_data_delete
), (gpointer
) this );
945 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
946 GTK_SIGNAL_FUNC(source_drag_begin
), (gpointer
) this );
947 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
948 GTK_SIGNAL_FUNC(source_drag_end
), (gpointer
) this );
952 // wxUSE_DRAG_AND_DROP