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
);
150 wxDragResult result
= wxDragMove
;
151 if (context
->suggested_action
== GDK_ACTION_COPY
) result
= wxDragCopy
;
153 if (drop_target
->m_firstMotion
)
155 /* the first "drag_motion" event substitutes a "drag_enter" event */
156 result
= drop_target
->OnEnter( x
, y
, result
);
160 /* give program a chance to react (i.e. to say no by returning FALSE) */
161 result
= drop_target
->OnDragOver( x
, y
, result
);
164 bool ret
= result
!= wxDragNone
;
167 GdkDragAction action
= GDK_ACTION_MOVE
;
168 if (result
== wxDragCopy
) action
= GDK_ACTION_COPY
;
169 gdk_drag_status( context
, action
, time
);
172 /* after this, invalidate the drop_target's GdkDragContext */
173 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
175 /* this has to be done because GDK has no "drag_enter" event */
176 drop_target
->m_firstMotion
= FALSE
;
181 // ----------------------------------------------------------------------------
183 // ----------------------------------------------------------------------------
185 static gboolean
target_drag_drop( GtkWidget
*widget
,
186 GdkDragContext
*context
,
190 wxDropTarget
*drop_target
)
192 if (g_isIdle
) wxapp_install_idle_handler();
194 /* Owen Taylor: "if the drop is not in a drop zone,
195 return FALSE, otherwise, if you aren't accepting
196 the drop, call gtk_drag_finish() with success == FALSE
197 otherwise call gtk_drag_data_get()" */
199 // printf( "drop.\n" );
201 /* this seems to make a difference between not accepting
202 due to wrong target area and due to wrong format. let
203 us hope that this is not required.. */
205 /* inform the wxDropTarget about the current GdkDragContext.
206 this is only valid for the duration of this call */
207 drop_target
->SetDragContext( context
);
209 /* inform the wxDropTarget about the current drag widget.
210 this is only valid for the duration of this call */
211 drop_target
->SetDragWidget( widget
);
213 /* inform the wxDropTarget about the current drag time.
214 this is only valid for the duration of this call */
215 drop_target
->SetDragTime( time
);
218 wxDragResult result = wxDragMove;
219 if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy;
222 bool ret
= drop_target
->OnDrop( x
, y
);
226 wxLogDebug( wxT( "Drop target: OnDrop returned TRUE") );
228 /* cancel the whole thing */
229 gtk_drag_finish( context
,
230 FALSE
, /* no success */
231 FALSE
, /* don't delete data on dropping side */
236 wxLogDebug( wxT( "Drop target: OnDrop returned TRUE") );
239 /* disable GUI threads */
240 wxapp_uninstall_thread_wakeup();
243 GdkAtom format
= drop_target
->GetMatchingPair();
247 GdkDragAction action = GDK_ACTION_MOVE;
248 if (result == wxDragCopy) action == GDK_ACTION_COPY;
249 context->action = action;
251 /* this should trigger an "drag_data_received" event */
252 gtk_drag_get_data( widget
,
258 /* re-enable GUI threads */
259 wxapp_install_thread_wakeup();
263 /* after this, invalidate the drop_target's GdkDragContext */
264 drop_target
->SetDragContext( (GdkDragContext
*) NULL
);
266 /* after this, invalidate the drop_target's drag widget */
267 drop_target
->SetDragWidget( (GtkWidget
*) NULL
);
269 /* this has to be done because GDK has no "drag_enter" event */
270 drop_target
->m_firstMotion
= TRUE
;
275 // ----------------------------------------------------------------------------
276 // "drag_data_received"
277 // ----------------------------------------------------------------------------
279 static void target_drag_data_received( GtkWidget
*WXUNUSED(widget
),
280 GdkDragContext
*context
,
283 GtkSelectionData
*data
,
284 guint
WXUNUSED(info
),
286 wxDropTarget
*drop_target
)
288 if (g_isIdle
) wxapp_install_idle_handler();
290 /* Owen Taylor: "call gtk_drag_finish() with
294 if ((data
->length
<= 0) || (data
->format
!= 8))
296 /* negative data length and non 8-bit data format
297 qualifies for junk */
298 gtk_drag_finish (context
, FALSE
, FALSE
, time
);
303 wxLogDebug( wxT( "Drop target: data received event") );
305 /* inform the wxDropTarget about the current GtkSelectionData.
306 this is only valid for the duration of this call */
307 drop_target
->SetDragData( data
);
309 if (drop_target
->OnData( x
, y
))
311 wxLogDebug( wxT( "Drop target: OnData returned TRUE") );
313 /* tell GTK that data transfer was successfull */
314 gtk_drag_finish( context
, TRUE
, FALSE
, time
);
318 wxLogDebug( wxT( "Drop target: OnData returned FALSE") );
320 /* tell GTK that data transfer was not successfull */
321 gtk_drag_finish( context
, FALSE
, FALSE
, time
);
324 /* after this, invalidate the drop_target's drag data */
325 drop_target
->SetDragData( (GtkSelectionData
*) NULL
);
328 //----------------------------------------------------------------------------
330 //----------------------------------------------------------------------------
332 wxDropTarget::wxDropTarget( wxDataObject
*data
)
333 : wxDropTargetBase( data
)
335 m_firstMotion
= TRUE
;
336 m_dragContext
= (GdkDragContext
*) NULL
;
337 m_dragWidget
= (GtkWidget
*) NULL
;
338 m_dragData
= (GtkSelectionData
*) NULL
;
342 wxDragResult
wxDropTarget::OnDragOver( wxCoord
WXUNUSED(x
),
346 // GetMatchingPair() checks for m_dataObject too, no need to do it here
348 // disable the debug message from GetMatchingPair() - there are too many
354 return (GetMatchingPair() != (GdkAtom
) 0) ? def
: wxDragNone
;
357 bool wxDropTarget::OnDrop( wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
) )
362 return (GetMatchingPair() != (GdkAtom
) 0);
365 bool wxDropTarget::OnData( wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
) )
370 if (GetMatchingPair() == (GdkAtom
) 0)
376 GdkAtom
wxDropTarget::GetMatchingPair()
384 GList
*child
= m_dragContext
->targets
;
387 GdkAtom formatAtom
= (GdkAtom
) GPOINTER_TO_INT(child
->data
);
388 wxDataFormat
format( formatAtom
);
391 char *name
= gdk_atom_name( formatAtom
);
392 wxLogDebug("Drop target: drag has format: %s", name
? name
: "unnamed");
395 if (m_dataObject
->IsSupportedFormat( format
))
404 bool wxDropTarget::GetData()
412 wxDataFormat
dragFormat( m_dragData
->target
);
414 if (!m_dataObject
->IsSupportedFormat( dragFormat
))
417 if (dragFormat
.GetType() == wxDF_TEXT
)
419 wxTextDataObject
*text_object
= (wxTextDataObject
*)m_dataObject
;
420 text_object
->SetText( (const char*)m_dragData
->data
);
424 if (dragFormat
.GetType() == wxDF_FILENAME
)
426 wxFileDataObject
*file_object
= (wxFileDataObject
*)m_dataObject
;
427 file_object
->SetData( 0, (const char*)m_dragData
->data
);
431 m_dataObject
->SetData( dragFormat
, (size_t)m_dragData
->length
, (const void*)m_dragData
->data
);
436 void wxDropTarget::UnregisterWidget( GtkWidget
*widget
)
438 wxCHECK_RET( widget
!= NULL
, wxT("unregister widget is NULL") );
440 gtk_drag_dest_unset( widget
);
442 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
443 GTK_SIGNAL_FUNC(target_drag_leave
), (gpointer
) this );
445 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
446 GTK_SIGNAL_FUNC(target_drag_motion
), (gpointer
) this );
448 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
449 GTK_SIGNAL_FUNC(target_drag_drop
), (gpointer
) this );
451 gtk_signal_disconnect_by_func( GTK_OBJECT(widget
),
452 GTK_SIGNAL_FUNC(target_drag_data_received
), (gpointer
) this );
455 void wxDropTarget::RegisterWidget( GtkWidget
*widget
)
457 wxCHECK_RET( widget
!= NULL
, wxT("register widget is NULL") );
459 /* gtk_drag_dest_set() determines what default behaviour we'd like
460 GTK to supply. we don't want to specify out targets (=formats)
461 or actions in advance (i.e. not GTK_DEST_DEFAULT_MOTION and
462 not GTK_DEST_DEFAULT_DROP). instead we react individually to
463 "drag_motion" and "drag_drop" events. this makes it possible
464 to allow dropping on only a small area. we should set
465 GTK_DEST_DEFAULT_HIGHLIGHT as this will switch on the nice
466 highlighting if dragging over standard controls, but this
467 seems to be broken without the other two. */
469 gtk_drag_dest_set( widget
,
470 (GtkDestDefaults
) 0, /* no default behaviour */
471 (GtkTargetEntry
*) NULL
, /* we don't supply any formats here */
472 0, /* number of targets = 0 */
473 (GdkDragAction
) 0 ); /* we don't supply any actions here */
475 gtk_signal_connect( GTK_OBJECT(widget
), "drag_leave",
476 GTK_SIGNAL_FUNC(target_drag_leave
), (gpointer
) this );
478 gtk_signal_connect( GTK_OBJECT(widget
), "drag_motion",
479 GTK_SIGNAL_FUNC(target_drag_motion
), (gpointer
) this );
481 gtk_signal_connect( GTK_OBJECT(widget
), "drag_drop",
482 GTK_SIGNAL_FUNC(target_drag_drop
), (gpointer
) this );
484 gtk_signal_connect( GTK_OBJECT(widget
), "drag_data_received",
485 GTK_SIGNAL_FUNC(target_drag_data_received
), (gpointer
) this );
488 // ----------------------------------------------------------------------------
490 // ----------------------------------------------------------------------------
492 wxTextDropTarget::wxTextDropTarget()
493 : wxDropTarget(new wxTextDataObject
)
497 bool wxTextDropTarget::OnData(wxCoord x
, wxCoord y
)
502 return OnDropText(x
, y
, ((wxTextDataObject
*)m_dataObject
)->GetText());
505 // ----------------------------------------------------------------------------
507 // ----------------------------------------------------------------------------
509 wxFileDropTarget::wxFileDropTarget()
510 : wxDropTarget(new wxFileDataObject
)
514 bool wxFileDropTarget::OnData(wxCoord x
, wxCoord y
)
519 return OnDropFiles(x
, y
,
520 ((wxFileDataObject
*)m_dataObject
)->GetFilenames());
523 //----------------------------------------------------------------------------
525 //----------------------------------------------------------------------------
528 source_drag_data_get (GtkWidget
*WXUNUSED(widget
),
529 GdkDragContext
*context
,
530 GtkSelectionData
*selection_data
,
531 guint
WXUNUSED(info
),
532 guint
WXUNUSED(time
),
533 wxDropSource
*drop_source
)
535 if (g_isIdle
) wxapp_install_idle_handler();
537 wxDataFormat
format( selection_data
->target
);
539 wxLogDebug( wxT("Drop source: format requested: %s"), format
.GetId().c_str() );
541 drop_source
->m_retValue
= wxDragCancel
;
543 wxDataObject
*data
= drop_source
->GetDataObject();
547 wxLogDebug( wxT("Drop source: no data object") );
551 if (!data
->IsSupportedFormat(format
))
553 wxLogDebug( wxT("Drop source: unsupported format") );
557 if (data
->GetDataSize(format
) == 0)
559 wxLogDebug( wxT("Drop source: empty data") );
563 size_t size
= data
->GetDataSize(format
);
565 // printf( "data size: %d.\n", (int)data_size );
567 guchar
*d
= new guchar
[size
];
569 if (!data
->GetDataHere( format
, (void*)d
))
576 /* disable GUI threads */
577 wxapp_uninstall_thread_wakeup();
580 gtk_selection_data_set( selection_data
,
581 selection_data
->target
,
587 /* enable GUI threads */
588 wxapp_install_thread_wakeup();
593 /* so far only copy, no moves. TODO. */
594 drop_source
->m_retValue
= wxDragCopy
;
597 //----------------------------------------------------------------------------
598 // "drag_data_delete"
599 //----------------------------------------------------------------------------
601 static void source_drag_data_delete( GtkWidget
*WXUNUSED(widget
),
602 GdkDragContext
*WXUNUSED(context
),
603 wxDropSource
*drop_source
)
605 if (g_isIdle
) wxapp_install_idle_handler();
607 // printf( "Delete the data!\n" );
609 drop_source
->m_retValue
= wxDragMove
;
612 //----------------------------------------------------------------------------
614 //----------------------------------------------------------------------------
616 static void source_drag_begin( GtkWidget
*WXUNUSED(widget
),
617 GdkDragContext
*WXUNUSED(context
),
618 wxDropSource
*WXUNUSED(drop_source
) )
620 if (g_isIdle
) wxapp_install_idle_handler();
622 // printf( "drag_begin.\n" );
625 //----------------------------------------------------------------------------
627 //----------------------------------------------------------------------------
629 static void source_drag_end( GtkWidget
*WXUNUSED(widget
),
630 GdkDragContext
*WXUNUSED(context
),
631 wxDropSource
*drop_source
)
633 if (g_isIdle
) wxapp_install_idle_handler();
635 // printf( "drag_end.\n" );
637 drop_source
->m_waiting
= FALSE
;
640 //-----------------------------------------------------------------------------
641 // "configure_event" from m_iconWindow
642 //-----------------------------------------------------------------------------
645 gtk_dnd_window_configure_callback( GtkWidget
*WXUNUSED(widget
), GdkEventConfigure
*WXUNUSED(event
), wxDropSource
*source
)
648 wxapp_install_idle_handler();
650 wxDragResult action
= wxDragNone
;
651 if (source
->m_dragContext
->action
== GDK_ACTION_COPY
) action
= wxDragCopy
;
652 if (source
->m_dragContext
->action
== GDK_ACTION_MOVE
) action
= wxDragMove
;
654 source
->GiveFeedback( action
, FALSE
);
659 //---------------------------------------------------------------------------
661 //---------------------------------------------------------------------------
663 wxDropSource::wxDropSource( wxWindow
*win
, const wxIcon
&icon
)
665 g_blockEventsOnDrag
= TRUE
;
668 m_iconWindow
= (GtkWidget
*) NULL
;
671 m_widget
= win
->m_widget
;
672 if (win
->m_wxwindow
) m_widget
= win
->m_wxwindow
;
674 m_retValue
= wxDragCancel
;
677 if (wxNullIcon
== icon
) m_icon
= wxIcon( page_xpm
);
680 wxDropSource::wxDropSource( wxDataObject
& data
, wxWindow
*win
, const wxIcon
&icon
)
686 m_iconWindow
= (GtkWidget
*) NULL
;
689 m_widget
= win
->m_widget
;
690 if (win
->m_wxwindow
) m_widget
= win
->m_wxwindow
;
692 m_retValue
= wxDragCancel
;
695 if (wxNullIcon
== icon
) m_icon
= wxIcon( page_xpm
);
698 wxDropSource::~wxDropSource()
700 g_blockEventsOnDrag
= FALSE
;
703 void wxDropSource::PrepareIcon( int hot_x
, int hot_y
, GdkDragContext
*context
)
705 GdkBitmap
*mask
= (GdkBitmap
*) NULL
;
706 if (m_icon
.GetMask()) mask
= m_icon
.GetMask()->GetBitmap();
707 GdkPixmap
*pixmap
= m_icon
.GetPixmap();
710 gdk_window_get_size (pixmap
, &width
, &height
);
712 GdkColormap
*colormap
= gtk_widget_get_colormap( m_widget
);
713 gtk_widget_push_visual (gdk_colormap_get_visual (colormap
));
714 gtk_widget_push_colormap (colormap
);
716 m_iconWindow
= gtk_window_new (GTK_WINDOW_POPUP
);
717 gtk_widget_set_events (m_iconWindow
, GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
);
718 gtk_widget_set_app_paintable (GTK_WIDGET (m_iconWindow
), TRUE
);
720 gtk_widget_pop_visual ();
721 gtk_widget_pop_colormap ();
723 gtk_widget_set_usize (m_iconWindow
, width
, height
);
724 gtk_widget_realize (m_iconWindow
);
726 gtk_signal_connect( GTK_OBJECT(m_iconWindow
), "configure_event",
727 GTK_SIGNAL_FUNC(gtk_dnd_window_configure_callback
), (gpointer
)this );
729 gdk_window_set_back_pixmap (m_iconWindow
->window
, pixmap
, FALSE
);
732 gtk_widget_shape_combine_mask (m_iconWindow
, mask
, 0, 0);
734 gtk_drag_set_icon_widget( context
, m_iconWindow
, hot_x
, hot_y
);
737 wxDragResult
wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove
) )
739 wxASSERT_MSG( m_data
, wxT("wxDragSource: no data") );
742 return (wxDragResult
) wxDragNone
;
744 if (m_data
->GetFormatCount() == 0)
745 return (wxDragResult
) wxDragNone
;
747 g_blockEventsOnDrag
= TRUE
;
753 GtkTargetList
*target_list
= gtk_target_list_new( (GtkTargetEntry
*) NULL
, 0 );
755 wxDataFormat
*array
= new wxDataFormat
[ m_data
->GetFormatCount() ];
756 m_data
->GetAllFormats( array
);
757 for (size_t i
= 0; i
< m_data
->GetFormatCount(); i
++)
759 GdkAtom atom
= array
[i
];
760 wxLogDebug( wxT("Supported atom %s"), gdk_atom_name( atom
) );
761 gtk_target_list_add( target_list
, atom
, 0, 0 );
765 GdkEventMotion event
;
766 event
.window
= m_widget
->window
;
769 GdkModifierType state
;
770 gdk_window_get_pointer( event
.window
, &x
, &y
, &state
);
774 event
.time
= GDK_CURRENT_TIME
;
776 /* GTK wants to know which button was pressed which caused the dragging */
777 int button_number
= 0;
778 if (event
.state
& GDK_BUTTON1_MASK
) button_number
= 1;
779 else if (event
.state
& GDK_BUTTON2_MASK
) button_number
= 2;
780 else if (event
.state
& GDK_BUTTON3_MASK
) button_number
= 3;
783 /* disable GUI threads */
784 wxapp_uninstall_thread_wakeup();
787 /* don't start dragging if no button is down */
790 GdkDragContext
*context
= gtk_drag_begin( m_widget
,
792 (GdkDragAction
)(GDK_ACTION_COPY
|GDK_ACTION_MOVE
),
793 button_number
, /* number of mouse button which started drag */
794 (GdkEvent
*) &event
);
796 m_dragContext
= context
;
798 PrepareIcon( 0, 0, context
);
800 while (m_waiting
) gtk_main_iteration();;
804 /* re-enable GUI threads */
805 wxapp_install_thread_wakeup();
808 g_blockEventsOnDrag
= FALSE
;
815 void wxDropSource::RegisterWindow()
817 if (!m_widget
) return;
819 gtk_signal_connect( GTK_OBJECT(m_widget
), "drag_data_get",
820 GTK_SIGNAL_FUNC (source_drag_data_get
), (gpointer
) this);
821 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_data_delete",
822 GTK_SIGNAL_FUNC (source_drag_data_delete
), (gpointer
) this );
823 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_begin",
824 GTK_SIGNAL_FUNC (source_drag_begin
), (gpointer
) this );
825 gtk_signal_connect (GTK_OBJECT(m_widget
), "drag_end",
826 GTK_SIGNAL_FUNC (source_drag_end
), (gpointer
) this );
830 void wxDropSource::UnregisterWindow()
832 if (!m_widget
) return;
834 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
835 GTK_SIGNAL_FUNC(source_drag_data_get
), (gpointer
) this );
836 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
837 GTK_SIGNAL_FUNC(source_drag_data_delete
), (gpointer
) this );
838 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
839 GTK_SIGNAL_FUNC(source_drag_begin
), (gpointer
) this );
840 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget
),
841 GTK_SIGNAL_FUNC(source_drag_end
), (gpointer
) this );
846 // wxUSE_DRAG_AND_DROP