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 #define TRACE_DND _T("dnd")
61 // global variables because GTK+ DnD want to have the
62 // mouse event that caused it
63 extern GdkEvent
*g_lastMouseEvent
;
64 extern int g_lastButtonNumber
;
66 //----------------------------------------------------------------------------
68 //----------------------------------------------------------------------------
70 /* Copyright (c) Julian Smart */
71 static const char * page_xpm
[] = {
72 /* columns rows colors chars-per-pixel */
121 " 56477<<<<8<<9&:X ",
122 " 59642%&*=-;<09&:5 ",
123 " 5q9642%&*=-<<<<<# ",
124 " 5qqw777<<<<<88:>+ ",
125 " erqq9642%&*=t;::+ ",
126 " eyrqq9642%&*=t;:O ",
127 " eyywwww777<<<<t;O ",
128 " e0yyrqq9642%&*=to ",
129 " e00yyrqq9642%&*=o ",
130 " eu0wwwwwww777<&*X ",
131 " euu00yyrqq9642%&X ",
132 " eiuu00yyrqq9642%X ",
133 " eiiwwwwwwwwww742$ ",
134 " eiiiuu00yyrqq964$ ",
135 " eiiiiuu00yyrqq96$ ",
136 " eiiiiiuu00yyrqq95 ",
137 " eiiiiiiuu00yyrqq5 ",
138 " eeeeeeeeeeeeee55e ",
147 // ============================================================================
149 // ============================================================================
151 // ----------------------------------------------------------------------------
152 // convert between GTK+ and wxWidgets DND constants
153 // ----------------------------------------------------------------------------
155 static wxDragResult
ConvertFromGTK(long action
)
159 case GDK_ACTION_COPY
:
162 case GDK_ACTION_LINK
:
165 case GDK_ACTION_MOVE
:
172 // ----------------------------------------------------------------------------
174 // ----------------------------------------------------------------------------
177 static void target_drag_leave( GtkWidget
*WXUNUSED(widget
),
178 GdkDragContext
*context
,
179 guint
WXUNUSED(time
),
180 wxDropTarget
*drop_target
)
182 if (g_isIdle
) wxapp_install_idle_handler();
184 /* inform the wxDropTarget about the current GdkDragContext.
185 this is only valid for the duration of this call */
186 drop_target
->SetDragContext( context
);
188 /* we don't need return values. this event is just for
190 drop_target
->OnLeave();
192 /* this has to be done because GDK has no "drag_enter" event */
193 drop_target
->m_firstMotion
= true;
195 /* after this, invalidate the drop_target's GdkDragContext */
196 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
200 // ----------------------------------------------------------------------------
202 // ----------------------------------------------------------------------------
205 static gboolean
target_drag_motion( GtkWidget
*WXUNUSED(widget
),
206 GdkDragContext
*context
,
210 wxDropTarget
*drop_target
)
212 if (g_isIdle
) wxapp_install_idle_handler();
214 /* Owen Taylor: "if the coordinates not in a drop zone,
215 return FALSE, otherwise call gtk_drag_status() and
218 /* inform the wxDropTarget about the current GdkDragContext.
219 this is only valid for the duration of this call */
220 drop_target
->SetDragContext( context
);
222 // GTK+ always supposes that we want to copy the data by default while we
223 // might want to move it, so examine not only suggested_action - which is
224 // only good if we don't have our own preferences - but also the actions
227 if (drop_target
->GetDefaultAction() == wxDragNone
)
229 // use default action set by wxDropSource::DoDragDrop()
230 if ( (gs_flagsForDrag
& wxDrag_DefaultMove
) == wxDrag_DefaultMove
&&
231 (context
->actions
& GDK_ACTION_MOVE
) )
233 // move is requested by the program and allowed by GTK+ - do it, even
234 // though suggested_action may be currently wxDragCopy
237 else // use whatever GTK+ says we should
239 result
= ConvertFromGTK(context
->suggested_action
);
241 if ( (result
== wxDragMove
) && !(gs_flagsForDrag
& wxDrag_AllowMove
) )
243 // we're requested to move but we can't
248 else if (drop_target
->GetDefaultAction() == wxDragMove
&&
249 (context
->actions
& GDK_ACTION_MOVE
))
255 if (context
->actions
& GDK_ACTION_COPY
)
257 else if (context
->actions
& GDK_ACTION_MOVE
)
263 if (drop_target
->m_firstMotion
)
265 /* the first "drag_motion" event substitutes a "drag_enter" event */
266 result
= drop_target
->OnEnter( x
, y
, result
);
270 /* give program a chance to react (i.e. to say no by returning FALSE) */
271 result
= drop_target
->OnDragOver( x
, y
, result
);
274 bool ret
= wxIsDragResultOk( result
);
277 GdkDragAction action
;
278 if (result
== wxDragCopy
)
279 action
= GDK_ACTION_COPY
;
280 else if (result
== wxDragLink
)
281 action
= GDK_ACTION_LINK
;
283 action
= GDK_ACTION_MOVE
;
285 gdk_drag_status( context
, action
, time
);
288 /* after this, invalidate the drop_target's GdkDragContext */
289 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
291 /* this has to be done because GDK has no "drag_enter" event */
292 drop_target
->m_firstMotion
= false;
298 // ----------------------------------------------------------------------------
300 // ----------------------------------------------------------------------------
303 static gboolean
target_drag_drop( GtkWidget
*widget
,
304 GdkDragContext
*context
,
308 wxDropTarget
*drop_target
)
310 if (g_isIdle
) wxapp_install_idle_handler();
312 /* Owen Taylor: "if the drop is not in a drop zone,
313 return FALSE, otherwise, if you aren't accepting
314 the drop, call gtk_drag_finish() with success == FALSE
315 otherwise call gtk_drag_data_get()" */
317 // printf( "drop.\n" );
319 /* this seems to make a difference between not accepting
320 due to wrong target area and due to wrong format. let
321 us hope that this is not required.. */
323 /* inform the wxDropTarget about the current GdkDragContext.
324 this is only valid for the duration of this call */
325 drop_target
->SetDragContext( context
);
327 /* inform the wxDropTarget about the current drag widget.
328 this is only valid for the duration of this call */
329 drop_target
->SetDragWidget( widget
);
331 /* inform the wxDropTarget about the current drag time.
332 this is only valid for the duration of this call */
333 drop_target
->SetDragTime( time
);
336 wxDragResult result = wxDragMove;
337 if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy;
340 /* reset the block here as someone might very well
341 show a dialog as a reaction to a drop and this
342 wouldn't work without events */
343 g_blockEventsOnDrag
= false;
345 bool ret
= drop_target
->OnDrop( x
, y
);
349 wxLogTrace(TRACE_DND
, wxT( "Drop target: OnDrop returned FALSE") );
351 /* cancel the whole thing */
352 gtk_drag_finish( context
,
353 FALSE
, /* no success */
354 FALSE
, /* don't delete data on dropping side */
359 wxLogTrace(TRACE_DND
, wxT( "Drop target: OnDrop returned TRUE") );
362 /* disable GUI threads */
365 GdkAtom format
= drop_target
->GetMatchingPair();
367 // this does happen somehow, see bug 555111
368 wxCHECK_MSG( format
, FALSE
, _T("no matching GdkAtom for format?") );
371 GdkDragAction action = GDK_ACTION_MOVE;
372 if (result == wxDragCopy) action == GDK_ACTION_COPY;
373 context->action = action;
375 /* this should trigger an "drag_data_received" event */
376 gtk_drag_get_data( widget
,
382 /* re-enable GUI threads */
386 /* after this, invalidate the drop_target's GdkDragContext */
387 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
389 /* after this, invalidate the drop_target's drag widget */
390 drop_target
->SetDragWidget( (GtkWidget
*) NULL
);
392 /* this has to be done because GDK has no "drag_enter" event */
393 drop_target
->m_firstMotion
= true;
399 // ----------------------------------------------------------------------------
400 // "drag_data_received"
401 // ----------------------------------------------------------------------------
404 static void target_drag_data_received( GtkWidget
*WXUNUSED(widget
),
405 GdkDragContext
*context
,
408 GtkSelectionData
*data
,
409 guint
WXUNUSED(info
),
411 wxDropTarget
*drop_target
)
413 if (g_isIdle
) wxapp_install_idle_handler();
415 /* Owen Taylor: "call gtk_drag_finish() with
418 if ((data
->length
<= 0) || (data
->format
!= 8))
420 /* negative data length and non 8-bit data format
421 qualifies for junk */
422 gtk_drag_finish (context
, FALSE
, FALSE
, time
);
427 wxLogTrace(TRACE_DND
, wxT( "Drop target: data received event") );
429 /* inform the wxDropTarget about the current GtkSelectionData.
430 this is only valid for the duration of this call */
431 drop_target
->SetDragData( data
);
433 wxDragResult result
= ConvertFromGTK(context
->action
);
435 if ( wxIsDragResultOk( drop_target
->OnData( x
, y
, result
) ) )
437 wxLogTrace(TRACE_DND
, wxT( "Drop target: OnData returned TRUE") );
439 /* tell GTK that data transfer was successful */
440 gtk_drag_finish( context
, TRUE
, FALSE
, time
);
444 wxLogTrace(TRACE_DND
, wxT( "Drop target: OnData returned FALSE") );
446 /* tell GTK that data transfer was not successful */
447 gtk_drag_finish( context
, FALSE
, FALSE
, time
);
450 /* after this, invalidate the drop_target's drag data */
451 drop_target
->SetDragData( (GtkSelectionData
*) NULL
);
455 //----------------------------------------------------------------------------
457 //----------------------------------------------------------------------------
459 wxDropTarget::wxDropTarget( wxDataObject
*data
)
460 : wxDropTargetBase( data
)
462 m_firstMotion
= true;
463 m_dragContext
= (GdkDragContext
*) NULL
;
464 m_dragWidget
= (GtkWidget
*) NULL
;
465 m_dragData
= (GtkSelectionData
*) NULL
;
469 wxDragResult
wxDropTarget::OnDragOver( wxCoord
WXUNUSED(x
),
473 // GetMatchingPair() checks for m_dataObject too, no need to do it here
475 // disable the debug message from GetMatchingPair() - there are too many
481 return (GetMatchingPair() != (GdkAtom
) 0) ? def
: wxDragNone
;
484 bool wxDropTarget::OnDrop( wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
) )
489 return (GetMatchingPair() != (GdkAtom
) 0);
492 wxDragResult
wxDropTarget::OnData( wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
),
498 if (GetMatchingPair() == (GdkAtom
) 0)
501 return GetData() ? def
: wxDragNone
;
504 GdkAtom
wxDropTarget::GetMatchingPair()
512 GList
*child
= m_dragContext
->targets
;
515 GdkAtom formatAtom
= GPOINTER_TO_INT(child
->data
);
516 wxDataFormat
format( formatAtom
);
519 wxLogTrace(TRACE_DND
, wxT("Drop target: drag has format: %s"),
520 format
.GetId().c_str());
523 if (m_dataObject
->IsSupportedFormat( format
))
532 bool wxDropTarget::GetData()
540 wxDataFormat
dragFormat( m_dragData
->target
);
542 if (!m_dataObject
->IsSupportedFormat( dragFormat
))
545 m_dataObject
->SetData( dragFormat
, (size_t)m_dragData
->length
, (const void*)m_dragData
->data
);
550 void wxDropTarget::UnregisterWidget( GtkWidget
*widget
)
552 wxCHECK_RET( widget
!= NULL
, wxT("unregister widget is NULL") );
554 gtk_drag_dest_unset( widget
);
556 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
557 GTK_SIGNAL_FUNC(target_drag_leave
), (gpointer
) this );
559 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
560 GTK_SIGNAL_FUNC(target_drag_motion
), (gpointer
) this );
562 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
563 GTK_SIGNAL_FUNC(target_drag_drop
), (gpointer
) this );
565 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
566 GTK_SIGNAL_FUNC(target_drag_data_received
), (gpointer
) this );
569 void wxDropTarget::RegisterWidget( GtkWidget
*widget
)
571 wxCHECK_RET( widget
!= NULL
, wxT("register widget is NULL") );
573 /* gtk_drag_dest_set() determines what default behaviour we'd like
574 GTK to supply. we don't want to specify out targets (=formats)
575 or actions in advance (i.e. not GTK_DEST_DEFAULT_MOTION and
576 not GTK_DEST_DEFAULT_DROP). instead we react individually to
577 "drag_motion" and "drag_drop" events. this makes it possible
578 to allow dropping on only a small area. we should set
579 GTK_DEST_DEFAULT_HIGHLIGHT as this will switch on the nice
580 highlighting if dragging over standard controls, but this
581 seems to be broken without the other two. */
583 gtk_drag_dest_set( widget
,
584 (GtkDestDefaults
) 0, /* no default behaviour */
585 (GtkTargetEntry
*) NULL
, /* we don't supply any formats here */
586 0, /* number of targets = 0 */
587 (GdkDragAction
) 0 ); /* we don't supply any actions here */
589 gtk_signal_connect( GTK_OBJECT(widget
), "drag_leave",
590 GTK_SIGNAL_FUNC(target_drag_leave
), (gpointer
) this );
592 gtk_signal_connect( GTK_OBJECT(widget
), "drag_motion",
593 GTK_SIGNAL_FUNC(target_drag_motion
), (gpointer
) this );
595 gtk_signal_connect( GTK_OBJECT(widget
), "drag_drop",
596 GTK_SIGNAL_FUNC(target_drag_drop
), (gpointer
) this );
598 gtk_signal_connect( GTK_OBJECT(widget
), "drag_data_received",
599 GTK_SIGNAL_FUNC(target_drag_data_received
), (gpointer
) this );
602 //----------------------------------------------------------------------------
604 //----------------------------------------------------------------------------
608 source_drag_data_get (GtkWidget
*WXUNUSED(widget
),
609 GdkDragContext
*WXUNUSED(context
),
610 GtkSelectionData
*selection_data
,
611 guint
WXUNUSED(info
),
612 guint
WXUNUSED(time
),
613 wxDropSource
*drop_source
)
615 if (g_isIdle
) wxapp_install_idle_handler();
617 wxDataFormat
format( selection_data
->target
);
619 wxLogTrace(TRACE_DND
, wxT("Drop source: format requested: %s"),
620 format
.GetId().c_str());
622 drop_source
->m_retValue
= wxDragCancel
;
624 wxDataObject
*data
= drop_source
->GetDataObject();
628 wxLogTrace(TRACE_DND
, wxT("Drop source: no data object") );
632 if (!data
->IsSupportedFormat(format
))
634 wxLogTrace(TRACE_DND
, wxT("Drop source: unsupported format") );
638 if (data
->GetDataSize(format
) == 0)
640 wxLogTrace(TRACE_DND
, wxT("Drop source: empty data") );
644 size_t size
= data
->GetDataSize(format
);
646 // printf( "data size: %d.\n", (int)data_size );
648 guchar
*d
= new guchar
[size
];
650 if (!data
->GetDataHere( format
, (void*)d
))
657 /* disable GUI threads */
660 gtk_selection_data_set( selection_data
,
661 selection_data
->target
,
667 /* enable GUI threads */
674 //----------------------------------------------------------------------------
675 // "drag_data_delete"
676 //----------------------------------------------------------------------------
679 static void source_drag_data_delete( GtkWidget
*WXUNUSED(widget
),
680 GdkDragContext
*context
,
681 wxDropSource
*WXUNUSED(drop_source
) )
684 wxapp_install_idle_handler();
686 // printf( "Drag source: drag_data_delete\n" );
690 //----------------------------------------------------------------------------
692 //----------------------------------------------------------------------------
695 static void source_drag_begin( GtkWidget
*WXUNUSED(widget
),
696 GdkDragContext
*WXUNUSED(context
),
697 wxDropSource
*WXUNUSED(drop_source
) )
700 wxapp_install_idle_handler();
702 // printf( "Drag source: drag_begin.\n" );
706 //----------------------------------------------------------------------------
708 //----------------------------------------------------------------------------
711 static void source_drag_end( GtkWidget
*WXUNUSED(widget
),
712 GdkDragContext
*WXUNUSED(context
),
713 wxDropSource
*drop_source
)
715 if (g_isIdle
) wxapp_install_idle_handler();
717 // printf( "Drag source: drag_end.\n" );
719 drop_source
->m_waiting
= false;
723 //-----------------------------------------------------------------------------
724 // "configure_event" from m_iconWindow
725 //-----------------------------------------------------------------------------
729 gtk_dnd_window_configure_callback( GtkWidget
*WXUNUSED(widget
), GdkEventConfigure
*WXUNUSED(event
), wxDropSource
*source
)
732 wxapp_install_idle_handler();
734 source
->GiveFeedback( ConvertFromGTK(source
->m_dragContext
->action
) );
740 //---------------------------------------------------------------------------
742 //---------------------------------------------------------------------------
744 wxDropSource::wxDropSource(wxWindow
*win
,
745 const wxIcon
&iconCopy
,
746 const wxIcon
&iconMove
,
747 const wxIcon
&iconNone
)
751 m_iconWindow
= (GtkWidget
*) NULL
;
754 m_widget
= win
->m_widget
;
755 if (win
->m_wxwindow
) m_widget
= win
->m_wxwindow
;
757 m_retValue
= wxDragCancel
;
759 SetIcons(iconCopy
, iconMove
, iconNone
);
762 wxDropSource::wxDropSource(wxDataObject
& data
,
764 const wxIcon
&iconCopy
,
765 const wxIcon
&iconMove
,
766 const wxIcon
&iconNone
)
772 m_iconWindow
= (GtkWidget
*) NULL
;
775 m_widget
= win
->m_widget
;
776 if (win
->m_wxwindow
) m_widget
= win
->m_wxwindow
;
778 m_retValue
= wxDragCancel
;
780 SetIcons(iconCopy
, iconMove
, iconNone
);
783 void wxDropSource::SetIcons(const wxIcon
&iconCopy
,
784 const wxIcon
&iconMove
,
785 const wxIcon
&iconNone
)
787 m_iconCopy
= iconCopy
;
788 m_iconMove
= iconMove
;
789 m_iconNone
= iconNone
;
791 if ( !m_iconCopy
.Ok() )
792 m_iconCopy
= wxIcon(page_xpm
);
793 if ( !m_iconMove
.Ok() )
794 m_iconMove
= m_iconCopy
;
795 if ( !m_iconNone
.Ok() )
796 m_iconNone
= m_iconCopy
;
799 wxDropSource::~wxDropSource()
803 void wxDropSource::PrepareIcon( int action
, GdkDragContext
*context
)
805 // get the right icon to display
807 if ( action
& GDK_ACTION_MOVE
)
809 else if ( action
& GDK_ACTION_COPY
)
815 if ( icon
->GetMask() )
816 mask
= icon
->GetMask()->GetBitmap();
818 mask
= (GdkBitmap
*)NULL
;
820 GdkPixmap
*pixmap
= icon
->GetPixmap();
823 gdk_window_get_size (pixmap
, &width
, &height
);
825 GdkColormap
*colormap
= gtk_widget_get_colormap( m_widget
);
826 gtk_widget_push_visual (gdk_colormap_get_visual (colormap
));
827 gtk_widget_push_colormap (colormap
);
829 m_iconWindow
= gtk_window_new (GTK_WINDOW_POPUP
);
830 gtk_widget_set_events (m_iconWindow
, GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
);
831 gtk_widget_set_app_paintable (GTK_WIDGET (m_iconWindow
), TRUE
);
833 gtk_widget_pop_visual ();
834 gtk_widget_pop_colormap ();
836 gtk_widget_set_usize (m_iconWindow
, width
, height
);
837 gtk_widget_realize (m_iconWindow
);
839 gtk_signal_connect( GTK_OBJECT(m_iconWindow
), "configure_event",
840 GTK_SIGNAL_FUNC(gtk_dnd_window_configure_callback
), (gpointer
)this );
842 gdk_window_set_back_pixmap (m_iconWindow
->window
, pixmap
, FALSE
);
845 gtk_widget_shape_combine_mask (m_iconWindow
, mask
, 0, 0);
847 gtk_drag_set_icon_widget( context
, m_iconWindow
, 0, 0 );
850 wxDragResult
wxDropSource::DoDragDrop(int flags
)
852 wxCHECK_MSG( m_data
&& m_data
->GetFormatCount(), wxDragNone
,
853 wxT("Drop source: no data") );
856 if (g_blockEventsOnDrag
)
859 // don't start dragging if no button is down
860 if (g_lastButtonNumber
== 0)
863 // we can only start a drag after a mouse event
864 if (g_lastMouseEvent
== NULL
)
868 g_blockEventsOnDrag
= true;
874 GtkTargetList
*target_list
= gtk_target_list_new( (GtkTargetEntry
*) NULL
, 0 );
876 wxDataFormat
*array
= new wxDataFormat
[ m_data
->GetFormatCount() ];
877 m_data
->GetAllFormats( array
);
878 size_t count
= m_data
->GetFormatCount();
879 for (size_t i
= 0; i
< count
; i
++)
881 GdkAtom atom
= array
[i
];
882 wxLogTrace(TRACE_DND
, wxT("Drop source: Supported atom %s"), gdk_atom_name( atom
));
883 gtk_target_list_add( target_list
, atom
, 0, 0 );
887 int action
= GDK_ACTION_COPY
;
888 if ( flags
& wxDrag_AllowMove
)
889 action
|= GDK_ACTION_MOVE
;
891 // VZ: as we already use g_blockEventsOnDrag it shouldn't be that bad
892 // to use a global to pass the flags to the drop target but I'd
893 // surely prefer a better way to do it
894 gs_flagsForDrag
= flags
;
896 GdkDragContext
*context
= gtk_drag_begin( m_widget
,
898 (GdkDragAction
)action
,
899 g_lastButtonNumber
, // number of mouse button which started drag
900 (GdkEvent
*) g_lastMouseEvent
);
902 m_dragContext
= context
;
904 PrepareIcon( action
, context
);
907 gtk_main_iteration();
909 m_retValue
= ConvertFromGTK(context
->action
);
910 if ( m_retValue
== wxDragNone
)
911 m_retValue
= wxDragCancel
;
913 g_blockEventsOnDrag
= false;
920 void wxDropSource::RegisterWindow()
922 if (!m_widget
) return;
924 gtk_signal_connect( GTK_OBJECT(m_widget
), "drag_data_get",
925 GTK_SIGNAL_FUNC (source_drag_data_get
), (gpointer
) this);
926 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_data_delete",
927 GTK_SIGNAL_FUNC (source_drag_data_delete
), (gpointer
) this );
928 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_begin",
929 GTK_SIGNAL_FUNC (source_drag_begin
), (gpointer
) this );
930 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_end",
931 GTK_SIGNAL_FUNC (source_drag_end
), (gpointer
) this );
935 void wxDropSource::UnregisterWindow()
937 if (!m_widget
) return;
939 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
940 GTK_SIGNAL_FUNC(source_drag_data_get
), (gpointer
) this );
941 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
942 GTK_SIGNAL_FUNC(source_drag_data_delete
), (gpointer
) this );
943 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
944 GTK_SIGNAL_FUNC(source_drag_begin
), (gpointer
) this );
945 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
946 GTK_SIGNAL_FUNC(source_drag_end
), (gpointer
) this );
950 // wxUSE_DRAG_AND_DROP