XDND support now can be disabled using WITH_GHOST_XDND=OFF with CMake and WITH_GHOST_XDND=False with SCons

Disabled on FreeBSD platforms due to some linking errors.
This commit is contained in:
Sergey Sharybin
2012-02-17 20:51:39 +00:00
parent 5af9e8d5ca
commit 9def83f7e0
13 changed files with 70 additions and 14 deletions

View File

@@ -160,6 +160,11 @@ if(UNIX AND NOT APPLE)
option(WITH_BUILTIN_GLEW "Use GLEW OpenGL wrapper library bundled with blender" ON)
option(WITH_XDG_USER_DIRS "Build with XDG Base Directory Specification (only config and documents for now)" OFF)
mark_as_advanced(WITH_XDG_USER_DIRS)
# freebsd doesn't seems to support XDND
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
option(WITH_GHOST_XDND "Enable drag'n'drop support on Linux using XDND protocol" ON)
endif()
else()
# not an option for other OS's
set(WITH_BUILTIN_GLEW ON)

View File

@@ -164,6 +164,8 @@ BF_EXPAT = '/usr/local'
BF_EXPAT_LIB = 'expat'
BF_EXPAT_LIBPATH = '${BF_EXPAT}/lib'
WITH_GHOST_XDND = False
WITH_BF_OPENMP = True
#Ray trace optimization

View File

@@ -166,6 +166,8 @@ BF_EXPAT_LIBPATH = '${BF_EXPAT}/lib'
WITH_BF_OPENMP = True
WITH_GHOST_XDND = False
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']

View File

@@ -166,6 +166,8 @@ BF_EXPAT_LIBPATH = '${BF_EXPAT}/lib'
WITH_BF_OPENMP = True
WITH_GHOST_XDND = False
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']

View File

@@ -138,6 +138,7 @@ def validate_arguments(args, bc):
'WITH_BF_OPENMP', 'BF_OPENMP', 'BF_OPENMP_LIBPATH',
'WITH_GHOST_COCOA',
'WITH_GHOST_SDL',
'WITH_GHOST_XDND',
'BF_GHOST_DEBUG',
'USE_QTKIT',
'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE',
@@ -567,7 +568,9 @@ def read_opts(env, cfg, args):
('BF_BOOST_INC', 'Boost include path', ''),
('BF_BOOST_LIB', 'Boost library', ''),
('BF_BOOST_LIBPATH', 'Boost library path', ''),
('BF_BOOST_LIB_STATIC', 'Boost static library', '')
('BF_BOOST_LIB_STATIC', 'Boost static library', ''),
(BoolVariable('WITH_GHOST_XDND', 'Build with drag-n-drop support on Linux platforms using XDND protocol', True))
) # end of opts.AddOptions()
return localopts

View File

@@ -72,6 +72,8 @@ if(WITH_CARVE)
add_subdirectory(carve)
endif()
if(UNIX AND NOT APPLE)
add_subdirectory(xdnd)
if(WITH_GHOST_XDND)
if(UNIX AND NOT APPLE)
add_subdirectory(xdnd)
endif()
endif()

6
extern/SConscript vendored
View File

@@ -35,5 +35,7 @@ if env['WITH_BF_LIBMV']:
if env['WITH_BF_CARVE']:
SConscript(['carve/SConscript'])
if env['OURPLATFORM'] in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'freebsd9', 'aix4', 'aix5'):
SConscript(['xdnd/SConscript'])
if env['WITH_GHOST_XDND']:
# FreeBSD doesn't seems to support XDND protocol
if env['OURPLATFORM'] in ('linux', 'openbsd3', 'sunos5', 'aix4', 'aix5'):
SConscript(['xdnd/SConscript'])

View File

@@ -220,18 +220,26 @@ elseif(UNIX)
intern/GHOST_SystemX11.cpp
intern/GHOST_SystemPathsX11.cpp
intern/GHOST_WindowX11.cpp
intern/GHOST_DropTargetX11.cpp
intern/GHOST_DisplayManagerX11.h
intern/GHOST_SystemX11.h
intern/GHOST_SystemPathsX11.h
intern/GHOST_WindowX11.h
intern/GHOST_DropTargetX11.h
)
list(APPEND INC
../../extern/xdnd
)
if(WITH_GHOST_XDND)
add_definitions(-DWITH_XDND)
list(APPEND INC
../../extern/xdnd
)
list(APPEND SRC
intern/GHOST_DropTargetX11.cpp
intern/GHOST_DropTargetX11.h
)
endif()
if(X11_XF86keysym_INCLUDE_PATH)
add_definitions(-DWITH_XF86KEYSYM)

