From 4419e367bcbe8c1b248e88eab8096f0b8ac4707c Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 18 Nov 2009 21:15:44 -0800 Subject: Add support for removing the Windows specific drag/drop code from the codebase via a new CMake file (DragDrop.cmake). --- indra/cmake/DragDrop.cmake | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 indra/cmake/DragDrop.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/DragDrop.cmake b/indra/cmake/DragDrop.cmake new file mode 100644 index 0000000000..a2d7df1312 --- /dev/null +++ b/indra/cmake/DragDrop.cmake @@ -0,0 +1,25 @@ +# -*- cmake -*- + +if (VIEWER) + + OPTION (OS_DRAG_DROP + "Build the viewer with OS level drag and drop turned on or off" + OFF) + + if (OS_DRAG_DROP) + + if (WINDOWS) + add_definitions(-DLL_OS_DRAGDROP_ENABLED=1) + endif (WINDOWS) + + if (DARWIN) + add_definitions(-DLL_OS_DRAGDROP_ENABLED=0) + endif (DARWIN) + + if (LINUX) + add_definitions(-DLL_OS_DRAGDROP_ENABLED=0) + endif (LINUX) + + endif (OS_DRAG_DROP) + +endif (VIEWER) -- cgit v1.3 From 9e53ad6111ce0e15cb10f2ffb47fee8b48d1c3db Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 18 Nov 2009 21:17:39 -0800 Subject: Doh! Update the CMake file that controls drag and drop to turn it ON --- indra/cmake/DragDrop.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/DragDrop.cmake b/indra/cmake/DragDrop.cmake index a2d7df1312..739d011813 100644 --- a/indra/cmake/DragDrop.cmake +++ b/indra/cmake/DragDrop.cmake @@ -4,7 +4,7 @@ if (VIEWER) OPTION (OS_DRAG_DROP "Build the viewer with OS level drag and drop turned on or off" - OFF) + ON) if (OS_DRAG_DROP) -- cgit v1.3 From 1500e90eccf237fb50f901528c5dc9d747f6d2f0 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 8 Jan 2010 15:11:03 -0800 Subject: Make sure mac build honors compile-time flag that en/disables OS drag and drop. Also fixed the cmake file to properly set LL_OS_DRAGDROP_ENABLED. --- indra/cmake/DragDrop.cmake | 6 ++---- indra/llwindow/llwindowmacosx.cpp | 5 +++++ indra/llwindow/llwindowmacosx.h | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/DragDrop.cmake b/indra/cmake/DragDrop.cmake index 739d011813..e56264f187 100644 --- a/indra/cmake/DragDrop.cmake +++ b/indra/cmake/DragDrop.cmake @@ -2,9 +2,7 @@ if (VIEWER) - OPTION (OS_DRAG_DROP - "Build the viewer with OS level drag and drop turned on or off" - ON) + set(OS_DRAG_DROP ON CACHE BOOL "Build the viewer with OS level drag and drop turned on or off") if (OS_DRAG_DROP) @@ -13,7 +11,7 @@ if (VIEWER) endif (WINDOWS) if (DARWIN) - add_definitions(-DLL_OS_DRAGDROP_ENABLED=0) + add_definitions(-DLL_OS_DRAGDROP_ENABLED=1) endif (DARWIN) if (LINUX) diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index ffc44a1e84..dc5a98756a 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -500,8 +500,10 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits // Set up window event handlers (some window-related events ONLY go to window handlers.) InstallStandardEventHandler(GetWindowEventTarget(mWindow)); InstallWindowEventHandler(mWindow, mEventHandlerUPP, GetEventTypeCount (WindowHandlerEventList), WindowHandlerEventList, (void*)this, &mWindowHandlerRef); // add event handler +#if LL_OS_DRAGDROP_ENABLED InstallTrackingHandler( dragTrackingHandler, mWindow, (void*)this ); InstallReceiveHandler( dragReceiveHandler, mWindow, (void*)this ); +#endif // LL_OS_DRAGDROP_ENABLED } { @@ -3387,6 +3389,8 @@ MASK LLWindowMacOSX::modifiersToMask(SInt16 modifiers) return mask; } +#if LL_OS_DRAGDROP_ENABLED + OSErr LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef theWindow, void * handlerRefCon, DragRef drag) { @@ -3507,3 +3511,4 @@ OSErr LLWindowMacOSX::handleDragNDrop(DragRef drag, LLWindowCallbacks::DragNDrop return result; } +#endif // LL_OS_DRAGDROP_ENABLED diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index bd3e46ebb4..09b8891db0 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -161,10 +161,13 @@ protected: void fixWindowSize(void); void stopDockTileBounce(); static MASK modifiersToMask(SInt16 modifiers); + +#if LL_OS_DRAGDROP_ENABLED static OSErr dragTrackingHandler(DragTrackingMessage message, WindowRef theWindow, void * handlerRefCon, DragRef theDrag); static OSErr dragReceiveHandler(WindowRef theWindow, void * handlerRefCon, DragRef theDrag); OSErr handleDragNDrop(DragRef theDrag, LLWindowCallbacks::DragNDropAction action); +#endif // LL_OS_DRAGDROP_ENABLED // // Platform specific variables -- cgit v1.3