#ifdef Carbon-specific code to get stubbed DND support compiling for OS X Cocoa.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier
2008-09-24 23:53:25 +00:00
parent 8852798bcd
commit 95710acb00
2 changed files with 12 additions and 5 deletions

View File

@@ -44,11 +44,6 @@
* turning off capabilities that don't work under cocoa yet * turning off capabilities that don't work under cocoa yet
*/ */
#if wxUSE_DRAG_AND_DROP
#undef wxUSE_DRAG_AND_DROP
#define wxUSE_DRAG_AND_DROP 0
#endif
#if wxUSE_DATAVIEWCTRL #if wxUSE_DATAVIEWCTRL
#undef wxUSE_DATAVIEWCTRL #undef wxUSE_DATAVIEWCTRL
#define wxUSE_DATAVIEWCTRL 0 #define wxUSE_DATAVIEWCTRL 0

View File

@@ -107,6 +107,7 @@ bool wxDropTarget::CurrentDragHasSupportedFormat()
} }
} }
#if wxOSX_USE_CARBON
if ( !supported ) if ( !supported )
{ {
PasteboardRef pasteboard; PasteboardRef pasteboard;
@@ -116,6 +117,7 @@ bool wxDropTarget::CurrentDragHasSupportedFormat()
supported = m_dataObject->HasDataInPasteboard( pasteboard ); supported = m_dataObject->HasDataInPasteboard( pasteboard );
} }
} }
#endif
return supported; return supported;
} }
@@ -164,6 +166,7 @@ bool wxDropTarget::GetData()
} }
} }
#if wxOSX_USE_CARBON
if ( !transferred ) if ( !transferred )
{ {
PasteboardRef pasteboard; PasteboardRef pasteboard;
@@ -173,6 +176,7 @@ bool wxDropTarget::GetData()
transferred = m_dataObject->GetFromPasteboard( pasteboard ); transferred = m_dataObject->GetFromPasteboard( pasteboard );
} }
} }
#endif
return transferred; return transferred;
} }
@@ -231,6 +235,7 @@ wxDragResult wxDropSource::DoDragDrop(int flags)
if ((m_data == NULL) || (m_data->GetFormatCount() == 0)) if ((m_data == NULL) || (m_data->GetFormatCount() == 0))
return (wxDragResult)wxDragNone; return (wxDragResult)wxDragNone;
#if wxOSX_USE_CARBON
DragReference theDrag; DragReference theDrag;
RgnHandle dragRegion; RgnHandle dragRegion;
OSStatus err = noErr; OSStatus err = noErr;
@@ -305,6 +310,7 @@ wxDragResult wxDropSource::DoDragDrop(int flags)
DisposeDrag( theDrag ); DisposeDrag( theDrag );
CFRelease( pasteboard ); CFRelease( pasteboard );
gTrackingGlobals.m_currentSource = NULL; gTrackingGlobals.m_currentSource = NULL;
#endif
return gTrackingGlobals.m_result; return gTrackingGlobals.m_result;
} }
@@ -325,15 +331,18 @@ bool gTrackingGlobalsInstalled = false;
// passing the globals via refcon is not needed by the CFM and later architectures anymore // passing the globals via refcon is not needed by the CFM and later architectures anymore
// but I'll leave it in there, just in case... // but I'll leave it in there, just in case...
#if wxOSX_USE_CARBON
pascal OSErr wxMacWindowDragTrackingHandler( pascal OSErr wxMacWindowDragTrackingHandler(
DragTrackingMessage theMessage, WindowPtr theWindow, DragTrackingMessage theMessage, WindowPtr theWindow,
void *handlerRefCon, DragReference theDrag ); void *handlerRefCon, DragReference theDrag );
pascal OSErr wxMacWindowDragReceiveHandler( pascal OSErr wxMacWindowDragReceiveHandler(
WindowPtr theWindow, void *handlerRefCon, WindowPtr theWindow, void *handlerRefCon,
DragReference theDrag ); DragReference theDrag );
#endif
void wxMacEnsureTrackingHandlersInstalled() void wxMacEnsureTrackingHandlersInstalled()
{ {
#if wxOSX_USE_CARBON
if ( !gTrackingGlobalsInstalled ) if ( !gTrackingGlobalsInstalled )
{ {
OSStatus err; OSStatus err;
@@ -346,8 +355,10 @@ void wxMacEnsureTrackingHandlersInstalled()
gTrackingGlobalsInstalled = true; gTrackingGlobalsInstalled = true;
} }
#endif
} }
#if wxOSX_USE_CARBON
pascal OSErr wxMacWindowDragTrackingHandler( pascal OSErr wxMacWindowDragTrackingHandler(
DragTrackingMessage theMessage, WindowPtr theWindow, DragTrackingMessage theMessage, WindowPtr theWindow,
void *handlerRefCon, DragReference theDrag ) void *handlerRefCon, DragReference theDrag )
@@ -562,6 +573,7 @@ pascal OSErr wxMacWindowDragReceiveHandler(
return noErr; return noErr;
} }
#endif
#endif // wxUSE_DRAG_AND_DROP #endif // wxUSE_DRAG_AND_DROP