From: Jouk Jansen Date: Fri, 1 Dec 2006 14:38:39 +0000 (+0000) Subject: Committing in . X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/98528e9b9451c2b82911407d0a6d9fb22e4160ac?ds=inline Committing in . added some #ifdef __WXDEBUG__ in the proper places around wxLogTrace(TRACE_DND... statements Modified Files: wxWidgets/src/gtk/dnd.cpp git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43731 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index 2a147ae682..0733a6e2e4 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -334,8 +334,10 @@ static gboolean target_drag_drop( GtkWidget *widget, if (!ret) { +#ifdef __WXDEBUG__ wxLogTrace(TRACE_DND, wxT( "Drop target: OnDrop returned FALSE") ); - +#endif + /* cancel the whole thing */ gtk_drag_finish( context, FALSE, /* no success */ @@ -344,8 +346,10 @@ static gboolean target_drag_drop( GtkWidget *widget, } else { +#ifdef __WXDEBUG__ wxLogTrace(TRACE_DND, wxT( "Drop target: OnDrop returned true") ); - +#endif + #if wxUSE_THREADS /* disable GUI threads */ #endif @@ -412,8 +416,10 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget), return; } +#ifdef __WXDEBUG__ wxLogTrace(TRACE_DND, wxT( "Drop target: data received event") ); - +#endif + /* inform the wxDropTarget about the current GtkSelectionData. this is only valid for the duration of this call */ drop_target->SetDragData( data ); @@ -422,15 +428,19 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget), if ( wxIsDragResultOk( drop_target->OnData( x, y, result ) ) ) { +#ifdef __WXDEBUG__ wxLogTrace(TRACE_DND, wxT( "Drop target: OnData returned true") ); - +#endif + /* tell GTK that data transfer was successful */ gtk_drag_finish( context, TRUE, FALSE, time ); } else { +#ifdef __WXDEBUG__ wxLogTrace(TRACE_DND, wxT( "Drop target: OnData returned FALSE") ); - +#endif + /* tell GTK that data transfer was not successful */ gtk_drag_finish( context, FALSE, FALSE, time ); } @@ -601,29 +611,37 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget), wxDataFormat format( selection_data->target ); +#ifdef __WXDEBUG__ wxLogTrace(TRACE_DND, wxT("Drop source: format requested: %s"), format.GetId().c_str()); - +#endif + drop_source->m_retValue = wxDragCancel; wxDataObject *data = drop_source->GetDataObject(); if (!data) { +#ifdef __WXDEBUG__ wxLogTrace(TRACE_DND, wxT("Drop source: no data object") ); - return; +#endif + return; } if (!data->IsSupportedFormat(format)) { +#ifdef __WXDEBUG__ wxLogTrace(TRACE_DND, wxT("Drop source: unsupported format") ); - return; +#endif + return; } if (data->GetDataSize(format) == 0) { +#ifdef __WXDEBUG__ wxLogTrace(TRACE_DND, wxT("Drop source: empty data") ); - return; +#endif + return; } size_t size = data->GetDataSize(format); @@ -861,8 +879,10 @@ wxDragResult wxDropSource::DoDragDrop(int flags) for (size_t i = 0; i < count; i++) { GdkAtom atom = array[i]; +#ifdef __WXDEBUG__ wxLogTrace(TRACE_DND, wxT("Drop source: Supported atom %s"), gdk_atom_name( atom )); - gtk_target_list_add( target_list, atom, 0, 0 ); +#endif + gtk_target_list_add( target_list, atom, 0, 0 ); } delete[] array;