View File

@@ -42,7 +42,12 @@ elif window_system in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'f
# defs += ['PREFIX=\\"/usr/local/\\"'] # XXX, make an option
defs += ['WITH_X11_XINPUT'] # XXX, make an option
incs += ' #/extern/xdnd'
# freebsd doesn't seem to support XDND protocol
if env['WITH_GHOST_XDND'] and window_system not in ('freebsd7', 'freebsd8', 'freebsd9'):
incs += ' #/extern/xdnd'
defs += ['WITH_XDND']
else:
sources.remove('intern' + os.sep + 'GHOST_DropTargetX11.cpp')
elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
for f in pf:

View File

@@ -42,12 +42,15 @@
#include "GHOST_EventButton.h"
#include "GHOST_EventWheel.h"
#include "GHOST_DisplayManagerX11.h"
#include "GHOST_DropTargetX11.h"
#include "GHOST_EventDragnDrop.h"
#ifdef WITH_INPUT_NDOF
#include "GHOST_NDOFManagerX11.h"
#endif
#ifdef WITH_XDND
#include "GHOST_DropTargetX11.h"
#endif
#include "GHOST_Debug.h"
#include <X11/Xatom.h>
@@ -711,10 +714,14 @@ GHOST_SystemX11::processEvent(XEvent *xe)
}
}
} else {
#ifdef WITH_XDND
/* try to handle drag event (if there's no such events, GHOST_HandleClientMessage will return zero) */
if (window->getDropTarget()->GHOST_HandleClientMessage(xe) == false) {
/* Unknown client message, ignore */
}
#else
/* Unknown client message, ignore */
#endif
}
break;
@@ -1485,6 +1492,7 @@ void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const
}
}
#ifdef WITH_XDND
GHOST_TSuccess GHOST_SystemX11::pushDragDropEvent(GHOST_TEventType eventType,
GHOST_TDragnDropTypes draggedObjectType,
GHOST_IWindow* window,
@@ -1498,3 +1506,4 @@ GHOST_TSuccess GHOST_SystemX11::pushDragDropEvent(GHOST_TEventType eventType,
window,mouseX,mouseY,data)
);
}
#endif

View File

@@ -235,6 +235,7 @@ public:
*/
void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
#if WITH_XDND
/**
* Creates a drag'n'drop event and pushes it immediately onto the event queue.
* Called by GHOST_DropTargetX11 class.
@@ -246,6 +247,7 @@ public:
* @return Indication whether the event was handled.
*/
static GHOST_TSuccess pushDragDropEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType,GHOST_IWindow* window, int mouseX, int mouseY, void* data);
#endif
/**
* @see GHOST_ISystem

View File

@@ -32,10 +32,13 @@
#include "GHOST_WindowX11.h"
#include "GHOST_SystemX11.h"
#include "GHOST_DropTargetX11.h"
#include "STR_String.h"
#include "GHOST_Debug.h"
#ifdef WITH_XDND
#include "GHOST_DropTargetX11.h"
#endif
// For standard X11 cursors
#include <X11/cursorfont.h>
#include <X11/Xatom.h>
@@ -326,10 +329,12 @@ GHOST_WindowX11(
XSelectInput(m_display , parentWindow, SubstructureNotifyMask);
}
#ifdef WITH_XDND
/* initialize drop target for newly created window */
m_dropTarget = new GHOST_DropTargetX11(this, m_system);
GHOST_PRINT("Set drop target\n");
#endif
/*
* One of the problem with WM-spec is that can't set a property
@@ -1323,7 +1328,9 @@ GHOST_WindowX11::
}
#endif
#ifdef WITH_XDND
delete m_dropTarget;
#endif
XDestroyWindow(m_display, m_window);
XFree(m_visual);

View File

@@ -45,7 +45,10 @@
class STR_String;
class GHOST_SystemX11;
#ifdef WITH_XDND
class GHOST_DropTargetX11;
#endif
/**
* X11 implementation of GHOST_IWindow.
@@ -225,8 +228,10 @@ public:
XIC getX11_XIC() { return m_xic; }
#endif
#ifdef WITH_XDND
GHOST_DropTargetX11* getDropTarget()
{ return m_dropTarget; }
#endif
/*
* Need this in case that we want start the window
@@ -365,7 +370,9 @@ private :
/** Cache of XC_* ID's to XCursor structures */
std::map<unsigned int, Cursor> m_standard_cursors;
#ifdef WITH_XDND
GHOST_DropTargetX11 * m_dropTarget;
#endif
#ifdef WITH_X11_XINPUT
/* Tablet devices */