macOS: officially upgrade to 10.9 libraries from lib/darwin.
This removes a bunch of code that is no longer needed, and running "make update" will now automatically download the new libraries. Differential Revision: https://developer.blender.org/D2861
This commit is contained in:
@@ -500,7 +500,12 @@ endif()
|
|||||||
# Experimental support of C11 and C++11
|
# Experimental support of C11 and C++11
|
||||||
#
|
#
|
||||||
# We default options to whatever default standard in the current compiler.
|
# We default options to whatever default standard in the current compiler.
|
||||||
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
|
if(APPLE)
|
||||||
|
set(_c11_init ON)
|
||||||
|
set(_cxx11_init ON)
|
||||||
|
set(WITH_C11 ON)
|
||||||
|
set(WITH_CXX11 ON)
|
||||||
|
elseif(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
|
||||||
set(_c11_init ON)
|
set(_c11_init ON)
|
||||||
set(_cxx11_init ON)
|
set(_cxx11_init ON)
|
||||||
else()
|
else()
|
||||||
|
@@ -419,10 +419,15 @@ icons: .FORCE
|
|||||||
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
|
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
|
||||||
|
|
||||||
update: .FORCE
|
update: .FORCE
|
||||||
|
if [ "$(OS_NCASE)" == "darwin" ] && [ ! -d "../lib/$(OS_NCASE)" ]; then \
|
||||||
|
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/$(OS_NCASE) ../lib/$(OS_NCASE) ; \
|
||||||
|
fi
|
||||||
if [ -d "../lib" ]; then \
|
if [ -d "../lib" ]; then \
|
||||||
|
svn cleanup ../lib/* ; \
|
||||||
svn update ../lib/* ; \
|
svn update ../lib/* ; \
|
||||||
fi
|
fi
|
||||||
git pull --rebase
|
git submodule update --init --recursive
|
||||||
|
git submodule foreach git checkout master
|
||||||
git submodule foreach git pull --rebase origin master
|
git submodule foreach git pull --rebase origin master
|
||||||
|
|
||||||
|
|
||||||
|
@@ -312,7 +312,7 @@ def generic_builder(id, libdir='', branch='', rsync=False):
|
|||||||
|
|
||||||
# Builders
|
# Builders
|
||||||
|
|
||||||
add_builder(c, 'mac_x86_64_10_6_cmake', 'darwin-9.x.universal', generic_builder, hour=1)
|
add_builder(c, 'mac_x86_64_10_6_cmake', 'darwin', generic_builder, hour=1)
|
||||||
add_builder(c, 'linux_glibc219_i686_cmake', '', generic_builder, hour=2)
|
add_builder(c, 'linux_glibc219_i686_cmake', '', generic_builder, hour=2)
|
||||||
add_builder(c, 'linux_glibc219_x86_64_cmake', '', generic_builder, hour=1)
|
add_builder(c, 'linux_glibc219_x86_64_cmake', '', generic_builder, hour=1)
|
||||||
add_builder(c, 'win32_cmake_vc2013', 'windows_vc12', generic_builder, hour=1)
|
add_builder(c, 'win32_cmake_vc2013', 'windows_vc12', generic_builder, hour=1)
|
||||||
|
@@ -28,11 +28,7 @@ macro(find_package_wrapper)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
if(NOT DEFINED LIBDIR)
|
if(NOT DEFINED LIBDIR)
|
||||||
if(WITH_CXX11)
|
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin)
|
||||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin)
|
|
||||||
else()
|
|
||||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal)
|
|
||||||
endif()
|
|
||||||
else()
|
else()
|
||||||
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
||||||
endif()
|
endif()
|
||||||
@@ -93,11 +89,7 @@ if(WITH_PYTHON)
|
|||||||
# normally cached but not since we include them with blender
|
# normally cached but not since we include them with blender
|
||||||
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m")
|
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m")
|
||||||
set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}m")
|
set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}m")
|
||||||
if(WITH_CXX11)
|
set(PYTHON_LIBRARY ${LIBDIR}/python/lib/libpython${PYTHON_VERSION}m.a)
|
||||||
set(PYTHON_LIBRARY ${LIBDIR}/python/lib/libpython${PYTHON_VERSION}m.a)
|
|
||||||
else()
|
|
||||||
set(PYTHON_LIBRARY python${PYTHON_VERSION}m)
|
|
||||||
endif()
|
|
||||||
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
|
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
|
||||||
# set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
|
# set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
|
||||||
else()
|
else()
|
||||||
@@ -148,11 +140,7 @@ if(WITH_IMAGE_OPENEXR)
|
|||||||
set(OPENEXR ${LIBDIR}/openexr)
|
set(OPENEXR ${LIBDIR}/openexr)
|
||||||
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
|
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
|
||||||
set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR}/include/OpenEXR)
|
set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR}/include/OpenEXR)
|
||||||
if(WITH_CXX11)
|
set(OPENEXR_POSTFIX -2_2)
|
||||||
set(OPENEXR_POSTFIX -2_2)
|
|
||||||
else()
|
|
||||||
set(OPENEXR_POSTFIX)
|
|
||||||
endif()
|
|
||||||
set(OPENEXR_LIBRARIES
|
set(OPENEXR_LIBRARIES
|
||||||
Iex${OPENEXR_POSTFIX}
|
Iex${OPENEXR_POSTFIX}
|
||||||
Half
|
Half
|
||||||
@@ -169,20 +157,16 @@ if(WITH_CODEC_FFMPEG)
|
|||||||
avcodec avdevice avformat avutil
|
avcodec avdevice avformat avutil
|
||||||
mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg
|
mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg
|
||||||
)
|
)
|
||||||
if(WITH_CXX11)
|
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} schroedinger orc vpx webp swresample)
|
||||||
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} schroedinger orc vpx webp swresample)
|
|
||||||
endif()
|
|
||||||
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_OPENJPEG OR WITH_CODEC_FFMPEG)
|
if(WITH_OPENJPEG OR WITH_CODEC_FFMPEG)
|
||||||
# use openjpeg from libdir that is linked into ffmpeg
|
# use openjpeg from libdir that is linked into ffmpeg
|
||||||
if(WITH_CXX11)
|
set(OPENJPEG ${LIBDIR}/openjpeg)
|
||||||
set(OPENJPEG ${LIBDIR}/openjpeg)
|
set(WITH_SYSTEM_OPENJPEG ON)
|
||||||
set(WITH_SYSTEM_OPENJPEG ON)
|
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include)
|
||||||
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include)
|
set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/libopenjpeg.a)
|
||||||
set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/libopenjpeg.a)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_library(SYSTEMSTUBS_LIBRARY
|
find_library(SYSTEMSTUBS_LIBRARY
|
||||||
@@ -200,11 +184,7 @@ set(PLATFORM_LINKFLAGS
|
|||||||
"-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio"
|
"-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(WITH_CXX11)
|
list(APPEND PLATFORM_LINKLIBS c++)
|
||||||
list(APPEND PLATFORM_LINKLIBS c++)
|
|
||||||
else()
|
|
||||||
list(APPEND PLATFORM_LINKLIBS stdc++)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_JACK)
|
if(WITH_JACK)
|
||||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -F/Library/Frameworks -weak_framework jackmp")
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -F/Library/Frameworks -weak_framework jackmp")
|
||||||
@@ -255,11 +235,7 @@ if(WITH_SDL)
|
|||||||
set(SDL_INCLUDE_DIR ${SDL}/include)
|
set(SDL_INCLUDE_DIR ${SDL}/include)
|
||||||
set(SDL_LIBRARY SDL2)
|
set(SDL_LIBRARY SDL2)
|
||||||
set(SDL_LIBPATH ${SDL}/lib)
|
set(SDL_LIBPATH ${SDL}/lib)
|
||||||
if(WITH_CXX11)
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework ForceFeedback")
|
||||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework ForceFeedback")
|
|
||||||
else()
|
|
||||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lazy_framework ForceFeedback")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PNG "${LIBDIR}/png")
|
set(PNG "${LIBDIR}/png")
|
||||||
@@ -280,11 +256,7 @@ endif()
|
|||||||
if(WITH_BOOST)
|
if(WITH_BOOST)
|
||||||
set(BOOST ${LIBDIR}/boost)
|
set(BOOST ${LIBDIR}/boost)
|
||||||
set(BOOST_INCLUDE_DIR ${BOOST}/include)
|
set(BOOST_INCLUDE_DIR ${BOOST}/include)
|
||||||
if(WITH_CXX11)
|
set(BOOST_POSTFIX)
|
||||||
set(BOOST_POSTFIX)
|
|
||||||
else()
|
|
||||||
set(BOOST_POSTFIX -mt)
|
|
||||||
endif()
|
|
||||||
set(BOOST_LIBRARIES
|
set(BOOST_LIBRARIES
|
||||||
boost_date_time${BOOST_POSTFIX}
|
boost_date_time${BOOST_POSTFIX}
|
||||||
boost_filesystem${BOOST_POSTFIX}
|
boost_filesystem${BOOST_POSTFIX}
|
||||||
@@ -321,9 +293,7 @@ if(WITH_OPENIMAGEIO)
|
|||||||
${OPENEXR_LIBRARIES}
|
${OPENEXR_LIBRARIES}
|
||||||
${ZLIB_LIBRARIES}
|
${ZLIB_LIBRARIES}
|
||||||
)
|
)
|
||||||
if(WITH_CXX11)
|
set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${LIBDIR}/ffmpeg/lib/libwebp.a)
|
||||||
set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${LIBDIR}/ffmpeg/lib/libwebp.a)
|
|
||||||
endif()
|
|
||||||
set(OPENIMAGEIO_LIBPATH
|
set(OPENIMAGEIO_LIBPATH
|
||||||
${OPENIMAGEIO}/lib
|
${OPENIMAGEIO}/lib
|
||||||
${JPEG_LIBPATH}
|
${JPEG_LIBPATH}
|
||||||
@@ -461,10 +431,8 @@ set(PLATFORM_LINKFLAGS
|
|||||||
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker ${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map"
|
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker ${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(WITH_CXX11)
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -stdlib=libc++")
|
||||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -stdlib=libc++")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Suppress ranlib "has no symbols" warnings (workaround for T48250)
|
# Suppress ranlib "has no symbols" warnings (workaround for T48250)
|
||||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||||
|
@@ -101,21 +101,14 @@ if(OSX_SYSTEM MATCHES 10.9)
|
|||||||
set(CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT})
|
set(CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_CXX11)
|
# 10.9 is our min. target, if you use higher sdk, weak linking happens
|
||||||
# 10.9 is our min. target, if you use higher sdk, weak linking happens
|
if(CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||||
if(CMAKE_OSX_DEPLOYMENT_TARGET)
|
if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.9)
|
||||||
if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.9)
|
message(STATUS "Setting deployment target to 10.9, lower versions are incompatible with WITH_CXX11")
|
||||||
message(STATUS "Setting deployment target to 10.9, lower versions are incompatible with WITH_CXX11")
|
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
|
||||||
# 10.6 is our min. target, if you use higher sdk, weak linking happens
|
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")
|
if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")
|
||||||
|
@@ -1254,27 +1254,6 @@ bool GHOST_SystemCocoa::handleTabletEvent(void *eventPtr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
|
|
||||||
enum {
|
|
||||||
NSEventPhaseNone = 0,
|
|
||||||
NSEventPhaseBegan = 0x1 << 0,
|
|
||||||
NSEventPhaseStationary = 0x1 << 1,
|
|
||||||
NSEventPhaseChanged = 0x1 << 2,
|
|
||||||
NSEventPhaseEnded = 0x1 << 3,
|
|
||||||
NSEventPhaseCancelled = 0x1 << 4,
|
|
||||||
};
|
|
||||||
typedef NSUInteger NSEventPhase;
|
|
||||||
|
|
||||||
@interface NSEvent (AvailableOn1070AndLater)
|
|
||||||
- (BOOL)hasPreciseScrollingDeltas;
|
|
||||||
- (CGFloat)scrollingDeltaX;
|
|
||||||
- (CGFloat)scrollingDeltaY;
|
|
||||||
- (NSEventPhase)momentumPhase;
|
|
||||||
- (BOOL)isDirectionInvertedFromDevice;
|
|
||||||
- (NSEventPhase)phase;
|
|
||||||
@end
|
|
||||||
#endif
|
|
||||||
|
|
||||||
GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||||
{
|
{
|
||||||
NSEvent *event = (NSEvent *)eventPtr;
|
NSEvent *event = (NSEvent *)eventPtr;
|
||||||
@@ -1459,7 +1438,6 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
|||||||
double dx;
|
double dx;
|
||||||
double dy;
|
double dy;
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
|
|
||||||
/* with 10.7 nice scrolling deltas are supported */
|
/* with 10.7 nice scrolling deltas are supported */
|
||||||
dx = [event scrollingDeltaX];
|
dx = [event scrollingDeltaX];
|
||||||
dy = [event scrollingDeltaY];
|
dy = [event scrollingDeltaY];
|
||||||
@@ -1469,29 +1447,6 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
|||||||
dx = [event deltaX];
|
dx = [event deltaX];
|
||||||
dy = [event deltaY];
|
dy = [event deltaY];
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
/* trying to pretend you have nice scrolls... */
|
|
||||||
dx = [event deltaX];
|
|
||||||
dy = -[event deltaY];
|
|
||||||
const double deltaMax = 50.0;
|
|
||||||
|
|
||||||
if ((dx == 0) && (dy == 0)) break;
|
|
||||||
|
|
||||||
/* Quadratic acceleration */
|
|
||||||
dx = dx*(fabs(dx) + 0.5);
|
|
||||||
if (dx < 0.0) dx -= 0.5;
|
|
||||||
else dx += 0.5;
|
|
||||||
if (dx < -deltaMax) dx = -deltaMax;
|
|
||||||
else if (dx > deltaMax) dx = deltaMax;
|
|
||||||
|
|
||||||
dy = dy*(fabs(dy) + 0.5);
|
|
||||||
if (dy < 0.0) dy -= 0.5;
|
|
||||||
else dy += 0.5;
|
|
||||||
if (dy < -deltaMax) dy= -deltaMax;
|
|
||||||
else if (dy > deltaMax) dy= deltaMax;
|
|
||||||
|
|
||||||
dy = -dy;
|
|
||||||
#endif
|
|
||||||
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
|
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
|
||||||
|
|
||||||
pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, window, GHOST_kTrackpadEventScroll, x, y, dx, dy));
|
pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, window, GHOST_kTrackpadEventScroll, x, y, dx, dy));
|
||||||
|
@@ -303,8 +303,6 @@ protected:
|
|||||||
|
|
||||||
GHOST_TabletData m_tablet;
|
GHOST_TabletData m_tablet;
|
||||||
|
|
||||||
bool m_lionStyleFullScreen;
|
|
||||||
|
|
||||||
bool m_immediateDraw;
|
bool m_immediateDraw;
|
||||||
bool m_debug_context; // for debug messages during context setup
|
bool m_debug_context; // for debug messages during context setup
|
||||||
};
|
};
|
||||||
|
@@ -43,14 +43,6 @@
|
|||||||
|
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
|
|
||||||
/* Lion style fullscreen support when building with the 10.6 SDK */
|
|
||||||
enum {
|
|
||||||
NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7,
|
|
||||||
NSFullScreenWindowMask = 1 << 14
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#pragma mark Cocoa window delegate object
|
#pragma mark Cocoa window delegate object
|
||||||
|
|
||||||
@interface CocoaWindowDelegate : NSObject
|
@interface CocoaWindowDelegate : NSObject
|
||||||
@@ -511,14 +503,6 @@ enum {
|
|||||||
|
|
||||||
#pragma mark initialization / finalization
|
#pragma mark initialization / finalization
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
|
|
||||||
@interface NSView (NSOpenGLSurfaceResolution)
|
|
||||||
- (BOOL)wantsBestResolutionOpenGLSurface;
|
|
||||||
- (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag;
|
|
||||||
- (NSRect)convertRectToBacking:(NSRect)bounds;
|
|
||||||
@end
|
|
||||||
#endif
|
|
||||||
|
|
||||||
GHOST_WindowCocoa::GHOST_WindowCocoa(
|
GHOST_WindowCocoa::GHOST_WindowCocoa(
|
||||||
GHOST_SystemCocoa *systemCocoa,
|
GHOST_SystemCocoa *systemCocoa,
|
||||||
const STR_String& title,
|
const STR_String& title,
|
||||||
@@ -537,7 +521,6 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
|
|||||||
m_systemCocoa = systemCocoa;
|
m_systemCocoa = systemCocoa;
|
||||||
m_fullScreen = false;
|
m_fullScreen = false;
|
||||||
m_immediateDraw = false;
|
m_immediateDraw = false;
|
||||||
m_lionStyleFullScreen = false;
|
|
||||||
|
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
|
||||||
@@ -613,16 +596,6 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
|
|||||||
if (state == GHOST_kWindowStateFullScreen)
|
if (state == GHOST_kWindowStateFullScreen)
|
||||||
setState(GHOST_kWindowStateFullScreen);
|
setState(GHOST_kWindowStateFullScreen);
|
||||||
|
|
||||||
// Starting with 10.9 (darwin 13.x.x), we can use Lion fullscreen,
|
|
||||||
// since it now has better multi-monitor support
|
|
||||||
// if the screens are spawned, additional screens get useless,
|
|
||||||
// so we only use lionStyleFullScreen when screens have separate spaces
|
|
||||||
|
|
||||||
if ([NSScreen respondsToSelector:@selector(screensHaveSeparateSpaces)] && [NSScreen screensHaveSeparateSpaces]) {
|
|
||||||
// implies we are on >= OSX 10.9
|
|
||||||
m_lionStyleFullScreen = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
[pool drain];
|
[pool drain];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -760,28 +733,18 @@ void GHOST_WindowCocoa::getClientBounds(GHOST_Rect& bounds) const
|
|||||||
|
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
|
||||||
if (!m_fullScreen) {
|
NSRect screenSize = [[m_window screen] visibleFrame];
|
||||||
NSRect screenSize = [[m_window screen] visibleFrame];
|
|
||||||
|
|
||||||
//Max window contents as screen size (excluding title bar...)
|
//Max window contents as screen size (excluding title bar...)
|
||||||
NSRect contentRect = [CocoaWindow contentRectForFrameRect:screenSize
|
NSRect contentRect = [CocoaWindow contentRectForFrameRect:screenSize
|
||||||
styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)];
|
styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)];
|
||||||
|
|
||||||
rect = [m_window contentRectForFrameRect:[m_window frame]];
|
rect = [m_window contentRectForFrameRect:[m_window frame]];
|
||||||
|
|
||||||
bounds.m_b = contentRect.size.height - (rect.origin.y -contentRect.origin.y);
|
bounds.m_b = contentRect.size.height - (rect.origin.y -contentRect.origin.y);
|
||||||
bounds.m_l = rect.origin.x -contentRect.origin.x;
|
bounds.m_l = rect.origin.x -contentRect.origin.x;
|
||||||
bounds.m_r = rect.origin.x-contentRect.origin.x + rect.size.width;
|
bounds.m_r = rect.origin.x-contentRect.origin.x + rect.size.width;
|
||||||
bounds.m_t = contentRect.size.height - (rect.origin.y + rect.size.height -contentRect.origin.y);
|
bounds.m_t = contentRect.size.height - (rect.origin.y + rect.size.height -contentRect.origin.y);
|
||||||
}
|
|
||||||
else {
|
|
||||||
NSRect screenSize = [[m_window screen] frame];
|
|
||||||
|
|
||||||
bounds.m_b = screenSize.origin.y + screenSize.size.height;
|
|
||||||
bounds.m_l = screenSize.origin.x;
|
|
||||||
bounds.m_r = screenSize.origin.x + screenSize.size.width;
|
|
||||||
bounds.m_t = screenSize.origin.y;
|
|
||||||
}
|
|
||||||
[pool drain];
|
[pool drain];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -856,9 +819,6 @@ GHOST_TWindowState GHOST_WindowCocoa::getState() const
|
|||||||
state = GHOST_kWindowStateNormal;
|
state = GHOST_kWindowStateNormal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_fullScreen) {
|
|
||||||
state = GHOST_kWindowStateFullScreen;
|
|
||||||
}
|
|
||||||
else if ([m_window isMiniaturized]) {
|
else if ([m_window isMiniaturized]) {
|
||||||
state = GHOST_kWindowStateMinimized;
|
state = GHOST_kWindowStateMinimized;
|
||||||
}
|
}
|
||||||
@@ -940,15 +900,12 @@ NSScreen* GHOST_WindowCocoa::getScreen()
|
|||||||
/* called for event, when window leaves monitor to another */
|
/* called for event, when window leaves monitor to another */
|
||||||
void GHOST_WindowCocoa::setNativePixelSize(void)
|
void GHOST_WindowCocoa::setNativePixelSize(void)
|
||||||
{
|
{
|
||||||
/* make sure 10.6 keeps running */
|
NSRect backingBounds = [m_openGLView convertRectToBacking:[m_openGLView bounds]];
|
||||||
if ([m_openGLView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
|
|
||||||
NSRect backingBounds = [m_openGLView convertRectToBacking:[m_openGLView bounds]];
|
|
||||||
|
|
||||||
GHOST_Rect rect;
|
GHOST_Rect rect;
|
||||||
getClientBounds(rect);
|
getClientBounds(rect);
|
||||||
|
|
||||||
m_nativePixelSize = (float)backingBounds.size.width / (float)rect.getWidth();
|
m_nativePixelSize = (float)backingBounds.size.width / (float)rect.getWidth();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -973,35 +930,8 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
|
|||||||
{
|
{
|
||||||
NSUInteger masks = [m_window styleMask];
|
NSUInteger masks = [m_window styleMask];
|
||||||
|
|
||||||
if (!m_fullScreen && !(masks & NSFullScreenWindowMask)) {
|
if (!(masks & NSFullScreenWindowMask)) {
|
||||||
if (m_lionStyleFullScreen) {
|
[m_window toggleFullScreen:nil];
|
||||||
[m_window toggleFullScreen:nil];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
|
||||||
|
|
||||||
/* This status change needs to be done before Cocoa call to enter fullscreen mode
|
|
||||||
* to give window delegate hint not to forward its deactivation to ghost wm that
|
|
||||||
* doesn't know view/window difference. */
|
|
||||||
m_fullScreen = true;
|
|
||||||
|
|
||||||
/* Disable toggle for Lion style fullscreen */
|
|
||||||
[m_window setCollectionBehavior:NSWindowCollectionBehaviorDefault];
|
|
||||||
|
|
||||||
//10.6 provides Cocoa functions to autoshow menu bar, and to change a window style
|
|
||||||
//Hide menu & dock if on primary screen. else only menu
|
|
||||||
if ([[m_window screen] isEqual:[[NSScreen screens] objectAtIndex:0]]) {
|
|
||||||
[NSApp setPresentationOptions:(NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar)];
|
|
||||||
}
|
|
||||||
//Make window borderless and enlarge it
|
|
||||||
[m_window setStyleMask:NSBorderlessWindowMask];
|
|
||||||
[m_window setFrame:[[m_window screen] frame] display:YES];
|
|
||||||
[m_window makeFirstResponder:m_openGLView];
|
|
||||||
|
|
||||||
//Tell WM of view new size
|
|
||||||
m_systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, this);
|
|
||||||
|
|
||||||
[pool drain];
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1014,26 +944,6 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
|
|||||||
// Lion style fullscreen
|
// Lion style fullscreen
|
||||||
[m_window toggleFullScreen:nil];
|
[m_window toggleFullScreen:nil];
|
||||||
}
|
}
|
||||||
else if (m_fullScreen) {
|
|
||||||
m_fullScreen = false;
|
|
||||||
|
|
||||||
/* Enable toggle for into Lion style fullscreen */
|
|
||||||
[m_window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
|
||||||
|
|
||||||
//Exit fullscreen
|
|
||||||
//Show again menu & dock if needed
|
|
||||||
if ([[m_window screen] isEqual:[NSScreen mainScreen]]) {
|
|
||||||
[NSApp setPresentationOptions:NSApplicationPresentationDefault];
|
|
||||||
}
|
|
||||||
//Make window normal and resize it
|
|
||||||
[m_window setStyleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)];
|
|
||||||
[m_window setFrame:[[m_window screen] visibleFrame] display:YES];
|
|
||||||
//TODO for 10.6 only : window title is forgotten after the style change
|
|
||||||
[m_window makeFirstResponder:m_openGLView];
|
|
||||||
|
|
||||||
//Tell WM of view new size
|
|
||||||
m_systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, this);
|
|
||||||
}
|
|
||||||
else if ([m_window isMiniaturized])
|
else if ([m_window isMiniaturized])
|
||||||
[m_window deminiaturize:nil];
|
[m_window deminiaturize:nil];
|
||||||
else if ([m_window isZoomed])
|
else if ([m_window isZoomed])
|
||||||
@@ -1223,7 +1133,6 @@ GHOST_TSuccess GHOST_WindowCocoa::setProgressBar(float progress)
|
|||||||
return GHOST_kSuccess;
|
return GHOST_kSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
|
|
||||||
static void postNotification()
|
static void postNotification()
|
||||||
{
|
{
|
||||||
NSUserNotification *notification = [[NSUserNotification alloc] init];
|
NSUserNotification *notification = [[NSUserNotification alloc] init];
|
||||||
@@ -1233,7 +1142,6 @@ static void postNotification()
|
|||||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
|
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
|
||||||
[notification release];
|
[notification release];
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
GHOST_TSuccess GHOST_WindowCocoa::endProgressBar()
|
GHOST_TSuccess GHOST_WindowCocoa::endProgressBar()
|
||||||
{
|
{
|
||||||
@@ -1248,15 +1156,13 @@ GHOST_TSuccess GHOST_WindowCocoa::endProgressBar()
|
|||||||
[dockIcon unlockFocus];
|
[dockIcon unlockFocus];
|
||||||
[NSApp setApplicationIconImage:dockIcon];
|
[NSApp setApplicationIconImage:dockIcon];
|
||||||
|
|
||||||
|
// We use notifications to inform the user when the progress reached 100%
|
||||||
// With OSX 10.8 and later, we can use notifications to inform the user when the progress reached 100%
|
// Atm. just fire this when the progressbar ends, the behavior is controlled
|
||||||
// Atm. just fire this when the progressbar ends, the behavior is controlled in the NotificationCenter
|
// in the NotificationCenter If Blender is not frontmost window, a message
|
||||||
// If Blender is not frontmost window, a message pops up with sound, in any case an entry in notifications
|
// pops up with sound, in any case an entry in notifications
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
|
|
||||||
if ([NSUserNotificationCenter respondsToSelector:@selector(defaultUserNotificationCenter)]) {
|
if ([NSUserNotificationCenter respondsToSelector:@selector(defaultUserNotificationCenter)]) {
|
||||||
postNotification();
|
postNotification();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
[dockIcon release];
|
[dockIcon release];
|
||||||
|
|
||||||
|
@@ -915,49 +915,11 @@ elseif(APPLE)
|
|||||||
|
|
||||||
# python
|
# python
|
||||||
if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
|
if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
|
||||||
if(WITH_CXX11)
|
# Copy the python libs into the install directory
|
||||||
# Copy the python libs into the install directory
|
install_dir(
|
||||||
install_dir(
|
${PYTHON_LIBPATH}
|
||||||
${PYTHON_LIBPATH}
|
${TARGETDIR_VER}/python/lib
|
||||||
${TARGETDIR_VER}/python/lib
|
)
|
||||||
)
|
|
||||||
else()
|
|
||||||
# the python zip is first extracted as part of the build process,
|
|
||||||
# and then later installed as part of make install. this is much
|
|
||||||
# quicker, and means we can easily exclude files on copy
|
|
||||||
# Not needed for PYTHON_MODULE or WEB_PLUGIN due uses Pyhon framework
|
|
||||||
# use a hash of the .zip path to handle switching between different
|
|
||||||
# lib directories without needing a clean build
|
|
||||||
string(SHA1 PYTHON_ZIP_HASH ${LIBDIR}/release/${PYTHON_ZIP})
|
|
||||||
set(PYTHON_EXTRACT_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_ZIP_HASH}/python)
|
|
||||||
|
|
||||||
add_custom_target(
|
|
||||||
extractpyzip
|
|
||||||
DEPENDS ${PYTHON_EXTRACT_DIR})
|
|
||||||
|
|
||||||
set(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
|
|
||||||
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${PYTHON_EXTRACT_DIR}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PYTHON_EXTRACT_DIR}/"
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${PYTHON_EXTRACT_DIR}/"
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E chdir "${PYTHON_EXTRACT_DIR}/"
|
|
||||||
${CMAKE_COMMAND} -E tar xzfv "${LIBDIR}/release/${PYTHON_ZIP}"
|
|
||||||
DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
|
|
||||||
|
|
||||||
add_dependencies(blender extractpyzip)
|
|
||||||
|
|
||||||
# copy extracted python files
|
|
||||||
install_dir(
|
|
||||||
${PYTHON_EXTRACT_DIR}
|
|
||||||
\${TARGETDIR_VER}
|
|
||||||
)
|
|
||||||
# copy site-packages files
|
|
||||||
install_dir(
|
|
||||||
${LIBDIR}/release/site-packages
|
|
||||||
\${TARGETDIR_VER}/python/lib/python${PYTHON_VERSION}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
install(DIRECTORY ${LIBDIR}/python/bin
|
install(DIRECTORY ${LIBDIR}/python/bin
|
||||||
DESTINATION ${TARGETDIR_VER}/python
|
DESTINATION ${TARGETDIR_VER}/python
|
||||||
@@ -1012,27 +974,11 @@ elseif(APPLE)
|
|||||||
|
|
||||||
# python
|
# python
|
||||||
if(WITH_PYTHON AND NOT WITH_PYTHON_FRAMEWORK)
|
if(WITH_PYTHON AND NOT WITH_PYTHON_FRAMEWORK)
|
||||||
if(WITH_CXX11)
|
# Copy the python libs into the install directory
|
||||||
# Copy the python libs into the install directory
|
install_dir(
|
||||||
install_dir(
|
${PYTHON_LIBPATH}
|
||||||
${PYTHON_LIBPATH}
|
${PLAYER_TARGETDIR_VER}/python/lib
|
||||||
${PLAYER_TARGETDIR_VER}/python/lib
|
)
|
||||||
)
|
|
||||||
else()
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${PYTHON_EXTRACT_DIR}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PYTHON_EXTRACT_DIR}/"
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${PYTHON_EXTRACT_DIR}/"
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E chdir "${PYTHON_EXTRACT_DIR}/"
|
|
||||||
${CMAKE_COMMAND} -E tar xzfv "${LIBDIR}/release/${PYTHON_ZIP}"
|
|
||||||
DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
|
|
||||||
|
|
||||||
# copy extracted python files
|
|
||||||
install_dir(
|
|
||||||
${PYTHON_EXTRACT_DIR}
|
|
||||||
\${PLAYER_TARGETDIR_VER}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
Reference in New Issue
Block a user