Merge with develop
--HG-- branch : experimental-ui-scaling
This commit is contained in:
commit
3157984c21
120 changed files with 2917 additions and 1143 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -216,6 +216,7 @@ code/ryzom/server/src/ryzom_admin_service/ryzom_admin_service
|
||||||
code/ryzom/server/src/ryzom_naming_service/ryzom_naming_service
|
code/ryzom/server/src/ryzom_naming_service/ryzom_naming_service
|
||||||
code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service
|
code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service
|
||||||
code/ryzom/server/src/tick_service/tick_service
|
code/ryzom/server/src/tick_service/tick_service
|
||||||
|
|
||||||
# WebTT temp dir
|
# WebTT temp dir
|
||||||
code/ryzom/tools/server/www/webtt/app/tmp
|
code/ryzom/tools/server/www/webtt/app/tmp
|
||||||
|
|
||||||
|
@ -236,13 +237,13 @@ code/ryzom/tools/server/ryzom_ams/old
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#tools and external dir's
|
# Tools and external directories
|
||||||
external
|
external
|
||||||
external_stlport
|
external_stlport
|
||||||
nel_tools*
|
nel_tools*
|
||||||
ryzom_tools*
|
ryzom_tools*
|
||||||
|
|
||||||
#Dumps
|
# Dumps
|
||||||
*.dmp
|
*.dmp
|
||||||
|
|
||||||
code/nel/tools/build_gamedata/processes/ai_wmap/ai_build_wmap.cfg
|
code/nel/tools/build_gamedata/processes/ai_wmap/ai_build_wmap.cfg
|
||||||
|
|
|
@ -9,7 +9,7 @@ os:
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
env:
|
env:
|
||||||
- CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_LUA51=ON -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL_TOOLS=OFF"
|
- CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL_TOOLS=OFF"
|
||||||
- CMAKE_CONFIGURE_OPTIONS="-DCPPTEST_LIBRARY_DEBUG:STRING=/usr/lib/libcpptest.so"
|
- CMAKE_CONFIGURE_OPTIONS="-DCPPTEST_LIBRARY_DEBUG:STRING=/usr/lib/libcpptest.so"
|
||||||
CMAKE_BUILD_OPTIONS="--target nel_unit_test -- -j 2"
|
CMAKE_BUILD_OPTIONS="--target nel_unit_test -- -j 2"
|
||||||
RUN="build/bin/nel_unit_test"
|
RUN="build/bin/nel_unit_test"
|
||||||
|
|
|
@ -53,8 +53,8 @@ ENDIF()
|
||||||
|
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||||
PROJECT(RyzomCore CXX C)
|
PROJECT(RyzomCore CXX C)
|
||||||
SET(NL_VERSION_MAJOR 0)
|
SET(NL_VERSION_MAJOR 1)
|
||||||
SET(NL_VERSION_MINOR 12)
|
SET(NL_VERSION_MINOR 0)
|
||||||
SET(NL_VERSION_PATCH 0)
|
SET(NL_VERSION_PATCH 0)
|
||||||
SET(YEAR "2004-${CURRENT_YEAR}")
|
SET(YEAR "2004-${CURRENT_YEAR}")
|
||||||
SET(AUTHOR "Winch Gate and The Ryzom Core Community")
|
SET(AUTHOR "Winch Gate and The Ryzom Core Community")
|
||||||
|
@ -86,12 +86,12 @@ NL_SETUP_NELNS_DEFAULT_OPTIONS()
|
||||||
NL_SETUP_RYZOM_DEFAULT_OPTIONS()
|
NL_SETUP_RYZOM_DEFAULT_OPTIONS()
|
||||||
NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS()
|
NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS()
|
||||||
|
|
||||||
NL_SETUP_PREFIX_PATHS()
|
|
||||||
RYZOM_SETUP_PREFIX_PATHS()
|
|
||||||
|
|
||||||
NL_SETUP_BUILD()
|
NL_SETUP_BUILD()
|
||||||
NL_SETUP_BUILD_FLAGS()
|
NL_SETUP_BUILD_FLAGS()
|
||||||
|
|
||||||
|
NL_SETUP_PREFIX_PATHS()
|
||||||
|
RYZOM_SETUP_PREFIX_PATHS()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
#Platform specifics
|
#Platform specifics
|
||||||
|
|
||||||
|
@ -167,6 +167,7 @@ ENDIF()
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
FIND_LIBRARY(CARBON_FRAMEWORK Carbon)
|
FIND_LIBRARY(CARBON_FRAMEWORK Carbon)
|
||||||
FIND_LIBRARY(FOUNDATION_FRAMEWORK Foundation)
|
FIND_LIBRARY(FOUNDATION_FRAMEWORK Foundation)
|
||||||
|
FIND_LIBRARY(SECURITY_FRAMEWORK Security)
|
||||||
|
|
||||||
IF(APPLE_CERTIFICATE)
|
IF(APPLE_CERTIFICATE)
|
||||||
# Find codesign_allocate
|
# Find codesign_allocate
|
||||||
|
@ -191,214 +192,10 @@ IF(APPLE)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
MACRO(ADD_QT_LIBRARY _NAME)
|
INCLUDE(FindHelpers)
|
||||||
IF(WIN32)
|
|
||||||
SET(_PREFIX "Qt5")
|
|
||||||
SET(_EXT "lib")
|
|
||||||
ELSE()
|
|
||||||
SET(_PREFIX "libQt5")
|
|
||||||
SET(_EXT "a")
|
|
||||||
ENDIF()
|
|
||||||
SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}.${_EXT}")
|
|
||||||
IF(EXISTS ${_LIB})
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} optimized ${_LIB})
|
|
||||||
ENDIF()
|
|
||||||
SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}d.${_EXT}")
|
|
||||||
IF(EXISTS ${_LIB})
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} debug ${_LIB})
|
|
||||||
ENDIF()
|
|
||||||
ENDMACRO()
|
|
||||||
|
|
||||||
MACRO(ADD_QT_PLUGIN _TYPE _NAME)
|
|
||||||
IF(WIN32)
|
|
||||||
SET(_PREFIX "")
|
|
||||||
SET(_EXT "lib")
|
|
||||||
ELSE()
|
|
||||||
SET(_PREFIX "lib")
|
|
||||||
SET(_EXT "a")
|
|
||||||
ENDIF()
|
|
||||||
SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}.${_EXT}")
|
|
||||||
IF(EXISTS ${_LIB})
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} optimized ${_LIB})
|
|
||||||
ENDIF()
|
|
||||||
SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}d.${_EXT}")
|
|
||||||
IF(EXISTS ${_LIB})
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} debug ${_LIB})
|
|
||||||
ENDIF()
|
|
||||||
ENDMACRO()
|
|
||||||
|
|
||||||
IF(WITH_QT5)
|
IF(WITH_QT5)
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)
|
FIND_QT5()
|
||||||
|
|
||||||
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QTDIR} $ENV{QTDIR})
|
|
||||||
|
|
||||||
FIND_PACKAGE(Qt5Core QUIET)
|
|
||||||
|
|
||||||
IF(Qt5Core_FOUND)
|
|
||||||
# Check if we are using Qt static or shared libraries
|
|
||||||
GET_TARGET_PROPERTY(_FILE Qt5::Core IMPORTED_LOCATION_RELEASE)
|
|
||||||
|
|
||||||
SET(QT_VERSION "${Qt5Core_VERSION_STRING}")
|
|
||||||
SET(_VERSION "${QT_VERSION}")
|
|
||||||
|
|
||||||
IF(_FILE MATCHES "\\.(lib|a)$")
|
|
||||||
SET(QT_STATIC ON)
|
|
||||||
SET(_VERSION "${_VERSION} static version")
|
|
||||||
ELSE()
|
|
||||||
SET(QT_STATIC OFF)
|
|
||||||
SET(_VERSION "${_VERSION} shared version")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
MESSAGE(STATUS "Found Qt ${_VERSION}")
|
|
||||||
|
|
||||||
# These variables are not defined with Qt5 CMake modules
|
|
||||||
SET(QT_BINARY_DIR "${_qt5Core_install_prefix}/bin")
|
|
||||||
SET(QT_LIBRARY_DIR "${_qt5Core_install_prefix}/lib")
|
|
||||||
SET(QT_PLUGINS_DIR "${_qt5Core_install_prefix}/plugins")
|
|
||||||
SET(QT_TRANSLATIONS_DIR "${_qt5Core_install_prefix}/translations")
|
|
||||||
|
|
||||||
# Fix wrong include directories with Qt 5 under Mac OS X
|
|
||||||
INCLUDE_DIRECTORIES("${_qt5Core_install_prefix}/include")
|
|
||||||
|
|
||||||
FIND_PACKAGE(Qt5Gui)
|
|
||||||
FIND_PACKAGE(Qt5Widgets)
|
|
||||||
FIND_PACKAGE(Qt5OpenGL)
|
|
||||||
FIND_PACKAGE(Qt5Xml)
|
|
||||||
FIND_PACKAGE(Qt5LinguistTools)
|
|
||||||
FIND_PACKAGE(Qt5Network)
|
|
||||||
|
|
||||||
IF(QT_STATIC)
|
|
||||||
ADD_DEFINITIONS(-DQT_STATICPLUGIN)
|
|
||||||
|
|
||||||
SET(QT_LIBRARIES Qt5::Widgets)
|
|
||||||
|
|
||||||
# Gui
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Gui Qt5::OpenGL)
|
|
||||||
|
|
||||||
ADD_QT_LIBRARY(PrintSupport)
|
|
||||||
|
|
||||||
IF(WIN32)
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES}
|
|
||||||
${WINSDK_LIBRARY_DIR}/Imm32.lib
|
|
||||||
${WINSDK_LIBRARY_DIR}/OpenGL32.lib
|
|
||||||
${WINSDK_LIBRARY_DIR}/WinMM.Lib)
|
|
||||||
ADD_QT_PLUGIN(platforms qwindows)
|
|
||||||
ADD_QT_LIBRARY(PlatformSupport)
|
|
||||||
ELSEIF(APPLE)
|
|
||||||
# Cups needs .dylib
|
|
||||||
SET(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
|
||||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib)
|
|
||||||
FIND_LIBRARY(CUPS_LIBRARY cups)
|
|
||||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES})
|
|
||||||
|
|
||||||
FIND_LIBRARY(IOKIT_FRAMEWORK IOKit)
|
|
||||||
FIND_LIBRARY(COCOA_FRAMEWORK Cocoa)
|
|
||||||
FIND_LIBRARY(SYSTEMCONFIGURATION_FRAMEWORK SystemConfiguration)
|
|
||||||
FIND_LIBRARY(OPENGL_FRAMEWORK NAMES OpenGL)
|
|
||||||
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES}
|
|
||||||
${CUPS_LIBRARY}
|
|
||||||
${COCOA_FRAMEWORK}
|
|
||||||
${SYSTEMCONFIGURATION_FRAMEWORK}
|
|
||||||
${IOKIT_FRAMEWORK}
|
|
||||||
${OPENGL_FRAMEWORK})
|
|
||||||
|
|
||||||
ADD_QT_PLUGIN(printsupport cocoaprintersupport)
|
|
||||||
ADD_QT_PLUGIN(platforms qcocoa)
|
|
||||||
ADD_QT_LIBRARY(PlatformSupport)
|
|
||||||
ELSE()
|
|
||||||
# order is very important there
|
|
||||||
ADD_QT_PLUGIN(platforms qxcb)
|
|
||||||
ADD_QT_PLUGIN(xcbglintegrations qxcb-glx-integration)
|
|
||||||
|
|
||||||
ADD_QT_LIBRARY(XcbQpa)
|
|
||||||
ADD_QT_LIBRARY(PlatformSupport)
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} -lX11-xcb -lXi -lSM -lICE -lxcb -lGL -lxcb-glx)
|
|
||||||
IF(EXISTS "${QT_LIBRARY_DIR}/libxcb-static.a")
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_LIBRARY_DIR}/libxcb-static.a")
|
|
||||||
ENDIF()
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} -lfontconfig)
|
|
||||||
ADD_QT_LIBRARY(DBus)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
ADD_QT_PLUGIN(imageformats qgif)
|
|
||||||
ADD_QT_PLUGIN(imageformats qicns)
|
|
||||||
ADD_QT_PLUGIN(imageformats qico)
|
|
||||||
ADD_QT_PLUGIN(imageformats qjpeg)
|
|
||||||
|
|
||||||
# harfbuzz is needed since Qt 5.3
|
|
||||||
IF(UNIX)
|
|
||||||
SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzzng.a")
|
|
||||||
ELSEIF(WIN32)
|
|
||||||
SET(HB_LIB "${QT_LIBRARY_DIR}/qtharfbuzzng.lib")
|
|
||||||
ENDIF()
|
|
||||||
IF(EXISTS ${HB_LIB})
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} ${HB_LIB})
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
# freetype is needed since Qt 5.5
|
|
||||||
FIND_PACKAGE(Freetype)
|
|
||||||
|
|
||||||
IF(FREETYPE_FOUND)
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIBRARIES})
|
|
||||||
ELSE()
|
|
||||||
IF(UNIX)
|
|
||||||
SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/libqtfreetype.a")
|
|
||||||
ELSEIF(WIN32)
|
|
||||||
SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/qtfreetype.lib")
|
|
||||||
ENDIF()
|
|
||||||
IF(EXISTS ${FREETYPE_LIB})
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIB})
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
ADD_QT_PLUGIN(accessible qtaccessiblewidgets)
|
|
||||||
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARY})
|
|
||||||
|
|
||||||
# Network
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Network Qt5::Xml)
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES})
|
|
||||||
|
|
||||||
IF(WIN32)
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES}
|
|
||||||
${WINSDK_LIBRARY_DIR}/Crypt32.lib
|
|
||||||
${WINSDK_LIBRARY_DIR}/WS2_32.Lib
|
|
||||||
${WINSDK_LIBRARY_DIR}/IPHlpApi.Lib)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
# Core
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Core)
|
|
||||||
|
|
||||||
# pcre is needed since Qt 5.5
|
|
||||||
IF(UNIX)
|
|
||||||
SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre.a")
|
|
||||||
ELSEIF(WIN32)
|
|
||||||
SET(PCRE_LIB "${QT_LIBRARY_DIR}/qtpcre.lib")
|
|
||||||
ENDIF()
|
|
||||||
IF(EXISTS ${PCRE_LIB})
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} ${PCRE_LIB})
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF(APPLE)
|
|
||||||
FIND_LIBRARY(PCRE_LIBRARY pcre16 pcre)
|
|
||||||
|
|
||||||
FIND_LIBRARY(SECURITY_FRAMEWORK Security)
|
|
||||||
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES}
|
|
||||||
${PCRE_LIBRARY}
|
|
||||||
${FOUNDATION_FRAMEWORK}
|
|
||||||
${CARBON_FRAMEWORK}
|
|
||||||
${SECURITY_FRAMEWORK})
|
|
||||||
ELSEIF(UNIX)
|
|
||||||
SET(QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -ldl -lrt)
|
|
||||||
ENDIF()
|
|
||||||
ELSE()
|
|
||||||
SET(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Gui Qt5::OpenGL Qt5::Core)
|
|
||||||
ENDIF()
|
|
||||||
ELSE()
|
|
||||||
MESSAGE(WARNING "Unable to find Qt 5")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(WITH_QT)
|
IF(WITH_QT)
|
||||||
|
@ -430,22 +227,41 @@ IF(WITH_NEL)
|
||||||
IF(CURL_STATIC)
|
IF(CURL_STATIC)
|
||||||
SET(CURL_DEFINITIONS -DCURL_STATICLIB)
|
SET(CURL_DEFINITIONS -DCURL_STATICLIB)
|
||||||
|
|
||||||
SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
|
LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
|
||||||
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES})
|
LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES})
|
||||||
|
|
||||||
IF(UNIX)
|
IF(WIN32)
|
||||||
|
LIST(APPEND CURL_LIBRARIES Crypt32 Cryptui)
|
||||||
|
ELSE()
|
||||||
# CURL depends on libidn
|
# CURL depends on libidn
|
||||||
FIND_LIBRARY(IDN_LIBRARY idn)
|
FIND_LIBRARY(IDN_LIBRARY idn)
|
||||||
IF(IDN_LIBRARY)
|
IF(IDN_LIBRARY)
|
||||||
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${IDN_LIBRARY})
|
LIST(APPEND CURL_LIBRARIES ${IDN_LIBRARY})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# CURL Macports version depends on libidn, libintl and libiconv too
|
# CURL Macports version can depend on libidn, libidn2, libintl, libpsl and libiconv too
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
FIND_LIBRARY(INTL_LIBRARY intl)
|
FIND_LIBRARY(INTL_LIBRARY intl)
|
||||||
IF(INTL_LIBRARY)
|
IF(INTL_LIBRARY)
|
||||||
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${INTL_LIBRARY})
|
LIST(APPEND CURL_LIBRARIES ${INTL_LIBRARY})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_LIBRARY(IDN2_LIBRARY idn2)
|
||||||
|
IF(IDN2_LIBRARY)
|
||||||
|
LIST(APPEND CURL_LIBRARIES ${IDN2_LIBRARY})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_LIBRARY(PSL_LIBRARY psl)
|
||||||
|
IF(PSL_LIBRARY)
|
||||||
|
LIST(APPEND CURL_LIBRARIES ${PSL_LIBRARY})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_LIBRARY(UNISTRING_LIBRARY unistring)
|
||||||
|
IF(UNISTRING_LIBRARY)
|
||||||
|
LIST(APPEND CURL_LIBRARIES ${UNISTRING_LIBRARY})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
LIST(APPEND CURL_LIBRARIES ${SECURITY_FRAMEWORK})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@ -453,6 +269,19 @@ IF(WITH_NEL)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include)
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include)
|
||||||
ADD_SUBDIRECTORY(nel)
|
ADD_SUBDIRECTORY(nel)
|
||||||
|
|
||||||
|
# Aliases for targets
|
||||||
|
SET(NELMISC_LIBRARIES nelmisc)
|
||||||
|
SET(NELNET_LIBRARIES nelnet)
|
||||||
|
SET(NELLIGO_LIBRARIES nelligo)
|
||||||
|
SET(NELGEORGES_LIBRARIES nelgeorges)
|
||||||
|
SET(NEL3D_LIBRARIES nel3d)
|
||||||
|
SET(NELGUI_LIBRARIES nelgui)
|
||||||
|
SET(NELSOUND_LIBRARIES nelsound)
|
||||||
|
ELSE()
|
||||||
|
# FIND_PACKAGE(NeL COMPONENTS 3d misc pacs sound nimp REQUIRED)
|
||||||
|
FIND_PACKAGE(NeL REQUIRED)
|
||||||
|
INCLUDE_DIRECTORIES(${NEL_INCLUDE_DIRS})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(WITH_RYZOM)
|
IF(WITH_RYZOM)
|
||||||
|
|
959
code/CMakeModules/FindHelpers.cmake
Normal file
959
code/CMakeModules/FindHelpers.cmake
Normal file
|
@ -0,0 +1,959 @@
|
||||||
|
MACRO(CONVERT_NUMBER_VERSION _VERSION_NUMBER _BASE _OUT)
|
||||||
|
SET(${_OUT})
|
||||||
|
SET(_NUMBER ${_VERSION_NUMBER})
|
||||||
|
WHILE(_NUMBER GREATER 0)
|
||||||
|
MATH(EXPR _TEMP "${_NUMBER} % ${_BASE}")
|
||||||
|
LIST(APPEND ${_OUT} ${_TEMP})
|
||||||
|
MATH(EXPR _NUMBER "${_NUMBER} / ${_BASE}")
|
||||||
|
ENDWHILE()
|
||||||
|
ENDMACRO(CONVERT_NUMBER_VERSION)
|
||||||
|
|
||||||
|
FUNCTION(JOIN VALUES GLUE OUTPUT)
|
||||||
|
STRING(REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}")
|
||||||
|
STRING(REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping
|
||||||
|
SET(${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
|
||||||
|
ENDFUNCTION()
|
||||||
|
|
||||||
|
MACRO(PARSE_VERSION_OTHER FILENAME)
|
||||||
|
IF(EXISTS ${FILENAME})
|
||||||
|
SET(_FILTER_ARRAY ${ARGN})
|
||||||
|
JOIN("${_FILTER_ARRAY}" "|" _FILTER_REGEX)
|
||||||
|
FILE(STRINGS ${FILENAME} _FILE REGEX "(${_FILTER_REGEX})[: \t=\(\)\"]+([0-9.]+)")
|
||||||
|
|
||||||
|
IF(_FILE)
|
||||||
|
FOREACH(_LINE ${_FILE})
|
||||||
|
FOREACH(_VAR ${_FILTER_ARRAY})
|
||||||
|
IF("${${_VAR}}" STREQUAL "")
|
||||||
|
STRING(REGEX REPLACE "^.*${_VAR}[: \t=\(\)\"]+([0-9.]+).*$" "\\1" ${_VAR} "${_LINE}")
|
||||||
|
IF(${_VAR} STREQUAL "${_LINE}")
|
||||||
|
SET(${_VAR})
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT ${_VAR} AND NOT STREQUAL "0")
|
||||||
|
SET(${_VAR} 0)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
# macro to define FIND_PACKAGE options with a different package name
|
||||||
|
MACRO(FIX_PACKAGE_OPTIONS OLDNAME NEWNAME)
|
||||||
|
# append other options if needed
|
||||||
|
SET(_OPTIONS COMPONENTS REQUIRED QUIETLY)
|
||||||
|
|
||||||
|
# process each options
|
||||||
|
FOREACH(_OPTION ${_OPTIONS})
|
||||||
|
SET(OLD_OPTION ${OLDNAME}_FIND_${_OPTION})
|
||||||
|
IF(DEFINED )
|
||||||
|
SET(NEW_OPTION ${NEWNAME}_FIND_${_OPTION})
|
||||||
|
SET(${NEW_OPTION} ${OLD_OPTION})
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO(FIND_PACKAGE_HELPER NAME INCLUDE)
|
||||||
|
# Looks for a directory containing NAME.
|
||||||
|
#
|
||||||
|
# NAME is the name of the library, lowercase and uppercase can be mixed
|
||||||
|
# It should be EXACTLY (same case) the same part as XXXX in FindXXXX.cmake
|
||||||
|
#
|
||||||
|
# INCLUDE is the file to check for includes
|
||||||
|
#
|
||||||
|
# Following parameters are optional variables and must be prefixed by:
|
||||||
|
#
|
||||||
|
# RELEASE is the list of libraries to check in release mode
|
||||||
|
# DEBUG is the list of libraries to check in debug mode
|
||||||
|
# SUFFIXES is the PATH_SUFFIXES to check for include file
|
||||||
|
# QUIET don't display anything
|
||||||
|
# VERBOSE display more details if not found
|
||||||
|
# REQUIRED throw an error if not found
|
||||||
|
# DIR is the base directory where to look for
|
||||||
|
#
|
||||||
|
# The first match will be used in the specified order and next matches will be ignored
|
||||||
|
#
|
||||||
|
# The following values are defined
|
||||||
|
# NAME_INCLUDE_DIR - where to find NAME
|
||||||
|
# NAME_LIBRARIES - link against these to use NAME
|
||||||
|
# NAME_FOUND - True if NAME is available.
|
||||||
|
|
||||||
|
SET(_PARAMS ${ARGN})
|
||||||
|
|
||||||
|
SET(_RELEASE_LIBRARIES)
|
||||||
|
SET(_DEBUG_LIBRARIES)
|
||||||
|
SET(_SUFFIXES)
|
||||||
|
SET(_BASE_DIRECTORIES)
|
||||||
|
|
||||||
|
SET(_IS_RELEASE OFF)
|
||||||
|
SET(_IS_DEBUG OFF)
|
||||||
|
SET(_IS_SUFFIXES OFF)
|
||||||
|
SET(_IS_VERBOSE OFF)
|
||||||
|
SET(_IS_DIR OFF)
|
||||||
|
|
||||||
|
IF(_PARAMS)
|
||||||
|
FOREACH(_PARAM ${_PARAMS})
|
||||||
|
IF(_PARAM STREQUAL "RELEASE")
|
||||||
|
SET(_IS_RELEASE ON)
|
||||||
|
SET(_IS_DEBUG OFF)
|
||||||
|
SET(_IS_SUFFIXES OFF)
|
||||||
|
SET(_IS_DIR OFF)
|
||||||
|
ELSEIF(_PARAM STREQUAL "DEBUG")
|
||||||
|
SET(_IS_RELEASE OFF)
|
||||||
|
SET(_IS_DEBUG ON)
|
||||||
|
SET(_IS_SUFFIXES OFF)
|
||||||
|
SET(_IS_DIR OFF)
|
||||||
|
ELSEIF(_PARAM STREQUAL "SUFFIXES")
|
||||||
|
SET(_IS_RELEASE OFF)
|
||||||
|
SET(_IS_DEBUG OFF)
|
||||||
|
SET(_IS_DIR OFF)
|
||||||
|
SET(_IS_SUFFIXES ON)
|
||||||
|
ELSEIF(_PARAM STREQUAL "QUIET")
|
||||||
|
SET(_IS_RELEASE OFF)
|
||||||
|
SET(_IS_DEBUG OFF)
|
||||||
|
SET(_IS_SUFFIXES OFF)
|
||||||
|
SET(_IS_DIR OFF)
|
||||||
|
SET(${NAME}_FIND_QUIETLY ON)
|
||||||
|
ELSEIF(_PARAM STREQUAL "VERBOSE")
|
||||||
|
SET(_IS_RELEASE OFF)
|
||||||
|
SET(_IS_DEBUG OFF)
|
||||||
|
SET(_IS_SUFFIXES OFF)
|
||||||
|
SET(_IS_DIR OFF)
|
||||||
|
SET(_IS_VERBOSE ON)
|
||||||
|
ELSEIF(_PARAM STREQUAL "REQUIRED")
|
||||||
|
SET(_IS_RELEASE OFF)
|
||||||
|
SET(_IS_DEBUG OFF)
|
||||||
|
SET(_IS_SUFFIXES OFF)
|
||||||
|
SET(_IS_DIR OFF)
|
||||||
|
SET(${NAME}_FIND_REQUIRED ON)
|
||||||
|
ELSEIF(_PARAM STREQUAL "DIR")
|
||||||
|
SET(_IS_RELEASE OFF)
|
||||||
|
SET(_IS_DEBUG OFF)
|
||||||
|
SET(_IS_SUFFIXES OFF)
|
||||||
|
SET(_IS_DIR ON)
|
||||||
|
ELSE()
|
||||||
|
IF(_IS_RELEASE)
|
||||||
|
LIST(APPEND _RELEASE_LIBRARIES ${_PARAM})
|
||||||
|
ELSEIF(_IS_DEBUG)
|
||||||
|
LIST(APPEND _DEBUG_LIBRARIES ${_PARAM})
|
||||||
|
ELSEIF(_IS_SUFFIXES)
|
||||||
|
LIST(APPEND _SUFFIXES ${_PARAM})
|
||||||
|
ELSEIF(_IS_DIR)
|
||||||
|
LIST(APPEND _BASE_DIRECTORIES ${_PARAM})
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS "parameter ${_PARAM} with no prefix")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Fixes names if invalid characters are found
|
||||||
|
IF("${NAME}" MATCHES "^[a-zA-Z0-9]+$")
|
||||||
|
SET(_NAME_FIXED ${NAME})
|
||||||
|
ELSE()
|
||||||
|
# if invalid characters are detected, replace them by valid ones
|
||||||
|
STRING(REPLACE "+" "p" _NAME_FIXED ${NAME})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Create uppercase and lowercase versions of NAME
|
||||||
|
STRING(TOUPPER ${NAME} _UPNAME)
|
||||||
|
STRING(TOLOWER ${NAME} _LOWNAME)
|
||||||
|
|
||||||
|
STRING(TOUPPER ${_NAME_FIXED} _UPNAME_FIXED)
|
||||||
|
STRING(TOLOWER ${_NAME_FIXED} _LOWNAME_FIXED)
|
||||||
|
|
||||||
|
SET(_SUFFIXES ${_SUFFIXES} ${_LOWNAME} ${_LOWNAME_FIXED} ${NAME})
|
||||||
|
|
||||||
|
# Don't use pkg-config
|
||||||
|
# IF(NOT WIN32 AND NOT IOS)
|
||||||
|
# FIND_PACKAGE(PkgConfig QUIET)
|
||||||
|
# SET(_MODULES ${_LOWNAME} ${_RELEASE_LIBRARIES})
|
||||||
|
# LIST(REMOVE_DUPLICATES _MODULES)
|
||||||
|
# IF(PKG_CONFIG_EXECUTABLE)
|
||||||
|
# PKG_SEARCH_MODULE(PKG_${_NAME_FIXED} QUIET ${_MODULES})
|
||||||
|
# ENDIF()
|
||||||
|
# ENDIF()
|
||||||
|
|
||||||
|
SET(_INCLUDE_PATHS)
|
||||||
|
SET(_LIBRARY_PATHS)
|
||||||
|
|
||||||
|
# Check for root directories passed to CMake with -DXXX_DIR=...
|
||||||
|
IF(DEFINED ${_UPNAME_FIXED}_DIR)
|
||||||
|
SET(_TMP ${${_UPNAME_FIXED}_DIR})
|
||||||
|
GET_FILENAME_COMPONENT(_TMP ${_TMP} ABSOLUTE)
|
||||||
|
LIST(APPEND _INCLUDE_PATHS ${_TMP}/include ${_TMP})
|
||||||
|
LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX})
|
||||||
|
|
||||||
|
IF(_IS_VERBOSE)
|
||||||
|
MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(DEFINED ${_UPNAME}_DIR)
|
||||||
|
SET(_TMP ${${_UPNAME}_DIR})
|
||||||
|
LIST(APPEND _INCLUDE_PATHS ${_TMP}/include ${_TMP})
|
||||||
|
LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX})
|
||||||
|
|
||||||
|
IF(_IS_VERBOSE)
|
||||||
|
MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(_BASE_DIRECTORIES)
|
||||||
|
FOREACH(_DIR ${_BASE_DIRECTORIES})
|
||||||
|
IF(_DIR)
|
||||||
|
LIST(APPEND _INCLUDE_PATHS ${_DIR}/include ${_DIR})
|
||||||
|
LIST(APPEND _LIBRARY_PATHS ${_DIR}/lib${LIB_SUFFIX})
|
||||||
|
|
||||||
|
IF(_IS_VERBOSE)
|
||||||
|
MESSAGE(STATUS "Using ${_DIR} as root directory")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(UNIX)
|
||||||
|
# Append UNIX standard include paths
|
||||||
|
SET(_UNIX_INCLUDE_PATHS)
|
||||||
|
|
||||||
|
# Append multiarch include paths
|
||||||
|
IF(CMAKE_LIBRARY_ARCHITECTURE)
|
||||||
|
LIST(APPEND _UNIX_INCLUDE_PATHS
|
||||||
|
/usr/local/include/${CMAKE_LIBRARY_ARCHITECTURE}
|
||||||
|
/usr/include/${CMAKE_LIBRARY_ARCHITECTURE})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
LIST(APPEND _UNIX_INCLUDE_PATHS
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
/sw/include
|
||||||
|
/opt/local/include
|
||||||
|
/opt/csw/include
|
||||||
|
/opt/include)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(_IS_VERBOSE)
|
||||||
|
MESSAGE(STATUS "Searching header ${INCLUDE} in: ${_INCLUDE_PATHS} with suffixes ${_SUFFIXES}")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Search for include directory
|
||||||
|
FIND_PATH(${_UPNAME_FIXED}_INCLUDE_DIR
|
||||||
|
NAMES ${INCLUDE}
|
||||||
|
HINTS
|
||||||
|
${PKG_${_NAME_FIXED}_INCLUDE_DIRS}
|
||||||
|
${_INCLUDE_PATHS}
|
||||||
|
$ENV{${_UPNAME}_DIR}/include
|
||||||
|
$ENV{${_UPNAME_FIXED}_DIR}/include
|
||||||
|
$ENV{${_UPNAME}_DIR}
|
||||||
|
$ENV{${_UPNAME_FIXED}_DIR}
|
||||||
|
PATHS
|
||||||
|
${_UNIX_INCLUDE_PATHS}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
${_SUFFIXES}
|
||||||
|
DOC "Include path for ${NAME}"
|
||||||
|
)
|
||||||
|
|
||||||
|
IF(_IS_VERBOSE)
|
||||||
|
IF(${_UPNAME_FIXED}_INCLUDE_DIR)
|
||||||
|
MESSAGE(STATUS "${INCLUDE} found in ${${_UPNAME_FIXED}_INCLUDE_DIR}")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS "${INCLUDE} not found")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Append environment variables XXX_DIR
|
||||||
|
LIST(APPEND _LIBRARY_PATHS
|
||||||
|
$ENV{${_UPNAME}_DIR}/lib${LIB_SUFFIX}
|
||||||
|
$ENV{${_UPNAME_FIXED}_DIR}/lib${LIB_SUFFIX})
|
||||||
|
|
||||||
|
IF(UNIX)
|
||||||
|
SET(_UNIX_LIBRARY_PATHS)
|
||||||
|
|
||||||
|
# Append multiarch libraries paths
|
||||||
|
IF(CMAKE_LIBRARY_ARCHITECTURE)
|
||||||
|
LIST(APPEND _UNIX_LIBRARY_PATHS
|
||||||
|
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
|
||||||
|
/lib/${CMAKE_LIBRARY_ARCHITECTURE}
|
||||||
|
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Append UNIX standard libraries paths
|
||||||
|
LIST(APPEND _UNIX_LIBRARY_PATHS
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/lib
|
||||||
|
/usr/local/X11R6/lib
|
||||||
|
/usr/X11R6/lib
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
/usr/freeware/lib${LIB_SUFFIX})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
LIST(APPEND _RELEASE_LIBRARIES ${_LOWNAME} ${_LOWNAME_FIXED} ${NAME} ${_NAME_FIXED})
|
||||||
|
LIST(APPEND _DEBUG_LIBRARIES ${_LOWNAME}d ${_LOWNAME_FIXED}d ${NAME}d ${_NAME_FIXED}d)
|
||||||
|
|
||||||
|
# Under Windows, some libs may need the lib prefix
|
||||||
|
IF(WIN32)
|
||||||
|
SET(_LIBS ${_RELEASE_LIBRARIES})
|
||||||
|
FOREACH(_LIB ${_LIBS})
|
||||||
|
LIST(APPEND _RELEASE_LIBRARIES lib${_LIB})
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
SET(_LIBS ${_DEBUG_LIBRARIES})
|
||||||
|
FOREACH(_LIB ${_LIBS})
|
||||||
|
LIST(APPEND _DEBUG_LIBRARIES lib${_LIB})
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
LIST(REMOVE_DUPLICATES _RELEASE_LIBRARIES)
|
||||||
|
LIST(REMOVE_DUPLICATES _DEBUG_LIBRARIES)
|
||||||
|
|
||||||
|
# Search for release library
|
||||||
|
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_RELEASE
|
||||||
|
NAMES
|
||||||
|
${_RELEASE_LIBRARIES}
|
||||||
|
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
|
||||||
|
PATHS
|
||||||
|
${_LIBRARY_PATHS}
|
||||||
|
${_UNIX_LIBRARY_PATHS}
|
||||||
|
NO_CMAKE_SYSTEM_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
IF(_IS_VERBOSE)
|
||||||
|
IF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
|
||||||
|
MESSAGE(STATUS "${NAME} release library found: ${${_UPNAME_FIXED}_LIBRARY_RELEASE}")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS "${NAME} release library not found in ${_LIBRARY_PATHS};${_UNIX_LIBRARY_PATHS}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Search for debug library
|
||||||
|
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_DEBUG
|
||||||
|
NAMES
|
||||||
|
${_DEBUG_LIBRARIES}
|
||||||
|
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
|
||||||
|
PATHS
|
||||||
|
${_LIBRARY_PATHS}
|
||||||
|
${_UNIX_LIBRARY_PATHS}
|
||||||
|
NO_CMAKE_SYSTEM_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
IF(_IS_VERBOSE)
|
||||||
|
IF(${_UPNAME_FIXED}_LIBRARY_DEBUG)
|
||||||
|
MESSAGE(STATUS "${NAME} debug library found: ${${_UPNAME_FIXED}_LIBRARY_DEBUG}")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS "${NAME} debug library not found")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(${_UPNAME_FIXED}_FOUND OFF)
|
||||||
|
|
||||||
|
IF(${_UPNAME_FIXED}_INCLUDE_DIR)
|
||||||
|
# Set also _INCLUDE_DIRS
|
||||||
|
SET(${_UPNAME_FIXED}_INCLUDE_DIRS ${${_UPNAME_FIXED}_INCLUDE_DIR})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Library has been found if at least only one library and include are found
|
||||||
|
IF(${_UPNAME_FIXED}_LIBRARY_RELEASE AND ${_UPNAME_FIXED}_LIBRARY_DEBUG)
|
||||||
|
# Release and debug libraries found
|
||||||
|
SET(${_UPNAME_FIXED}_FOUND ON)
|
||||||
|
SET(${_UPNAME_FIXED}_LIBRARIES optimized ${${_UPNAME_FIXED}_LIBRARY_RELEASE} debug ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
|
||||||
|
SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
|
||||||
|
ELSEIF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
|
||||||
|
# Release library found
|
||||||
|
SET(${_UPNAME_FIXED}_FOUND ON)
|
||||||
|
SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
|
||||||
|
SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
|
||||||
|
ELSEIF(${_UPNAME_FIXED}_LIBRARY_DEBUG)
|
||||||
|
# Debug library found
|
||||||
|
SET(${_UPNAME_FIXED}_FOUND ON)
|
||||||
|
SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
|
||||||
|
SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(${_UPNAME_FIXED}_FOUND)
|
||||||
|
IF(NOT ${NAME}_FIND_QUIETLY)
|
||||||
|
MESSAGE(STATUS "Found ${NAME}: ${${_UPNAME_FIXED}_LIBRARIES}")
|
||||||
|
ENDIF()
|
||||||
|
ELSE()
|
||||||
|
IF(${NAME}_FIND_REQUIRED)
|
||||||
|
MESSAGE(FATAL_ERROR "Error: Unable to find ${NAME}!")
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT ${NAME}_FIND_QUIETLY)
|
||||||
|
MESSAGE(STATUS "Warning: Unable to find ${NAME}!")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(${_UPNAME_FIXED}_LIBRARY_RELEASE ${_UPNAME_FIXED}_LIBRARY_DEBUG)
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO(MESSAGE_VERSION_PACKAGE_HELPER NAME VERSION)
|
||||||
|
MESSAGE(STATUS "Found ${NAME} ${VERSION}: ${ARGN}")
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO(FIND_LIBRARY_HELPER NAME)
|
||||||
|
# Looks for libraries.
|
||||||
|
#
|
||||||
|
# NAME is the name of the library, lowercase and uppercase can be mixed
|
||||||
|
#
|
||||||
|
# Following parameters are optional variables and must be prefixed by:
|
||||||
|
#
|
||||||
|
# RELEASE is the list of libraries to check in release mode
|
||||||
|
# DEBUG is the list of libraries to check in debug mode
|
||||||
|
# VERBOSE display more details if not found
|
||||||
|
# REQUIRED throw an error if not found
|
||||||
|
# DIR is the base directory where to look for
|
||||||
|
#
|
||||||
|
# The first match will be used in the specified order and next matches will be ignored
|
||||||
|
#
|
||||||
|
# The following values are defined
|
||||||
|
# NAME_LIBRARIES - link against these to use NAME
|
||||||
|
|
||||||
|
SET(_PARAMS ${ARGN})
|
||||||
|
|
||||||
|
SET(_RELEASE_LIBRARIES)
|
||||||
|
SET(_DEBUG_LIBRARIES)
|
||||||
|
SET(_BASE_DIRECTORIES)
|
||||||
|
|
||||||
|
SET(_IS_RELEASE OFF)
|
||||||
|
SET(_IS_DEBUG OFF)
|
||||||
|
SET(_IS_VERBOSE OFF)
|
||||||
|
SET(_IS_DIR OFF)
|
||||||
|
|
||||||
|
IF(_PARAMS)
|
||||||
|
FOREACH(_PARAM ${_PARAMS})
|
||||||
|
IF(_PARAM STREQUAL "RELEASE")
|
||||||
|
SET(_IS_RELEASE ON)
|
||||||
|
SET(_IS_DEBUG OFF)
|
||||||
|
SET(_IS_DIR OFF)
|
||||||
|
ELSEIF(_PARAM STREQUAL "DEBUG")
|
||||||
|
SET(_IS_RELEASE OFF)
|
||||||
|
SET(_IS_DEBUG ON)
|
||||||
|
SET(_IS_DIR OFF)
|
||||||
|
ELSEIF(_PARAM STREQUAL "VERBOSE")
|
||||||
|
SET(_IS_RELEASE OFF)
|
||||||
|
SET(_IS_DEBUG OFF)
|
||||||
|
SET(_IS_DIR OFF)
|
||||||
|
SET(_IS_VERBOSE ON)
|
||||||
|
ELSEIF(_PARAM STREQUAL "REQUIRED")
|
||||||
|
SET(_IS_RELEASE OFF)
|
||||||
|
SET(_IS_DEBUG OFF)
|
||||||
|
SET(_IS_DIR OFF)
|
||||||
|
SET(${NAME}_FIND_REQUIRED ON)
|
||||||
|
ELSEIF(_PARAM STREQUAL "DIR")
|
||||||
|
SET(_IS_RELEASE OFF)
|
||||||
|
SET(_IS_DEBUG OFF)
|
||||||
|
SET(_IS_DIR ON)
|
||||||
|
ELSE()
|
||||||
|
IF(_IS_RELEASE)
|
||||||
|
LIST(APPEND _RELEASE_LIBRARIES ${_PARAM})
|
||||||
|
ELSEIF(_IS_DEBUG)
|
||||||
|
LIST(APPEND _DEBUG_LIBRARIES ${_PARAM})
|
||||||
|
ELSEIF(_IS_DIR)
|
||||||
|
LIST(APPEND _BASE_DIRECTORIES ${_PARAM})
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS "parameter ${_PARAM} with no prefix")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Fixes names if invalid characters are found
|
||||||
|
IF("${NAME}" MATCHES "^[a-zA-Z0-9]+$")
|
||||||
|
SET(_NAME_FIXED ${NAME})
|
||||||
|
ELSE()
|
||||||
|
# if invalid characters are detected, replace them by valid ones
|
||||||
|
STRING(REPLACE "+" "p" _NAME_FIXED ${NAME})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Create uppercase and lowercase versions of NAME
|
||||||
|
STRING(TOUPPER ${NAME} _UPNAME)
|
||||||
|
STRING(TOLOWER ${NAME} _LOWNAME)
|
||||||
|
|
||||||
|
STRING(TOUPPER ${_NAME_FIXED} _UPNAME_FIXED)
|
||||||
|
STRING(TOLOWER ${_NAME_FIXED} _LOWNAME_FIXED)
|
||||||
|
|
||||||
|
SET(_LIBRARY_PATHS)
|
||||||
|
|
||||||
|
# Check for root directories passed to CMake with -DXXX_DIR=...
|
||||||
|
IF(DEFINED ${_UPNAME_FIXED}_DIR)
|
||||||
|
SET(_TMP ${${_UPNAME_FIXED}_DIR})
|
||||||
|
GET_FILENAME_COMPONENT(_TMP ${_TMP} ABSOLUTE)
|
||||||
|
LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX})
|
||||||
|
|
||||||
|
IF(_IS_VERBOSE)
|
||||||
|
MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(DEFINED ${_UPNAME}_DIR)
|
||||||
|
SET(_TMP ${${_UPNAME}_DIR})
|
||||||
|
LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX})
|
||||||
|
|
||||||
|
IF(_IS_VERBOSE)
|
||||||
|
MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(_BASE_DIRECTORIES)
|
||||||
|
FOREACH(_DIR ${_BASE_DIRECTORIES})
|
||||||
|
IF(_DIR)
|
||||||
|
LIST(APPEND _LIBRARY_PATHS ${_DIR}/lib${LIB_SUFFIX})
|
||||||
|
|
||||||
|
IF(_IS_VERBOSE)
|
||||||
|
MESSAGE(STATUS "Using ${_DIR} as root directory")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Append environment variables XXX_DIR
|
||||||
|
LIST(APPEND _LIBRARY_PATHS
|
||||||
|
$ENV{${_UPNAME}_DIR}/lib${LIB_SUFFIX}
|
||||||
|
$ENV{${_UPNAME_FIXED}_DIR}/lib${LIB_SUFFIX})
|
||||||
|
|
||||||
|
IF(UNIX)
|
||||||
|
SET(_UNIX_LIBRARY_PATHS)
|
||||||
|
|
||||||
|
# Append multiarch libraries paths
|
||||||
|
IF(CMAKE_LIBRARY_ARCHITECTURE)
|
||||||
|
LIST(APPEND _UNIX_LIBRARY_PATHS
|
||||||
|
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
|
||||||
|
/lib/${CMAKE_LIBRARY_ARCHITECTURE}
|
||||||
|
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Append UNIX standard libraries paths
|
||||||
|
LIST(APPEND _UNIX_LIBRARY_PATHS
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/lib
|
||||||
|
/usr/local/X11R6/lib
|
||||||
|
/usr/X11R6/lib
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
/usr/freeware/lib${LIB_SUFFIX})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
LIST(APPEND _RELEASE_LIBRARIES ${_LOWNAME} ${_LOWNAME_FIXED} ${NAME} ${_NAME_FIXED})
|
||||||
|
LIST(APPEND _DEBUG_LIBRARIES ${_LOWNAME}d ${_LOWNAME_FIXED}d ${NAME}d ${_NAME_FIXED}d)
|
||||||
|
|
||||||
|
# Under Windows, some libs may need the lib prefix
|
||||||
|
IF(WIN32)
|
||||||
|
SET(_LIBS ${_RELEASE_LIBRARIES})
|
||||||
|
FOREACH(_LIB ${_LIBS})
|
||||||
|
LIST(APPEND _RELEASE_LIBRARIES lib${_LIB})
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
SET(_LIBS ${_DEBUG_LIBRARIES})
|
||||||
|
FOREACH(_LIB ${_LIBS})
|
||||||
|
LIST(APPEND _DEBUG_LIBRARIES lib${_LIB})
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
LIST(REMOVE_DUPLICATES _RELEASE_LIBRARIES)
|
||||||
|
LIST(REMOVE_DUPLICATES _DEBUG_LIBRARIES)
|
||||||
|
|
||||||
|
# Search for release library
|
||||||
|
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_RELEASE
|
||||||
|
NAMES
|
||||||
|
${_RELEASE_LIBRARIES}
|
||||||
|
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
|
||||||
|
PATHS
|
||||||
|
${_LIBRARY_PATHS}
|
||||||
|
${_UNIX_LIBRARY_PATHS}
|
||||||
|
NO_CMAKE_SYSTEM_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
IF(_IS_VERBOSE)
|
||||||
|
IF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
|
||||||
|
MESSAGE(STATUS "${NAME} release library found: ${${_UPNAME_FIXED}_LIBRARY_RELEASE}")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS "${NAME} release library not found in ${_LIBRARY_PATHS};${_UNIX_LIBRARY_PATHS}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Search for debug library
|
||||||
|
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_DEBUG
|
||||||
|
NAMES
|
||||||
|
${_DEBUG_LIBRARIES}
|
||||||
|
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
|
||||||
|
PATHS
|
||||||
|
${_LIBRARY_PATHS}
|
||||||
|
${_UNIX_LIBRARY_PATHS}
|
||||||
|
NO_CMAKE_SYSTEM_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
IF(_IS_VERBOSE)
|
||||||
|
IF(${_UPNAME_FIXED}_LIBRARY_DEBUG)
|
||||||
|
MESSAGE(STATUS "${NAME} debug library found: ${${_UPNAME_FIXED}_LIBRARY_DEBUG}")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS "${NAME} debug library not found")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Library has been found if at least only one library and include are found
|
||||||
|
IF(${_UPNAME_FIXED}_LIBRARY_RELEASE AND ${_UPNAME_FIXED}_LIBRARY_DEBUG)
|
||||||
|
# Release and debug libraries found
|
||||||
|
SET(${_UPNAME_FIXED}_LIBRARIES optimized ${${_UPNAME_FIXED}_LIBRARY_RELEASE} debug ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
|
||||||
|
SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
|
||||||
|
ELSEIF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
|
||||||
|
# Release library found
|
||||||
|
SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
|
||||||
|
SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
|
||||||
|
ELSEIF(${_UPNAME_FIXED}_LIBRARY_DEBUG)
|
||||||
|
# Debug library found
|
||||||
|
SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
|
||||||
|
SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(${_UPNAME_FIXED}_LIBRARY_RELEASE ${_UPNAME_FIXED}_LIBRARY_DEBUG)
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO(FIND_LIBCURL)
|
||||||
|
IF(NOT CURL_FOUND)
|
||||||
|
FIND_PACKAGE(CURL REQUIRED)
|
||||||
|
|
||||||
|
IF(WIN32 OR CURL_LIBRARY MATCHES "\\.a" OR WITH_STATIC_CURL)
|
||||||
|
SET(CURL_STATIC ON)
|
||||||
|
ELSE()
|
||||||
|
SET(CURL_STATIC OFF)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(CURL_STATIC)
|
||||||
|
SET(CURL_DEFINITIONS -DCURL_STATICLIB)
|
||||||
|
|
||||||
|
IF(UNIX)
|
||||||
|
# CURL can depend on libidn
|
||||||
|
FIND_LIBRARY(IDN_LIBRARY idn)
|
||||||
|
IF(IDN_LIBRARY)
|
||||||
|
LIST(APPEND CURL_LIBRARIES ${IDN_LIBRARY})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# CURL Macports version can depend on libidn, libintl and libiconv too
|
||||||
|
IF(APPLE)
|
||||||
|
FIND_LIBRARY(INTL_LIBRARY intl)
|
||||||
|
IF(INTL_LIBRARY)
|
||||||
|
LIST(APPEND CURL_LIBRARIES ${INTL_LIBRARY})
|
||||||
|
ENDIF()
|
||||||
|
ELSE()
|
||||||
|
# Only used by libcurl under Linux
|
||||||
|
FIND_PACKAGE(OpenSSL REQUIRED)
|
||||||
|
|
||||||
|
#IF(WIN32)
|
||||||
|
# SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib)
|
||||||
|
#ENDIF()
|
||||||
|
|
||||||
|
# Only Linux version of libcurl depends on OpenSSL
|
||||||
|
LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
|
||||||
|
LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO(FIND_LIBXML2)
|
||||||
|
IF(NOT LIBXML2_FOUND)
|
||||||
|
FIND_PACKAGE(LibXml2 REQUIRED)
|
||||||
|
|
||||||
|
IF(WIN32 OR WITH_STATIC_LIBXML2)
|
||||||
|
LIST(APPEND LIBXML2_DEFINITIONS -DLIBXML_STATIC)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(WITH_LIBXML2_ICONV)
|
||||||
|
FIND_PACKAGE(Iconv REQUIRED)
|
||||||
|
# LIST(APPEND CURL_INCLUDE_DIRS ${ICONV_INCLUDE_DIR})
|
||||||
|
LIST(APPEND LIBXML2_LIBRARIES ${ICONV_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(WITH_STATIC)
|
||||||
|
# libxml2 could need winsock2 library
|
||||||
|
IF(WIN32)
|
||||||
|
FIND_LIBRARY(WINSOCK2_LIB ws2_32)
|
||||||
|
|
||||||
|
IF(WINSOCK2_LIB)
|
||||||
|
LIST(APPEND LIBXML2_LIBRARIES ${WINSOCK2_LIB})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_LIBRARY(CRYPT32_LIB Crypt32)
|
||||||
|
|
||||||
|
IF(CRYPT32_LIB)
|
||||||
|
LIST(APPEND LIBXML2_LIBRARIES ${CRYPT32_LIB})
|
||||||
|
ENDIF()
|
||||||
|
ELSE()
|
||||||
|
# under Linux and OS X, recent libxml2 versions are linked against liblzma
|
||||||
|
FIND_PACKAGE(LibLZMA)
|
||||||
|
|
||||||
|
IF(LIBLZMA_LIBRARIES)
|
||||||
|
LIST(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO(ADD_QT_LIBRARY _NAME)
|
||||||
|
IF(WIN32)
|
||||||
|
SET(_PREFIX "Qt5")
|
||||||
|
SET(_EXT "lib")
|
||||||
|
ELSE()
|
||||||
|
SET(_PREFIX "libQt5")
|
||||||
|
SET(_EXT "a")
|
||||||
|
ENDIF()
|
||||||
|
SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}.${_EXT}")
|
||||||
|
IF(EXISTS ${_LIB})
|
||||||
|
LIST(APPEND QT_LIBRARIES optimized ${_LIB})
|
||||||
|
ENDIF()
|
||||||
|
SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}d.${_EXT}")
|
||||||
|
IF(EXISTS ${_LIB})
|
||||||
|
LIST(APPEND QT_LIBRARIES debug ${_LIB})
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO(ADD_QT_PLUGIN _TYPE _NAME)
|
||||||
|
IF(WIN32)
|
||||||
|
SET(_PREFIX "")
|
||||||
|
SET(_EXT "lib")
|
||||||
|
ELSE()
|
||||||
|
SET(_PREFIX "lib")
|
||||||
|
SET(_EXT "a")
|
||||||
|
ENDIF()
|
||||||
|
SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}.${_EXT}")
|
||||||
|
IF(EXISTS ${_LIB})
|
||||||
|
LIST(APPEND QT_LIBRARIES optimized ${_LIB})
|
||||||
|
ENDIF()
|
||||||
|
SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}d.${_EXT}")
|
||||||
|
IF(EXISTS ${_LIB})
|
||||||
|
LIST(APPEND QT_LIBRARIES debug ${_LIB})
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO(ADD_QT_SYSTEM_LIBRARY _NAME)
|
||||||
|
# Save default suffixes
|
||||||
|
SET(_OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
|
||||||
|
# Define specific suffixes
|
||||||
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||||
|
|
||||||
|
# Find the library with specified suffixes
|
||||||
|
FIND_LIBRARY(${_NAME}_LIBRARY NAMES ${_NAME})
|
||||||
|
|
||||||
|
# Restore default suffixes
|
||||||
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_OLD_SUFFIXES})
|
||||||
|
|
||||||
|
IF(${_NAME}_LIBRARY)
|
||||||
|
MESSAGE(STATUS "Found ${${_NAME}_LIBRARY} ${_NAME}")
|
||||||
|
|
||||||
|
LIST(APPEND QT_LIBRARIES ${${_NAME}_LIBRARY})
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS "Didn't find ${_NAME}")
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO(FIND_QT5)
|
||||||
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)
|
||||||
|
|
||||||
|
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QTDIR} $ENV{QTDIR})
|
||||||
|
|
||||||
|
FIND_PACKAGE(Qt5Core QUIET)
|
||||||
|
|
||||||
|
IF(Qt5Core_FOUND)
|
||||||
|
# Check if we are using Qt static or shared libraries
|
||||||
|
GET_TARGET_PROPERTY(_FILE Qt5::Core IMPORTED_LOCATION_RELEASE)
|
||||||
|
|
||||||
|
SET(QT_VERSION "${Qt5Core_VERSION_STRING}")
|
||||||
|
SET(_VERSION "${QT_VERSION}")
|
||||||
|
|
||||||
|
IF(_FILE MATCHES "\\.(lib|a)$")
|
||||||
|
SET(QT_STATIC ON)
|
||||||
|
SET(_VERSION "${_VERSION} static version")
|
||||||
|
ELSE()
|
||||||
|
SET(QT_STATIC OFF)
|
||||||
|
SET(_VERSION "${_VERSION} shared version")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Found Qt ${_VERSION}")
|
||||||
|
|
||||||
|
# These variables are not defined with Qt5 CMake modules
|
||||||
|
SET(QT_BINARY_DIR "${_qt5Core_install_prefix}/bin")
|
||||||
|
SET(QT_LIBRARY_DIR "${_qt5Core_install_prefix}/lib")
|
||||||
|
SET(QT_PLUGINS_DIR "${_qt5Core_install_prefix}/plugins")
|
||||||
|
SET(QT_TRANSLATIONS_DIR "${_qt5Core_install_prefix}/translations")
|
||||||
|
|
||||||
|
# Fix wrong include directories with Qt 5 under Mac OS X
|
||||||
|
INCLUDE_DIRECTORIES("${_qt5Core_install_prefix}/include")
|
||||||
|
|
||||||
|
FIND_PACKAGE(Qt5Gui)
|
||||||
|
FIND_PACKAGE(Qt5Widgets)
|
||||||
|
FIND_PACKAGE(Qt5OpenGL)
|
||||||
|
FIND_PACKAGE(Qt5Xml)
|
||||||
|
FIND_PACKAGE(Qt5LinguistTools)
|
||||||
|
FIND_PACKAGE(Qt5Network)
|
||||||
|
|
||||||
|
IF(QT_STATIC)
|
||||||
|
FIND_PACKAGE(PNG REQUIRED)
|
||||||
|
FIND_PACKAGE(Jpeg REQUIRED)
|
||||||
|
|
||||||
|
ADD_DEFINITIONS(-DQT_STATICPLUGIN)
|
||||||
|
|
||||||
|
SET(QT_LIBRARIES Qt5::Widgets)
|
||||||
|
|
||||||
|
# Gui
|
||||||
|
LIST(APPEND QT_LIBRARIES Qt5::Gui Qt5::OpenGL)
|
||||||
|
|
||||||
|
ADD_QT_LIBRARY(PrintSupport)
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
LIST(APPEND QT_LIBRARIES
|
||||||
|
${WINSDK_LIBRARY_DIR}/Imm32.lib
|
||||||
|
${WINSDK_LIBRARY_DIR}/OpenGL32.lib
|
||||||
|
${WINSDK_LIBRARY_DIR}/WinMM.Lib)
|
||||||
|
ADD_QT_PLUGIN(platforms qwindows)
|
||||||
|
ADD_QT_LIBRARY(PlatformSupport)
|
||||||
|
ELSEIF(APPLE)
|
||||||
|
# Cups needs .dylib
|
||||||
|
SET(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib)
|
||||||
|
FIND_LIBRARY(CUPS_LIBRARY cups)
|
||||||
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
|
||||||
|
FIND_LIBRARY(IOKIT_FRAMEWORK IOKit)
|
||||||
|
FIND_LIBRARY(COCOA_FRAMEWORK Cocoa)
|
||||||
|
FIND_LIBRARY(SYSTEMCONFIGURATION_FRAMEWORK SystemConfiguration)
|
||||||
|
FIND_LIBRARY(OPENGL_FRAMEWORK NAMES OpenGL)
|
||||||
|
|
||||||
|
LIST(APPEND QT_LIBRARIES
|
||||||
|
${CUPS_LIBRARY}
|
||||||
|
${COCOA_FRAMEWORK}
|
||||||
|
${SYSTEMCONFIGURATION_FRAMEWORK}
|
||||||
|
${IOKIT_FRAMEWORK}
|
||||||
|
${OPENGL_FRAMEWORK})
|
||||||
|
|
||||||
|
ADD_QT_PLUGIN(printsupport cocoaprintersupport)
|
||||||
|
ADD_QT_PLUGIN(platforms qcocoa)
|
||||||
|
ADD_QT_LIBRARY(PlatformSupport)
|
||||||
|
ELSE()
|
||||||
|
# order is very important there
|
||||||
|
ADD_QT_PLUGIN(platforms qxcb)
|
||||||
|
ADD_QT_PLUGIN(xcbglintegrations qxcb-glx-integration)
|
||||||
|
|
||||||
|
ADD_QT_LIBRARY(XcbQpa)
|
||||||
|
ADD_QT_LIBRARY(GlxSupport)
|
||||||
|
ADD_QT_LIBRARY(ServiceSupport)
|
||||||
|
ADD_QT_LIBRARY(EdidSupport)
|
||||||
|
ADD_QT_LIBRARY(FontDatabaseSupport)
|
||||||
|
ADD_QT_LIBRARY(ThemeSupport)
|
||||||
|
ADD_QT_LIBRARY(EventDispatcherSupport)
|
||||||
|
ADD_QT_LIBRARY(PlatformSupport)
|
||||||
|
|
||||||
|
ADD_QT_LIBRARY(DBus)
|
||||||
|
|
||||||
|
IF(EXISTS "${QT_LIBRARY_DIR}/libxcb-static.a")
|
||||||
|
LIST(APPEND QT_LIBRARIES "${QT_LIBRARY_DIR}/libxcb-static.a")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# always link these in dynamic, API never changes
|
||||||
|
ADD_QT_SYSTEM_LIBRARY(X11)
|
||||||
|
ADD_QT_SYSTEM_LIBRARY(Xmu)
|
||||||
|
ADD_QT_SYSTEM_LIBRARY(X11-xcb)
|
||||||
|
ADD_QT_SYSTEM_LIBRARY(Xi)
|
||||||
|
ADD_QT_SYSTEM_LIBRARY(SM)
|
||||||
|
ADD_QT_SYSTEM_LIBRARY(ICE)
|
||||||
|
ADD_QT_SYSTEM_LIBRARY(xcb)
|
||||||
|
ADD_QT_SYSTEM_LIBRARY(GL)
|
||||||
|
ADD_QT_SYSTEM_LIBRARY(xcb-glx)
|
||||||
|
ADD_QT_SYSTEM_LIBRARY(fontconfig)
|
||||||
|
ADD_QT_SYSTEM_LIBRARY(Xrender)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ADD_QT_PLUGIN(imageformats qgif)
|
||||||
|
ADD_QT_PLUGIN(imageformats qicns)
|
||||||
|
ADD_QT_PLUGIN(imageformats qico)
|
||||||
|
ADD_QT_PLUGIN(imageformats qjpeg)
|
||||||
|
|
||||||
|
# harfbuzz is needed since Qt 5.3
|
||||||
|
IF(UNIX)
|
||||||
|
SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzzng.a")
|
||||||
|
IF(NOT EXISTS ${HB_LIB})
|
||||||
|
SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzz.a")
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(WIN32)
|
||||||
|
SET(HB_LIB "${QT_LIBRARY_DIR}/qtharfbuzzng.lib")
|
||||||
|
ENDIF()
|
||||||
|
IF(EXISTS ${HB_LIB})
|
||||||
|
LIST(APPEND QT_LIBRARIES ${HB_LIB})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# freetype is needed since Qt 5.5
|
||||||
|
FIND_PACKAGE(Freetype)
|
||||||
|
|
||||||
|
IF(FREETYPE_FOUND)
|
||||||
|
LIST(APPEND QT_LIBRARIES ${FREETYPE_LIBRARIES})
|
||||||
|
ELSE()
|
||||||
|
IF(UNIX)
|
||||||
|
SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/libqtfreetype.a")
|
||||||
|
ELSEIF(WIN32)
|
||||||
|
SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/qtfreetype.lib")
|
||||||
|
ENDIF()
|
||||||
|
IF(EXISTS ${FREETYPE_LIB})
|
||||||
|
LIST(APPEND QT_LIBRARIES ${FREETYPE_LIB})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ADD_QT_PLUGIN(accessible qtaccessiblewidgets)
|
||||||
|
|
||||||
|
LIST(APPEND QT_LIBRARIES ${PNG_LIBRARIES} ${JPEG_LIBRARY})
|
||||||
|
|
||||||
|
# Network
|
||||||
|
LIST(APPEND QT_LIBRARIES Qt5::Network Qt5::Xml)
|
||||||
|
LIST(APPEND QT_LIBRARIES ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES})
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
LIST(APPEND QT_LIBRARIES
|
||||||
|
${WINSDK_LIBRARY_DIR}/Crypt32.lib
|
||||||
|
${WINSDK_LIBRARY_DIR}/WS2_32.Lib
|
||||||
|
${WINSDK_LIBRARY_DIR}/IPHlpApi.Lib)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Core
|
||||||
|
LIST(APPEND QT_LIBRARIES Qt5::Core)
|
||||||
|
|
||||||
|
# pcre is needed since Qt 5.5
|
||||||
|
IF(UNIX)
|
||||||
|
SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre.a")
|
||||||
|
IF(NOT EXISTS ${PCRE_LIB})
|
||||||
|
SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre2.a")
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(WIN32)
|
||||||
|
SET(PCRE_LIB "${QT_LIBRARY_DIR}/qtpcre.lib")
|
||||||
|
ENDIF()
|
||||||
|
IF(EXISTS ${PCRE_LIB})
|
||||||
|
LIST(APPEND QT_LIBRARIES ${PCRE_LIB})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(APPLE)
|
||||||
|
FIND_LIBRARY(PCRE_LIBRARY pcre16 pcre)
|
||||||
|
|
||||||
|
FIND_LIBRARY(SECURITY_FRAMEWORK Security)
|
||||||
|
|
||||||
|
LIST(APPEND QT_LIBRARIES
|
||||||
|
${PCRE_LIBRARY}
|
||||||
|
${FOUNDATION_FRAMEWORK}
|
||||||
|
${CARBON_FRAMEWORK}
|
||||||
|
${SECURITY_FRAMEWORK})
|
||||||
|
ELSEIF(UNIX)
|
||||||
|
FIND_PACKAGE(Threads)
|
||||||
|
LIST(APPEND QT_LIBRARIES ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} -lrt)
|
||||||
|
ENDIF()
|
||||||
|
ELSE()
|
||||||
|
SET(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Gui Qt5::OpenGL Qt5::Core)
|
||||||
|
ENDIF()
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(WARNING "Unable to find Qt 5")
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
398
code/CMakeModules/FindNeL.cmake
Normal file
398
code/CMakeModules/FindNeL.cmake
Normal file
|
@ -0,0 +1,398 @@
|
||||||
|
# NEL_DIR can be specified as root directory
|
||||||
|
|
||||||
|
# Returned variables
|
||||||
|
# NELDRIVER_XXX_BINARY_DEBUG
|
||||||
|
# NELDRIVER_XXX_BINARY_RELEASE
|
||||||
|
# NELDRIVER_XXX_LIBRARY_DEBUG
|
||||||
|
# NELDRIVER_XXX_LIBRARY_RELEASE
|
||||||
|
# NELDRIVER_XXX_FOUND
|
||||||
|
# NEL_DEFINITIONS
|
||||||
|
# NEL_INCLUDE_DIR
|
||||||
|
# NEL_INCLUDE_DIRS
|
||||||
|
# NEL_LIBRARIES
|
||||||
|
# NELXXX_FOUND
|
||||||
|
# NELXXX_LIBRARIES
|
||||||
|
|
||||||
|
|
||||||
|
INCLUDE(FindHelpers)
|
||||||
|
|
||||||
|
# Init all variables we'll set
|
||||||
|
SET(NEL_LIBRARIES)
|
||||||
|
SET(NEL_INCLUDE_DIR)
|
||||||
|
SET(NEL_INCLUDE_DIRS)
|
||||||
|
SET(NEL_VERSION)
|
||||||
|
SET(NEL_STATIC)
|
||||||
|
SET(NEL_STATIC_DRIVERS)
|
||||||
|
SET(NEL_VERSION_MAJOR)
|
||||||
|
SET(NEL_VERSION_MINOR)
|
||||||
|
SET(NEL_VERSION_PATCH)
|
||||||
|
SET(NEL_REVISION)
|
||||||
|
SET(NEL_VERSION)
|
||||||
|
|
||||||
|
SET(NEL_MODULES_FOUND)
|
||||||
|
SET(NEL_MODULES_AVAILABLE 3d georges gui ligo logic net pacs sound) # cegui pipeline
|
||||||
|
|
||||||
|
SET(NEL_DRIVERS_FOUND)
|
||||||
|
SET(NEL_DRIVERS_AVAILABLE opengl opengles direct3d dsound fmod openal xaudio2)
|
||||||
|
|
||||||
|
SET(NELMISC_FIND_REQUIRED ${NeL_FIND_REQUIRED})
|
||||||
|
|
||||||
|
# Force search of NELMISC
|
||||||
|
FIND_PACKAGE_HELPER(nelmisc nel/misc/types_nl.h RELEASE nelmisc_r nelmisc DEBUG nelmisc_d DIR ${NEL_DIR} VERBOSE QUIET)
|
||||||
|
|
||||||
|
IF(NELMISC_FOUND)
|
||||||
|
# define NEL_DIR if not specified
|
||||||
|
IF(NOT NEL_DIR)
|
||||||
|
GET_FILENAME_COMPONENT(NEL_DIR ${NELMISC_INCLUDE_DIR}/.. ABSOLUTE)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Aliases for include directory
|
||||||
|
SET(NEL_INCLUDE_DIR ${NELMISC_INCLUDE_DIR})
|
||||||
|
SET(NEL_INCLUDE_DIRS ${NEL_INCLUDE_DIR})
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Found NeL headers in ${NEL_INCLUDE_DIR}")
|
||||||
|
|
||||||
|
GET_FILENAME_COMPONENT(NEL_LIBRARY_DIR ${NELMISC_LIBRARY} DIRECTORY)
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Found NeL library in ${NEL_LIBRARY_DIR}")
|
||||||
|
|
||||||
|
# TODO: implement static version checks for Windows
|
||||||
|
|
||||||
|
# static libraries
|
||||||
|
IF(UNIX)
|
||||||
|
GET_FILENAME_COMPONENT(_LIBEXT ${NELMISC_LIBRARY} EXT)
|
||||||
|
|
||||||
|
IF(_LIBEXT STREQUAL ".a")
|
||||||
|
SET(NEL_STATIC ON)
|
||||||
|
MESSAGE(STATUS "NeL is using static libraries")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
SET(NELDRIVER_DIRS_TO_CHECK
|
||||||
|
${NEL_DIR}/bin${LIB_SUFFIX}
|
||||||
|
${NEL_DIR}
|
||||||
|
)
|
||||||
|
ELSE()
|
||||||
|
SET(NELDRIVER_DIRS_TO_CHECK
|
||||||
|
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel
|
||||||
|
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
|
||||||
|
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel
|
||||||
|
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
|
||||||
|
/usr/lib/nel
|
||||||
|
/usr/lib
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# check for static drivers
|
||||||
|
FOREACH(_DRIVER ${NEL_DRIVERS_AVAILABLE})
|
||||||
|
IF(WIN32)
|
||||||
|
SET(_DRIVER_RELASE_FILE "nel_drv_${_DRIVER}_win_r")
|
||||||
|
SET(_DRIVER_DEBUG_FILE "nel_drv_${_DRIVER}_win_d")
|
||||||
|
SET(_DRIVER_SHARED_EXT dll)
|
||||||
|
SET(_DRIVER_STATIC_EXT lib)
|
||||||
|
ELSE()
|
||||||
|
SET(_DRIVER_RELEASE_FILE "nel_drv_${_DRIVER}")
|
||||||
|
SET(_DRIVER_DEBUG_FILE)
|
||||||
|
SET(_DRIVER_SHARED_EXT so)
|
||||||
|
SET(_DRIVER_STATIC_EXT a)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
STRING(TOUPPER ${_DRIVER} _UPDRIVER)
|
||||||
|
|
||||||
|
FOREACH(_DIR ${NELDRIVER_DIRS_TO_CHECK})
|
||||||
|
SET(_FOUND OFF)
|
||||||
|
|
||||||
|
IF(_DRIVER_RELASE_FILE)
|
||||||
|
SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_SHARED_EXT}")
|
||||||
|
IF(EXISTS ${_FILE})
|
||||||
|
SET(NELDRIVER_${_UPDRIVER}_BINARY_RELEASE ${_FILE})
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Found NeL release shared driver ${_DRIVER}: ${_FILE}")
|
||||||
|
|
||||||
|
SET(NEL_STATIC_DRIVERS OFF)
|
||||||
|
|
||||||
|
IF(NOT NEL_DRIVER_DIR)
|
||||||
|
SET(NEL_DRIVER_DIR ${_DIR})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_STATIC_EXT}")
|
||||||
|
IF(EXISTS ${_FILE})
|
||||||
|
SET(NELDRIVER_${_UPDRIVER}_LIBRARY_RELEASE ${_FILE})
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Found NeL release static driver ${_DRIVER}: ${_FILE}")
|
||||||
|
|
||||||
|
SET(NEL_STATIC_DRIVERS ON)
|
||||||
|
|
||||||
|
IF(NOT NEL_DRIVER_DIR)
|
||||||
|
SET(NEL_DRIVER_DIR ${_DIR})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(_DRIVER_DEBUG_FILE)
|
||||||
|
SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_SHARED_EXT}")
|
||||||
|
IF(EXISTS ${_FILE})
|
||||||
|
SET(NELDRIVER_${_UPDRIVER}_BINARY_DEBUG ${_FILE})
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Found NeL debug shared driver ${_DRIVER}: ${_FILE}")
|
||||||
|
|
||||||
|
SET(NEL_STATIC_DRIVERS OFF)
|
||||||
|
|
||||||
|
IF(NOT NEL_DRIVER_DIR)
|
||||||
|
SET(NEL_DRIVER_DIR ${_DIR})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_STATIC_EXT}")
|
||||||
|
IF(EXISTS ${_FILE})
|
||||||
|
SET(NELDRIVER_${_UPDRIVER}_LIBRARY_DEBUG ${_FILE})
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Found NeL debug static driver ${_DRIVER}: ${_FILE}")
|
||||||
|
|
||||||
|
SET(NEL_STATIC_DRIVERS ON)
|
||||||
|
|
||||||
|
IF(NOT NEL_DRIVER_DIR)
|
||||||
|
SET(NEL_DRIVER_DIR ${_DIR})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(_FOUND)
|
||||||
|
SET(NELDRIVER_${_UPDRIVER}_FOUND ON)
|
||||||
|
LIST(APPEND NEL_DRIVERS_FOUND ${_DRIVER})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Found NeL driver in ${NEL_DRIVER_DIR}")
|
||||||
|
|
||||||
|
PARSE_VERSION_OTHER(${NEL_INCLUDE_DIR}/nel/misc/version_nl.h NL_VERSION_MAJOR NL_VERSION_MINOR NL_VERSION_PATCH NL_REVISION)
|
||||||
|
|
||||||
|
SET(NEL_VERSION_MAJOR ${NL_VERSION_MAJOR})
|
||||||
|
SET(NEL_VERSION_MINOR ${NL_VERSION_MINOR})
|
||||||
|
SET(NEL_VERSION_PATCH ${NL_VERSION_PATCH})
|
||||||
|
SET(NEL_REVISION ${NL_REVISION})
|
||||||
|
|
||||||
|
IF(NOT NEL_VERSION)
|
||||||
|
IF(NEL_VERSION_MAJOR OR NEL_VERSION_MINOR} OR NEL_VERSION_PATCH)
|
||||||
|
SET(NEL_VERSION "${NEL_VERSION_MAJOR}.${NEL_VERSION_MINOR}.${NEL_VERSION_PATCH}")
|
||||||
|
ELSE()
|
||||||
|
SET(NEL_VERSION "0.5.0")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NEL_REVISION)
|
||||||
|
SET(NEL_VERSION "${NEL_VERSION}.${NEL_REVISION}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_PACKAGE(PNG REQUIRED)
|
||||||
|
IF(PNG_FOUND)
|
||||||
|
LIST(APPEND NELMISC_LIBRARIES ${PNG_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_PACKAGE(Jpeg REQUIRED)
|
||||||
|
IF(JPEG_FOUND)
|
||||||
|
LIST(APPEND NELMISC_LIBRARIES ${JPEG_LIBRARY})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_PACKAGE(GIF)
|
||||||
|
|
||||||
|
IF(GIF_FOUND)
|
||||||
|
LIST(APPEND NELMISC_LIBRARIES ${GIF_LIBRARY})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_LIBXML2()
|
||||||
|
|
||||||
|
IF(LIBXML2_FOUND)
|
||||||
|
LIST(APPEND NELMISC_LIBRARIES ${LIBXML2_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
LIST(REMOVE_ITEM NeL_FIND_COMPONENTS misc)
|
||||||
|
|
||||||
|
LIST(APPEND NEL_MODULES_FOUND misc)
|
||||||
|
LIST(APPEND NEL_LIBRARIES ${NELMISC_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT NeL_FIND_COMPONENTS)
|
||||||
|
SET(NeL_FIND_COMPONENTS ${NEL_MODULES_AVAILABLE})
|
||||||
|
|
||||||
|
# We can skip not installed modules
|
||||||
|
SET(NeL_FIND_REQUIRED OFF)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FOREACH(COMPONENT ${NeL_FIND_COMPONENTS})
|
||||||
|
SET(_NAME NeL${COMPONENT})
|
||||||
|
STRING(TOUPPER ${_NAME} _UPNAME)
|
||||||
|
|
||||||
|
# module is required
|
||||||
|
SET(${_NAME}_FIND_REQUIRED ${NeL_FIND_REQUIRED})
|
||||||
|
|
||||||
|
IF(COMPONENT STREQUAL "3d")
|
||||||
|
SET(HEADER_FILE shape.h)
|
||||||
|
# ELSEIF(COMPONENT STREQUAL "cegui")
|
||||||
|
# SET(HEADER_FILE shape.h)
|
||||||
|
ELSEIF(COMPONENT STREQUAL "georges")
|
||||||
|
SET(HEADER_FILE form.h)
|
||||||
|
ELSEIF(COMPONENT STREQUAL "gui")
|
||||||
|
SET(HEADER_FILE reflect.h)
|
||||||
|
ELSEIF(COMPONENT STREQUAL "ligo")
|
||||||
|
SET(HEADER_FILE primitive.h)
|
||||||
|
ELSEIF(COMPONENT STREQUAL "logic")
|
||||||
|
SET(HEADER_FILE logic_state.h)
|
||||||
|
ELSEIF(COMPONENT STREQUAL "net")
|
||||||
|
SET(HEADER_FILE sock.h)
|
||||||
|
ELSEIF(COMPONENT STREQUAL "pacs")
|
||||||
|
SET(HEADER_FILE primitive_block.h)
|
||||||
|
# ELSEIF(COMPONENT STREQUAL "pipeline")
|
||||||
|
# SET(HEADER_FILE shape.h)
|
||||||
|
ELSEIF(COMPONENT STREQUAL "sound")
|
||||||
|
SET(HEADER_FILE shape.h)
|
||||||
|
ELSE()
|
||||||
|
SET(HEADER_FILE)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# display if a component has a wrong name
|
||||||
|
IF(NOT HEADER_FILE)
|
||||||
|
MESSAGE(STATUS "NeL module ${COMPONENT} not supported, ignoring it...")
|
||||||
|
CONTINUE()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_PACKAGE_HELPER(${_NAME} nel/${COMPONENT}/${HEADER_FILE}
|
||||||
|
RELEASE nel${COMPONENT}_r nel${COMPONENT}
|
||||||
|
DEBUG nel${COMPONENT}_d
|
||||||
|
QUIET)
|
||||||
|
|
||||||
|
IF(${_UPNAME}_FOUND)
|
||||||
|
LIST(APPEND NEL_MODULES_FOUND ${COMPONENT})
|
||||||
|
|
||||||
|
IF(COMPONENT STREQUAL "3d")
|
||||||
|
IF(NEL_STATIC)
|
||||||
|
# 3rd party dependencies
|
||||||
|
FIND_PACKAGE(Freetype REQUIRED)
|
||||||
|
IF(FREETYPE_FOUND)
|
||||||
|
LIST(APPEND ${_UPNAME}_LIBRARIES ${FREETYPE_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Append static 3D drivers
|
||||||
|
IF(NEL_STATIC_DRIVERS)
|
||||||
|
# Direct3D driver (only under Windows)
|
||||||
|
IF(WIN32)
|
||||||
|
IF(NELDRIVER_DIRECT3D_LIBRARY_DEBUG)
|
||||||
|
LIST(APPEND ${_UPNAME}_LIBRARIES debug ${NELDRIVER_DIRECT3D_LIBRARY_DEBUG})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NELDRIVER_DIRECT3D_LIBRARY_RELEASE)
|
||||||
|
LIST(APPEND ${_UPNAME}_LIBRARIES optimized ${NELDRIVER_DIRECT3D_LIBRARY_RELEASE})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# OpenGL driver
|
||||||
|
IF(NELDRIVER_OPENGL_LIBRARY_DEBUG)
|
||||||
|
LIST(APPEND ${_UPNAME}_LIBRARIES debug ${NELDRIVER_OPENGL_LIBRARY_DEBUG})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NELDRIVER_OPENGL_LIBRARY_RELEASE)
|
||||||
|
LIST(APPEND ${_UPNAME}_LIBRARIES optimized ${NELDRIVER_OPENGL_LIBRARY_RELEASE})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(COMPONENT STREQUAL "gui")
|
||||||
|
FIND_PACKAGE(Luabind REQUIRED)
|
||||||
|
|
||||||
|
LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES})
|
||||||
|
|
||||||
|
FIND_LIBCURL()
|
||||||
|
|
||||||
|
IF(CURL_FOUND)
|
||||||
|
LIST(APPEND ${_UPNAME}_LIBRARIES ${CURL_LIBRARIES})
|
||||||
|
LIST(APPEND ${_UPNAME}_DEFINITIONS ${CURL_DEFINITIONS})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# TODO: remove complately OpenSSL requirement on Windows
|
||||||
|
|
||||||
|
# Only used by libcurl under Linux
|
||||||
|
FIND_PACKAGE(OpenSSL REQUIRED)
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
LIST(APPEND OPENSSL_LIBRARIES Crypt32.lib)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Only Linux version of libcurl depends on OpenSSL
|
||||||
|
LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
|
||||||
|
LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES})
|
||||||
|
|
||||||
|
LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES} ${CURL_LIBRARIES})
|
||||||
|
LIST(APPEND NEL_DEFINITIONS ${${_UPNAME}_DEFINITIONS})
|
||||||
|
ELSEIF(COMPONENT STREQUAL "sound")
|
||||||
|
FIND_PACKAGE(Ogg REQUIRED)
|
||||||
|
|
||||||
|
IF(OGG_FOUND)
|
||||||
|
LIST(APPEND ${_UPNAME}_LIBRARIES ${OGG_LIBRARY})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_PACKAGE(Vorbis REQUIRED)
|
||||||
|
|
||||||
|
IF(VORBIS_FOUND)
|
||||||
|
LIST(APPEND ${_UPNAME}_LIBRARIES ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NEL_STATIC)
|
||||||
|
# Link to snd_lowlevel
|
||||||
|
FIND_LIBRARY_HELPER(nelsnd_lowlevel RELEASE nelsnd_lowlevel_r DEBUG nelsnd_lowlevel_d DIR ${NEL_DIR} REQUIRED)
|
||||||
|
|
||||||
|
IF(NELSND_LOWLEVEL_LIBRARIES)
|
||||||
|
MESSAGE(STATUS "Found NeL sound lowlevel ${NELSND_LOWLEVEL_LIBRARIES}")
|
||||||
|
|
||||||
|
LIST(APPEND NELSOUND_LIBRARIES ${NELSND_LOWLEVEL_LIBRARIES})
|
||||||
|
|
||||||
|
IF(NEL_STATIC_DRIVERS)
|
||||||
|
# DirectSound, XAudio2 and FMod drivers (only under Windows)
|
||||||
|
IF(WIN32)
|
||||||
|
# DirectSound
|
||||||
|
IF(NELDRIVER_DIRECTSOUND_LIBRARY_DEBUG)
|
||||||
|
LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_DIRECTSOUND_LIBRARY_DEBUG})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NELDRIVER_DIRECTSOUND_LIBRARY_RELEASE)
|
||||||
|
LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_DIRECTSOUND_LIBRARY_RELEASE})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# FMod
|
||||||
|
IF(NELDRIVER_FMOD_LIBRARY_DEBUG)
|
||||||
|
LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_FMOD_LIBRARY_DEBUG})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NELDRIVER_FMOD_LIBRARY_RELEASE)
|
||||||
|
LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_FMOD_LIBRARY_RELEASE})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# XAudio2
|
||||||
|
IF(NELDRIVER_XAUDIO2_LIBRARY_DEBUG)
|
||||||
|
LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_XAUDIO2_LIBRARY_DEBUG})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NELDRIVER_XAUDIO2_LIBRARY_RELEASE)
|
||||||
|
LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_XAUDIO2_LIBRARY_RELEASE})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# OpenAL driver
|
||||||
|
IF(NELDRIVER_OPENAL_LIBRARY_DEBUG)
|
||||||
|
LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_OPENAL_LIBRARY_DEBUG})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NELDRIVER_OPENAL_LIBRARY_RELEASE)
|
||||||
|
LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_OPENAL_LIBRARY_RELEASE})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
LIST(APPEND NEL_LIBRARIES ${${_UPNAME}_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
MESSAGE_VERSION_PACKAGE_HELPER(NeL ${NEL_VERSION} ${NEL_MODULES_FOUND})
|
14
code/CMakeModules/FindRyzomGameShare.cmake
Normal file
14
code/CMakeModules/FindRyzomGameShare.cmake
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
INCLUDE(FindHelpers)
|
||||||
|
|
||||||
|
FIND_PACKAGE_HELPER(RyzomGameShare game_share/continent.h RELEASE ryzom_gameshare_r ryzom_gameshare DEBUG ryzom_gameshare_d DIR ${NEL_DIR} ${RYZOM_DIR} SUFFIXES ryzom)
|
||||||
|
|
||||||
|
IF(RYZOMGAMESHARE_FOUND)
|
||||||
|
FIND_PACKAGE(NeL REQUIRED)
|
||||||
|
LIST(APPEND RYZOMGAMESHARE_INCLUDE_DIRS ${NEL_INCLUDE_DIRS})
|
||||||
|
LIST(APPEND RYZOMGAMESHARE_LIBRARIES ${NELMISC_LIBRARIES} ${NELLIGO_LIBRARIES} ${NELNET_LIBRARIES} ${NELGEORGES_LIBRARIES})
|
||||||
|
|
||||||
|
SET(RYZOM_GAMESHARE_LIBRARIES ${RYZOMGAMESHARE_LIBRARIES})
|
||||||
|
SET(RYZOM_GAMESHARE_FOUND ${RYZOMGAMESHARE_FOUND})
|
||||||
|
SET(RYZOM_GAMESHARE_INCLUDE_DIR ${RYZOMGAMESHARE_INCLUDE_DIR})
|
||||||
|
SET(RYZOM_GAMESHARE_INCLUDE_DIRS ${RYZOMGAMESHARE_INCLUDE_DIRS})
|
||||||
|
ENDIF()
|
74
code/CMakeModules/FindSteam.cmake
Normal file
74
code/CMakeModules/FindSteam.cmake
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
# - Locate Steam API
|
||||||
|
# This module defines
|
||||||
|
# STEAM_LIBRARY, the library to link against
|
||||||
|
# STEAM_FOUND, if false, do not try to link to STEAM
|
||||||
|
# STEAM_INCLUDE_DIR, where to find headers.
|
||||||
|
|
||||||
|
IF(STEAM_LIBRARY AND STEAM_INCLUDE_DIR)
|
||||||
|
# in cache already
|
||||||
|
SET(Steam_FIND_QUIETLY TRUE)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
FIND_PATH(STEAM_INCLUDE_DIR
|
||||||
|
steam_api.h
|
||||||
|
PATH_SUFFIXES steam
|
||||||
|
PATHS
|
||||||
|
$ENV{STEAM_DIR}/public
|
||||||
|
)
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
IF(TARGET_X64)
|
||||||
|
SET(STEAM_LIBNAME steam_api64)
|
||||||
|
SET(STEAM_RUNTIMENAME steam_api64.dll)
|
||||||
|
SET(STEAM_PATHNAME redistributable_bin/win64)
|
||||||
|
ELSE()
|
||||||
|
SET(STEAM_LIBNAME steam_api)
|
||||||
|
SET(STEAM_RUNTIMENAME steam_api.dll)
|
||||||
|
SET(STEAM_PATHNAME redistributable_bin)
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(APPLE)
|
||||||
|
# universal binary
|
||||||
|
SET(STEAM_LIBNAME steam_api)
|
||||||
|
SET(STEAM_RUNTIMENAME libsteam_api.dylib)
|
||||||
|
SET(STEAM_PATHNAME redistributable_bin/osx32)
|
||||||
|
ELSE()
|
||||||
|
SET(STEAM_LIBNAME steam_api)
|
||||||
|
SET(STEAM_RUNTIMENAME libsteam_api.so)
|
||||||
|
IF(TARGET_X64)
|
||||||
|
SET(STEAM_PATHNAME redistributable_bin/linux64)
|
||||||
|
ELSE()
|
||||||
|
SET(STEAM_PATHNAME redistributable_bin/linux32)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_LIBRARY(STEAM_LIBRARY
|
||||||
|
NAMES ${STEAM_LIBNAME}
|
||||||
|
HINTS
|
||||||
|
$ENV{STEAM_DIR}/${STEAM_PATHNAME}
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_FILE(STEAM_RUNTIME
|
||||||
|
NAMES ${STEAM_RUNTIMENAME}
|
||||||
|
HINTS
|
||||||
|
$ENV{STEAM_DIR}/${STEAM_PATHNAME}
|
||||||
|
PATHS
|
||||||
|
${EXTERNAL_BINARY_PATH}
|
||||||
|
${CMAKE_LIBRARY_PATH}
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
# Don't need to check STEAM_LIBRARY because we're dynamically loading Steam DLL
|
||||||
|
IF(STEAM_INCLUDE_DIR)
|
||||||
|
SET(STEAM_FOUND ON)
|
||||||
|
SET(STEAM_LIBRARIES ${STEAM_LIBRARY})
|
||||||
|
SET(STEAM_INCLUDE_DIRS ${STEAM_INCLUDE_DIR})
|
||||||
|
IF(NOT Steam_FIND_QUIETLY)
|
||||||
|
MESSAGE(STATUS "Found Steam: ${STEAM_INCLUDE_DIR} and ${STEAM_RUNTIME}")
|
||||||
|
ENDIF()
|
||||||
|
ELSE()
|
||||||
|
IF(NOT Steam_FIND_QUIETLY)
|
||||||
|
MESSAGE(STATUS "Warning: Unable to find Steam!")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
|
@ -83,4 +83,6 @@ ENDIF()
|
||||||
|
|
||||||
IF(DEFINED REVISION)
|
IF(DEFINED REVISION)
|
||||||
MESSAGE(STATUS "Found revision ${REVISION}")
|
MESSAGE(STATUS "Found revision ${REVISION}")
|
||||||
|
ELSE()
|
||||||
|
SET(REVISION 0)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
|
@ -209,8 +209,8 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(USE_CPP0X AND gcc_compiler_version GREATER "6.2.0")
|
IF(CMAKE_CXX11_EXTENSION_COMPILE_OPTION)
|
||||||
LIST(APPEND _FLAGS "-std=gnu++11")
|
LIST(APPEND _FLAGS ${CMAKE_CXX11_EXTENSION_COMPILE_OPTION})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Format definitions
|
# Format definitions
|
||||||
|
|
|
@ -238,6 +238,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
|
||||||
OPTION(WITH_EXTERNAL "With provided external." OFF)
|
OPTION(WITH_EXTERNAL "With provided external." OFF)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
OPTION(WITH_STATIC_EXTERNAL "With static external libraries" OFF)
|
OPTION(WITH_STATIC_EXTERNAL "With static external libraries" OFF)
|
||||||
|
OPTION(WITH_STATIC_RUNTIMES "Use only static C++ runtimes" OFF)
|
||||||
IF(UNIX AND NOT APPLE)
|
IF(UNIX AND NOT APPLE)
|
||||||
OPTION(WITH_UNIX_STRUCTURE "Use UNIX structure (bin, include, lib)" ON )
|
OPTION(WITH_UNIX_STRUCTURE "Use UNIX structure (bin, include, lib)" ON )
|
||||||
ELSE()
|
ELSE()
|
||||||
|
@ -373,8 +374,14 @@ MACRO(ADD_PLATFORM_LINKFLAGS _FLAGS)
|
||||||
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${_FLAGS}")
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${_FLAGS}")
|
||||||
ENDMACRO()
|
ENDMACRO()
|
||||||
|
|
||||||
MACRO(NL_SETUP_BUILD)
|
MACRO(CONVERT_VERSION_NUMBER _VERSION_NUMBER _BASE)
|
||||||
|
SET(${_VERSION_NUMBER} 0)
|
||||||
|
FOREACH(_ARG ${ARGN})
|
||||||
|
MATH(EXPR ${_VERSION_NUMBER} "${${_VERSION_NUMBER}} * ${_BASE} + ${_ARG}")
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO(NL_SETUP_BUILD)
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Setup the buildmode variables.
|
# Setup the buildmode variables.
|
||||||
#
|
#
|
||||||
|
@ -636,8 +643,14 @@ MACRO(NL_SETUP_BUILD)
|
||||||
SET(NL_RELEASE_LINKFLAGS "/RELEASE ${NL_RELEASE_LINKFLAGS}")
|
SET(NL_RELEASE_LINKFLAGS "/RELEASE ${NL_RELEASE_LINKFLAGS}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(NL_DEBUG_CFLAGS "/Zi /MDd /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}")
|
IF(WITH_STATIC_RUNTIMES)
|
||||||
SET(NL_RELEASE_CFLAGS "/MD /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}")
|
SET(RUNTIME_FLAG "/MT")
|
||||||
|
ELSE()
|
||||||
|
SET(RUNTIME_FLAG "/MD")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(NL_DEBUG_CFLAGS "/Zi ${RUNTIME_FLAG}d /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}")
|
||||||
|
SET(NL_RELEASE_CFLAGS "${RUNTIME_FLAG} /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}")
|
||||||
SET(NL_DEBUG_LINKFLAGS "/DEBUG /OPT:NOREF /OPT:NOICF /NODEFAULTLIB:msvcrt ${MSVC_INCREMENTAL_YES_FLAG} ${NL_DEBUG_LINKFLAGS}")
|
SET(NL_DEBUG_LINKFLAGS "/DEBUG /OPT:NOREF /OPT:NOICF /NODEFAULTLIB:msvcrt ${MSVC_INCREMENTAL_YES_FLAG} ${NL_DEBUG_LINKFLAGS}")
|
||||||
SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO ${NL_RELEASE_LINKFLAGS}")
|
SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO ${NL_RELEASE_LINKFLAGS}")
|
||||||
|
|
||||||
|
@ -874,7 +887,9 @@ MACRO(NL_SETUP_BUILD)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# use c++0x standard to use std::unique_ptr and std::shared_ptr
|
# use c++0x standard to use std::unique_ptr and std::shared_ptr
|
||||||
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -std=c++0x")
|
IF(CMAKE_CXX11_EXTENSION_COMPILE_OPTION)
|
||||||
|
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} ${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
ADD_PLATFORM_FLAGS("-D_REENTRANT")
|
ADD_PLATFORM_FLAGS("-D_REENTRANT")
|
||||||
|
|
||||||
|
@ -950,8 +965,6 @@ MACRO(NL_SETUP_BUILD)
|
||||||
ADD_PLATFORM_FLAGS("-fPIC")
|
ADD_PLATFORM_FLAGS("-fPIC")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -ftemplate-depth-48")
|
|
||||||
|
|
||||||
# hardening
|
# hardening
|
||||||
ADD_PLATFORM_FLAGS("-fstack-protector --param=ssp-buffer-size=4")
|
ADD_PLATFORM_FLAGS("-fstack-protector --param=ssp-buffer-size=4")
|
||||||
|
|
||||||
|
@ -965,6 +978,10 @@ MACRO(NL_SETUP_BUILD)
|
||||||
|
|
||||||
IF(NOT APPLE)
|
IF(NOT APPLE)
|
||||||
ADD_PLATFORM_LINKFLAGS("-Wl,--no-undefined -Wl,--as-needed")
|
ADD_PLATFORM_LINKFLAGS("-Wl,--no-undefined -Wl,--as-needed")
|
||||||
|
|
||||||
|
IF(WITH_STATIC_RUNTIMES)
|
||||||
|
ADD_PLATFORM_LINKFLAGS("-static-libstdc++")
|
||||||
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(NOT APPLE)
|
IF(NOT APPLE)
|
||||||
|
@ -1023,6 +1040,12 @@ MACRO(NL_MAKE_ABSOLUTE_PREFIX NAME_RELATIVE NAME_ABSOLUTE)
|
||||||
ENDMACRO(NL_MAKE_ABSOLUTE_PREFIX)
|
ENDMACRO(NL_MAKE_ABSOLUTE_PREFIX)
|
||||||
|
|
||||||
MACRO(NL_SETUP_PREFIX_PATHS)
|
MACRO(NL_SETUP_PREFIX_PATHS)
|
||||||
|
IF(TARGET_X64 AND WIN32)
|
||||||
|
SET(LIB_SUFFIX "64")
|
||||||
|
ELSE()
|
||||||
|
SET(LIB_SUFFIX "")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
## Allow override of install_prefix/etc path.
|
## Allow override of install_prefix/etc path.
|
||||||
IF(NOT NL_ETC_PREFIX)
|
IF(NOT NL_ETC_PREFIX)
|
||||||
IF(WITH_UNIX_STRUCTURE)
|
IF(WITH_UNIX_STRUCTURE)
|
||||||
|
@ -1046,7 +1069,7 @@ MACRO(NL_SETUP_PREFIX_PATHS)
|
||||||
## Allow override of install_prefix/sbin path.
|
## Allow override of install_prefix/sbin path.
|
||||||
IF(NOT NL_SBIN_PREFIX)
|
IF(NOT NL_SBIN_PREFIX)
|
||||||
IF(WITH_UNIX_STRUCTURE)
|
IF(WITH_UNIX_STRUCTURE)
|
||||||
SET(NL_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.")
|
SET(NL_SBIN_PREFIX "sbin${LIB_SUFFIX}" CACHE PATH "Installation path for admin tools and services.")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(NL_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
|
SET(NL_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@ -1056,7 +1079,7 @@ MACRO(NL_SETUP_PREFIX_PATHS)
|
||||||
## Allow override of install_prefix/bin path.
|
## Allow override of install_prefix/bin path.
|
||||||
IF(NOT NL_BIN_PREFIX)
|
IF(NOT NL_BIN_PREFIX)
|
||||||
IF(WITH_UNIX_STRUCTURE)
|
IF(WITH_UNIX_STRUCTURE)
|
||||||
SET(NL_BIN_PREFIX "bin" CACHE PATH "Installation path for tools and applications.")
|
SET(NL_BIN_PREFIX "bin${LIB_SUFFIX}" CACHE PATH "Installation path for tools and applications.")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(NL_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
|
SET(NL_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@ -1068,7 +1091,7 @@ MACRO(NL_SETUP_PREFIX_PATHS)
|
||||||
IF(LIBRARY_ARCHITECTURE)
|
IF(LIBRARY_ARCHITECTURE)
|
||||||
SET(NL_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
|
SET(NL_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(NL_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
|
SET(NL_LIB_PREFIX "lib${LIB_SUFFIX}" CACHE PATH "Installation path for libraries.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
NL_MAKE_ABSOLUTE_PREFIX(NL_LIB_PREFIX NL_LIB_ABSOLUTE_PREFIX)
|
NL_MAKE_ABSOLUTE_PREFIX(NL_LIB_PREFIX NL_LIB_ABSOLUTE_PREFIX)
|
||||||
|
@ -1079,7 +1102,11 @@ MACRO(NL_SETUP_PREFIX_PATHS)
|
||||||
IF(LIBRARY_ARCHITECTURE)
|
IF(LIBRARY_ARCHITECTURE)
|
||||||
SET(NL_DRIVER_PREFIX "lib/${LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.")
|
SET(NL_DRIVER_PREFIX "lib/${LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(NL_DRIVER_PREFIX "lib/nel" CACHE PATH "Installation path for drivers.")
|
IF(WIN32)
|
||||||
|
SET(NL_DRIVER_PREFIX "bin${LIB_SUFFIX}" CACHE PATH "Installation path for drivers.")
|
||||||
|
ELSE()
|
||||||
|
SET(NL_DRIVER_PREFIX "lib${LIB_SUFFIX}/nel" CACHE PATH "Installation path for drivers.")
|
||||||
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(NL_DRIVER_PREFIX "." CACHE PATH "Installation path for drivers.")
|
SET(NL_DRIVER_PREFIX "." CACHE PATH "Installation path for drivers.")
|
||||||
|
@ -1112,7 +1139,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
|
||||||
## Allow override of install_prefix/sbin path.
|
## Allow override of install_prefix/sbin path.
|
||||||
IF(NOT RYZOM_SBIN_PREFIX)
|
IF(NOT RYZOM_SBIN_PREFIX)
|
||||||
IF(WITH_UNIX_STRUCTURE)
|
IF(WITH_UNIX_STRUCTURE)
|
||||||
SET(RYZOM_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.")
|
SET(RYZOM_SBIN_PREFIX "sbin${LIB_SUFFIX}" CACHE PATH "Installation path for admin tools and services.")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
|
SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@ -1122,7 +1149,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
|
||||||
## Allow override of install_prefix/bin path.
|
## Allow override of install_prefix/bin path.
|
||||||
IF(NOT RYZOM_BIN_PREFIX)
|
IF(NOT RYZOM_BIN_PREFIX)
|
||||||
IF(WITH_UNIX_STRUCTURE)
|
IF(WITH_UNIX_STRUCTURE)
|
||||||
SET(RYZOM_BIN_PREFIX "bin" CACHE PATH "Installation path for tools.")
|
SET(RYZOM_BIN_PREFIX "bin${LIB_SUFFIX}" CACHE PATH "Installation path for tools.")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
|
SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@ -1134,7 +1161,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
|
||||||
IF(LIBRARY_ARCHITECTURE)
|
IF(LIBRARY_ARCHITECTURE)
|
||||||
SET(RYZOM_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
|
SET(RYZOM_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(RYZOM_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
|
SET(RYZOM_LIB_PREFIX "lib${LIB_SUFFIX}" CACHE PATH "Installation path for libraries.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_LIB_PREFIX RYZOM_LIB_ABSOLUTE_PREFIX)
|
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_LIB_PREFIX RYZOM_LIB_ABSOLUTE_PREFIX)
|
||||||
|
@ -1210,4 +1237,4 @@ MACRO(SETUP_EXTERNAL)
|
||||||
FIND_PACKAGE(MSVC REQUIRED)
|
FIND_PACKAGE(MSVC REQUIRED)
|
||||||
FIND_PACKAGE(WindowsSDK REQUIRED)
|
FIND_PACKAGE(WindowsSDK REQUIRED)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDMACRO(SETUP_EXTERNAL)
|
ENDMACRO()
|
||||||
|
|
|
@ -224,7 +224,7 @@ public:
|
||||||
// @{
|
// @{
|
||||||
// first param is the associated window.
|
// first param is the associated window.
|
||||||
// Must be a HWND for Windows (WIN32).
|
// Must be a HWND for Windows (WIN32).
|
||||||
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show = true, bool resizeable = true) throw(EBadDisplay) = 0;
|
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show = true, bool resizeable = true) = 0;
|
||||||
// Must be called after a setDisplay that initialize the mode
|
// Must be called after a setDisplay that initialize the mode
|
||||||
virtual bool setMode(const GfxMode &mode) = 0;
|
virtual bool setMode(const GfxMode &mode) = 0;
|
||||||
virtual bool getModes(std::vector<GfxMode> &modes) = 0;
|
virtual bool getModes(std::vector<GfxMode> &modes) = 0;
|
||||||
|
|
|
@ -134,14 +134,14 @@ class CDRU
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// Portable Function which create a GL Driver (using gl dll...).
|
/// Portable Function which create a GL Driver (using gl dll...).
|
||||||
static IDriver *createGlDriver() throw(EDru);
|
static IDriver *createGlDriver();
|
||||||
|
|
||||||
/// Portable Function which create a GL ES Driver (using gl dll...).
|
/// Portable Function which create a GL ES Driver (using gl dll...).
|
||||||
static IDriver *createGlEsDriver() throw(EDru);
|
static IDriver *createGlEsDriver();
|
||||||
|
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
/// Windows Function which create a Direct3d Driver.
|
/// Windows Function which create a Direct3d Driver.
|
||||||
static IDriver *createD3DDriver() throw(EDru);
|
static IDriver *createD3DDriver();
|
||||||
#endif // NL_OS_WINDOWS
|
#endif // NL_OS_WINDOWS
|
||||||
|
|
||||||
/// \name 2D render.
|
/// \name 2D render.
|
||||||
|
|
|
@ -168,9 +168,9 @@ public:
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
/// Verify the binding of patchs of all zones. throw EBadBind if error.
|
/// Verify the binding of patchs of all zones. throw EBadBind if error.
|
||||||
void checkBinds() throw(EBadBind);
|
void checkBinds();
|
||||||
/// Verify the binding of patchs of one zone. throw EBadBind if error. nop if zone not loaded.
|
/// Verify the binding of patchs of one zone. throw EBadBind if error. nop if zone not loaded.
|
||||||
void checkBinds(uint16 zoneId) throw(EBadBind);
|
void checkBinds(uint16 zoneId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build tileBank. Call this after loading the near and far tile banks.
|
* Build tileBank. Call this after loading the near and far tile banks.
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
*
|
*
|
||||||
* You can access the driver with CNELU::Driver.
|
* You can access the driver with CNELU::Driver.
|
||||||
*/
|
*/
|
||||||
static bool initDriver(uint w, uint h, uint bpp=32, bool windowed=true, nlWindow systemWindow=EmptyWindow, bool offscreen=false, bool direct3d=false) throw(EDru);
|
static bool initDriver(uint w, uint h, uint bpp=32, bool windowed=true, nlWindow systemWindow=EmptyWindow, bool offscreen=false, bool direct3d=false);
|
||||||
|
|
||||||
/** Init all that we need for a Scene.
|
/** Init all that we need for a Scene.
|
||||||
* - register scene basics models,
|
* - register scene basics models,
|
||||||
|
@ -108,7 +108,7 @@ public:
|
||||||
* - initScene();
|
* - initScene();
|
||||||
* - initEventServer();
|
* - initEventServer();
|
||||||
*/
|
*/
|
||||||
static bool init(uint w, uint h, CViewport viewport=CViewport(), uint bpp=32, bool windowed=true, nlWindow systemWindow=EmptyWindow, bool offscreen = false, bool direct3d = false) throw(EDru);
|
static bool init(uint w, uint h, CViewport viewport=CViewport(), uint bpp=32, bool windowed=true, nlWindow systemWindow=EmptyWindow, bool offscreen = false, bool direct3d = false);
|
||||||
|
|
||||||
/** Delete all:
|
/** Delete all:
|
||||||
* - releaseEventServer();
|
* - releaseEventServer();
|
||||||
|
|
|
@ -88,7 +88,7 @@ public:
|
||||||
|
|
||||||
void setShadeOutline (bool b) { _ShadeOutline = b; }
|
void setShadeOutline (bool b) { _ShadeOutline = b; }
|
||||||
|
|
||||||
void setShadeExtent (float shext) { _ShadeExtent = shext; }
|
void setShadeExtent (float x, float y) { _ShadeExtentX = x; _ShadeExtentY = y; }
|
||||||
|
|
||||||
/// The alpha of the shade is multiplied at each draw with the alpha of the color. Default: (0,0,0,255)
|
/// The alpha of the shade is multiplied at each draw with the alpha of the color. Default: (0,0,0,255)
|
||||||
void setShadeColor (NLMISC::CRGBA color) { _ShadeColor = color; }
|
void setShadeColor (NLMISC::CRGBA color) { _ShadeColor = color; }
|
||||||
|
@ -157,19 +157,20 @@ public:
|
||||||
rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
|
rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
|
||||||
if (_ShadeOutline)
|
if (_ShadeOutline)
|
||||||
{
|
{
|
||||||
float rext = _ShadeExtent * 0.7071f;
|
float rextX = _ShadeExtentX * 0.7071f;
|
||||||
rCS.render2D(*_Driver, x+rext, z-rext, _HotSpot, _ScaleX, _ScaleZ);
|
float rextY = _ShadeExtentY * 0.7071f;
|
||||||
rCS.render2D(*_Driver, x-rext, z-rext, _HotSpot, _ScaleX, _ScaleZ);
|
rCS.render2D(*_Driver, x+rextX, z-rextY, _HotSpot, _ScaleX, _ScaleZ);
|
||||||
rCS.render2D(*_Driver, x-rext, z+rext, _HotSpot, _ScaleX, _ScaleZ);
|
rCS.render2D(*_Driver, x-rextX, z-rextY, _HotSpot, _ScaleX, _ScaleZ);
|
||||||
rCS.render2D(*_Driver, x+rext, z+rext, _HotSpot, _ScaleX, _ScaleZ);
|
rCS.render2D(*_Driver, x-rextX, z+rextY, _HotSpot, _ScaleX, _ScaleZ);
|
||||||
rCS.render2D(*_Driver, x+_ShadeExtent, z, _HotSpot, _ScaleX, _ScaleZ);
|
rCS.render2D(*_Driver, x+rextX, z+rextY, _HotSpot, _ScaleX, _ScaleZ);
|
||||||
rCS.render2D(*_Driver, x-_ShadeExtent, z, _HotSpot, _ScaleX, _ScaleZ);
|
rCS.render2D(*_Driver, x+_ShadeExtentX, z, _HotSpot, _ScaleX, _ScaleZ);
|
||||||
rCS.render2D(*_Driver, x, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ);
|
rCS.render2D(*_Driver, x-_ShadeExtentX, z, _HotSpot, _ScaleX, _ScaleZ);
|
||||||
rCS.render2D(*_Driver, x, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ);
|
rCS.render2D(*_Driver, x, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ);
|
||||||
|
rCS.render2D(*_Driver, x, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rCS.render2D(*_Driver, x+_ShadeExtent, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ);
|
rCS.render2D(*_Driver, x+_ShadeExtentX, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ);
|
||||||
}
|
}
|
||||||
rCS.Color= bkup;
|
rCS.Color= bkup;
|
||||||
}
|
}
|
||||||
|
@ -190,19 +191,20 @@ public:
|
||||||
rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
|
rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
|
||||||
if (_ShadeOutline)
|
if (_ShadeOutline)
|
||||||
{
|
{
|
||||||
float rext = _ShadeExtent * 0.7071f;
|
float rextX = _ShadeExtentX * 0.7071f;
|
||||||
rCS.render2DClip(*_Driver, rdrBuffer, x+rext, z-rext, xmin, ymin, xmax, ymax);
|
float rextY = _ShadeExtentY * 0.7071f;
|
||||||
rCS.render2DClip(*_Driver, rdrBuffer, x-rext, z-rext, xmin, ymin, xmax, ymax);
|
rCS.render2DClip(*_Driver, rdrBuffer, x+rextX, z-rextY, xmin, ymin, xmax, ymax);
|
||||||
rCS.render2DClip(*_Driver, rdrBuffer, x-rext, z+rext, xmin, ymin, xmax, ymax);
|
rCS.render2DClip(*_Driver, rdrBuffer, x-rextX, z-rextY, xmin, ymin, xmax, ymax);
|
||||||
rCS.render2DClip(*_Driver, rdrBuffer, x+rext, z+rext, xmin, ymin, xmax, ymax);
|
rCS.render2DClip(*_Driver, rdrBuffer, x-rextX, z+rextY, xmin, ymin, xmax, ymax);
|
||||||
rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtent, z, xmin, ymin, xmax, ymax);
|
rCS.render2DClip(*_Driver, rdrBuffer, x+rextX, z+rextY, xmin, ymin, xmax, ymax);
|
||||||
rCS.render2DClip(*_Driver, rdrBuffer, x-_ShadeExtent, z, xmin, ymin, xmax, ymax);
|
rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtentX, z, xmin, ymin, xmax, ymax);
|
||||||
rCS.render2DClip(*_Driver, rdrBuffer, x, z+_ShadeExtent, xmin, ymin, xmax, ymax);
|
rCS.render2DClip(*_Driver, rdrBuffer, x-_ShadeExtentX, z, xmin, ymin, xmax, ymax);
|
||||||
rCS.render2DClip(*_Driver, rdrBuffer, x, z-_ShadeExtent, xmin, ymin, xmax, ymax);
|
rCS.render2DClip(*_Driver, rdrBuffer, x, z+_ShadeExtentY, xmin, ymin, xmax, ymax);
|
||||||
|
rCS.render2DClip(*_Driver, rdrBuffer, x, z-_ShadeExtentY, xmin, ymin, xmax, ymax);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtent, z-_ShadeExtent, xmin, ymin, xmax, ymax);
|
rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtentX, z-_ShadeExtentY, xmin, ymin, xmax, ymax);
|
||||||
}
|
}
|
||||||
rCS.Color= bkup;
|
rCS.Color= bkup;
|
||||||
}
|
}
|
||||||
|
@ -223,19 +225,20 @@ public:
|
||||||
rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
|
rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
|
||||||
if (_ShadeOutline)
|
if (_ShadeOutline)
|
||||||
{
|
{
|
||||||
float rext = _ShadeExtent * 0.7071f;
|
float rextX = _ShadeExtentX * 0.7071f;
|
||||||
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+rext, y-rext, depth, xmin, ymin, xmax, ymax);
|
float rextY = _ShadeExtentY * 0.7071f;
|
||||||
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-rext, y-rext, depth, xmin, ymin, xmax, ymax);
|
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+rextX, y-rextY, depth, xmin, ymin, xmax, ymax);
|
||||||
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-rext, y+rext, depth, xmin, ymin, xmax, ymax);
|
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-rextX, y-rextY, depth, xmin, ymin, xmax, ymax);
|
||||||
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+rext, y+rext, depth, xmin, ymin, xmax, ymax);
|
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-rextX, y+rextY, depth, xmin, ymin, xmax, ymax);
|
||||||
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtent, y, depth, xmin, ymin, xmax, ymax);
|
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+rextX, y+rextY, depth, xmin, ymin, xmax, ymax);
|
||||||
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-_ShadeExtent, y, depth, xmin, ymin, xmax, ymax);
|
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtentX, y, depth, xmin, ymin, xmax, ymax);
|
||||||
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y+_ShadeExtent, depth, xmin, ymin, xmax, ymax);
|
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-_ShadeExtentX, y, depth, xmin, ymin, xmax, ymax);
|
||||||
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y-_ShadeExtent, depth, xmin, ymin, xmax, ymax);
|
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y+_ShadeExtentY, depth, xmin, ymin, xmax, ymax);
|
||||||
|
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y-_ShadeExtentY, depth, xmin, ymin, xmax, ymax);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtent, y-_ShadeExtent, depth, xmin, ymin, xmax, ymax);
|
rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtentX, y-_ShadeExtentY, depth, xmin, ymin, xmax, ymax);
|
||||||
}
|
}
|
||||||
rCS.Color= bkup;
|
rCS.Color= bkup;
|
||||||
}
|
}
|
||||||
|
@ -258,19 +261,20 @@ public:
|
||||||
_TempString.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
|
_TempString.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
|
||||||
if (_ShadeOutline)
|
if (_ShadeOutline)
|
||||||
{
|
{
|
||||||
float rext = _ShadeExtent * 0.7071f;
|
float rextX = _ShadeExtentX * 0.7071f;
|
||||||
_TempString.render2D(*_Driver,x+rext,z-rext,_HotSpot,_ScaleX,_ScaleZ);
|
float rextY = _ShadeExtentY * 0.7071f;
|
||||||
_TempString.render2D(*_Driver,x-rext,z-rext,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x+rextX,z-rextY,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
_TempString.render2D(*_Driver,x-rext,z+rext,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x-rextX,z-rextY,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
_TempString.render2D(*_Driver,x+rext,z+rext,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x-rextX,z+rextY,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
_TempString.render2D(*_Driver,x+_ShadeExtent,z,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x+rextX,z+rextY,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
_TempString.render2D(*_Driver,x-_ShadeExtent,z,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x+_ShadeExtentX,z,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
_TempString.render2D(*_Driver,x,z+_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x-_ShadeExtentX,z,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
_TempString.render2D(*_Driver,x,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x,z+_ShadeExtentY,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
|
_TempString.render2D(*_Driver,x,z-_ShadeExtentY,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_TempString.render2D(*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver, x+_ShadeExtentX, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ);
|
||||||
}
|
}
|
||||||
_TempString.Color = bkup;
|
_TempString.Color = bkup;
|
||||||
}
|
}
|
||||||
|
@ -297,19 +301,20 @@ public:
|
||||||
_TempString.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
|
_TempString.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8);
|
||||||
if (_ShadeOutline)
|
if (_ShadeOutline)
|
||||||
{
|
{
|
||||||
float rext = _ShadeExtent * 0.7071f;
|
float rextX = _ShadeExtentX * 0.7071f;
|
||||||
_TempString.render2D(*_Driver,x+rext,z-rext,_HotSpot,_ScaleX,_ScaleZ);
|
float rextY = _ShadeExtentY * 0.7071f;
|
||||||
_TempString.render2D(*_Driver,x-rext,z-rext,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x+rextX,z-rextY,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
_TempString.render2D(*_Driver,x-rext,z+rext,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x-rextX,z-rextY,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
_TempString.render2D(*_Driver,x+rext,z+rext,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x-rextX,z+rextY,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
_TempString.render2D(*_Driver,x+_ShadeExtent,z,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x+rextX,z+rextY,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
_TempString.render2D(*_Driver,x-_ShadeExtent,z,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x+_ShadeExtentX,z,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
_TempString.render2D(*_Driver,x,z+_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x-_ShadeExtentX,z,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
_TempString.render2D(*_Driver,x,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver,x,z+_ShadeExtentY,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
|
_TempString.render2D(*_Driver,x,z-_ShadeExtentY,_HotSpot,_ScaleX,_ScaleZ);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_TempString.render2D(*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
|
_TempString.render2D(*_Driver, x+_ShadeExtentX, z-_ShadeExtentY, _HotSpot, _ScaleX, _ScaleZ);
|
||||||
}
|
}
|
||||||
_TempString.Color = bkup;
|
_TempString.Color = bkup;
|
||||||
}
|
}
|
||||||
|
@ -412,7 +417,8 @@ private:
|
||||||
bool _ShadeOutline;
|
bool _ShadeOutline;
|
||||||
|
|
||||||
/// shade's extent (shadow size)
|
/// shade's extent (shadow size)
|
||||||
float _ShadeExtent;
|
float _ShadeExtentX;
|
||||||
|
float _ShadeExtentY;
|
||||||
|
|
||||||
/// Shade color (default is black)
|
/// Shade color (default is black)
|
||||||
NLMISC::CRGBA _ShadeColor;
|
NLMISC::CRGBA _ShadeColor;
|
||||||
|
|
|
@ -80,7 +80,7 @@ public:
|
||||||
bool getShaded() const;
|
bool getShaded() const;
|
||||||
void setShadeOutline(bool b);
|
void setShadeOutline(bool b);
|
||||||
bool getShadeOutline() const;
|
bool getShadeOutline() const;
|
||||||
void setShadeExtent(float shext) ;
|
void setShadeExtent(float x, float y);
|
||||||
void setShadeColor (NLMISC::CRGBA sc);
|
void setShadeColor (NLMISC::CRGBA sc);
|
||||||
NLMISC::CRGBA getShadeColor () const;
|
NLMISC::CRGBA getShadeColor () const;
|
||||||
void setKeep800x600Ratio(bool keep);
|
void setKeep800x600Ratio(bool keep);
|
||||||
|
|
|
@ -205,7 +205,7 @@ public:
|
||||||
* set the shadow's size
|
* set the shadow's size
|
||||||
* \param the shade extent
|
* \param the shade extent
|
||||||
*/
|
*/
|
||||||
virtual void setShadeExtent (float shext) = 0;
|
virtual void setShadeExtent (float x, float y) = 0;
|
||||||
/**
|
/**
|
||||||
* set the shadow's color
|
* set the shadow's color
|
||||||
* The alpha of the shade is multiplied at each draw with the alpha of the color. Default: (0,0,0,255)
|
* The alpha of the shade is multiplied at each draw with the alpha of the color. Default: (0,0,0,255)
|
||||||
|
|
|
@ -17,19 +17,22 @@
|
||||||
#ifndef CL_CURL_CERTIFICATES_HTML_H
|
#ifndef CL_CURL_CERTIFICATES_HTML_H
|
||||||
#define CL_CURL_CERTIFICATES_HTML_H
|
#define CL_CURL_CERTIFICATES_HTML_H
|
||||||
|
|
||||||
#include <curl/curl.h>
|
|
||||||
|
|
||||||
#include "nel/misc/types_nl.h"
|
#include "nel/misc/types_nl.h"
|
||||||
|
|
||||||
|
// forward declaration to avoid curl.h inclusion everywhere
|
||||||
|
typedef void CURL;
|
||||||
|
|
||||||
namespace NLGUI
|
namespace NLGUI
|
||||||
{
|
{
|
||||||
#if defined(NL_OS_WINDOWS)
|
class CCurlCertificates
|
||||||
class CCurlCertificates {
|
{
|
||||||
public:
|
public:
|
||||||
// cURL SSL certificate loading
|
// allow to use custom PEM certificates
|
||||||
static CURLcode sslCtxFunction(CURL *curl, void *sslctx, void *parm);
|
static void addCertificateFile(const std::string &cert);
|
||||||
|
|
||||||
|
// set all CURL options to use custom SSL context function
|
||||||
|
static void useCertificates(CURL *curl);
|
||||||
};
|
};
|
||||||
#endif // NL_OS_WINDOWS
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
#ifndef CL_GROUP_HTML_H
|
#ifndef CL_GROUP_HTML_H
|
||||||
#define CL_GROUP_HTML_H
|
#define CL_GROUP_HTML_H
|
||||||
|
|
||||||
#include <curl/curl.h>
|
|
||||||
|
|
||||||
#include "nel/misc/types_nl.h"
|
#include "nel/misc/types_nl.h"
|
||||||
#include "nel/gui/interface_group.h"
|
#include "nel/gui/interface_group.h"
|
||||||
#include "nel/gui/group_scrolltext.h"
|
#include "nel/gui/group_scrolltext.h"
|
||||||
|
@ -27,6 +25,9 @@
|
||||||
#include "nel/gui/group_table.h"
|
#include "nel/gui/group_table.h"
|
||||||
#include "nel/gui/libwww_types.h"
|
#include "nel/gui/libwww_types.h"
|
||||||
|
|
||||||
|
// forward declaration
|
||||||
|
typedef void CURLM;
|
||||||
|
|
||||||
typedef std::map<std::string, std::string> TStyle;
|
typedef std::map<std::string, std::string> TStyle;
|
||||||
|
|
||||||
namespace NLGUI
|
namespace NLGUI
|
||||||
|
@ -66,8 +67,6 @@ namespace NLGUI
|
||||||
std::vector< std::string > trustedDomains;
|
std::vector< std::string > trustedDomains;
|
||||||
/// Maximum concurrent MultiCurl connections per CGroupHTML instance
|
/// Maximum concurrent MultiCurl connections per CGroupHTML instance
|
||||||
sint32 curlMaxConnections;
|
sint32 curlMaxConnections;
|
||||||
/// cacert.pem location
|
|
||||||
std::string curlCABundle;
|
|
||||||
|
|
||||||
SWebOptions(): curlMaxConnections(2)
|
SWebOptions(): curlMaxConnections(2)
|
||||||
{
|
{
|
||||||
|
@ -76,10 +75,25 @@ namespace NLGUI
|
||||||
|
|
||||||
static SWebOptions options;
|
static SWebOptions options;
|
||||||
|
|
||||||
|
// text-shadow
|
||||||
|
struct STextShadow
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
STextShadow(bool enabled = false, bool outline = false, sint32 x=1, sint32 y=1, NLMISC::CRGBA color=NLMISC::CRGBA::Black)
|
||||||
|
: Enabled(enabled), Outline(outline), X(x), Y(y), Color(color)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
bool Enabled;
|
||||||
|
bool Outline;
|
||||||
|
sint32 X;
|
||||||
|
sint32 Y;
|
||||||
|
NLMISC::CRGBA Color;
|
||||||
|
};
|
||||||
|
|
||||||
class CStyleParams
|
class CStyleParams
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CStyleParams () : FontFamily(""), TextColor(255,255,255,255)
|
CStyleParams () : FontFamily(""), TextColor(255,255,255,255), TextShadow()
|
||||||
{
|
{
|
||||||
FontSize=10;
|
FontSize=10;
|
||||||
FontWeight=400;
|
FontWeight=400;
|
||||||
|
@ -97,6 +111,7 @@ namespace NLGUI
|
||||||
bool FontOblique;
|
bool FontOblique;
|
||||||
std::string FontFamily;
|
std::string FontFamily;
|
||||||
NLMISC::CRGBA TextColor;
|
NLMISC::CRGBA TextColor;
|
||||||
|
STextShadow TextShadow;
|
||||||
bool GlobalColor;
|
bool GlobalColor;
|
||||||
bool Underlined;
|
bool Underlined;
|
||||||
bool StrikeThrough;
|
bool StrikeThrough;
|
||||||
|
@ -505,78 +520,32 @@ namespace NLGUI
|
||||||
// IL mode
|
// IL mode
|
||||||
bool _LI;
|
bool _LI;
|
||||||
|
|
||||||
// Current text color
|
// Current active style
|
||||||
std::vector<NLMISC::CRGBA> _TextColor;
|
CStyleParams _Style;
|
||||||
inline const NLMISC::CRGBA &getTextColor() const
|
// Default style
|
||||||
|
CStyleParams _StyleDefault;
|
||||||
|
// Nested style stack
|
||||||
|
std::vector<CStyleParams> _StyleParams;
|
||||||
|
inline void pushStyle()
|
||||||
{
|
{
|
||||||
if (_TextColor.empty())
|
_StyleParams.push_back(_Style);
|
||||||
return TextColor;
|
}
|
||||||
return _TextColor.back();
|
inline void popStyle()
|
||||||
|
{
|
||||||
|
if (_StyleParams.empty())
|
||||||
|
_Style = _StyleDefault;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_Style = _StyleParams.back();
|
||||||
|
_StyleParams.pop_back();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Current global color flag
|
|
||||||
std::vector<bool> _GlobalColor;
|
|
||||||
inline bool getGlobalColor() const
|
|
||||||
{
|
|
||||||
if (_GlobalColor.empty())
|
|
||||||
return false;
|
|
||||||
return _GlobalColor.back();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Current font name
|
|
||||||
std::vector<std::string> _FontFamily;
|
|
||||||
inline const char* getFontFamily() const
|
|
||||||
{
|
|
||||||
if (_FontFamily.empty())
|
|
||||||
return "";
|
|
||||||
return _FontFamily.back().c_str();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Current font size
|
|
||||||
std::vector<uint> _FontSize;
|
|
||||||
inline uint getFontSize() const
|
|
||||||
{
|
|
||||||
if (_FontSize.empty())
|
|
||||||
return TextFontSize;
|
|
||||||
return _FontSize.back();
|
|
||||||
}
|
|
||||||
inline uint getFontSizeSmaller() const
|
inline uint getFontSizeSmaller() const
|
||||||
{
|
{
|
||||||
if (getFontSize() < 5)
|
if (_Style.FontSize < 5)
|
||||||
return 3;
|
return 3;
|
||||||
return getFontSize()-2;
|
return _Style.FontSize-2;
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<uint> _FontWeight;
|
|
||||||
inline uint getFontWeight() const
|
|
||||||
{
|
|
||||||
if (_FontWeight.empty())
|
|
||||||
return 400;
|
|
||||||
return _FontWeight.back();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<bool> _FontOblique;
|
|
||||||
inline bool getFontOblique() const
|
|
||||||
{
|
|
||||||
if (_FontOblique.empty())
|
|
||||||
return false;
|
|
||||||
return _FontOblique.back();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<bool> _FontUnderlined;
|
|
||||||
inline bool getFontUnderlined() const
|
|
||||||
{
|
|
||||||
if (_FontUnderlined.empty())
|
|
||||||
return false;
|
|
||||||
return _FontUnderlined.back();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<bool> _FontStrikeThrough;
|
|
||||||
inline bool getFontStrikeThrough() const
|
|
||||||
{
|
|
||||||
if (_FontStrikeThrough.empty())
|
|
||||||
return false;
|
|
||||||
return _FontStrikeThrough.back();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Current link
|
// Current link
|
||||||
|
@ -641,6 +610,14 @@ namespace NLGUI
|
||||||
return _TR.back();
|
return _TR.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<STextShadow> _TextShadow;
|
||||||
|
inline STextShadow getTextShadow() const
|
||||||
|
{
|
||||||
|
if (_TextShadow.empty())
|
||||||
|
return STextShadow();
|
||||||
|
return _TextShadow.back();
|
||||||
|
}
|
||||||
|
|
||||||
// Forms
|
// Forms
|
||||||
class CForm
|
class CForm
|
||||||
{
|
{
|
||||||
|
@ -880,11 +857,6 @@ namespace NLGUI
|
||||||
|
|
||||||
// HtmlType download finished
|
// HtmlType download finished
|
||||||
void htmlDownloadFinished(const std::string &content, const std::string &type, long code);
|
void htmlDownloadFinished(const std::string &content, const std::string &type, long code);
|
||||||
|
|
||||||
// cURL transfer callbacks
|
|
||||||
static size_t curlHeaderCallback(char *buffer, size_t size, size_t nmemb, void *pCCurlWWWData);
|
|
||||||
static size_t curlDataCallback(char *buffer, size_t size, size_t nmemb, void *pCCurlWWWData);
|
|
||||||
static size_t curlProgressCallback(void *pCCurlWWWData, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// adapter group that store y offset for inputs inside an html form
|
// adapter group that store y offset for inputs inside an html form
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace NLGUI
|
||||||
class CStrictTransportSecurity
|
class CStrictTransportSecurity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::map<std::string, SHSTSObject> THSTSObject;
|
typedef std::map<std::string, SHSTSObject> THSTSObjectMap;
|
||||||
|
|
||||||
static CStrictTransportSecurity* getInstance();
|
static CStrictTransportSecurity* getInstance();
|
||||||
static void release();
|
static void release();
|
||||||
|
@ -66,7 +66,7 @@ namespace NLGUI
|
||||||
~CStrictTransportSecurity();
|
~CStrictTransportSecurity();
|
||||||
|
|
||||||
std::string _Filename;
|
std::string _Filename;
|
||||||
THSTSObject _Domains;
|
THSTSObjectMap _Domains;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,6 +192,9 @@ namespace NLGUI
|
||||||
void setMarginLeft(sint32 m) { _MarginLeft = m; }
|
void setMarginLeft(sint32 m) { _MarginLeft = m; }
|
||||||
sint32 getMarginLeft() const { return _MarginLeft; }
|
sint32 getMarginLeft() const { return _MarginLeft; }
|
||||||
|
|
||||||
|
// Return inner width for child elements
|
||||||
|
virtual sint32 getInnerWidth() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the max width used by the window.
|
* Get the max width used by the window.
|
||||||
*
|
*
|
||||||
|
|
|
@ -164,6 +164,7 @@ namespace NLGUI
|
||||||
sint32 getMaxH () const { return _MaxH; }
|
sint32 getMaxH () const { return _MaxH; }
|
||||||
sint32 getMaxWReal () const { return _Active ? _MaxWReal : 0; }
|
sint32 getMaxWReal () const { return _Active ? _MaxWReal : 0; }
|
||||||
sint32 getMaxHReal () const { return _Active ? _MaxHReal : 0; }
|
sint32 getMaxHReal () const { return _Active ? _MaxHReal : 0; }
|
||||||
|
sint32 getInnerWidth () const;
|
||||||
sint32 getOfsX () const { return _OffsetX; }
|
sint32 getOfsX () const { return _OffsetX; }
|
||||||
sint32 getOfsY () const { return _OffsetY; }
|
sint32 getOfsY () const { return _OffsetY; }
|
||||||
bool getResizeFromChildW() const { return _ResizeFromChildW; }
|
bool getResizeFromChildW() const { return _ResizeFromChildW; }
|
||||||
|
|
|
@ -20,11 +20,12 @@
|
||||||
#ifndef CL_LIB_WWW_H
|
#ifndef CL_LIB_WWW_H
|
||||||
#define CL_LIB_WWW_H
|
#define CL_LIB_WWW_H
|
||||||
|
|
||||||
#include <curl/curl.h>
|
|
||||||
|
|
||||||
#include "nel/misc/rgba.h"
|
#include "nel/misc/rgba.h"
|
||||||
#include "nel/gui/libwww_types.h"
|
#include "nel/gui/libwww_types.h"
|
||||||
|
|
||||||
|
// forward declaration to avoid curl.h inclusion everywhere
|
||||||
|
typedef void CURL;
|
||||||
|
|
||||||
namespace NLGUI
|
namespace NLGUI
|
||||||
{
|
{
|
||||||
class CCtrlBaseButton;
|
class CCtrlBaseButton;
|
||||||
|
@ -102,6 +103,7 @@ namespace NLGUI
|
||||||
HTML_ATTR(TR,L_MARGIN),
|
HTML_ATTR(TR,L_MARGIN),
|
||||||
HTML_ATTR(TR,NOWRAP),
|
HTML_ATTR(TR,NOWRAP),
|
||||||
HTML_ATTR(TR,VALIGN),
|
HTML_ATTR(TR,VALIGN),
|
||||||
|
HTML_ATTR(TR,STYLE),
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
|
|
@ -118,7 +118,7 @@ namespace NLGUI
|
||||||
/** read/write between values on a lua stack & a property exported from a 'CReflectable' derived object
|
/** read/write between values on a lua stack & a property exported from a 'CReflectable' derived object
|
||||||
* (throws on error)
|
* (throws on error)
|
||||||
*/
|
*/
|
||||||
static void luaValueToReflectedProperty(CLuaState &ls, int stackIndex, CReflectable &target, const CReflectedProperty &property) throw(ELuaIHMException);
|
static void luaValueToReflectedProperty(CLuaState &ls, int stackIndex, CReflectable &target, const CReflectedProperty &property);
|
||||||
|
|
||||||
// push a reflected property on the stack
|
// push a reflected property on the stack
|
||||||
// NB : no check is done that 'property' is part of the class info of 'reflectedObject'
|
// NB : no check is done that 'property' is part of the class info of 'reflectedObject'
|
||||||
|
|
|
@ -110,7 +110,7 @@ namespace NLGUI
|
||||||
/** create a sub table for this object, with a string as a key
|
/** create a sub table for this object, with a string as a key
|
||||||
* This object must be a table or an exception if thrown
|
* This object must be a table or an exception if thrown
|
||||||
*/
|
*/
|
||||||
CLuaObject newTable(const char *tableName) throw(ELuaNotATable);
|
CLuaObject newTable(const char *tableName);
|
||||||
|
|
||||||
|
|
||||||
/** Set a value in a table.
|
/** Set a value in a table.
|
||||||
|
@ -118,29 +118,29 @@ namespace NLGUI
|
||||||
* NB : value should came from the same lua environment
|
* NB : value should came from the same lua environment
|
||||||
* \TODO other type of keys
|
* \TODO other type of keys
|
||||||
*/
|
*/
|
||||||
void setValue(const char *key, const CLuaObject &value) throw(ELuaNotATable);
|
void setValue(const char *key, const CLuaObject &value);
|
||||||
void setValue(const std::string &key, const CLuaObject &value) throw(ELuaNotATable) { setValue(key.c_str(), value); }
|
void setValue(const std::string &key, const CLuaObject &value) { setValue(key.c_str(), value); }
|
||||||
void setValue(const char *key, const std::string &value) throw(ELuaNotATable);
|
void setValue(const char *key, const std::string &value);
|
||||||
void setValue(const char *key, const char *value) throw(ELuaNotATable);
|
void setValue(const char *key, const char *value);
|
||||||
void setValue(const char *key, bool value) throw(ELuaNotATable);
|
void setValue(const char *key, bool value);
|
||||||
void setValue(const char *key, TLuaWrappedFunction value) throw(ELuaNotATable);
|
void setValue(const char *key, TLuaWrappedFunction value);
|
||||||
void setValue(const char *key, double value) throw(ELuaNotATable);
|
void setValue(const char *key, double value);
|
||||||
void setValue(const char *key, uint32 value) throw(ELuaNotATable);
|
void setValue(const char *key, uint32 value);
|
||||||
void setValue(const char *key, sint32 value) throw(ELuaNotATable);
|
void setValue(const char *key, sint32 value);
|
||||||
void setValue(const char *key, sint64 value) throw(ELuaNotATable);
|
void setValue(const char *key, sint64 value);
|
||||||
void setValue(const std::string &key, const std::string &value) throw(ELuaNotATable) { setValue(key.c_str(), value); }
|
void setValue(const std::string &key, const std::string &value) { setValue(key.c_str(), value); }
|
||||||
void setNil(const char *key) throw(ELuaNotATable);
|
void setNil(const char *key);
|
||||||
void setNil(const std::string &key) throw(ELuaNotATable) { setNil(key.c_str()); }
|
void setNil(const std::string &key) { setNil(key.c_str()); }
|
||||||
/** Erase a value in a table by its key.
|
/** Erase a value in a table by its key.
|
||||||
* If this object is not a table then an exception is thrown.
|
* If this object is not a table then an exception is thrown.
|
||||||
* \TODO other type of keys
|
* \TODO other type of keys
|
||||||
*/
|
*/
|
||||||
void eraseValue(const char *key) throw(ELuaNotATable);
|
void eraseValue(const char *key);
|
||||||
void eraseValue(const std::string &key) throw(ELuaNotATable) { eraseValue(key.c_str()); }
|
void eraseValue(const std::string &key) { eraseValue(key.c_str()); }
|
||||||
// test is this object is enumerable
|
// test is this object is enumerable
|
||||||
bool isEnumerable() const;
|
bool isEnumerable() const;
|
||||||
// Enumeration of a table. If the object is not a table, an exception is thrown.
|
// Enumeration of a table. If the object is not a table, an exception is thrown.
|
||||||
CLuaEnumeration enumerate() throw(ELuaNotATable);
|
CLuaEnumeration enumerate();
|
||||||
// retrieve metatable of an object (or nil if object has no metatable)
|
// retrieve metatable of an object (or nil if object has no metatable)
|
||||||
CLuaObject getMetaTable() const;
|
CLuaObject getMetaTable() const;
|
||||||
// set metatable for this object
|
// set metatable for this object
|
||||||
|
@ -155,7 +155,7 @@ namespace NLGUI
|
||||||
CLuaObject operator[](const std::string &key) const { return operator[](key.c_str()); }
|
CLuaObject operator[](const std::string &key) const { return operator[](key.c_str()); }
|
||||||
/** Checked access to a sub element of a table. An exception is thrown is the element is not a table.
|
/** Checked access to a sub element of a table. An exception is thrown is the element is not a table.
|
||||||
*/
|
*/
|
||||||
CLuaObject at(const char *key) const throw (ELuaNotATable);
|
CLuaObject at(const char *key) const;
|
||||||
CLuaObject at(const std::string &key) const { return at(key.c_str()); }
|
CLuaObject at(const std::string &key) const { return at(key.c_str()); }
|
||||||
|
|
||||||
// Test is that table has the given key. The object must be a table or an exception is thrown
|
// Test is that table has the given key. The object must be a table or an exception is thrown
|
||||||
|
|
|
@ -89,6 +89,7 @@ namespace NLGUI
|
||||||
void setShadow (bool bShadow);
|
void setShadow (bool bShadow);
|
||||||
void setShadowOutline (bool bShadowOutline);
|
void setShadowOutline (bool bShadowOutline);
|
||||||
void setShadowColor (const NLMISC::CRGBA &color);
|
void setShadowColor (const NLMISC::CRGBA &color);
|
||||||
|
void setShadowOffset (sint x, sint y);
|
||||||
void setLineMaxW (sint nMaxW, bool invalidate=true);
|
void setLineMaxW (sint nMaxW, bool invalidate=true);
|
||||||
void setOverflowText(const ucstring &text) { _OverflowText = text; }
|
void setOverflowText(const ucstring &text) { _OverflowText = text; }
|
||||||
void setMultiLine (bool bMultiLine);
|
void setMultiLine (bool bMultiLine);
|
||||||
|
@ -114,6 +115,7 @@ namespace NLGUI
|
||||||
bool getShadow() { return _Shadow; }
|
bool getShadow() { return _Shadow; }
|
||||||
bool getShadowOutline() { return _ShadowOutline; }
|
bool getShadowOutline() { return _ShadowOutline; }
|
||||||
NLMISC::CRGBA getShadowColor() { return _ShadowColor; }
|
NLMISC::CRGBA getShadowColor() { return _ShadowColor; }
|
||||||
|
void getShadowOffset(sint &x, sint &y) { x = _ShadowX; y = _ShadowY; }
|
||||||
sint getLineMaxW() const { return _LineMaxW; }
|
sint getLineMaxW() const { return _LineMaxW; }
|
||||||
ucstring getOverflowText() const { return _OverflowText; }
|
ucstring getOverflowText() const { return _OverflowText; }
|
||||||
bool getMultiLine() const { return _MultiLine; }
|
bool getMultiLine() const { return _MultiLine; }
|
||||||
|
@ -254,6 +256,8 @@ namespace NLGUI
|
||||||
/// the shadow mode
|
/// the shadow mode
|
||||||
bool _Shadow;
|
bool _Shadow;
|
||||||
bool _ShadowOutline;
|
bool _ShadowOutline;
|
||||||
|
sint32 _ShadowX;
|
||||||
|
sint32 _ShadowY;
|
||||||
/// the case mode
|
/// the case mode
|
||||||
TCaseMode _CaseMode;
|
TCaseMode _CaseMode;
|
||||||
/// the text shadow color
|
/// the text shadow color
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
CONVERT_VERSION_NUMBER(NL_VERSION_NUM 100 ${NL_VERSION_MAJOR} ${NL_VERSION_MINOR} ${NL_VERSION_PATCH})
|
||||||
|
|
||||||
|
CONFIGURE_FILE(version_nl.cmake ${CMAKE_BINARY_DIR}/version_nl.h)
|
||||||
|
|
||||||
FILE(GLOB HEADERS *.h)
|
FILE(GLOB HEADERS *.h)
|
||||||
|
|
||||||
INSTALL(FILES ${HEADERS} DESTINATION include/nel/misc COMPONENT headers)
|
INSTALL(FILES ${HEADERS} ${CMAKE_BINARY_DIR}/version_nl.h DESTINATION include/nel/misc COMPONENT headers)
|
||||||
|
|
|
@ -86,10 +86,10 @@ public:
|
||||||
static void release();
|
static void release();
|
||||||
|
|
||||||
/// Register your class for future Instanciation.
|
/// Register your class for future Instanciation.
|
||||||
static void registerClass(const std::string &className, IClassable* (*creator)(), const std::string &typeidCheck) throw(ERegistry);
|
static void registerClass(const std::string &className, IClassable* (*creator)(), const std::string &typeidCheck);
|
||||||
|
|
||||||
/// Create an object from his class name.
|
/// Create an object from his class name.
|
||||||
static IClassable *create(const std::string &className) throw(ERegistry);
|
static IClassable *create(const std::string &className);
|
||||||
|
|
||||||
/// check if the object has been correctly registered. Must be used for debug only, and Must compile with RTTI.
|
/// check if the object has been correctly registered. Must be used for debug only, and Must compile with RTTI.
|
||||||
static bool checkObject(IClassable* obj);
|
static bool checkObject(IClassable* obj);
|
||||||
|
|
|
@ -108,9 +108,9 @@ public: // Advanced Usage.
|
||||||
/// flush the file.
|
/// flush the file.
|
||||||
void flush();
|
void flush();
|
||||||
/// Seek the file
|
/// Seek the file
|
||||||
bool seek (sint32 offset, IStream::TSeekOrigin origin) const throw(EStream);
|
bool seek (sint32 offset, IStream::TSeekOrigin origin) const;
|
||||||
/// Get the location of the file pointer
|
/// Get the location of the file pointer
|
||||||
sint32 getPos () const throw(EStream);
|
sint32 getPos () const;
|
||||||
|
|
||||||
// Imp the Name of the stream as the name of the file.
|
// Imp the Name of the stream as the name of the file.
|
||||||
virtual std::string getStreamName() const;
|
virtual std::string getStreamName() const;
|
||||||
|
@ -125,7 +125,7 @@ public: // Advanced Usage.
|
||||||
// return true if there's nothing more to read (same as ifstream)
|
// return true if there's nothing more to read (same as ifstream)
|
||||||
bool eof ();
|
bool eof ();
|
||||||
|
|
||||||
virtual void serialBuffer(uint8 *buf, uint len)throw(EReadError);
|
virtual void serialBuffer(uint8 *buf, uint len);
|
||||||
|
|
||||||
/// \name Statistics
|
/// \name Statistics
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ public: // Advanced Usage.
|
||||||
static void clearDump ();
|
static void clearDump ();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void serialBit(bool &bit) throw(EReadError);
|
virtual void serialBit(bool &bit);
|
||||||
|
|
||||||
virtual uint getDbgStreamSize() const;
|
virtual uint getDbgStreamSize() const;
|
||||||
|
|
||||||
|
@ -223,20 +223,20 @@ public: // Advanced Usage.
|
||||||
/// flush the file.
|
/// flush the file.
|
||||||
void flush();
|
void flush();
|
||||||
/// Seek the file
|
/// Seek the file
|
||||||
bool seek (sint32 offset, IStream::TSeekOrigin origin) const throw(EStream);
|
bool seek (sint32 offset, IStream::TSeekOrigin origin) const;
|
||||||
/// Get the location of the file pointer
|
/// Get the location of the file pointer
|
||||||
sint32 getPos () const throw(EStream);
|
sint32 getPos () const;
|
||||||
|
|
||||||
// Imp the Name of the stream as the name of the file.
|
// Imp the Name of the stream as the name of the file.
|
||||||
virtual std::string getStreamName() const;
|
virtual std::string getStreamName() const;
|
||||||
|
|
||||||
// very useful to serialize string in text mode (without the size)
|
// very useful to serialize string in text mode (without the size)
|
||||||
virtual void serialBuffer(uint8 *buf, uint len) throw(EWriteError);
|
virtual void serialBuffer(uint8 *buf, uint len);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Internal close.
|
/// Internal close.
|
||||||
void internalClose(bool success);
|
void internalClose(bool success);
|
||||||
virtual void serialBit(bool &bit) throw(EWriteError);
|
virtual void serialBit(bool &bit);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FILE *_F;
|
FILE *_F;
|
||||||
|
|
|
@ -197,7 +197,7 @@ public:
|
||||||
* \return true if seek sucessfull.
|
* \return true if seek sucessfull.
|
||||||
* \see ESeekNotSupported SeekOrigin getPos
|
* \see ESeekNotSupported SeekOrigin getPos
|
||||||
*/
|
*/
|
||||||
virtual bool seek (sint32 offset, TSeekOrigin origin) const throw(EStream);
|
virtual bool seek (sint32 offset, TSeekOrigin origin) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the location of the stream pointer.
|
* Get the location of the stream pointer.
|
||||||
|
@ -210,7 +210,7 @@ public:
|
||||||
* \return the new offset regarding from the origin.
|
* \return the new offset regarding from the origin.
|
||||||
* \see ESeekNotSupported SeekOrigin seek
|
* \see ESeekNotSupported SeekOrigin seek
|
||||||
*/
|
*/
|
||||||
virtual sint32 getPos () const throw(EStream)
|
virtual sint32 getPos () const
|
||||||
{
|
{
|
||||||
return sint32(_Buffer.Pos);
|
return sint32(_Buffer.Pos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,7 +226,7 @@ public:
|
||||||
std::string toString() { if(Ptr) return toString(*Ptr); else return "<null>"; }
|
std::string toString() { if(Ptr) return toString(*Ptr); else return "<null>"; }
|
||||||
|
|
||||||
// serial using serialPtr
|
// serial using serialPtr
|
||||||
void serialPtr(NLMISC::IStream &f) throw(NLMISC::EStream )
|
void serialPtr(NLMISC::IStream &f)
|
||||||
{
|
{
|
||||||
T* obj= NULL;
|
T* obj= NULL;
|
||||||
if(f.isReading())
|
if(f.isReading())
|
||||||
|
@ -242,7 +242,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// serial using serialPloyPtr
|
// serial using serialPloyPtr
|
||||||
void serialPolyPtr(NLMISC::IStream &f) throw(NLMISC::EStream )
|
void serialPolyPtr(NLMISC::IStream &f)
|
||||||
{
|
{
|
||||||
T* obj= NULL;
|
T* obj= NULL;
|
||||||
if(f.isReading())
|
if(f.isReading())
|
||||||
|
@ -337,7 +337,7 @@ public:
|
||||||
void kill();
|
void kill();
|
||||||
|
|
||||||
// serial using serialPloyPtr
|
// serial using serialPloyPtr
|
||||||
void serialPolyPtr(NLMISC::IStream &f) throw(NLMISC::EStream )
|
void serialPolyPtr(NLMISC::IStream &f)
|
||||||
{
|
{
|
||||||
T* obj= NULL;
|
T* obj= NULL;
|
||||||
if(f.isReading())
|
if(f.isReading())
|
||||||
|
|
|
@ -177,10 +177,10 @@ public:
|
||||||
uint32 getCount() { return _IdCounter; }
|
uint32 getCount() { return _IdCounter; }
|
||||||
|
|
||||||
// helper serialize a string id as a string
|
// helper serialize a string id as a string
|
||||||
void serial(NLMISC::IStream &f, TSStringId &strId) throw(EStream);
|
void serial(NLMISC::IStream &f, TSStringId &strId);
|
||||||
|
|
||||||
// helper serialize a string id vector
|
// helper serialize a string id vector
|
||||||
void serial(NLMISC::IStream &f, std::vector<TSStringId> &strIdVect) throw(EStream);
|
void serial(NLMISC::IStream &f, std::vector<TSStringId> &strIdVect);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,9 @@
|
||||||
# elif _MSC_VER >= 1600
|
# elif _MSC_VER >= 1600
|
||||||
# define NL_COMP_VC10
|
# define NL_COMP_VC10
|
||||||
# define NL_COMP_VC_VERSION 100
|
# define NL_COMP_VC_VERSION 100
|
||||||
|
# ifdef _HAS_CPP0X
|
||||||
|
# undef _HAS_CPP0X // VC++ 2010 doesn't implement C++11 stuff we need
|
||||||
|
# endif
|
||||||
# elif _MSC_VER >= 1500
|
# elif _MSC_VER >= 1500
|
||||||
# define NL_COMP_VC9
|
# define NL_COMP_VC9
|
||||||
# define NL_COMP_VC_VERSION 90
|
# define NL_COMP_VC_VERSION 90
|
||||||
|
@ -409,8 +412,16 @@ typedef unsigned int uint; // at least 32bits (depend of processor)
|
||||||
#define NL_DEFAULT_MEMORY_ALIGNMENT 16
|
#define NL_DEFAULT_MEMORY_ALIGNMENT 16
|
||||||
#define NL_ALIGN_SSE2 NL_ALIGN(NL_DEFAULT_MEMORY_ALIGNMENT)
|
#define NL_ALIGN_SSE2 NL_ALIGN(NL_DEFAULT_MEMORY_ALIGNMENT)
|
||||||
|
|
||||||
#ifndef NL_CPU_X86_64
|
#ifdef NL_CPU_X86_64
|
||||||
// on x86_64, new and delete are already aligned on 16 bytes
|
// on x86_64, new and delete are already aligned on 16 bytes
|
||||||
|
#elif (defined(NL_COMP_VC) && defined(NL_DEBUG))
|
||||||
|
// don't use aligned memory if debugging with VC++ in 32 bits
|
||||||
|
#else
|
||||||
|
// use aligned memory in all other cases
|
||||||
|
#define NL_USE_ALIGNED_MEMORY_OPERATORS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NL_USE_ALIGNED_MEMORY_OPERATORS
|
||||||
|
|
||||||
#ifdef NL_NO_EXCEPTION_SPECS
|
#ifdef NL_NO_EXCEPTION_SPECS
|
||||||
extern void *operator new(size_t size);
|
extern void *operator new(size_t size);
|
||||||
|
@ -422,9 +433,9 @@ extern void *operator new(size_t size) throw(std::bad_alloc);
|
||||||
extern void *operator new[](size_t size) throw(std::bad_alloc);
|
extern void *operator new[](size_t size) throw(std::bad_alloc);
|
||||||
extern void operator delete(void *p) throw();
|
extern void operator delete(void *p) throw();
|
||||||
extern void operator delete[](void *p) throw();
|
extern void operator delete[](void *p) throw();
|
||||||
#endif
|
#endif /* NL_NO_EXCEPTION_SPECS */
|
||||||
|
|
||||||
#endif
|
#endif /* NL_USE_ALIGNED_MEMORY_OPERATORS */
|
||||||
|
|
||||||
#else /* NL_HAS_SSE2 */
|
#else /* NL_HAS_SSE2 */
|
||||||
|
|
||||||
|
|
14
code/nel/include/nel/misc/version_nl.cmake
Normal file
14
code/nel/include/nel/misc/version_nl.cmake
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#ifndef NL_VERSION_H
|
||||||
|
#define NL_VERSION_H
|
||||||
|
|
||||||
|
#define NL_VERSION "${NL_VERSION}"
|
||||||
|
#define NL_VERSION_MAJOR ${NL_VERSION_MAJOR}
|
||||||
|
#define NL_VERSION_MINOR ${NL_VERSION_MINOR}
|
||||||
|
#define NL_VERSION_PATCH ${NL_VERSION_PATCH}
|
||||||
|
#define NL_VERSION_NUM ${NL_VERSION_NUM}
|
||||||
|
|
||||||
|
#define NL_REVISION ${REVISION}
|
||||||
|
|
||||||
|
#define NL_BUILD_DATE "${BUILD_DATE}"
|
||||||
|
|
||||||
|
#endif
|
|
@ -146,7 +146,7 @@ public:
|
||||||
return _LengthR;
|
return _LengthR;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual sint32 getPos () const throw(NLMISC::EStream)
|
virtual sint32 getPos() const
|
||||||
{
|
{
|
||||||
// return (_BufPos - _Buffer.getPtr()) - _SubMessagePosR;
|
// return (_BufPos - _Buffer.getPtr()) - _SubMessagePosR;
|
||||||
return _Buffer.Pos - _SubMessagePosR;
|
return _Buffer.Pos - _SubMessagePosR;
|
||||||
|
|
|
@ -213,18 +213,14 @@ namespace NLNET
|
||||||
* Note that a module can be plugged in several socket at the same
|
* Note that a module can be plugged in several socket at the same
|
||||||
* time, but not twice in the same socket.
|
* time, but not twice in the same socket.
|
||||||
*/
|
*/
|
||||||
virtual void plugModule(IModuleSocket *moduleSocket)
|
virtual void plugModule(IModuleSocket *moduleSocket) =0;
|
||||||
throw (EModuleAlreadyPluggedHere)
|
|
||||||
=0;
|
|
||||||
/** Unplug this module from the specified socket.
|
/** Unplug this module from the specified socket.
|
||||||
* Note that a module can be plugged in several socket at the same
|
* Note that a module can be plugged in several socket at the same
|
||||||
* time, but not twice in the same socket.
|
* time, but not twice in the same socket.
|
||||||
* Throw an exception if the socket is not currently plug into
|
* Throw an exception if the socket is not currently plug into
|
||||||
* the specified socket.
|
* the specified socket.
|
||||||
*/
|
*/
|
||||||
virtual void unplugModule(IModuleSocket *moduleSocket)
|
virtual void unplugModule(IModuleSocket *moduleSocket) =0;
|
||||||
throw (EModuleNotPluggedHere)
|
|
||||||
=0;
|
|
||||||
/** Fill resultList vector with the list of socket into
|
/** Fill resultList vector with the list of socket into
|
||||||
* witch this module is currently plugged.
|
* witch this module is currently plugged.
|
||||||
* This method don't clear the result vector before filling it.
|
* This method don't clear the result vector before filling it.
|
||||||
|
@ -265,9 +261,7 @@ namespace NLNET
|
||||||
* The call is blocking until receptions of the operation
|
* The call is blocking until receptions of the operation
|
||||||
* result message (or detection of the dest module module is down)
|
* result message (or detection of the dest module module is down)
|
||||||
*/
|
*/
|
||||||
virtual void invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg)
|
virtual void invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg) =0;
|
||||||
throw (EInvokeFailed)
|
|
||||||
=0;
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
@ -448,9 +442,7 @@ namespace NLNET
|
||||||
* This method do the job of finding a valid socket to effectively send
|
* This method do the job of finding a valid socket to effectively send
|
||||||
* the message.
|
* the message.
|
||||||
*/
|
*/
|
||||||
virtual void sendModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
|
virtual void sendModuleMessage(IModule *senderModule, const NLNET::CMessage &message) =0;
|
||||||
throw (EModuleNotReachable)
|
|
||||||
=0;
|
|
||||||
|
|
||||||
/** Return the first item of the security item list
|
/** Return the first item of the security item list
|
||||||
* If no security data are available, the method
|
* If no security data are available, the method
|
||||||
|
@ -779,10 +771,10 @@ namespace NLNET
|
||||||
// Init base module, init module name
|
// Init base module, init module name
|
||||||
bool initModule(const TParsedCommandLine &initInfo);
|
bool initModule(const TParsedCommandLine &initInfo);
|
||||||
|
|
||||||
void plugModule(IModuleSocket *moduleSocket) throw (EModuleAlreadyPluggedHere);
|
void plugModule(IModuleSocket *moduleSocket);
|
||||||
void unplugModule(IModuleSocket *moduleSocket) throw (EModuleNotPluggedHere);
|
void unplugModule(IModuleSocket *moduleSocket);
|
||||||
void getPluggedSocketList(std::vector<IModuleSocket*> &resultList);
|
void getPluggedSocketList(std::vector<IModuleSocket*> &resultList);
|
||||||
void invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg) throw (EInvokeFailed);
|
void invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg);
|
||||||
void _onModuleUp(IModuleProxy *removedProxy);
|
void _onModuleUp(IModuleProxy *removedProxy);
|
||||||
void _onModuleDown(IModuleProxy *removedProxy);
|
void _onModuleDown(IModuleProxy *removedProxy);
|
||||||
|
|
||||||
|
@ -879,8 +871,7 @@ namespace NLNET
|
||||||
|
|
||||||
/** Send a message to the module.
|
/** Send a message to the module.
|
||||||
*/
|
*/
|
||||||
virtual void sendModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
|
virtual void sendModuleMessage(IModule *senderModule, const NLNET::CMessage &message);
|
||||||
throw (EModuleNotReachable);
|
|
||||||
|
|
||||||
virtual const TSecurityData *getFirstSecurityData() const
|
virtual const TSecurityData *getFirstSecurityData() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -171,8 +171,7 @@ namespace NLNET
|
||||||
virtual void setTransportPeerInvisible(const std::string &transportInstanceName, bool peerInvisible) =0;
|
virtual void setTransportPeerInvisible(const std::string &transportInstanceName, bool peerInvisible) =0;
|
||||||
|
|
||||||
/// Activate/stop firewalling mode on a transport
|
/// Activate/stop firewalling mode on a transport
|
||||||
virtual void setTransportFirewallMode(const std::string &transportInstanceName, bool firewalled)
|
virtual void setTransportFirewallMode(const std::string &transportInstanceName, bool firewalled) =0;
|
||||||
throw (EGatewayFirewallBreak) =0;
|
|
||||||
|
|
||||||
/// Send a command to a transport
|
/// Send a command to a transport
|
||||||
virtual void transportCommand(const TParsedCommandLine &commandLine) =0;
|
virtual void transportCommand(const TParsedCommandLine &commandLine) =0;
|
||||||
|
@ -233,9 +232,7 @@ namespace NLNET
|
||||||
/** Disclose module information to a connected gateway.
|
/** Disclose module information to a connected gateway.
|
||||||
* This can also be this gateway itself.
|
* This can also be this gateway itself.
|
||||||
*/
|
*/
|
||||||
virtual void discloseModule(IModuleProxy *moduleProxy)
|
virtual void discloseModule(IModuleProxy *moduleProxy) =0;
|
||||||
throw (EGatewayNotConnected)
|
|
||||||
=0;
|
|
||||||
|
|
||||||
/** Retrieve the proxy for a locally plugged module.
|
/** Retrieve the proxy for a locally plugged module.
|
||||||
* Each local module plugged in a gateway has an associated
|
* Each local module plugged in a gateway has an associated
|
||||||
|
@ -346,9 +343,9 @@ namespace NLNET
|
||||||
virtual const std::string &getClassName() const =0;
|
virtual const std::string &getClassName() const =0;
|
||||||
|
|
||||||
/// The gateway send a command message to the transport
|
/// The gateway send a command message to the transport
|
||||||
virtual void onCommand(const CMessage &command) throw (EInvalidCommand) = 0;
|
virtual void onCommand(const CMessage &command) = 0;
|
||||||
/// The gateway send a textual command to the transport
|
/// The gateway send a textual command to the transport
|
||||||
virtual bool onCommand(const TParsedCommandLine &command) throw (EInvalidCommand) = 0;
|
virtual bool onCommand(const TParsedCommandLine &command) = 0;
|
||||||
|
|
||||||
/// The gateway update the transport regularly
|
/// The gateway update the transport regularly
|
||||||
virtual void update() =0;
|
virtual void update() =0;
|
||||||
|
|
|
@ -42,15 +42,11 @@ namespace NLNET
|
||||||
* If the destination module is not accessible through this socket,
|
* If the destination module is not accessible through this socket,
|
||||||
* an exception is thrown.
|
* an exception is thrown.
|
||||||
*/
|
*/
|
||||||
virtual void sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message )
|
virtual void sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message) =0;
|
||||||
throw (EModuleNotPluggedHere)
|
|
||||||
=0;
|
|
||||||
/** A plugged module send a message to all the module reachable
|
/** A plugged module send a message to all the module reachable
|
||||||
* with this socket.
|
* with this socket.
|
||||||
*/
|
*/
|
||||||
virtual void broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
|
virtual void broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message) =0;
|
||||||
throw (EModuleNotPluggedHere)
|
|
||||||
=0;
|
|
||||||
|
|
||||||
/** Fill the resultList with the list of module that are
|
/** Fill the resultList with the list of module that are
|
||||||
* reachable with this socket.
|
* reachable with this socket.
|
||||||
|
@ -95,21 +91,15 @@ namespace NLNET
|
||||||
virtual void _onModulePlugged(const TModulePtr &pluggedModule);
|
virtual void _onModulePlugged(const TModulePtr &pluggedModule);
|
||||||
virtual void _onModuleUnplugged(const TModulePtr &pluggedModule);
|
virtual void _onModuleUnplugged(const TModulePtr &pluggedModule);
|
||||||
|
|
||||||
virtual void _sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message )
|
virtual void _sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message) =0;
|
||||||
throw (EModuleNotPluggedHere, NLNET::EModuleNotReachable)
|
|
||||||
=0;
|
|
||||||
|
|
||||||
virtual void _broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
|
virtual void _broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message) =0;
|
||||||
throw (EModuleNotPluggedHere)
|
|
||||||
=0;
|
|
||||||
|
|
||||||
virtual void sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message )
|
virtual void sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message);
|
||||||
throw (EModuleNotPluggedHere);
|
|
||||||
/** A plugged module send a message to all the module reachable
|
/** A plugged module send a message to all the module reachable
|
||||||
* with this socket.
|
* with this socket.
|
||||||
*/
|
*/
|
||||||
virtual void broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
|
virtual void broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message);
|
||||||
throw (EModuleNotPluggedHere);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1328,7 +1328,7 @@ const D3DFORMAT FinalPixelFormat[ITexture::UploadFormatCount][CDriverD3D::FinalP
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
|
|
||||||
bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable) throw(EBadDisplay)
|
bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable)
|
||||||
{
|
{
|
||||||
H_AUTO_D3D(CDriver3D_setDisplay);
|
H_AUTO_D3D(CDriver3D_setDisplay);
|
||||||
|
|
||||||
|
|
|
@ -849,7 +849,7 @@ public:
|
||||||
|
|
||||||
// Mode initialisation, requests
|
// Mode initialisation, requests
|
||||||
virtual bool init (uintptr_t windowIcon = 0, emptyProc exitFunc = 0);
|
virtual bool init (uintptr_t windowIcon = 0, emptyProc exitFunc = 0);
|
||||||
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable) throw(EBadDisplay);
|
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable);
|
||||||
virtual bool release();
|
virtual bool release();
|
||||||
virtual bool setMode(const GfxMode& mode);
|
virtual bool setMode(const GfxMode& mode);
|
||||||
virtual bool getModes(std::vector<GfxMode> &modes);
|
virtual bool getModes(std::vector<GfxMode> &modes);
|
||||||
|
|
|
@ -325,7 +325,7 @@ public:
|
||||||
virtual void disableHardwareVertexArrayAGP();
|
virtual void disableHardwareVertexArrayAGP();
|
||||||
virtual void disableHardwareTextureShader();
|
virtual void disableHardwareTextureShader();
|
||||||
|
|
||||||
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable) throw(EBadDisplay);
|
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable);
|
||||||
virtual bool setMode(const GfxMode& mode);
|
virtual bool setMode(const GfxMode& mode);
|
||||||
virtual bool getModes(std::vector<GfxMode> &modes);
|
virtual bool getModes(std::vector<GfxMode> &modes);
|
||||||
virtual bool getCurrentScreenMode(GfxMode &mode);
|
virtual bool getCurrentScreenMode(GfxMode &mode);
|
||||||
|
|
|
@ -611,7 +611,7 @@ void CDriverGL::setWindowIcon(const std::vector<NLMISC::CBitmap> &bitmaps)
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool resizeable) throw(EBadDisplay)
|
bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool resizeable)
|
||||||
{
|
{
|
||||||
H_AUTO_OGL(CDriverGL_setDisplay)
|
H_AUTO_OGL(CDriverGL_setDisplay)
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ extern IDriver* createGlEsDriverInstance ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
IDriver *CDRU::createGlDriver() throw (EDru)
|
IDriver *CDRU::createGlDriver()
|
||||||
{
|
{
|
||||||
#ifdef NL_STATIC
|
#ifdef NL_STATIC
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ IDriver *CDRU::createGlDriver() throw (EDru)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
IDriver *CDRU::createGlEsDriver() throw (EDru)
|
IDriver *CDRU::createGlEsDriver()
|
||||||
{
|
{
|
||||||
#ifdef NL_STATIC
|
#ifdef NL_STATIC
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ IDriver *CDRU::createGlEsDriver() throw (EDru)
|
||||||
|
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
|
|
||||||
IDriver *CDRU::createD3DDriver() throw (EDru)
|
IDriver *CDRU::createD3DDriver()
|
||||||
{
|
{
|
||||||
#ifdef NL_STATIC
|
#ifdef NL_STATIC
|
||||||
|
|
||||||
|
|
|
@ -2423,7 +2423,7 @@ void CLandscape::checkZoneBinds(CZone &curZone, EBadBind &bindError)
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CLandscape::checkBinds() throw(EBadBind)
|
void CLandscape::checkBinds()
|
||||||
{
|
{
|
||||||
EBadBind bindError;
|
EBadBind bindError;
|
||||||
|
|
||||||
|
@ -2439,7 +2439,7 @@ void CLandscape::checkBinds() throw(EBadBind)
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CLandscape::checkBinds(uint16 zoneId) throw(EBadBind)
|
void CLandscape::checkBinds(uint16 zoneId)
|
||||||
{
|
{
|
||||||
EBadBind bindError;
|
EBadBind bindError;
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ CEventServer CNELU::EventServer;
|
||||||
CEventListenerAsync CNELU::AsyncListener;
|
CEventListenerAsync CNELU::AsyncListener;
|
||||||
|
|
||||||
|
|
||||||
bool CNELU::initDriver (uint w, uint h, uint bpp, bool windowed, nlWindow systemWindow, bool offscreen, bool direct3d) throw(EDru)
|
bool CNELU::initDriver (uint w, uint h, uint bpp, bool windowed, nlWindow systemWindow, bool offscreen, bool direct3d)
|
||||||
{
|
{
|
||||||
// Init debug system
|
// Init debug system
|
||||||
// NLMISC::InitDebug();
|
// NLMISC::InitDebug();
|
||||||
|
@ -183,7 +183,7 @@ void CNELU::releaseDriver()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CNELU::init (uint w, uint h, CViewport viewport, uint bpp, bool windowed, nlWindow systemWindow, bool offscreen, bool direct3d) throw(EDru)
|
bool CNELU::init (uint w, uint h, CViewport viewport, uint bpp, bool windowed, nlWindow systemWindow, bool offscreen, bool direct3d)
|
||||||
{
|
{
|
||||||
NL3D::registerSerial3d();
|
NL3D::registerSerial3d();
|
||||||
if (initDriver(w,h,bpp,windowed,systemWindow,offscreen,direct3d))
|
if (initDriver(w,h,bpp,windowed,systemWindow,offscreen,direct3d))
|
||||||
|
|
|
@ -47,7 +47,8 @@ CTextContext::CTextContext()
|
||||||
|
|
||||||
_Shaded = false;
|
_Shaded = false;
|
||||||
_ShadeOutline = false;
|
_ShadeOutline = false;
|
||||||
_ShadeExtent = 0.001f;
|
_ShadeExtentX = 0.001f;
|
||||||
|
_ShadeExtentY = 0.001f;
|
||||||
_ShadeColor = NLMISC::CRGBA(0,0,0);
|
_ShadeColor = NLMISC::CRGBA(0,0,0);
|
||||||
|
|
||||||
_Keep800x600Ratio= true;
|
_Keep800x600Ratio= true;
|
||||||
|
|
|
@ -187,11 +187,11 @@ bool CTextContextUser::getShadeOutline() const
|
||||||
|
|
||||||
return _TextContext.getShadeOutline();
|
return _TextContext.getShadeOutline();
|
||||||
}
|
}
|
||||||
void CTextContextUser::setShadeExtent(float shext)
|
void CTextContextUser::setShadeExtent(float x, float y)
|
||||||
{
|
{
|
||||||
H_AUTO2;
|
H_AUTO2;
|
||||||
|
|
||||||
_TextContext.setShadeExtent(shext);
|
_TextContext.setShadeExtent(x, y);
|
||||||
}
|
}
|
||||||
void CTextContextUser::setShadeColor (NLMISC::CRGBA sc)
|
void CTextContextUser::setShadeColor (NLMISC::CRGBA sc)
|
||||||
{
|
{
|
||||||
|
|
|
@ -677,7 +677,7 @@ void CWaterHeightMap::setWaves(float intensity, float period, uint radius, bool
|
||||||
void CWaterHeightMap::serial(NLMISC::IStream &f)
|
void CWaterHeightMap::serial(NLMISC::IStream &f)
|
||||||
{
|
{
|
||||||
f.xmlPushBegin("WaterHeightMap");
|
f.xmlPushBegin("WaterHeightMap");
|
||||||
f.xmlSetAttrib ("NAME") ;
|
f.xmlSetAttrib ("NAME");
|
||||||
f.serial (_Name);
|
f.serial (_Name);
|
||||||
f.xmlPushEnd();
|
f.xmlPushEnd();
|
||||||
(void)f.serialVersion(0);
|
(void)f.serialVersion(0);
|
||||||
|
|
|
@ -6,9 +6,10 @@ SOURCE_GROUP("src" FILES ${SRC})
|
||||||
|
|
||||||
NL_TARGET_LIB(nelgui ${SRC} ${HEADERS})
|
NL_TARGET_LIB(nelgui ${SRC} ${HEADERS})
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR} ${CURL_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR} ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(nelgui nelmisc nel3d ${LUA_LIBRARIES} ${LUABIND_LIBRARIES} ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES})
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(nelgui nelmisc nel3d ${LUA_LIBRARIES} ${LUABIND_LIBRARIES} ${CURL_LIBRARIES})
|
|
||||||
NL_DEFAULT_PROPS(nelgui "NeL, Library: NeL GUI")
|
NL_DEFAULT_PROPS(nelgui "NeL, Library: NeL GUI")
|
||||||
NL_ADD_RUNTIME_FLAGS(nelgui)
|
NL_ADD_RUNTIME_FLAGS(nelgui)
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,18 @@
|
||||||
|
|
||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
#include <openssl/err.h>
|
||||||
|
|
||||||
#if defined(NL_OS_WINDOWS)
|
#include <curl/curl.h>
|
||||||
#pragma comment(lib, "crypt32.lib")
|
|
||||||
#pragma comment(lib, "cryptui.lib")
|
// for compatibility with older versions
|
||||||
|
#ifndef CURL_AT_LEAST_VERSION
|
||||||
|
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
|
||||||
|
#define CURL_AT_LEAST_VERSION(x,y,z) \
|
||||||
|
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace NLMISC;
|
using namespace NLMISC;
|
||||||
|
|
||||||
|
@ -36,36 +42,143 @@ using namespace NLMISC;
|
||||||
|
|
||||||
namespace NLGUI
|
namespace NLGUI
|
||||||
{
|
{
|
||||||
#if defined(NL_OS_WINDOWS)
|
|
||||||
static std::vector<X509 *> x509CertList;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// x509CertList lifetime manager
|
// x509CertList lifetime manager
|
||||||
//
|
//
|
||||||
class SX509Certificates {
|
class SX509Certificates
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
SX509Certificates()
|
struct CertEntry
|
||||||
{
|
{
|
||||||
curl_version_info_data *data;
|
X509 *cert;
|
||||||
data = curl_version_info(CURLVERSION_NOW);
|
std::string name;
|
||||||
if (!(data && data->features & CURL_VERSION_SSPI))
|
std::string file;
|
||||||
|
|
||||||
|
bool operator == (const std::string &str)
|
||||||
{
|
{
|
||||||
addCertificatesFrom("CA");
|
return file == str;
|
||||||
addCertificatesFrom("AuthRoot");
|
|
||||||
addCertificatesFrom("ROOT");
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
std::vector<CertEntry> CertList;
|
||||||
|
|
||||||
|
bool isUsingOpenSSLBackend;
|
||||||
|
bool isInitialized;
|
||||||
|
|
||||||
|
SX509Certificates():isUsingOpenSSLBackend(false), isInitialized(false)
|
||||||
|
{
|
||||||
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
~SX509Certificates()
|
~SX509Certificates()
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < x509CertList.size(); ++i)
|
for (uint i = 0; i < CertList.size(); ++i)
|
||||||
{
|
{
|
||||||
X509_free(x509CertList[i]);
|
X509_free(CertList[i].cert);
|
||||||
}
|
}
|
||||||
|
|
||||||
x509CertList.clear();
|
CertList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void init()
|
||||||
|
{
|
||||||
|
// init CURL
|
||||||
|
CURL *curl = curl_easy_init();
|
||||||
|
if (!curl) return;
|
||||||
|
|
||||||
|
// get information on CURL
|
||||||
|
curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
|
||||||
|
|
||||||
|
bool useOpenSSLBackend = false;
|
||||||
|
|
||||||
|
#if CURL_AT_LEAST_VERSION(7, 34, 0)
|
||||||
|
// get more information on CURL session
|
||||||
|
curl_tlssessioninfo *sessionInfo;
|
||||||
|
|
||||||
|
CURLINFO info;
|
||||||
|
|
||||||
|
#if CURL_AT_LEAST_VERSION(7, 48, 0)
|
||||||
|
info = CURLINFO_TLS_SSL_PTR;
|
||||||
|
#else
|
||||||
|
info = CURLINFO_TLS_SESSION;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
CURLcode res = curl_easy_getinfo(curl, info, &sessionInfo);
|
||||||
|
|
||||||
|
// CURL using OpenSSL backend
|
||||||
|
if ((res == CURLE_OK) && sessionInfo && sessionInfo->backend == CURLSSLBACKEND_OPENSSL) useOpenSSLBackend = true;
|
||||||
|
#elif CURL_AT_LEAST_VERSION(7, 12, 3)
|
||||||
|
// get a list of OpenSSL engines
|
||||||
|
struct curl_slist *engines;
|
||||||
|
|
||||||
|
CURLcode res = curl_easy_getinfo(curl, CURLINFO_SSL_ENGINES, &engines);
|
||||||
|
|
||||||
|
// CURL using OpenSSL backend
|
||||||
|
// With OpenSSL compiled without any engine, engines will too return NULL
|
||||||
|
// Fortunately, if OpenSSL isn't compiled with engines means we compiled it ourself and CURL is a recent version
|
||||||
|
if ((res == CURLE_OK) && engines)
|
||||||
|
{
|
||||||
|
// free engines
|
||||||
|
curl_slist_free_all(engines);
|
||||||
|
|
||||||
|
useOpenSSLBackend = true;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
// TODO: implement an equivalent, but CURL 7.12 was released in 2004
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// only use OpenSSL callback if not using Windows SSPI and using OpenSSL backend
|
||||||
|
if (useOpenSSLBackend && !(data && data->features & CURL_VERSION_SSPI))
|
||||||
|
{
|
||||||
|
#ifdef NL_OS_WINDOWS
|
||||||
|
// load native Windows CA Certs
|
||||||
|
addCertificatesFrom("CA");
|
||||||
|
addCertificatesFrom("AuthRoot");
|
||||||
|
addCertificatesFrom("ROOT");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
isUsingOpenSSLBackend = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// if CURL is using SSPI or SChannel under Windows or DarwinSSL under OS X, we'll use native system CA Certs
|
||||||
|
isUsingOpenSSLBackend = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// clean up CURL
|
||||||
|
curl_easy_cleanup(curl);
|
||||||
|
|
||||||
|
isInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string getCertName(X509 *cert)
|
||||||
|
{
|
||||||
|
// NULL certificate
|
||||||
|
if (!cert) return "";
|
||||||
|
|
||||||
|
X509_NAME *subject = X509_get_subject_name(cert);
|
||||||
|
|
||||||
|
std::string name;
|
||||||
|
unsigned char *tmp = NULL;
|
||||||
|
|
||||||
|
// construct a multiline string with name
|
||||||
|
for (int j = 0, jlen = X509_NAME_entry_count(subject); j < jlen; ++j)
|
||||||
|
{
|
||||||
|
X509_NAME_ENTRY *e = X509_NAME_get_entry(subject, j);
|
||||||
|
ASN1_STRING *d = X509_NAME_ENTRY_get_data(e);
|
||||||
|
|
||||||
|
if (ASN1_STRING_to_UTF8(&tmp, d) > 0)
|
||||||
|
{
|
||||||
|
name += NLMISC::toString("%s\n", tmp);
|
||||||
|
|
||||||
|
OPENSSL_free(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef NL_OS_WINDOWS
|
||||||
void addCertificatesFrom(LPCSTR root)
|
void addCertificatesFrom(LPCSTR root)
|
||||||
{
|
{
|
||||||
HCERTSTORE hStore;
|
HCERTSTORE hStore;
|
||||||
|
@ -78,36 +191,154 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
x509 = NULL;
|
x509 = NULL;
|
||||||
x509 = d2i_X509(NULL, (const unsigned char **)&pContext->pbCertEncoded, pContext->cbCertEncoded);
|
x509 = d2i_X509(NULL, (const unsigned char **)&pContext->pbCertEncoded, pContext->cbCertEncoded);
|
||||||
|
|
||||||
if (x509)
|
if (x509)
|
||||||
{
|
{
|
||||||
x509CertList.push_back(x509);
|
CertEntry entry;
|
||||||
|
entry.cert = x509;
|
||||||
|
entry.file = root;
|
||||||
|
entry.name = getCertName(x509);
|
||||||
|
|
||||||
|
CertList.push_back(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CertFreeCertificateContext(pContext);
|
CertFreeCertificateContext(pContext);
|
||||||
CertCloseStore(hStore, 0);
|
CertCloseStore(hStore, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is called before debug context is set and log ends up in log.log
|
// this is called before debug context is set and log ends up in log.log
|
||||||
//nlinfo("Loaded %d certificates from '%s' certificate store", List.size(), root);
|
//nlinfo("Loaded %d certificates from '%s' certificate store", (int)CertList.size(), root);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void addCertificatesFromFile(const std::string &cert)
|
||||||
|
{
|
||||||
|
if (!isInitialized)
|
||||||
|
{
|
||||||
|
nlwarning("CURL not initialized! Check if there are another errors");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isUsingOpenSSLBackend)
|
||||||
|
{
|
||||||
|
nlinfo("CURL not using OpenSSL backend! Unable to use custom certificates");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nlinfo("CURL using OpenSSL backend!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// this file was already loaded
|
||||||
|
if (std::find(CertList.begin(), CertList.end(), cert) != CertList.end()) return;
|
||||||
|
|
||||||
|
// look for certificate in search paths
|
||||||
|
string path = CPath::lookup(cert, false);
|
||||||
|
|
||||||
|
if (path.empty())
|
||||||
|
{
|
||||||
|
nlwarning("Unable to find %s", cert.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
nlinfo("CURL CA bundle '%s'", path.c_str());
|
||||||
|
|
||||||
|
CIFile file;
|
||||||
|
|
||||||
|
// open certificate
|
||||||
|
if (!file.open(path))
|
||||||
|
{
|
||||||
|
nlwarning("Unable to open %s", path.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// load certificate content into memory
|
||||||
|
std::vector<uint8> buffer(file.getFileSize());
|
||||||
|
file.serialBuffer(&buffer[0], file.getFileSize());
|
||||||
|
|
||||||
|
// get a BIO
|
||||||
|
BIO *bio = BIO_new_mem_buf(&buffer[0], file.getFileSize());
|
||||||
|
|
||||||
|
if (bio)
|
||||||
|
{
|
||||||
|
// use it to read the PEM formatted certificate from memory into an X509
|
||||||
|
// structure that SSL can use
|
||||||
|
STACK_OF(X509_INFO) *info = PEM_X509_INFO_read_bio(bio, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
if (info)
|
||||||
|
{
|
||||||
|
// iterate over all entries from the PEM file, add them to the x509_store one by one
|
||||||
|
for (sint i = 0; i < sk_X509_INFO_num(info); ++i)
|
||||||
|
{
|
||||||
|
X509_INFO *itmp = sk_X509_INFO_value(info, i);
|
||||||
|
|
||||||
|
if (itmp && itmp->x509)
|
||||||
|
{
|
||||||
|
CertEntry entry;
|
||||||
|
entry.cert = X509_dup(itmp->x509);
|
||||||
|
entry.file = cert;
|
||||||
|
entry.name = getCertName(entry.cert);
|
||||||
|
|
||||||
|
CertList.push_back(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// cleanup
|
||||||
|
sk_X509_INFO_pop_free(info, X509_INFO_free);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nlwarning("Unable to read PEM info");
|
||||||
|
}
|
||||||
|
|
||||||
|
// decrease reference counts
|
||||||
|
BIO_free(bio);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nlwarning("Unable to allocate BIO buffer for certificates");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// this will be initialized on startup and cleared on exit
|
/// this will be initialized on startup and cleared on exit
|
||||||
static SX509Certificates x509CertListManager;
|
static SX509Certificates x509CertListManager;
|
||||||
|
|
||||||
// ***************************************************************************
|
// cURL SSL certificate loading
|
||||||
// static
|
static CURLcode sslCtxFunction(CURL *curl, void *sslctx, void *parm)
|
||||||
CURLcode CCurlCertificates::sslCtxFunction(CURL *curl, void *sslctx, void *parm)
|
|
||||||
{
|
{
|
||||||
if (x509CertList.size() > 0)
|
CURLcode res = CURLE_OK;
|
||||||
|
|
||||||
|
if (x509CertListManager.CertList.size() > 0)
|
||||||
{
|
{
|
||||||
SSL_CTX *ctx = (SSL_CTX*)sslctx;
|
SSL_CTX *ctx = (SSL_CTX*)sslctx;
|
||||||
X509_STORE *x509store = SSL_CTX_get_cert_store(ctx);
|
X509_STORE *x509store = SSL_CTX_get_cert_store(ctx);
|
||||||
if (x509store)
|
if (x509store)
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < x509CertList.size(); ++i)
|
char errorBuffer[1024];
|
||||||
|
|
||||||
|
for (uint i = 0, ilen = x509CertListManager.CertList.size(); i < ilen; ++i)
|
||||||
{
|
{
|
||||||
X509_STORE_add_cert(x509store, x509CertList[i]);
|
SX509Certificates::CertEntry entry = x509CertListManager.CertList[i];
|
||||||
|
|
||||||
|
// add our certificate to this store
|
||||||
|
if (X509_STORE_add_cert(x509store, entry.cert) == 0)
|
||||||
|
{
|
||||||
|
uint errCode = ERR_get_error();
|
||||||
|
|
||||||
|
// ignore already in hash table errors
|
||||||
|
if (ERR_GET_LIB(errCode) != ERR_LIB_X509 || ERR_GET_REASON(errCode) != X509_R_CERT_ALREADY_IN_HASH_TABLE)
|
||||||
|
{
|
||||||
|
ERR_error_string_n(errCode, errorBuffer, 1024);
|
||||||
|
nlwarning("Error adding certificate %s: %s", entry.name.c_str(), errorBuffer);
|
||||||
|
res = CURLE_SSL_CACERT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nldebug("Added certificate %s", entry.name.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -115,9 +346,40 @@ namespace NLGUI
|
||||||
nlwarning("SSL_CTX_get_cert_store returned NULL");
|
nlwarning("SSL_CTX_get_cert_store returned NULL");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CURLE_OK;
|
else
|
||||||
|
{
|
||||||
|
res = CURLE_SSL_CACERT;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ***************************************************************************
|
||||||
|
// static
|
||||||
|
void CCurlCertificates::addCertificateFile(const std::string &cert)
|
||||||
|
{
|
||||||
|
x509CertListManager.addCertificatesFromFile(cert);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ***************************************************************************
|
||||||
|
// static
|
||||||
|
void CCurlCertificates::useCertificates(CURL *curl)
|
||||||
|
{
|
||||||
|
// CURL must be valid, using OpenSSL backend and certificates must be loaded, else return
|
||||||
|
if (!curl || !x509CertListManager.isInitialized || !x509CertListManager.isUsingOpenSSLBackend || x509CertListManager.CertList.empty()) return;
|
||||||
|
|
||||||
|
curl_easy_setopt(curl, CURLOPT_SSLCERTTYPE, "PEM");
|
||||||
|
|
||||||
|
// would allow to provide the CA in memory instead of using CURLOPT_CAINFO, but needs to include and link OpenSSL
|
||||||
|
if (curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, &sslCtxFunction) != CURLE_OK)
|
||||||
|
{
|
||||||
|
nlwarning("Unable to support CURLOPT_SSL_CTX_FUNCTION, curl not compiled with OpenSSL ?");
|
||||||
|
}
|
||||||
|
|
||||||
|
// set both CURLOPT_CAINFO and CURLOPT_CAPATH to NULL to be sure we won't use default values (these files can be missing and generate errors)
|
||||||
|
curl_easy_setopt(curl, CURLOPT_CAINFO, NULL);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_CAPATH, NULL);
|
||||||
}
|
}
|
||||||
#endif // NL_OS_WINDOWS
|
|
||||||
|
|
||||||
}// namespace
|
}// namespace
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1410,7 +1410,7 @@ namespace NLGUI
|
||||||
// Get the child width
|
// Get the child width
|
||||||
maxWidth += _Elements[k].Element->getMaxUsedW();
|
maxWidth += _Elements[k].Element->getMaxUsedW();
|
||||||
}
|
}
|
||||||
return maxWidth;
|
return maxWidth + _MarginLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@ -1425,7 +1425,7 @@ namespace NLGUI
|
||||||
if (width > minWidth)
|
if (width > minWidth)
|
||||||
minWidth = width;
|
minWidth = width;
|
||||||
}
|
}
|
||||||
return minWidth;
|
return minWidth + _MarginLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -703,7 +703,7 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
if (ContinuousUpdate)
|
if (ContinuousUpdate)
|
||||||
{
|
{
|
||||||
sint parentWidth = std::min(_Parent->getMaxWReal(), _Parent->getWReal());
|
sint parentWidth = _Parent->getInnerWidth();
|
||||||
if (_LastParentW != (sint) parentWidth)
|
if (_LastParentW != (sint) parentWidth)
|
||||||
{
|
{
|
||||||
_LastParentW = parentWidth;
|
_LastParentW = parentWidth;
|
||||||
|
@ -813,10 +813,6 @@ namespace NLGUI
|
||||||
for(sint span = 0; span < cell->ColSpan -1; ++span)
|
for(sint span = 0; span < cell->ColSpan -1; ++span)
|
||||||
{
|
{
|
||||||
++column;
|
++column;
|
||||||
_Columns[column].Width = std::max(_Columns[column].Width, _Columns[column-1].Width);
|
|
||||||
_Columns[column].WidthMax = std::max(_Columns[column].WidthMax, _Columns[column-1].WidthMax);
|
|
||||||
_Columns[column].TableRatio = std::max(_Columns[column].TableRatio, _Columns[column-1].TableRatio);
|
|
||||||
_Columns[column].WidthWanted = std::max(_Columns[column].WidthWanted, _Columns[column-1].WidthWanted);
|
|
||||||
_Columns[column].RowSpan = _Columns[column-1].RowSpan;
|
_Columns[column].RowSpan = _Columns[column-1].RowSpan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1163,7 +1159,7 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
if (_Parent != NULL)
|
if (_Parent != NULL)
|
||||||
{
|
{
|
||||||
sint parentWidth = std::min(_Parent->getMaxWReal(), _Parent->getWReal());
|
sint parentWidth = _Parent->getInnerWidth();
|
||||||
if (_LastParentW != (sint) parentWidth)
|
if (_LastParentW != (sint) parentWidth)
|
||||||
{
|
{
|
||||||
if (ContinuousUpdate)
|
if (ContinuousUpdate)
|
||||||
|
@ -1311,6 +1307,9 @@ namespace NLGUI
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
void CGroupTable::draw ()
|
void CGroupTable::draw ()
|
||||||
{
|
{
|
||||||
|
// move X for clip and borders
|
||||||
|
_XReal += _MarginLeft;
|
||||||
|
|
||||||
// search a parent container
|
// search a parent container
|
||||||
CInterfaceGroup *gr = getParent();
|
CInterfaceGroup *gr = getParent();
|
||||||
while (gr)
|
while (gr)
|
||||||
|
@ -1391,6 +1390,9 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
CInterfaceGroup::draw ();
|
CInterfaceGroup::draw ();
|
||||||
|
|
||||||
|
// restore
|
||||||
|
_XReal -= _MarginLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CGroupTable::getProperties( const std::string &name ) const
|
std::string CGroupTable::getProperties( const std::string &name ) const
|
||||||
|
|
|
@ -87,9 +87,12 @@ namespace NLGUI {
|
||||||
if (domain.empty() || _Domains.empty())
|
if (domain.empty() || _Domains.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (_Domains.count(domain) > 0)
|
THSTSObjectMap::const_iterator itHsts;
|
||||||
|
|
||||||
|
itHsts = _Domains.find(domain);
|
||||||
|
if (itHsts != _Domains.end())
|
||||||
{
|
{
|
||||||
hsts = _Domains.at(domain);
|
hsts = itHsts->second;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,11 +102,12 @@ namespace NLGUI {
|
||||||
{
|
{
|
||||||
std::string tmp;
|
std::string tmp;
|
||||||
tmp = domain.substr(firstOf+1);
|
tmp = domain.substr(firstOf+1);
|
||||||
if (_Domains.count(tmp))
|
itHsts = _Domains.find(tmp);
|
||||||
|
if (itHsts != _Domains.end())
|
||||||
{
|
{
|
||||||
if (_Domains.at(tmp).IncludeSubDomains)
|
if (itHsts->second.IncludeSubDomains)
|
||||||
{
|
{
|
||||||
hsts = _Domains.at(tmp);
|
hsts = itHsts->second;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +186,7 @@ namespace NLGUI {
|
||||||
{
|
{
|
||||||
uint32 nbItems = _Domains.size();
|
uint32 nbItems = _Domains.size();
|
||||||
f.serial(nbItems);
|
f.serial(nbItems);
|
||||||
for (THSTSObject::iterator it = _Domains.begin(); it != _Domains.end(); ++it)
|
for (THSTSObjectMap::iterator it = _Domains.begin(); it != _Domains.end(); ++it)
|
||||||
{
|
{
|
||||||
std::string domain(it->first);
|
std::string domain(it->first);
|
||||||
f.serial(domain);
|
f.serial(domain);
|
||||||
|
|
|
@ -506,10 +506,16 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
sint32 CInterfaceElement::getInnerWidth() const
|
||||||
|
{
|
||||||
|
return _WReal - _MarginLeft;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void CInterfaceElement::updateCoords()
|
void CInterfaceElement::updateCoords()
|
||||||
{
|
{
|
||||||
_XReal = _X + _MarginLeft;
|
_XReal = _X;
|
||||||
_YReal = _Y;
|
_YReal = _Y;
|
||||||
_WReal = getW();
|
_WReal = getW();
|
||||||
_HReal = getH();
|
_HReal = getH();
|
||||||
|
@ -526,7 +532,7 @@ namespace NLGUI
|
||||||
if (el == NULL)
|
if (el == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_XReal += el->_XReal - el->_MarginLeft;
|
_XReal += el->_XReal;
|
||||||
_YReal += el->_YReal;
|
_YReal += el->_YReal;
|
||||||
|
|
||||||
THotSpot hsParent = _ParentPosRef;
|
THotSpot hsParent = _ParentPosRef;
|
||||||
|
|
|
@ -1397,6 +1397,13 @@ namespace NLGUI
|
||||||
restoreClip (oldSciX, oldSciY, oldSciW, oldSciH);
|
restoreClip (oldSciX, oldSciY, oldSciW, oldSciH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
sint32 CInterfaceGroup::getInnerWidth() const
|
||||||
|
{
|
||||||
|
sint width = CInterfaceElement::getInnerWidth();
|
||||||
|
return std::min(width, _MaxWReal - _MarginLeft);
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void CInterfaceGroup::checkCoords()
|
void CInterfaceGroup::checkCoords()
|
||||||
{
|
{
|
||||||
|
@ -1468,7 +1475,7 @@ namespace NLGUI
|
||||||
pIE->updateCoords();
|
pIE->updateCoords();
|
||||||
}
|
}
|
||||||
|
|
||||||
_XReal -= _OffsetX - _MarginLeft;
|
_XReal -= (_OffsetX + _MarginLeft);
|
||||||
_YReal -= _OffsetY;
|
_YReal -= _OffsetY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1958,9 +1965,11 @@ namespace NLGUI
|
||||||
newSciH = newSciH - ((newSciY+newSciH)-(oldSciY+oldSciH));
|
newSciH = newSciH - ((newSciY+newSciH)-(oldSciY+oldSciH));
|
||||||
}
|
}
|
||||||
|
|
||||||
newSciXDest = newSciX - _MarginLeft;
|
// Don't apply margins because HTML list marker is drawn outside group paragraph inner content.
|
||||||
|
// Should not be an issue because horizontal scolling not used.
|
||||||
|
newSciXDest = newSciX/* + _MarginLeft*/;
|
||||||
newSciYDest = newSciY;
|
newSciYDest = newSciY;
|
||||||
newSciWDest = newSciW + _MarginLeft;
|
newSciWDest = newSciW/* - _MarginLeft*/;
|
||||||
newSciHDest = newSciH;
|
newSciHDest = newSciH;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
#include "nel/gui/libwww.h"
|
#include "nel/gui/libwww.h"
|
||||||
#include "nel/gui/group_html.h"
|
#include "nel/gui/group_html.h"
|
||||||
|
|
||||||
|
#include <curl/curl.h>
|
||||||
|
|
||||||
using namespace NLMISC;
|
using namespace NLMISC;
|
||||||
|
|
||||||
#ifdef DEBUG_NEW
|
#ifdef DEBUG_NEW
|
||||||
|
@ -101,6 +103,7 @@ namespace NLGUI
|
||||||
HTML_ATTR(TR,L_MARGIN),
|
HTML_ATTR(TR,L_MARGIN),
|
||||||
HTML_ATTR(TR,NOWRAP),
|
HTML_ATTR(TR,NOWRAP),
|
||||||
HTML_ATTR(TR,VALIGN),
|
HTML_ATTR(TR,VALIGN),
|
||||||
|
HTML_ATTR(TR,STYLE),
|
||||||
{ 0 }
|
{ 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1434,7 +1434,7 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CLuaIHM::luaValueToReflectedProperty(CLuaState &ls, int stackIndex, CReflectable &target, const CReflectedProperty &property) throw(ELuaIHMException)
|
void CLuaIHM::luaValueToReflectedProperty(CLuaState &ls, int stackIndex, CReflectable &target, const CReflectedProperty &property)
|
||||||
{
|
{
|
||||||
//H_AUTO(Lua_property_throw)
|
//H_AUTO(Lua_property_throw)
|
||||||
if(ls.isNil(stackIndex))
|
if(ls.isNil(stackIndex))
|
||||||
|
|
|
@ -222,7 +222,7 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
CLuaEnumeration CLuaObject::enumerate() throw(ELuaNotATable)
|
CLuaEnumeration CLuaObject::enumerate()
|
||||||
{
|
{
|
||||||
if (!isEnumerable())
|
if (!isEnumerable())
|
||||||
{
|
{
|
||||||
|
@ -271,7 +271,7 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
CLuaObject CLuaObject::at(const char *key) const throw(ELuaNotATable)
|
CLuaObject CLuaObject::at(const char *key) const
|
||||||
{
|
{
|
||||||
if (!isEnumerable()) throw ELuaNotATable(NLMISC::toString("Can't get key '%s' in object '%s' because type is '%s', it is not a table.", key, getId().c_str(), getTypename()).c_str());
|
if (!isEnumerable()) throw ELuaNotATable(NLMISC::toString("Can't get key '%s' in object '%s' because type is '%s', it is not a table.", key, getId().c_str(), getTypename()).c_str());
|
||||||
return operator[](key);
|
return operator[](key);
|
||||||
|
@ -286,7 +286,7 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
CLuaObject CLuaObject::newTable(const char *tableName) throw(ELuaNotATable)
|
CLuaObject CLuaObject::newTable(const char *tableName)
|
||||||
{
|
{
|
||||||
nlassert(tableName);
|
nlassert(tableName);
|
||||||
nlassert(isValid());
|
nlassert(isValid());
|
||||||
|
@ -301,7 +301,7 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
void CLuaObject::setValue(const char *key, const CLuaObject &value) throw(ELuaNotATable)
|
void CLuaObject::setValue(const char *key, const CLuaObject &value)
|
||||||
{
|
{
|
||||||
nlassert(key);
|
nlassert(key);
|
||||||
nlassert(isValid());
|
nlassert(isValid());
|
||||||
|
@ -317,7 +317,7 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
void CLuaObject::setNil(const char *key) throw(ELuaNotATable)
|
void CLuaObject::setNil(const char *key)
|
||||||
{
|
{
|
||||||
nlassert(key);
|
nlassert(key);
|
||||||
nlassert(isValid());
|
nlassert(isValid());
|
||||||
|
@ -331,7 +331,7 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
void CLuaObject::setValue(const char *key, const char *value) throw(ELuaNotATable)
|
void CLuaObject::setValue(const char *key, const char *value)
|
||||||
{
|
{
|
||||||
nlassert(value);
|
nlassert(value);
|
||||||
nlassert(key);
|
nlassert(key);
|
||||||
|
@ -346,13 +346,13 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
void CLuaObject::setValue(const char *key, const std::string &value) throw(ELuaNotATable)
|
void CLuaObject::setValue(const char *key, const std::string &value)
|
||||||
{
|
{
|
||||||
setValue(key, value.c_str());
|
setValue(key, value.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
void CLuaObject::setValue(const char *key, bool value) throw(ELuaNotATable)
|
void CLuaObject::setValue(const char *key, bool value)
|
||||||
{
|
{
|
||||||
nlassert(key);
|
nlassert(key);
|
||||||
nlassert(isValid());
|
nlassert(isValid());
|
||||||
|
@ -366,7 +366,7 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
void CLuaObject::setValue(const char *key, TLuaWrappedFunction value) throw(ELuaNotATable)
|
void CLuaObject::setValue(const char *key, TLuaWrappedFunction value)
|
||||||
{
|
{
|
||||||
nlassert(key);
|
nlassert(key);
|
||||||
nlassert(isValid());
|
nlassert(isValid());
|
||||||
|
@ -380,7 +380,7 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
void CLuaObject::setValue(const char *key, double value) throw(ELuaNotATable)
|
void CLuaObject::setValue(const char *key, double value)
|
||||||
{
|
{
|
||||||
nlassert(key);
|
nlassert(key);
|
||||||
nlassert(isValid());
|
nlassert(isValid());
|
||||||
|
@ -394,7 +394,7 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
void CLuaObject::setValue(const char *key, uint32 value) throw(ELuaNotATable)
|
void CLuaObject::setValue(const char *key, uint32 value)
|
||||||
{
|
{
|
||||||
nlassert(key);
|
nlassert(key);
|
||||||
nlassert(isValid());
|
nlassert(isValid());
|
||||||
|
@ -408,7 +408,7 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
void CLuaObject::setValue(const char *key, sint32 value) throw(ELuaNotATable)
|
void CLuaObject::setValue(const char *key, sint32 value)
|
||||||
{
|
{
|
||||||
nlassert(key);
|
nlassert(key);
|
||||||
nlassert(isValid());
|
nlassert(isValid());
|
||||||
|
@ -422,7 +422,7 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
void CLuaObject::setValue(const char *key, sint64 value) throw(ELuaNotATable)
|
void CLuaObject::setValue(const char *key, sint64 value)
|
||||||
{
|
{
|
||||||
nlassert(key);
|
nlassert(key);
|
||||||
nlassert(isValid());
|
nlassert(isValid());
|
||||||
|
@ -436,7 +436,7 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
// *************************************************
|
||||||
void CLuaObject::eraseValue(const char *key) throw(ELuaNotATable)
|
void CLuaObject::eraseValue(const char *key)
|
||||||
{
|
{
|
||||||
nlassert(isValid());
|
nlassert(isValid());
|
||||||
nlassert(key);
|
nlassert(key);
|
||||||
|
|
|
@ -72,6 +72,8 @@ namespace NLGUI
|
||||||
_Shadow = false;
|
_Shadow = false;
|
||||||
_ShadowOutline = false;
|
_ShadowOutline = false;
|
||||||
_ShadowColor = CRGBA(0,0,0,255);
|
_ShadowColor = CRGBA(0,0,0,255);
|
||||||
|
_ShadowX = 1;
|
||||||
|
_ShadowY = 1;
|
||||||
|
|
||||||
_MultiLine = false;
|
_MultiLine = false;
|
||||||
_TextMode = DontClipWord;
|
_TextMode = DontClipWord;
|
||||||
|
@ -444,6 +446,22 @@ namespace NLGUI
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if( name == "shadow_x" )
|
||||||
|
{
|
||||||
|
sint sx;
|
||||||
|
if( fromString( value, sx ) )
|
||||||
|
_ShadowX = sx;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if( name == "shadow_y" )
|
||||||
|
{
|
||||||
|
sint sy;
|
||||||
|
if( fromString( value, sy ) )
|
||||||
|
_ShadowY = sy;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
if( name == "multi_line" )
|
if( name == "multi_line" )
|
||||||
{
|
{
|
||||||
bool b;
|
bool b;
|
||||||
|
@ -624,6 +642,8 @@ namespace NLGUI
|
||||||
xmlSetProp( node, BAD_CAST "shadow", BAD_CAST toString( _Shadow ).c_str() );
|
xmlSetProp( node, BAD_CAST "shadow", BAD_CAST toString( _Shadow ).c_str() );
|
||||||
xmlSetProp( node, BAD_CAST "shadow_outline", BAD_CAST toString( _ShadowOutline ).c_str() );
|
xmlSetProp( node, BAD_CAST "shadow_outline", BAD_CAST toString( _ShadowOutline ).c_str() );
|
||||||
xmlSetProp( node, BAD_CAST "shadow_color", BAD_CAST toString( _ShadowColor ).c_str() );
|
xmlSetProp( node, BAD_CAST "shadow_color", BAD_CAST toString( _ShadowColor ).c_str() );
|
||||||
|
xmlSetProp( node, BAD_CAST "shadow_x", BAD_CAST toString( _ShadowX ).c_str() );
|
||||||
|
xmlSetProp( node, BAD_CAST "shadow_y", BAD_CAST toString( _ShadowY ).c_str() );
|
||||||
xmlSetProp( node, BAD_CAST "multi_line", BAD_CAST toString( _MultiLine ).c_str() );
|
xmlSetProp( node, BAD_CAST "multi_line", BAD_CAST toString( _MultiLine ).c_str() );
|
||||||
|
|
||||||
std::string just;
|
std::string just;
|
||||||
|
@ -735,6 +755,16 @@ namespace NLGUI
|
||||||
if (prop)
|
if (prop)
|
||||||
_ShadowColor = convertColor(prop);
|
_ShadowColor = convertColor(prop);
|
||||||
|
|
||||||
|
prop= (char*) xmlGetProp( cur, (xmlChar*)"shadow_x" );
|
||||||
|
_ShadowX = 1;
|
||||||
|
if (prop)
|
||||||
|
fromString( (const char *)prop, _ShadowX);
|
||||||
|
|
||||||
|
prop= (char*) xmlGetProp( cur, (xmlChar*)"shadow_y" );
|
||||||
|
_ShadowY = 1;
|
||||||
|
if (prop)
|
||||||
|
fromString( (const char *)prop, _ShadowY);
|
||||||
|
|
||||||
prop = (char*) xmlGetProp( cur, (xmlChar*)"multi_line" );
|
prop = (char*) xmlGetProp( cur, (xmlChar*)"multi_line" );
|
||||||
_MultiLine = false;
|
_MultiLine = false;
|
||||||
if (prop)
|
if (prop)
|
||||||
|
@ -895,8 +925,7 @@ namespace NLGUI
|
||||||
return maxw;
|
return maxw;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sint parentWidth = std::min(_Parent->getMaxWReal(), _Parent->getWReal() - _Parent->getMarginLeft());
|
return std::min(_Parent->getInnerWidth(), (sint)_LineMaxW);
|
||||||
return std::min(parentWidth-(sint)(_XReal-(_Parent->getXReal()-_Parent->getMarginLeft())), (sint)_LineMaxW);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -989,6 +1018,19 @@ namespace NLGUI
|
||||||
((_YReal) > (ClipY+ClipH)) || ((_YReal+_HReal) < ClipY))
|
((_YReal) > (ClipY+ClipH)) || ((_YReal+_HReal) < ClipY))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// hack: allow shadow to overflow outside parent box.
|
||||||
|
// In CGroupHTML context, clip is set for row
|
||||||
|
if (std::abs(_ShadowX) > 0)
|
||||||
|
{
|
||||||
|
ClipX -= 3;
|
||||||
|
ClipW += 3;
|
||||||
|
}
|
||||||
|
if (std::abs(_ShadowY) > 0)
|
||||||
|
{
|
||||||
|
ClipY -= 3;
|
||||||
|
ClipH += 3;
|
||||||
|
}
|
||||||
|
|
||||||
// *** Screen Minimized?
|
// *** Screen Minimized?
|
||||||
if (rVR.isMinimized())
|
if (rVR.isMinimized())
|
||||||
return;
|
return;
|
||||||
|
@ -1012,6 +1054,8 @@ namespace NLGUI
|
||||||
shcol.A = (uint8)(((sint)shcol.A*((sint)CWidgetManager::getInstance()->getGlobalColorForContent().A+1))>>8);
|
shcol.A = (uint8)(((sint)shcol.A*((sint)CWidgetManager::getInstance()->getGlobalColorForContent().A+1))>>8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float oow, ooh;
|
||||||
|
rVR.getScreenOOSize (oow, ooh);
|
||||||
|
|
||||||
// *** Draw multiline
|
// *** Draw multiline
|
||||||
if ((_MultiLine)&&(_Parent != NULL))
|
if ((_MultiLine)&&(_Parent != NULL))
|
||||||
|
@ -1022,6 +1066,7 @@ namespace NLGUI
|
||||||
TextContext->setShaded (_Shadow);
|
TextContext->setShaded (_Shadow);
|
||||||
TextContext->setShadeOutline (_ShadowOutline);
|
TextContext->setShadeOutline (_ShadowOutline);
|
||||||
TextContext->setShadeColor (shcol);
|
TextContext->setShadeColor (shcol);
|
||||||
|
TextContext->setShadeExtent (_ShadowX*oow, _ShadowY*ooh);
|
||||||
TextContext->setFontSize (_FontSize*_Scale);
|
TextContext->setFontSize (_FontSize*_Scale);
|
||||||
TextContext->setEmbolden (_Embolden);
|
TextContext->setEmbolden (_Embolden);
|
||||||
TextContext->setOblique (_Oblique);
|
TextContext->setOblique (_Oblique);
|
||||||
|
@ -1142,6 +1187,7 @@ namespace NLGUI
|
||||||
TextContext->setShaded (_Shadow);
|
TextContext->setShaded (_Shadow);
|
||||||
TextContext->setShadeOutline (_ShadowOutline);
|
TextContext->setShadeOutline (_ShadowOutline);
|
||||||
TextContext->setShadeColor (shcol);
|
TextContext->setShadeColor (shcol);
|
||||||
|
TextContext->setShadeExtent (_ShadowX*oow, _ShadowY*ooh);
|
||||||
TextContext->setFontSize (_FontSize*_Scale);
|
TextContext->setFontSize (_FontSize*_Scale);
|
||||||
TextContext->setEmbolden (_Embolden);
|
TextContext->setEmbolden (_Embolden);
|
||||||
TextContext->setOblique (_Oblique);
|
TextContext->setOblique (_Oblique);
|
||||||
|
@ -1355,6 +1401,13 @@ namespace NLGUI
|
||||||
_ShadowColor = color;
|
_ShadowColor = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ***************************************************************************
|
||||||
|
void CViewText::setShadowOffset(sint32 x, sint32 y)
|
||||||
|
{
|
||||||
|
_ShadowX = x;
|
||||||
|
_ShadowY = y;
|
||||||
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CViewText::setLineMaxW (sint nMaxW, bool invalidate)
|
void CViewText::setLineMaxW (sint nMaxW, bool invalidate)
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,7 +49,7 @@ void CClassRegistry::release()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================================================================================================
|
// ======================================================================================================
|
||||||
IClassable *CClassRegistry::create(const string &className) throw(ERegistry)
|
IClassable *CClassRegistry::create(const string &className)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ IClassable *CClassRegistry::create(const string &className) throw(ERegistry)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================================================================================================
|
// ======================================================================================================
|
||||||
void CClassRegistry::registerClass(const string &className, IClassable* (*creator)(), const string &typeidCheck) throw(ERegistry)
|
void CClassRegistry::registerClass(const string &className, IClassable* (*creator)(), const string &typeidCheck)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource ); }
|
||||||
#endif // !NL_COMP_MINGW
|
#endif // !NL_COMP_MINGW
|
||||||
|
|
||||||
|
|
||||||
#if defined(NL_HAS_SSE2) && !defined(NL_CPU_X86_64)
|
#ifdef NL_USE_ALIGNED_MEMORY_OPERATORS
|
||||||
|
|
||||||
#ifdef NL_NO_EXCEPTION_SPECS
|
#ifdef NL_NO_EXCEPTION_SPECS
|
||||||
void *operator new(size_t size)
|
void *operator new(size_t size)
|
||||||
|
|
|
@ -401,7 +401,7 @@ bool CIFile::eof ()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================================================================================================
|
// ======================================================================================================
|
||||||
void CIFile::serialBuffer(uint8 *buf, uint len) throw(EReadError)
|
void CIFile::serialBuffer(uint8 *buf, uint len)
|
||||||
{
|
{
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -444,7 +444,7 @@ void CIFile::serialBuffer(uint8 *buf, uint len) throw(EReadError)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================================================================================================
|
// ======================================================================================================
|
||||||
void CIFile::serialBit(bool &bit) throw(EReadError)
|
void CIFile::serialBit(bool &bit)
|
||||||
{
|
{
|
||||||
// Simple for now.
|
// Simple for now.
|
||||||
uint8 v=bit;
|
uint8 v=bit;
|
||||||
|
@ -453,7 +453,7 @@ void CIFile::serialBit(bool &bit) throw(EReadError)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================================================================================================
|
// ======================================================================================================
|
||||||
bool CIFile::seek (sint32 offset, IStream::TSeekOrigin origin) const throw(EStream)
|
bool CIFile::seek (sint32 offset, IStream::TSeekOrigin origin) const
|
||||||
{
|
{
|
||||||
if ((_CacheFileOnOpen) && (_Cache == NULL))
|
if ((_CacheFileOnOpen) && (_Cache == NULL))
|
||||||
return false;
|
return false;
|
||||||
|
@ -485,7 +485,7 @@ bool CIFile::seek (sint32 offset, IStream::TSeekOrigin origin) const throw(EStr
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================================================================================================
|
// ======================================================================================================
|
||||||
sint32 CIFile::getPos () const throw(EStream)
|
sint32 CIFile::getPos () const
|
||||||
{
|
{
|
||||||
return _ReadPos;
|
return _ReadPos;
|
||||||
}
|
}
|
||||||
|
@ -652,7 +652,7 @@ void COFile::flush()
|
||||||
|
|
||||||
|
|
||||||
// ======================================================================================================
|
// ======================================================================================================
|
||||||
void COFile::serialBuffer(uint8 *buf, uint len) throw(EWriteError)
|
void COFile::serialBuffer(uint8 *buf, uint len)
|
||||||
{
|
{
|
||||||
if(!_F)
|
if(!_F)
|
||||||
throw EFileNotOpened(_FileName);
|
throw EFileNotOpened(_FileName);
|
||||||
|
@ -667,14 +667,14 @@ void COFile::serialBuffer(uint8 *buf, uint len) throw(EWriteError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ======================================================================================================
|
// ======================================================================================================
|
||||||
void COFile::serialBit(bool &bit) throw(EWriteError)
|
void COFile::serialBit(bool &bit)
|
||||||
{
|
{
|
||||||
// Simple for now.
|
// Simple for now.
|
||||||
uint8 v=bit;
|
uint8 v=bit;
|
||||||
serialBuffer(&v, 1);
|
serialBuffer(&v, 1);
|
||||||
}
|
}
|
||||||
// ======================================================================================================
|
// ======================================================================================================
|
||||||
bool COFile::seek (sint32 offset, IStream::TSeekOrigin origin) const throw(EStream)
|
bool COFile::seek (sint32 offset, IStream::TSeekOrigin origin) const
|
||||||
{
|
{
|
||||||
if (_F)
|
if (_F)
|
||||||
{
|
{
|
||||||
|
@ -701,7 +701,7 @@ bool COFile::seek (sint32 offset, IStream::TSeekOrigin origin) const throw(EStr
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// ======================================================================================================
|
// ======================================================================================================
|
||||||
sint32 COFile::getPos () const throw(EStream)
|
sint32 COFile::getPos () const
|
||||||
{
|
{
|
||||||
if (_F)
|
if (_F)
|
||||||
{
|
{
|
||||||
|
|
|
@ -107,7 +107,7 @@ void CMemStream::serialBit(bool &bit)
|
||||||
* (to prevent from an "inside serial" to increment it).
|
* (to prevent from an "inside serial" to increment it).
|
||||||
* Then a seek(end) would get back to the pointer.
|
* Then a seek(end) would get back to the pointer.
|
||||||
*/
|
*/
|
||||||
bool CMemStream::seek (sint32 offset, TSeekOrigin origin) const throw(EStream)
|
bool CMemStream::seek (sint32 offset, TSeekOrigin origin) const
|
||||||
{
|
{
|
||||||
switch (origin)
|
switch (origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -211,7 +211,7 @@ void CStaticStringMapper::clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
void CStaticStringMapper::serial(IStream &f, TSStringId &strId) throw(EStream)
|
void CStaticStringMapper::serial(IStream &f, TSStringId &strId)
|
||||||
{
|
{
|
||||||
std::string tmp;
|
std::string tmp;
|
||||||
if (f.isReading())
|
if (f.isReading())
|
||||||
|
@ -227,7 +227,7 @@ void CStaticStringMapper::serial(IStream &f, TSStringId &strId) throw(EStream)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
void CStaticStringMapper::serial(IStream &f, std::vector<TSStringId> &strIdVect) throw(EStream)
|
void CStaticStringMapper::serial(IStream &f, std::vector<TSStringId> &strIdVect)
|
||||||
{
|
{
|
||||||
std::vector<std::string> vsTmp;
|
std::vector<std::string> vsTmp;
|
||||||
std::string sTmp;
|
std::string sTmp;
|
||||||
|
|
|
@ -1470,9 +1470,9 @@ uint64 CSystemInfo::availableHDSpace (const string &filename)
|
||||||
uint64 CSystemInfo::availablePhysicalMemory ()
|
uint64 CSystemInfo::availablePhysicalMemory ()
|
||||||
{
|
{
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
MEMORYSTATUS ms;
|
MEMORYSTATUSEX ms;
|
||||||
GlobalMemoryStatus (&ms);
|
GlobalMemoryStatusEx(&ms);
|
||||||
return uint64(ms.dwAvailPhys);
|
return ms.ullAvailPhys;
|
||||||
#elif defined NL_OS_MAC
|
#elif defined NL_OS_MAC
|
||||||
return uint64(getsysctlnum64("hw.usermem"));
|
return uint64(getsysctlnum64("hw.usermem"));
|
||||||
#elif defined NL_OS_UNIX
|
#elif defined NL_OS_UNIX
|
||||||
|
@ -1485,9 +1485,9 @@ uint64 CSystemInfo::availablePhysicalMemory ()
|
||||||
uint64 CSystemInfo::totalPhysicalMemory ()
|
uint64 CSystemInfo::totalPhysicalMemory ()
|
||||||
{
|
{
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
MEMORYSTATUS ms;
|
MEMORYSTATUSEX ms;
|
||||||
GlobalMemoryStatus (&ms);
|
GlobalMemoryStatusEx(&ms);
|
||||||
return uint64(ms.dwTotalPhys);
|
return ms.ullTotalPhys;
|
||||||
#elif defined NL_OS_MAC
|
#elif defined NL_OS_MAC
|
||||||
return uint64(getsysctlnum64("hw.physmem"));
|
return uint64(getsysctlnum64("hw.physmem"));
|
||||||
#elif defined NL_OS_UNIX
|
#elif defined NL_OS_UNIX
|
||||||
|
@ -1867,9 +1867,9 @@ bool CSystemInfo::getVideoInfo (std::string &deviceName, uint64 &driverVersion)
|
||||||
uint64 CSystemInfo::virtualMemory ()
|
uint64 CSystemInfo::virtualMemory ()
|
||||||
{
|
{
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
MEMORYSTATUS ms;
|
MEMORYSTATUSEX ms;
|
||||||
GlobalMemoryStatus (&ms);
|
GlobalMemoryStatusEx(&ms);
|
||||||
return uint64(ms.dwTotalVirtual - ms.dwAvailVirtual);
|
return ms.ullTotalVirtual - ms.ullAvailVirtual;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -397,7 +397,7 @@ namespace NLNET
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CModuleBase::plugModule(IModuleSocket *moduleSocket) throw (EModuleAlreadyPluggedHere)
|
void CModuleBase::plugModule(IModuleSocket *moduleSocket)
|
||||||
{
|
{
|
||||||
CModuleSocket *sock = dynamic_cast<CModuleSocket*>(moduleSocket);
|
CModuleSocket *sock = dynamic_cast<CModuleSocket*>(moduleSocket);
|
||||||
nlassert(sock != NULL);
|
nlassert(sock != NULL);
|
||||||
|
@ -415,7 +415,7 @@ namespace NLNET
|
||||||
_ModuleSockets.insert(moduleSocket);
|
_ModuleSockets.insert(moduleSocket);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CModuleBase::unplugModule(IModuleSocket *moduleSocket) throw (EModuleNotPluggedHere)
|
void CModuleBase::unplugModule(IModuleSocket *moduleSocket)
|
||||||
{
|
{
|
||||||
CModuleSocket *sock = dynamic_cast<CModuleSocket*>(moduleSocket);
|
CModuleSocket *sock = dynamic_cast<CModuleSocket*>(moduleSocket);
|
||||||
nlassert(sock != NULL);
|
nlassert(sock != NULL);
|
||||||
|
@ -443,7 +443,7 @@ namespace NLNET
|
||||||
* The call is blocking until receptions of the operation
|
* The call is blocking until receptions of the operation
|
||||||
* result message (or a module down)
|
* result message (or a module down)
|
||||||
*/
|
*/
|
||||||
void CModuleBase::invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg) throw (EInvokeFailed)
|
void CModuleBase::invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg)
|
||||||
{
|
{
|
||||||
H_AUTO(CModuleBase_invokeModuleOperation);
|
H_AUTO(CModuleBase_invokeModuleOperation);
|
||||||
|
|
||||||
|
@ -867,7 +867,6 @@ namespace NLNET
|
||||||
}
|
}
|
||||||
|
|
||||||
void CModuleProxy::sendModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
|
void CModuleProxy::sendModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
|
||||||
throw (EModuleNotReachable)
|
|
||||||
{
|
{
|
||||||
H_AUTO(CModuleProxy_sendModuleMessage);
|
H_AUTO(CModuleProxy_sendModuleMessage);
|
||||||
|
|
||||||
|
|
|
@ -448,7 +448,6 @@ namespace NLNET
|
||||||
|
|
||||||
/// Activate/stop firewalling mode on a transport
|
/// Activate/stop firewalling mode on a transport
|
||||||
virtual void setTransportFirewallMode(const std::string &transportInstanceName, bool firewalled)
|
virtual void setTransportFirewallMode(const std::string &transportInstanceName, bool firewalled)
|
||||||
throw (EGatewayFirewallBreak)
|
|
||||||
{
|
{
|
||||||
TTransportList::iterator it(_Transports.find(transportInstanceName));
|
TTransportList::iterator it(_Transports.find(transportInstanceName));
|
||||||
if (it == _Transports.end())
|
if (it == _Transports.end())
|
||||||
|
@ -1246,7 +1245,6 @@ namespace NLNET
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void discloseModule(IModuleProxy *moduleProxy)
|
virtual void discloseModule(IModuleProxy *moduleProxy)
|
||||||
throw (EGatewayNotConnected)
|
|
||||||
{
|
{
|
||||||
nlassert(moduleProxy->getModuleGateway() == this);
|
nlassert(moduleProxy->getModuleGateway() == this);
|
||||||
|
|
||||||
|
@ -1560,8 +1558,7 @@ namespace NLNET
|
||||||
return getModuleName();
|
return getModuleName();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message )
|
void _sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message)
|
||||||
throw (EModuleNotReachable, EModuleNotPluggedHere)
|
|
||||||
{
|
{
|
||||||
// the socket implementation already checked that the module is plugged here
|
// the socket implementation already checked that the module is plugged here
|
||||||
// just check that the destination module effectively from here
|
// just check that the destination module effectively from here
|
||||||
|
@ -1585,7 +1582,6 @@ namespace NLNET
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void _broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
|
virtual void _broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
|
||||||
throw (EModuleNotPluggedHere)
|
|
||||||
{
|
{
|
||||||
H_AUTO(CModuleGetaway__broadcastModuleMessage);
|
H_AUTO(CModuleGetaway__broadcastModuleMessage);
|
||||||
// send the message to all proxies (except the sender module)
|
// send the message to all proxies (except the sender module)
|
||||||
|
|
|
@ -184,13 +184,13 @@ namespace NLNET
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onCommand(const CMessage &/* command */) throw (EInvalidCommand)
|
void onCommand(const CMessage &/* command */)
|
||||||
{
|
{
|
||||||
// nothing done for now
|
// nothing done for now
|
||||||
throw EInvalidCommand();
|
throw EInvalidCommand();
|
||||||
}
|
}
|
||||||
/// The gateway send a textual command to the transport
|
/// The gateway send a textual command to the transport
|
||||||
bool onCommand(const TParsedCommandLine &command) throw (EInvalidCommand)
|
bool onCommand(const TParsedCommandLine &command)
|
||||||
{
|
{
|
||||||
if (command.SubParams.size() < 1)
|
if (command.SubParams.size() < 1)
|
||||||
throw EInvalidCommand();
|
throw EInvalidCommand();
|
||||||
|
@ -218,7 +218,7 @@ namespace NLNET
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Open the server by starting listing for incoming connection on the specified port
|
/// Open the server by starting listing for incoming connection on the specified port
|
||||||
void openServer(uint16 port) throw (ETransportError)
|
void openServer(uint16 port)
|
||||||
{
|
{
|
||||||
if (_CallbackServer.get() != NULL)
|
if (_CallbackServer.get() != NULL)
|
||||||
throw ETransportError("openServer : The server is already open");
|
throw ETransportError("openServer : The server is already open");
|
||||||
|
@ -607,13 +607,13 @@ namespace NLNET
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onCommand(const CMessage &/* command */) throw (EInvalidCommand)
|
void onCommand(const CMessage &/* command */)
|
||||||
{
|
{
|
||||||
// nothing done for now
|
// nothing done for now
|
||||||
throw EInvalidCommand();
|
throw EInvalidCommand();
|
||||||
}
|
}
|
||||||
/// The gateway send a textual command to the transport
|
/// The gateway send a textual command to the transport
|
||||||
bool onCommand(const TParsedCommandLine &command) throw (EInvalidCommand)
|
bool onCommand(const TParsedCommandLine &command)
|
||||||
{
|
{
|
||||||
if (command.SubParams.size() < 1)
|
if (command.SubParams.size() < 1)
|
||||||
throw EInvalidCommand();
|
throw EInvalidCommand();
|
||||||
|
|
|
@ -218,13 +218,13 @@ namespace NLNET
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onCommand(const CMessage &/* command */) throw (EInvalidCommand)
|
void onCommand(const CMessage &/* command */)
|
||||||
{
|
{
|
||||||
// nothing done for now
|
// nothing done for now
|
||||||
throw EInvalidCommand();
|
throw EInvalidCommand();
|
||||||
}
|
}
|
||||||
/// The gateway send a textual command to the transport
|
/// The gateway send a textual command to the transport
|
||||||
bool onCommand(const TParsedCommandLine &command) throw (EInvalidCommand)
|
bool onCommand(const TParsedCommandLine &command)
|
||||||
{
|
{
|
||||||
if (command.SubParams.size() < 1)
|
if (command.SubParams.size() < 1)
|
||||||
throw EInvalidCommand();
|
throw EInvalidCommand();
|
||||||
|
@ -255,7 +255,7 @@ namespace NLNET
|
||||||
|
|
||||||
|
|
||||||
/// Open the server by establishing route with all known services
|
/// Open the server by establishing route with all known services
|
||||||
void open(const std::string &subNetName) throw (ETransportError)
|
void open(const std::string &subNetName)
|
||||||
{
|
{
|
||||||
H_AUTO(L5_open);
|
H_AUTO(L5_open);
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,6 @@ namespace NLNET
|
||||||
|
|
||||||
/// Activate/stop firewalling mode on a transport
|
/// Activate/stop firewalling mode on a transport
|
||||||
virtual void setTransportFirewallMode(const std::string &/* transportInstanceName */, bool /* firewalled */)
|
virtual void setTransportFirewallMode(const std::string &/* transportInstanceName */, bool /* firewalled */)
|
||||||
throw (EGatewayFirewallBreak)
|
|
||||||
{
|
{
|
||||||
// unsupported
|
// unsupported
|
||||||
nlstop;
|
nlstop;
|
||||||
|
@ -174,12 +173,10 @@ namespace NLNET
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// virtual void openGatewayServer(uint16 listeningPort)
|
// virtual void openGatewayServer(uint16 listeningPort)
|
||||||
// throw (EGatewayAlreadyOpen, EGatewayPortInUse)
|
|
||||||
// {
|
// {
|
||||||
// nlstop;
|
// nlstop;
|
||||||
// }
|
// }
|
||||||
// virtual void closeGatewayServer()
|
// virtual void closeGatewayServer()
|
||||||
// throw (EGatewayNotOpen)
|
|
||||||
// {
|
// {
|
||||||
// nlstop;
|
// nlstop;
|
||||||
// }
|
// }
|
||||||
|
@ -233,7 +230,6 @@ namespace NLNET
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
virtual void discloseModule(IModuleProxy *moduleProxy)
|
virtual void discloseModule(IModuleProxy *moduleProxy)
|
||||||
throw (EGatewayNotConnected)
|
|
||||||
{
|
{
|
||||||
// check that the module is plugged here
|
// check that the module is plugged here
|
||||||
nlassert(_ModuleProxies.getB(moduleProxy) != NULL);
|
nlassert(_ModuleProxies.getB(moduleProxy) != NULL);
|
||||||
|
@ -364,8 +360,7 @@ namespace NLNET
|
||||||
return getModuleName();
|
return getModuleName();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message )
|
void _sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message)
|
||||||
throw (EModuleNotReachable, EModuleNotPluggedHere)
|
|
||||||
{
|
{
|
||||||
TModuleProxies::TAToBMap::const_iterator first(_ModuleProxies.getAToBMap().begin()), last(_ModuleProxies.getAToBMap().end());
|
TModuleProxies::TAToBMap::const_iterator first(_ModuleProxies.getAToBMap().begin()), last(_ModuleProxies.getAToBMap().end());
|
||||||
for (; first != last && first->first->getModuleProxyId() != destModuleProxyId; ++first) {}
|
for (; first != last && first->first->getModuleProxyId() != destModuleProxyId; ++first) {}
|
||||||
|
@ -373,7 +368,6 @@ namespace NLNET
|
||||||
throw EModuleNotReachable();
|
throw EModuleNotReachable();
|
||||||
}
|
}
|
||||||
virtual void _broadcastModuleMessage(IModule * /* senderModule */, const NLNET::CMessage &/* message */)
|
virtual void _broadcastModuleMessage(IModule * /* senderModule */, const NLNET::CMessage &/* message */)
|
||||||
throw (EModuleNotPluggedHere)
|
|
||||||
{
|
{
|
||||||
nlstop;
|
nlstop;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,8 +85,7 @@ namespace NLNET
|
||||||
_PluggedModules.removeWithB(pluggedModule);
|
_PluggedModules.removeWithB(pluggedModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CModuleSocket::sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message )
|
void CModuleSocket::sendModuleMessage(IModule *senderModule, TModuleId destModuleProxyId, const NLNET::CMessage &message)
|
||||||
throw (EModuleNotPluggedHere)
|
|
||||||
{
|
{
|
||||||
TPluggedModules::TBToAMap::const_iterator it(_PluggedModules.getBToAMap().find(senderModule));
|
TPluggedModules::TBToAMap::const_iterator it(_PluggedModules.getBToAMap().find(senderModule));
|
||||||
if (it == _PluggedModules.getBToAMap().end())
|
if (it == _PluggedModules.getBToAMap().end())
|
||||||
|
@ -100,7 +99,6 @@ namespace NLNET
|
||||||
}
|
}
|
||||||
|
|
||||||
void CModuleSocket::broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
|
void CModuleSocket::broadcastModuleMessage(IModule *senderModule, const NLNET::CMessage &message)
|
||||||
throw (EModuleNotPluggedHere)
|
|
||||||
{
|
{
|
||||||
TPluggedModules::TBToAMap::const_iterator it(_PluggedModules.getBToAMap().find(senderModule));
|
TPluggedModules::TBToAMap::const_iterator it(_PluggedModules.getBToAMap().find(senderModule));
|
||||||
if (it == _PluggedModules.getBToAMap().end())
|
if (it == _PluggedModules.getBToAMap().end())
|
||||||
|
|
|
@ -357,7 +357,7 @@ void CParticleWorkspace::setName(const std::string &name)
|
||||||
|
|
||||||
|
|
||||||
//***********************************************************************************************
|
//***********************************************************************************************
|
||||||
CParticleWorkspace::CNode *CParticleWorkspace::addNode(const std::string &filenameWithFullPath) throw( NLMISC::EStream)
|
CParticleWorkspace::CNode *CParticleWorkspace::addNode(const std::string &filenameWithFullPath)
|
||||||
{
|
{
|
||||||
nlassert(_OV);
|
nlassert(_OV);
|
||||||
// Check that file is not already inserted
|
// Check that file is not already inserted
|
||||||
|
|
|
@ -186,7 +186,7 @@ public:
|
||||||
*
|
*
|
||||||
* \return pointer to new node, or NULL if already inserted
|
* \return pointer to new node, or NULL if already inserted
|
||||||
*/
|
*/
|
||||||
CNode *addNode(const std::string &filenameWithFullPath) throw( NLMISC::Exception);
|
CNode *addNode(const std::string &filenameWithFullPath);
|
||||||
// remove a node by its index
|
// remove a node by its index
|
||||||
void removeNode(uint index);
|
void removeNode(uint index);
|
||||||
// remove a node by its pointer
|
// remove a node by its pointer
|
||||||
|
|
|
@ -671,7 +671,7 @@ bool NLPACS::CComputableSurface::checkConsistency()
|
||||||
CComputableSurfaceBorder& border = (*BorderKeeper)[BorderIds[i]];
|
CComputableSurfaceBorder& border = (*BorderKeeper)[BorderIds[i]];
|
||||||
|
|
||||||
for (j=0; j+1<border.Vertices.size(); ++j)
|
for (j=0; j+1<border.Vertices.size(); ++j)
|
||||||
edges.push_back(std::make_pair<NLMISC::CVectorD, NLMISC::CVectorD>(border.Vertices[j], border.Vertices[j+1]));
|
edges.push_back(std::make_pair(border.Vertices[j], border.Vertices[j+1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i+1<edges.size(); ++i)
|
for (i=0; i+1<edges.size(); ++i)
|
||||||
|
|
|
@ -75,6 +75,11 @@
|
||||||
keep="true"
|
keep="true"
|
||||||
max_historic="0"
|
max_historic="0"
|
||||||
fontsize="10"
|
fontsize="10"
|
||||||
|
shadow="true"
|
||||||
|
shadow_x="1"
|
||||||
|
shadow_y="1"
|
||||||
|
shadow_color="0 0 0 255"
|
||||||
|
shadow_outline="false"
|
||||||
backup_father_container_pos="false"
|
backup_father_container_pos="false"
|
||||||
want_return="false"
|
want_return="false"
|
||||||
color="255 255 255 255"
|
color="255 255 255 255"
|
||||||
|
@ -93,7 +98,7 @@
|
||||||
<view type="bitmap" id="r" texture="log_eb_r.tga" posref="MR MR" scale="true" sizeref="h" h="-16" w="8" />
|
<view type="bitmap" id="r" texture="log_eb_r.tga" posref="MR MR" scale="true" sizeref="h" h="-16" w="8" />
|
||||||
|
|
||||||
<group type="edit_box" sizeref="wh" w="-8" h="-8" id="eb" posref="MM MM" on_focus="#on_focus" on_focus_params="#on_focus_params" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" backup_father_container_pos="#backup_father_container_pos">
|
<group type="edit_box" sizeref="wh" w="-8" h="-8" id="eb" posref="MM MM" on_focus="#on_focus" on_focus_params="#on_focus_params" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" backup_father_container_pos="#backup_father_container_pos">
|
||||||
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="true" hardtext="" global_color="false"/>
|
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="#shadow" shadow_x="#shadow_x" shadow_y="#shadow_y" shadow_color="#shadow_color" shadow_outline="#shadow_outline" hardtext="" global_color="false"/>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
|
@ -114,6 +119,11 @@
|
||||||
fontsize="10"
|
fontsize="10"
|
||||||
fontweight=""
|
fontweight=""
|
||||||
fontstyle=""
|
fontstyle=""
|
||||||
|
shadow="true"
|
||||||
|
shadow_x="1"
|
||||||
|
shadow_y="1"
|
||||||
|
shadow_color="0 0 0 255"
|
||||||
|
shadow_outline="false"
|
||||||
backup_father_container_pos="false"
|
backup_father_container_pos="false"
|
||||||
want_return="false"
|
want_return="false"
|
||||||
color="255 255 255 255"
|
color="255 255 255 255"
|
||||||
|
@ -124,7 +134,7 @@
|
||||||
<group id="#id" posref="#posref" x="#x" y="#y" posparent="#posparent" child_resize_h="#child_resize_h" sizeref="#sizeref" w="#w" h="#h" render_layer="#render_layer">
|
<group id="#id" posref="#posref" x="#x" y="#y" posparent="#posparent" child_resize_h="#child_resize_h" sizeref="#sizeref" w="#w" h="#h" render_layer="#render_layer">
|
||||||
<group type="edit_box" sizeref="#sizeref_eb" w="-16" id="eb" posref="TL TL" x="8" y="-8" child_resize_h="#child_resize_h" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" backup_father_container_pos="#backup_father_container_pos" render_layer="#render_layer">
|
<group type="edit_box" sizeref="#sizeref_eb" w="-16" id="eb" posref="TL TL" x="8" y="-8" child_resize_h="#child_resize_h" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" backup_father_container_pos="#backup_father_container_pos" render_layer="#render_layer">
|
||||||
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="log_eb_m.tga" inherit_gc_alpha="false" render_layer="#render_layer"/>
|
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="log_eb_m.tga" inherit_gc_alpha="false" render_layer="#render_layer"/>
|
||||||
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" multi_min_line="#multi_min_line" fontsize="#fontsize" color="#color" fontweight="#fontweight" fontstyle="#fontstyle" shadow="true" hardtext="" global_color="false" render_layer="#render_layer"/>
|
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" multi_min_line="#multi_min_line" fontsize="#fontsize" color="#color" fontweight="#fontweight" fontstyle="#fontstyle" shadow="#shadow" shadow_x="#shadow_x" shadow_y="#shadow_y" shadow_color="#shadow_color" shadow_outline="#shadow_outline" hardtext="" global_color="false" render_layer="#render_layer"/>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<!-- border around the list -->
|
<!-- border around the list -->
|
||||||
|
@ -153,6 +163,11 @@
|
||||||
keep="true"
|
keep="true"
|
||||||
max_historic="40"
|
max_historic="40"
|
||||||
fontsize="10"
|
fontsize="10"
|
||||||
|
shadow="true"
|
||||||
|
shadow_x="1"
|
||||||
|
shadow_y="1"
|
||||||
|
shadow_color="0 0 0 255"
|
||||||
|
shadow_outline="false"
|
||||||
backup_father_container_pos="false"
|
backup_father_container_pos="false"
|
||||||
want_return="false"
|
want_return="false"
|
||||||
color="255 255 255 255"
|
color="255 255 255 255"
|
||||||
|
@ -162,7 +177,7 @@
|
||||||
<group id="#id" posref="#posref" x="#x" y="#y" posparent="#posparent" child_resize_h="#child_resize_h" sizeref="#sizeref" w="#w" h="#h" render_layer="#render_layer">
|
<group id="#id" posref="#posref" x="#x" y="#y" posparent="#posparent" child_resize_h="#child_resize_h" sizeref="#sizeref" w="#w" h="#h" render_layer="#render_layer">
|
||||||
<group type="edit_box" sizeref="#sizeref_eb" w="-8" id="eb" posref="TL TL" x="4" y="-4" child_resize_h="#child_resize_h" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" backup_father_container_pos="#backup_father_container_pos" render_layer="#render_layer">
|
<group type="edit_box" sizeref="#sizeref_eb" w="-8" id="eb" posref="TL TL" x="4" y="-4" child_resize_h="#child_resize_h" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" backup_father_container_pos="#backup_father_container_pos" render_layer="#render_layer">
|
||||||
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="W_box_blank.tga" inherit_gc_alpha="true" render_layer="#render_layer"/>
|
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="W_box_blank.tga" inherit_gc_alpha="true" render_layer="#render_layer"/>
|
||||||
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="true" hardtext="" global_color="false" render_layer="#render_layer"/>
|
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="#shadow" shadow_x="#shadow_x" shadow_y="#shadow_y" shadow_color="#shadow_color" shadow_outline="#shadow_outline" hardtext="" global_color="false" render_layer="#render_layer"/>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<!-- border around the list -->
|
<!-- border around the list -->
|
||||||
|
@ -397,6 +412,11 @@
|
||||||
keep="true"
|
keep="true"
|
||||||
max_historic="40"
|
max_historic="40"
|
||||||
fontsize="10"
|
fontsize="10"
|
||||||
|
shadow="true"
|
||||||
|
shadow_x="1"
|
||||||
|
shadow_y="1"
|
||||||
|
shadow_color="0 0 0 255"
|
||||||
|
shadow_outline="false"
|
||||||
backup_father_container_pos="false"
|
backup_father_container_pos="false"
|
||||||
want_return="false"
|
want_return="false"
|
||||||
color="255 255 255 255"
|
color="255 255 255 255"
|
||||||
|
@ -407,7 +427,7 @@
|
||||||
<group type="edit_box" sizeref="#sizeref_eb" w="-16" id="eb" posref="TL TL" x="8" y="-8" child_resize_h="#child_resize_h" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" backup_father_container_pos="#backup_father_container_pos" render_layer="#render_layer">
|
<group type="edit_box" sizeref="#sizeref_eb" w="-16" id="eb" posref="TL TL" x="8" y="-8" child_resize_h="#child_resize_h" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" backup_father_container_pos="#backup_father_container_pos" render_layer="#render_layer">
|
||||||
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="log_eb_m.tga" inherit_gc_alpha="false" render_layer="#render_layer"/>
|
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="log_eb_m.tga" inherit_gc_alpha="false" render_layer="#render_layer"/>
|
||||||
|
|
||||||
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="true" hardtext="" global_color="false" render_layer="#render_layer"/>
|
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="#shadow" shadow_x="#shadow_x" shadow_y="#shadow_y" shadow_color="#shadow_color" shadow_outline="#shadow_outline" hardtext="" global_color="false" render_layer="#render_layer"/>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<!-- border around the list -->
|
<!-- border around the list -->
|
||||||
|
@ -435,6 +455,11 @@
|
||||||
keep="true"
|
keep="true"
|
||||||
max_historic="40"
|
max_historic="40"
|
||||||
fontsize="10"
|
fontsize="10"
|
||||||
|
shadow="true"
|
||||||
|
shadow_x="1"
|
||||||
|
shadow_y="1"
|
||||||
|
shadow_color="0 0 0 255"
|
||||||
|
shadow_outline="false"
|
||||||
backup_father_container_pos="false"
|
backup_father_container_pos="false"
|
||||||
want_return="false"
|
want_return="false"
|
||||||
color="255 255 255 255"
|
color="255 255 255 255"
|
||||||
|
@ -444,7 +469,7 @@
|
||||||
|
|
||||||
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="blank.tga" color="255 255 255 0" />
|
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="blank.tga" color="255 255 255 0" />
|
||||||
|
|
||||||
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="true" hardtext="" global_color="false"/>
|
<view id="edit_text" type="text" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="#shadow" shadow_x="#shadow_x" shadow_y="#shadow_y" shadow_color="#shadow_color" shadow_outline="#shadow_outline" hardtext="" global_color="false"/>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<!-- border around the list -->
|
<!-- border around the list -->
|
||||||
|
|
|
@ -2653,6 +2653,11 @@
|
||||||
keep="true"
|
keep="true"
|
||||||
max_historic="40"
|
max_historic="40"
|
||||||
fontsize="10"
|
fontsize="10"
|
||||||
|
shadow="true"
|
||||||
|
shadow_x="1"
|
||||||
|
shadow_y="1"
|
||||||
|
shadow_color="0 0 0 255"
|
||||||
|
shadow_outline="false"
|
||||||
backup_father_container_pos="false"
|
backup_father_container_pos="false"
|
||||||
want_return="false"
|
want_return="false"
|
||||||
clear_on_escape="false"
|
clear_on_escape="false"
|
||||||
|
@ -2722,7 +2727,11 @@
|
||||||
multi_line_space="0"
|
multi_line_space="0"
|
||||||
fontsize="#fontsize"
|
fontsize="#fontsize"
|
||||||
color="#color"
|
color="#color"
|
||||||
shadow="true"
|
shadow="#shadow"
|
||||||
|
shadow_x="#shadow_x"
|
||||||
|
shadow_y="#shadow_y"
|
||||||
|
shadow_color="#shadow_color"
|
||||||
|
shadow_outline="#shadow_outline"
|
||||||
hardtext=""
|
hardtext=""
|
||||||
global_color="false" />
|
global_color="false" />
|
||||||
</group>
|
</group>
|
||||||
|
@ -2826,6 +2835,11 @@
|
||||||
keep="true"
|
keep="true"
|
||||||
max_historic="40"
|
max_historic="40"
|
||||||
fontsize="10"
|
fontsize="10"
|
||||||
|
shadow="true"
|
||||||
|
shadow_x="1"
|
||||||
|
shadow_y="1"
|
||||||
|
shadow_color="0 0 0 255"
|
||||||
|
shadow_outline="false"
|
||||||
backup_father_container_pos="false"
|
backup_father_container_pos="false"
|
||||||
want_return="false"
|
want_return="false"
|
||||||
color="255 255 255 255"
|
color="255 255 255 255"
|
||||||
|
@ -2886,7 +2900,11 @@
|
||||||
multi_min_line="#multi_min_line"
|
multi_min_line="#multi_min_line"
|
||||||
fontsize="#fontsize"
|
fontsize="#fontsize"
|
||||||
color="#color"
|
color="#color"
|
||||||
shadow="true"
|
shadow="#shadow"
|
||||||
|
shadow_x="#shadow_x"
|
||||||
|
shadow_y="#shadow_y"
|
||||||
|
shadow_color="#shadow_color"
|
||||||
|
shadow_outline="#shadow_outline"
|
||||||
hardtext=""
|
hardtext=""
|
||||||
global_color="false"
|
global_color="false"
|
||||||
render_layer="#render_layer" />
|
render_layer="#render_layer" />
|
||||||
|
|
|
@ -56,7 +56,7 @@ public:
|
||||||
CVector Heading;
|
CVector Heading;
|
||||||
//CVMatrix Matrix;
|
//CVMatrix Matrix;
|
||||||
public:
|
public:
|
||||||
void serial(NLMISC::IStream &f) throw(EStream)
|
void serial(NLMISC::IStream &f)
|
||||||
{
|
{
|
||||||
f.serial(Date);
|
f.serial(Date);
|
||||||
f.serial(Pos);
|
f.serial(Pos);
|
||||||
|
|
|
@ -216,13 +216,13 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onCommand(const CMessage &/* command */) throw (IGatewayTransport::EInvalidCommand)
|
void onCommand(const CMessage &/* command */)
|
||||||
{
|
{
|
||||||
// nothing done for now
|
// nothing done for now
|
||||||
throw EInvalidCommand();
|
throw EInvalidCommand();
|
||||||
}
|
}
|
||||||
/// The gateway send a textual command to the transport
|
/// The gateway send a textual command to the transport
|
||||||
bool onCommand(const TParsedCommandLine &command) throw (IGatewayTransport::EInvalidCommand)
|
bool onCommand(const TParsedCommandLine &command)
|
||||||
{
|
{
|
||||||
if (command.SubParams.size() < 1)
|
if (command.SubParams.size() < 1)
|
||||||
throw EInvalidCommand();
|
throw EInvalidCommand();
|
||||||
|
@ -256,7 +256,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Open the connection by intercepting client gateway message
|
/// Open the connection by intercepting client gateway message
|
||||||
void open() throw (ETransportError)
|
void open()
|
||||||
{
|
{
|
||||||
if (_Open)
|
if (_Open)
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,8 +19,7 @@
|
||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
|
||||||
#include <openssl/ssl.h>
|
#include "nel/gui/curl_certificates.h"
|
||||||
#include <openssl/err.h>
|
|
||||||
|
|
||||||
using namespace NLMISC;
|
using namespace NLMISC;
|
||||||
using namespace NLNET;
|
using namespace NLNET;
|
||||||
|
@ -64,135 +63,20 @@ bool CCurlHttpClient::authenticate(const std::string &user, const std::string &p
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *CAFilename = "ssl_ca_cert.pem"; // this is the certificate "Thawte Server CA"
|
static const std::string CAFilename = "ssl_ca_cert.pem"; // this is the certificate "Thawte Server CA"
|
||||||
|
|
||||||
// ***************************************************************************
|
|
||||||
static CURLcode sslctx_function(CURL * /* curl */, void *sslctx, void * /* parm */)
|
|
||||||
{
|
|
||||||
// look for certificate in search paths
|
|
||||||
string path = CPath::lookup(CAFilename);
|
|
||||||
nlinfo("Cert path '%s'", path.c_str());
|
|
||||||
|
|
||||||
if (path.empty())
|
|
||||||
{
|
|
||||||
nlwarning("Unable to find %s", CAFilename);
|
|
||||||
return CURLE_SSL_CACERT;
|
|
||||||
}
|
|
||||||
|
|
||||||
CIFile file;
|
|
||||||
|
|
||||||
// open certificate
|
|
||||||
if (!file.open(path))
|
|
||||||
{
|
|
||||||
nlwarning("Unable to open %s", path.c_str());
|
|
||||||
return CURLE_SSL_CACERT;
|
|
||||||
}
|
|
||||||
|
|
||||||
CURLcode res = CURLE_OK;
|
|
||||||
|
|
||||||
// load certificate content into memory
|
|
||||||
std::vector<uint8> buffer(file.getFileSize());
|
|
||||||
file.serialBuffer(&buffer[0], file.getFileSize());
|
|
||||||
|
|
||||||
// get a BIO
|
|
||||||
BIO *bio = BIO_new_mem_buf(&buffer[0], file.getFileSize());
|
|
||||||
|
|
||||||
char errorBuffer[1024];
|
|
||||||
|
|
||||||
if (bio)
|
|
||||||
{
|
|
||||||
// get a pointer to the X509 certificate store (which may be empty!)
|
|
||||||
X509_STORE *store = SSL_CTX_get_cert_store((SSL_CTX *)sslctx);
|
|
||||||
|
|
||||||
// use it to read the PEM formatted certificate from memory into an X509
|
|
||||||
// structure that SSL can use
|
|
||||||
STACK_OF(X509_INFO) *info = PEM_X509_INFO_read_bio(bio, NULL, NULL, NULL);
|
|
||||||
|
|
||||||
if (info)
|
|
||||||
{
|
|
||||||
// iterate over all entries from the PEM file, add them to the x509_store one by one
|
|
||||||
for (sint i = 0; i < sk_X509_INFO_num(info); ++i)
|
|
||||||
{
|
|
||||||
X509_INFO *itmp = sk_X509_INFO_value(info, i);
|
|
||||||
|
|
||||||
if (itmp && itmp->x509)
|
|
||||||
{
|
|
||||||
X509_NAME *subject = X509_get_subject_name(itmp->x509);
|
|
||||||
|
|
||||||
std::string name;
|
|
||||||
unsigned char *tmp = NULL;
|
|
||||||
|
|
||||||
// construct a multiline string with name
|
|
||||||
for (int i = 0, ilen = X509_NAME_entry_count(subject); i < ilen; ++i)
|
|
||||||
{
|
|
||||||
X509_NAME_ENTRY *e = X509_NAME_get_entry(subject, i);
|
|
||||||
ASN1_STRING *d = X509_NAME_ENTRY_get_data(e);
|
|
||||||
|
|
||||||
if (ASN1_STRING_to_UTF8(&tmp, d) > 0)
|
|
||||||
{
|
|
||||||
name += NLMISC::toString("%s\n", tmp);
|
|
||||||
|
|
||||||
OPENSSL_free(tmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// add our certificate to this store
|
|
||||||
if (X509_STORE_add_cert(store, itmp->x509) == 0)
|
|
||||||
{
|
|
||||||
uint errCode = ERR_get_error();
|
|
||||||
|
|
||||||
// ignore already in hash table errors
|
|
||||||
if (ERR_GET_LIB(errCode) != ERR_LIB_X509 || ERR_GET_REASON(errCode) != X509_R_CERT_ALREADY_IN_HASH_TABLE)
|
|
||||||
{
|
|
||||||
ERR_error_string_n(errCode, errorBuffer, 1024);
|
|
||||||
nlwarning("Error adding certificate %s: %s", name.c_str(), errorBuffer);
|
|
||||||
res = CURLE_SSL_CACERT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nlinfo("Added certificate %s", name.c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// cleanup
|
|
||||||
sk_X509_INFO_pop_free(info, X509_INFO_free);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nlwarning("Unable to read PEM info");
|
|
||||||
res = CURLE_SSL_CACERT;
|
|
||||||
}
|
|
||||||
|
|
||||||
// decrease reference counts
|
|
||||||
BIO_free(bio);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nlwarning("Unable to allocate BIO buffer for certificates");
|
|
||||||
res = CURLE_SSL_CACERT;
|
|
||||||
}
|
|
||||||
|
|
||||||
// all set to go
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
bool CCurlHttpClient::verifyServer(bool verify)
|
bool CCurlHttpClient::verifyServer(bool verify)
|
||||||
{
|
{
|
||||||
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYHOST, verify ? 2 : 0);
|
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYHOST, verify ? 2 : 0);
|
||||||
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYPEER, verify ? 1 : 0);
|
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYPEER, verify ? 1 : 0);
|
||||||
curl_easy_setopt(_Curl, CURLOPT_SSLCERTTYPE, "PEM");
|
|
||||||
// would allow to provide the CA in memory instead of using CURLOPT_CAINFO, but needs to include and link OpenSSL
|
|
||||||
if (curl_easy_setopt(_Curl, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function) != CURLE_OK)
|
|
||||||
{
|
|
||||||
nlwarning("Unable to support CURLOPT_SSL_CTX_FUNCTION, curl not compiled with OpenSSL ?");
|
|
||||||
}
|
|
||||||
|
|
||||||
// set both CURLOPT_CAINFO and CURLOPT_CAPATH to NULL to be sure we won't use default values (these files can be missing and generate errors)
|
// specify custom CA certs
|
||||||
curl_easy_setopt(_Curl, CURLOPT_CAINFO, NULL);
|
NLGUI::CCurlCertificates::addCertificateFile(CAFilename);
|
||||||
curl_easy_setopt(_Curl, CURLOPT_CAPATH, NULL);
|
|
||||||
|
// if supported, use custom SSL context function to load certificates
|
||||||
|
NLGUI::CCurlCertificates::useCertificates(_Curl);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,21 @@ static inline bool isUrlTag(const ucstring &s, ucstring::size_type index, ucstri
|
||||||
if (isUrl && i > 0 && !markdown)
|
if (isUrl && i > 0 && !markdown)
|
||||||
{
|
{
|
||||||
// '}' is in the list because of color tags, ie "@{FFFF}http://..."
|
// '}' is in the list because of color tags, ie "@{FFFF}http://..."
|
||||||
const vector<ucchar> chars {' ', '"', '\'', '(', '[', '}'};
|
#ifdef NL_ISO_CPP0X_AVAILABLE
|
||||||
|
const vector<ucchar> chars{ ' ', '"', '\'', '(', '[', '}' };
|
||||||
|
#else
|
||||||
|
static std::vector<ucchar> chars;
|
||||||
|
|
||||||
|
if (chars.empty())
|
||||||
|
{
|
||||||
|
chars.push_back(' ');
|
||||||
|
chars.push_back('"');
|
||||||
|
chars.push_back('\'');
|
||||||
|
chars.push_back('(');
|
||||||
|
chars.push_back('[');
|
||||||
|
chars.push_back('}');
|
||||||
|
}
|
||||||
|
#endif
|
||||||
isUrl = std::find(chars.begin(), chars.end(), s[i - 1]) != chars.end();
|
isUrl = std::find(chars.begin(), chars.end(), s[i - 1]) != chars.end();
|
||||||
}
|
}
|
||||||
return isUrl;
|
return isUrl;
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#include "../net_manager.h"
|
#include "../net_manager.h"
|
||||||
#include "../connection.h"
|
#include "../connection.h"
|
||||||
|
|
||||||
|
#include <curl/curl.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace NLMISC;
|
using namespace NLMISC;
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,8 @@
|
||||||
#include "nel/gui/lua_helper.h"
|
#include "nel/gui/lua_helper.h"
|
||||||
using namespace NLGUI;
|
using namespace NLGUI;
|
||||||
#include "nel/gui/lua_ihm.h"
|
#include "nel/gui/lua_ihm.h"
|
||||||
|
#include "nel/gui/curl_certificates.h"
|
||||||
|
|
||||||
#include "lua_ihm_ryzom.h"
|
#include "lua_ihm_ryzom.h"
|
||||||
|
|
||||||
#include "add_on_manager.h"
|
#include "add_on_manager.h"
|
||||||
|
@ -471,15 +473,11 @@ CInterfaceManager::CInterfaceManager()
|
||||||
CGroupHTML::options.appName = getUserAgentName();
|
CGroupHTML::options.appName = getUserAgentName();
|
||||||
CGroupHTML::options.appVersion = getUserAgentVersion();
|
CGroupHTML::options.appVersion = getUserAgentVersion();
|
||||||
CGroupHTML::options.curlMaxConnections = ClientCfg.CurlMaxConnections;
|
CGroupHTML::options.curlMaxConnections = ClientCfg.CurlMaxConnections;
|
||||||
|
|
||||||
if (!ClientCfg.CurlCABundle.empty())
|
if (!ClientCfg.CurlCABundle.empty())
|
||||||
{
|
{
|
||||||
string filename = CPath::lookup(ClientCfg.CurlCABundle, false);
|
// specify custom CA certs, lookup will be made in this function
|
||||||
if (!filename.empty())
|
NLGUI::CCurlCertificates::addCertificateFile(ClientCfg.CurlCABundle);
|
||||||
{
|
|
||||||
filename = CPath::getFullPath(filename, false);
|
|
||||||
CGroupHTML::options.curlCABundle = filename;
|
|
||||||
nlinfo("curl ca bundle '%s'", filename.c_str());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NLGUI::CDBManager::getInstance()->resizeBanks( NB_CDB_BANKS );
|
NLGUI::CDBManager::getInstance()->resizeBanks( NB_CDB_BANKS );
|
||||||
|
|
|
@ -83,8 +83,8 @@ void CItemGroup::addItem(sint32 createTime, sint32 serial, SLOT_EQUIPMENT::TSlot
|
||||||
nldebug("Not adding duplicate item, createTime: %d, serial: %d", createTime, serial);
|
nldebug("Not adding duplicate item, createTime: %d, serial: %d", createTime, serial);
|
||||||
//In this case, we are adding the duplicate item for a 2 hands item
|
//In this case, we are adding the duplicate item for a 2 hands item
|
||||||
//If it's saved as a left hand item, save it as a right hand item instead (so we have only 1 correct item)
|
//If it's saved as a left hand item, save it as a right hand item instead (so we have only 1 correct item)
|
||||||
if(Items[i].slot == SLOT_EQUIPMENT::TSlotEquipment::HANDL && slot == SLOT_EQUIPMENT::TSlotEquipment::HANDR)
|
if(Items[i].slot == SLOT_EQUIPMENT::HANDL && slot == SLOT_EQUIPMENT::HANDR)
|
||||||
Items[i].slot = SLOT_EQUIPMENT::TSlotEquipment::HANDR;
|
Items[i].slot = SLOT_EQUIPMENT::HANDR;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -389,7 +389,7 @@ CItemGroup CItemGroupManager::migrateGroup(CItemGroup group)
|
||||||
//Get all matching items from all inventory
|
//Get all matching items from all inventory
|
||||||
CItemGroup out;
|
CItemGroup out;
|
||||||
out.name = group.name;
|
out.name = group.name;
|
||||||
for (int i=0; i < INVENTORIES::TInventory::NUM_ALL_INVENTORY; i++)
|
for (int i=0; i < INVENTORIES::NUM_ALL_INVENTORY; i++)
|
||||||
{
|
{
|
||||||
INVENTORIES::TInventory inventory = (INVENTORIES::TInventory)i;
|
INVENTORIES::TInventory inventory = (INVENTORIES::TInventory)i;
|
||||||
std::vector<CInventoryItem> items = matchingItems(&group, inventory);
|
std::vector<CInventoryItem> items = matchingItems(&group, inventory);
|
||||||
|
@ -501,7 +501,7 @@ bool CItemGroupManager::moveGroup(std::string name, INVENTORIES::TInventory dst)
|
||||||
|
|
||||||
std::string moveParams = "to=lists|nblist=1|listsheet0=" + toDbPath(dst);
|
std::string moveParams = "to=lists|nblist=1|listsheet0=" + toDbPath(dst);
|
||||||
// Grab all matching item from all available inventory and put it in dst
|
// Grab all matching item from all available inventory and put it in dst
|
||||||
for (int i=0; i< INVENTORIES::TInventory::NUM_ALL_INVENTORY; i ++)
|
for (int i=0; i< INVENTORIES::NUM_ALL_INVENTORY; i ++)
|
||||||
{
|
{
|
||||||
INVENTORIES::TInventory inventory = (INVENTORIES::TInventory)i;
|
INVENTORIES::TInventory inventory = (INVENTORIES::TInventory)i;
|
||||||
if (inventory != dst && pIM->isInventoryAvailable(inventory))
|
if (inventory != dst && pIM->isInventoryAvailable(inventory))
|
||||||
|
@ -531,7 +531,7 @@ bool CItemGroupManager::equipGroup(std::string name, bool pullBefore)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pullBefore) moveGroup(name, INVENTORIES::TInventory::bag);
|
if(pullBefore) moveGroup(name, INVENTORIES::bag);
|
||||||
//Start by unequipping all slot that user wants to unequip
|
//Start by unequipping all slot that user wants to unequip
|
||||||
for(int i=0; i < group->removeBeforeEquip.size(); i++)
|
for(int i=0; i < group->removeBeforeEquip.size(); i++)
|
||||||
{
|
{
|
||||||
|
@ -547,6 +547,7 @@ bool CItemGroupManager::equipGroup(std::string name, bool pullBefore)
|
||||||
|
|
||||||
uint32 maxEquipTime = 0;
|
uint32 maxEquipTime = 0;
|
||||||
|
|
||||||
|
#ifdef NL_ISO_CPP0X_AVAILABLE
|
||||||
std::map<ITEM_TYPE::TItemType, bool> possiblyDual =
|
std::map<ITEM_TYPE::TItemType, bool> possiblyDual =
|
||||||
{
|
{
|
||||||
{ITEM_TYPE::ANKLET, false},
|
{ITEM_TYPE::ANKLET, false},
|
||||||
|
@ -554,8 +555,17 @@ bool CItemGroupManager::equipGroup(std::string name, bool pullBefore)
|
||||||
{ITEM_TYPE::EARING, false},
|
{ITEM_TYPE::EARING, false},
|
||||||
{ITEM_TYPE::RING, false},
|
{ITEM_TYPE::RING, false},
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
|
std::map<ITEM_TYPE::TItemType, bool> possiblyDual;
|
||||||
|
|
||||||
|
possiblyDual[ITEM_TYPE::ANKLET] = false;
|
||||||
|
possiblyDual[ITEM_TYPE::BRACELET] = false;
|
||||||
|
possiblyDual[ITEM_TYPE::EARING] = false;
|
||||||
|
possiblyDual[ITEM_TYPE::RING] = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
std::vector<CInventoryItem> duals;
|
std::vector<CInventoryItem> duals;
|
||||||
std::vector<CInventoryItem> items = matchingItems(group, INVENTORIES::TInventory::bag);
|
std::vector<CInventoryItem> items = matchingItems(group, INVENTORIES::bag);
|
||||||
for(int i=0; i < items.size(); i++)
|
for(int i=0; i < items.size(); i++)
|
||||||
{
|
{
|
||||||
CInventoryItem item = items[i];
|
CInventoryItem item = items[i];
|
||||||
|
@ -713,19 +723,19 @@ std::string CItemGroupManager::toDbPath(INVENTORIES::TInventory inventory)
|
||||||
{
|
{
|
||||||
switch(inventory)
|
switch(inventory)
|
||||||
{
|
{
|
||||||
case INVENTORIES::TInventory::bag:
|
case INVENTORIES::bag:
|
||||||
return LIST_BAG_TEXT; break;
|
return LIST_BAG_TEXT; break;
|
||||||
case INVENTORIES::TInventory::pet_animal1:
|
case INVENTORIES::pet_animal1:
|
||||||
return LIST_PA0_TEXT; break;
|
return LIST_PA0_TEXT; break;
|
||||||
case INVENTORIES::TInventory::pet_animal2:
|
case INVENTORIES::pet_animal2:
|
||||||
return LIST_PA1_TEXT; break;
|
return LIST_PA1_TEXT; break;
|
||||||
case INVENTORIES::TInventory::pet_animal3:
|
case INVENTORIES::pet_animal3:
|
||||||
return LIST_PA2_TEXT; break;
|
return LIST_PA2_TEXT; break;
|
||||||
case INVENTORIES::TInventory::pet_animal4:
|
case INVENTORIES::pet_animal4:
|
||||||
return LIST_PA3_TEXT; break;
|
return LIST_PA3_TEXT; break;
|
||||||
case INVENTORIES::TInventory::player_room:
|
case INVENTORIES::player_room:
|
||||||
return LIST_ROOM_TEXT;break;
|
return LIST_ROOM_TEXT;break;
|
||||||
case INVENTORIES::TInventory::guild:
|
case INVENTORIES::guild:
|
||||||
return ClientCfg.ItemGroupAllowGuild ? LIST_GUILD_TEXT : ""; break;
|
return ClientCfg.ItemGroupAllowGuild ? LIST_GUILD_TEXT : ""; break;
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
|
|
|
@ -101,7 +101,7 @@ struct EPatchDownloadException : public Exception
|
||||||
{
|
{
|
||||||
EPatchDownloadException() : Exception( "Download Error" ) {}
|
EPatchDownloadException() : Exception( "Download Error" ) {}
|
||||||
EPatchDownloadException( const std::string& str ) : Exception( str ) {}
|
EPatchDownloadException( const std::string& str ) : Exception( str ) {}
|
||||||
virtual ~EPatchDownloadException() throw() {}
|
virtual ~EPatchDownloadException() throw(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,7 @@
|
||||||
#include "world_database_manager.h"
|
#include "world_database_manager.h"
|
||||||
#include "continent_manager.h"
|
#include "continent_manager.h"
|
||||||
#include "ig_callback.h"
|
#include "ig_callback.h"
|
||||||
|
#include "release.h"
|
||||||
//#include "fog_map.h"
|
//#include "fog_map.h"
|
||||||
#include "movie_shooter.h"
|
#include "movie_shooter.h"
|
||||||
#include "sound_manager.h"
|
#include "sound_manager.h"
|
||||||
|
@ -2555,6 +2556,9 @@ bool mainLoop()
|
||||||
|
|
||||||
if ( ! FarTP.isReselectingChar() ) // skip some parts if the user wants to quit in the middle of a char reselect
|
if ( ! FarTP.isReselectingChar() ) // skip some parts if the user wants to quit in the middle of a char reselect
|
||||||
{
|
{
|
||||||
|
// Saving ingame resolution when in windowed mode
|
||||||
|
saveIngameResolution();
|
||||||
|
|
||||||
// Release the structure for the ping.
|
// Release the structure for the ping.
|
||||||
Ping.release ();
|
Ping.release ();
|
||||||
|
|
||||||
|
|
|
@ -1312,8 +1312,8 @@ void CClientEditionModule::onUserComponentDownloaded(NLNET::IModuleProxy *sender
|
||||||
|
|
||||||
if (decompressionState != Z_OK)
|
if (decompressionState != Z_OK)
|
||||||
{
|
{
|
||||||
delete component;
|
nlwarning("Error: the downloaded user component is corrupted '%s'", component->Filename.c_str());
|
||||||
nlwarning("Error: the downloaded user component is corrupted '%s' ", component->Filename.c_str());
|
delete component;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
component->UncompressedData[component->UncompressedDataLength] = '\0';
|
component->UncompressedData[component->UncompressedDataLength] = '\0';
|
||||||
|
|
|
@ -4370,7 +4370,7 @@ void CEditor::setCurrentTool(CTool *tool)
|
||||||
}
|
}
|
||||||
|
|
||||||
// *********************************************************************************************************
|
// *********************************************************************************************************
|
||||||
CLuaObject CEditor::getClasses() throw(ELuaError)
|
CLuaObject CEditor::getClasses()
|
||||||
{
|
{
|
||||||
//H_AUTO(R2_getClasses_throw)
|
//H_AUTO(R2_getClasses_throw)
|
||||||
CHECK_EDITOR
|
CHECK_EDITOR
|
||||||
|
|
|
@ -421,7 +421,7 @@ public:
|
||||||
// get table for registry in lua environment
|
// get table for registry in lua environment
|
||||||
CLuaObject &getRegistry() { return _Registry; }
|
CLuaObject &getRegistry() { return _Registry; }
|
||||||
// get lua classes (the r2.Classes table)
|
// get lua classes (the r2.Classes table)
|
||||||
CLuaObject getClasses() throw(ELuaError);
|
CLuaObject getClasses();
|
||||||
// get R2 environment (the 'r2' table into lua global environment)
|
// get R2 environment (the 'r2' table into lua global environment)
|
||||||
CLuaObject &getEnv();
|
CLuaObject &getEnv();
|
||||||
// get the config table (that is the 'r2.Config' table)
|
// get the config table (that is the 'r2.Config' table)
|
||||||
|
|
|
@ -136,7 +136,7 @@ extern void selectTipsOfTheDay (uint tips);
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
// Saving ingame resolution when in windowed mode
|
// Saving ingame resolution when in windowed mode
|
||||||
static void saveIngameResolution()
|
void saveIngameResolution()
|
||||||
{
|
{
|
||||||
if (ClientCfg.Windowed)
|
if (ClientCfg.Windowed)
|
||||||
{
|
{
|
||||||
|
@ -382,8 +382,6 @@ void releaseMainLoop(bool closeConnection)
|
||||||
{
|
{
|
||||||
ProgressBar.release();
|
ProgressBar.release();
|
||||||
|
|
||||||
saveIngameResolution();
|
|
||||||
|
|
||||||
// Release R2 editor if applicable
|
// Release R2 editor if applicable
|
||||||
R2::getEditor().autoConfigRelease(IsInRingSession);
|
R2::getEditor().autoConfigRelease(IsInRingSession);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
#include "nel/misc/types_nl.h"
|
#include "nel/misc/types_nl.h"
|
||||||
|
|
||||||
|
|
||||||
|
// Saving ingame resolution when in windowed mode
|
||||||
|
void saveIngameResolution();
|
||||||
// called from farTP at reselection
|
// called from farTP at reselection
|
||||||
void releaseMainLoopReselect();
|
void releaseMainLoopReselect();
|
||||||
// Release InGame Data
|
// Release InGame Data
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
# only compile game_share for Ryzom client, server and tools
|
ADD_SUBDIRECTORY(src)
|
||||||
IF(WITH_RYZOM_CLIENT OR WITH_RYZOM_SERVER OR WITH_RYZOM_TOOLS)
|
|
||||||
ADD_SUBDIRECTORY(src)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
#ADD_CUSTOM_COMMAND(OUTPUT "${CMAKE_BINARY_DIR}/share/data_common.bnp"
|
#ADD_CUSTOM_COMMAND(OUTPUT "${CMAKE_BINARY_DIR}/share/data_common.bnp"
|
||||||
# COMMAND bnp_make -p ${CMAKE_CURRENT_SOURCE_DIR}/data_common ${CMAKE_BINARY_DIR}/share > /dev/null)
|
# COMMAND bnp_make -p ${CMAKE_CURRENT_SOURCE_DIR}/data_common ${CMAKE_BINARY_DIR}/share > /dev/null)
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
FILE(GLOB SRC *.cpp time_weather_season/*.cpp)
|
FIND_PACKAGE(ZLIB REQUIRED)
|
||||||
FILE(GLOB PRIV_H *.h time_weather_season/*.h)
|
|
||||||
|
FILE(GLOB SRC *.cpp)
|
||||||
|
FILE(GLOB SRC_TIME time_weather_season/*.cpp)
|
||||||
|
|
||||||
|
FILE(GLOB PRIV_H *.h)
|
||||||
|
FILE(GLOB PRIV_TIME_H time_weather_season/*.h)
|
||||||
|
|
||||||
|
SET(HEADER ${PRIV_H})
|
||||||
|
|
||||||
FILE(GLOB R2
|
FILE(GLOB R2
|
||||||
dms.h dms.cpp
|
dms.h dms.cpp
|
||||||
|
@ -17,20 +24,21 @@ FILE(GLOB R2
|
||||||
ring_*.h ring_*.cpp)
|
ring_*.h ring_*.cpp)
|
||||||
|
|
||||||
LIST(REMOVE_ITEM SRC R2)
|
LIST(REMOVE_ITEM SRC R2)
|
||||||
LIST(REMOVE_ITEM PRIV_H R2)
|
LIST(REMOVE_ITEM HEADER R2)
|
||||||
|
|
||||||
SOURCE_GROUP("" FILES ${SRC} ${PRIV_H})
|
SOURCE_GROUP("" FILES ${SRC} ${HEADER})
|
||||||
|
SOURCE_GROUP("time_weather_season" FILES ${SRC_TIME} ${PRIV_TIME_H})
|
||||||
SOURCE_GROUP("R2" FILES ${R2})
|
SOURCE_GROUP("R2" FILES ${R2})
|
||||||
|
|
||||||
# Filter out the source files not actually compiled.
|
# Filter out the source files not actually compiled.
|
||||||
LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/enum_template.cpp)
|
LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/enum_template.cpp)
|
||||||
LIST(REMOVE_ITEM PRIV_H ${CMAKE_CURRENT_SOURCE_DIR}/enum_template.h)
|
LIST(REMOVE_ITEM HEADER ${CMAKE_CURRENT_SOURCE_DIR}/enum_template.h)
|
||||||
|
|
||||||
NL_TARGET_LIB(ryzom_gameshare ${PRIV_H} ${SRC} ${R2})
|
NL_TARGET_LIB(ryzom_gameshare ${HEADER} ${PRIV_TIME_H} ${SRC} ${SRC_TIME} ${R2})
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(ryzom_gameshare nelmisc nelnet nelligo nelgeorges)
|
TARGET_LINK_LIBRARIES(ryzom_gameshare ${NELMISC_LIBRARIES} ${NELNET_LIBRARIES} ${NELLIGO_LIBRARIES} ${NELGEORGES_LIBRARIES})
|
||||||
NL_DEFAULT_PROPS(ryzom_gameshare "Ryzom, Library: Game Share")
|
NL_DEFAULT_PROPS(ryzom_gameshare "Ryzom, Library: Game Share")
|
||||||
NL_ADD_RUNTIME_FLAGS(ryzom_gameshare)
|
NL_ADD_RUNTIME_FLAGS(ryzom_gameshare)
|
||||||
NL_ADD_LIB_SUFFIX(ryzom_gameshare)
|
NL_ADD_LIB_SUFFIX(ryzom_gameshare)
|
||||||
|
@ -44,3 +52,9 @@ ENDIF()
|
||||||
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
|
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
|
||||||
INSTALL(TARGETS ryzom_gameshare LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries)
|
INSTALL(TARGETS ryzom_gameshare LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(FILES ${PRIV_H} DESTINATION include/ryzom/game_share COMPONENT headers)
|
||||||
|
INSTALL(FILES ${PRIV_TIME_H} DESTINATION include/ryzom/game_share/time_weather_season COMPONENT headers)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ public:
|
||||||
/// Set the value of a var
|
/// Set the value of a var
|
||||||
const std::string &set(const std::string &var, const std::string &value)
|
const std::string &set(const std::string &var, const std::string &value)
|
||||||
{
|
{
|
||||||
std::pair<TVarMap::iterator, bool> res = _Map.insert(std::make_pair<std::string, std::string>(var, value));
|
std::pair<TVarMap::iterator, bool> res = _Map.insert(std::make_pair(var, value));
|
||||||
if (!res.second)
|
if (!res.second)
|
||||||
(*(res.first)).second = value;
|
(*(res.first)).second = value;
|
||||||
return (*(res.first)).second;
|
return (*(res.first)).second;
|
||||||
|
|
|
@ -95,7 +95,7 @@ public:
|
||||||
{
|
{
|
||||||
if (PrimZoneMap.find(primZone.getName()) == PrimZoneMap.end())
|
if (PrimZoneMap.find(primZone.getName()) == PrimZoneMap.end())
|
||||||
{
|
{
|
||||||
PrimZoneMap.insert(std::make_pair<std::string, NLLIGO::CPrimZone>(primZone.getName(), primZone));
|
PrimZoneMap.insert(std::make_pair(primZone.getName(), primZone));
|
||||||
nlinfo("Using PrimZone '%s'", primZone.getName().c_str());
|
nlinfo("Using PrimZone '%s'", primZone.getName().c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -89,7 +89,6 @@ void CSpawnBot::setVisualPropertiesName()
|
||||||
// the npc name is displayed as a fauna
|
// the npc name is displayed as a fauna
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CVisualPropertiesInterface::setName(dataSetRow(), name);
|
CVisualPropertiesInterface::setName(dataSetRow(), name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1566,3 +1566,5 @@ NLMISC_COMMAND(simulateMsgDespawnEasterEgg, "", "<service_id> <ai_instance> <eas
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "event_reaction_include.h"
|
||||||
|
|
|
@ -83,7 +83,7 @@ std::string CFightSelectFilter::toString() const
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CFightScriptComp *CFightSelectFilterReader::create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *CFightSelectFilterReader::create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
std::vector<std::string> params;
|
std::vector<std::string> params;
|
||||||
explodeSubStrings(inStr, params, -1);
|
explodeSubStrings(inStr, params, -1);
|
||||||
|
@ -151,7 +151,7 @@ public:
|
||||||
CFightOnceReader() {}
|
CFightOnceReader() {}
|
||||||
virtual ~CFightOnceReader() {}
|
virtual ~CFightOnceReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
vector<string> params;
|
vector<string> params;
|
||||||
explodeSubStrings(inStr, params, -1);
|
explodeSubStrings(inStr, params, -1);
|
||||||
|
@ -229,7 +229,7 @@ public:
|
||||||
CFightTimedFilterReader() {}
|
CFightTimedFilterReader() {}
|
||||||
virtual ~CFightTimedFilterReader() {}
|
virtual ~CFightTimedFilterReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
vector<string> params;
|
vector<string> params;
|
||||||
explodeSubStrings(inStr, params, -1);
|
explodeSubStrings(inStr, params, -1);
|
||||||
|
@ -302,7 +302,7 @@ public:
|
||||||
CFightHPLessFilterReader() {}
|
CFightHPLessFilterReader() {}
|
||||||
virtual ~CFightHPLessFilterReader() {}
|
virtual ~CFightHPLessFilterReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
vector<string> params;
|
vector<string> params;
|
||||||
explodeSubStrings(inStr, params, -1);
|
explodeSubStrings(inStr, params, -1);
|
||||||
|
@ -372,7 +372,7 @@ public:
|
||||||
CFightHPMoreFilterReader() {}
|
CFightHPMoreFilterReader() {}
|
||||||
virtual ~CFightHPMoreFilterReader() {}
|
virtual ~CFightHPMoreFilterReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
vector<string> params;
|
vector<string> params;
|
||||||
explodeSubStrings(inStr, params, -1);
|
explodeSubStrings(inStr, params, -1);
|
||||||
|
@ -443,7 +443,7 @@ public:
|
||||||
CFightRandomFilterReader() {}
|
CFightRandomFilterReader() {}
|
||||||
virtual ~CFightRandomFilterReader() {}
|
virtual ~CFightRandomFilterReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
vector<string> params;
|
vector<string> params;
|
||||||
explodeSubStrings(inStr, params, -1);
|
explodeSubStrings(inStr, params, -1);
|
||||||
|
@ -523,7 +523,7 @@ public:
|
||||||
CFightSendActionReader() {}
|
CFightSendActionReader() {}
|
||||||
virtual ~CFightSendActionReader() {}
|
virtual ~CFightSendActionReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
vector<string> strings;
|
vector<string> strings;
|
||||||
explodeSubStrings(inStr, strings, -1);
|
explodeSubStrings(inStr, strings, -1);
|
||||||
|
@ -588,7 +588,7 @@ public:
|
||||||
CFightSendSelfActionReader() {}
|
CFightSendSelfActionReader() {}
|
||||||
virtual ~CFightSendSelfActionReader() {}
|
virtual ~CFightSendSelfActionReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
vector<string> strings;
|
vector<string> strings;
|
||||||
explodeSubStrings(inStr, strings, -1);
|
explodeSubStrings(inStr, strings, -1);
|
||||||
|
@ -647,7 +647,7 @@ public:
|
||||||
CFightAggroBlockReader() {}
|
CFightAggroBlockReader() {}
|
||||||
virtual ~CFightAggroBlockReader() {}
|
virtual ~CFightAggroBlockReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
vector<string> strings;
|
vector<string> strings;
|
||||||
explodeSubStrings(inStr, strings, -1);
|
explodeSubStrings(inStr, strings, -1);
|
||||||
|
@ -705,7 +705,7 @@ public:
|
||||||
CFightAggroChangeReader() {}
|
CFightAggroChangeReader() {}
|
||||||
virtual ~CFightAggroChangeReader() {}
|
virtual ~CFightAggroChangeReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
return new CFightAggroChange();
|
return new CFightAggroChange();
|
||||||
}
|
}
|
||||||
|
@ -751,7 +751,7 @@ public:
|
||||||
CFightDamageCoefReader() {}
|
CFightDamageCoefReader() {}
|
||||||
virtual ~CFightDamageCoefReader() {}
|
virtual ~CFightDamageCoefReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
vector<string> strings;
|
vector<string> strings;
|
||||||
explodeSubStrings(inStr, strings, -1);
|
explodeSubStrings(inStr, strings, -1);
|
||||||
|
@ -818,7 +818,7 @@ public:
|
||||||
CFightGroupDamageCoefReader() {}
|
CFightGroupDamageCoefReader() {}
|
||||||
virtual ~CFightGroupDamageCoefReader() {}
|
virtual ~CFightGroupDamageCoefReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
vector<string> strings;
|
vector<string> strings;
|
||||||
explodeSubStrings(inStr, strings, -1);
|
explodeSubStrings(inStr, strings, -1);
|
||||||
|
@ -871,7 +871,7 @@ public:
|
||||||
CFightDamageSpeedCoefReader() {}
|
CFightDamageSpeedCoefReader() {}
|
||||||
virtual ~CFightDamageSpeedCoefReader() {}
|
virtual ~CFightDamageSpeedCoefReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
vector<string> strings;
|
vector<string> strings;
|
||||||
explodeSubStrings(inStr, strings, -1);
|
explodeSubStrings(inStr, strings, -1);
|
||||||
|
@ -933,7 +933,7 @@ public:
|
||||||
CFightSetRandomTargetReader() {}
|
CFightSetRandomTargetReader() {}
|
||||||
virtual ~CFightSetRandomTargetReader() {}
|
virtual ~CFightSetRandomTargetReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
vector<string> strings;
|
vector<string> strings;
|
||||||
explodeSubStrings(inStr, strings, -1);
|
explodeSubStrings(inStr, strings, -1);
|
||||||
|
@ -1003,7 +1003,7 @@ public:
|
||||||
CFightMultReader() {}
|
CFightMultReader() {}
|
||||||
virtual ~CFightMultReader() {}
|
virtual ~CFightMultReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException)
|
CFightScriptComp *create (const std::string &inStr)
|
||||||
{
|
{
|
||||||
vector<string> params;
|
vector<string> params;
|
||||||
explodeSubStrings(inStr, params, -1);
|
explodeSubStrings(inStr, params, -1);
|
||||||
|
@ -1066,7 +1066,7 @@ void CFightScript::add(CFightScriptCompReader *reader)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CFightScriptCompReader *CFightScriptCompReader::getScriptReader (const string &str) throw (ReadFightActionException)
|
CFightScriptCompReader *CFightScriptCompReader::getScriptReader (const string &str)
|
||||||
{
|
{
|
||||||
CFightScript::TFightScriptMap::iterator it=CFightScript::_ScriptCompList.find(str);
|
CFightScript::TFightScriptMap::iterator it=CFightScript::_ScriptCompList.find(str);
|
||||||
if (it==CFightScript::_ScriptCompList.end())
|
if (it==CFightScript::_ScriptCompList.end())
|
||||||
|
@ -1075,7 +1075,7 @@ CFightScriptCompReader *CFightScriptCompReader::getScriptReader (const string &s
|
||||||
return &(*(it->second));
|
return &(*(it->second));
|
||||||
}
|
}
|
||||||
|
|
||||||
CFightScriptComp *CFightScriptCompReader::createScriptComp (const string &str) throw (ReadFightActionException)
|
CFightScriptComp *CFightScriptCompReader::createScriptComp (const string &str)
|
||||||
{
|
{
|
||||||
string scriptCompName;
|
string scriptCompName;
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,14 +51,12 @@ public:
|
||||||
{}
|
{}
|
||||||
virtual ~CFightScriptCompReader()
|
virtual ~CFightScriptCompReader()
|
||||||
{}
|
{}
|
||||||
virtual CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) = 0;
|
virtual CFightScriptComp *create (const std::string &inStr) = 0;
|
||||||
virtual std::string getName () const =0;
|
virtual std::string getName () const =0;
|
||||||
|
|
||||||
static CFightScriptCompReader *getScriptReader (const std::string &str) throw (ReadFightActionException);
|
static CFightScriptCompReader *getScriptReader (const std::string &str);
|
||||||
|
|
||||||
static CFightScriptComp *createScriptComp (const std::string &str) throw (ReadFightActionException);
|
static CFightScriptComp *createScriptComp(const std::string &str);
|
||||||
protected:
|
|
||||||
private:
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,8 +72,6 @@ public:
|
||||||
typedef CHashMap<std::string, NLMISC::CSmartPtr<CFightScriptCompReader> > TFightScriptMap;
|
typedef CHashMap<std::string, NLMISC::CSmartPtr<CFightScriptCompReader> > TFightScriptMap;
|
||||||
|
|
||||||
static TFightScriptMap _ScriptCompList;
|
static TFightScriptMap _ScriptCompList;
|
||||||
protected:
|
|
||||||
private:
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,7 +112,7 @@ public:
|
||||||
CFightSelectFilterReader() {}
|
CFightSelectFilterReader() {}
|
||||||
virtual ~CFightSelectFilterReader() {}
|
virtual ~CFightSelectFilterReader() {}
|
||||||
|
|
||||||
CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException);
|
CFightScriptComp *create(const std::string &inStr);
|
||||||
std::string getName () const
|
std::string getName () const
|
||||||
{
|
{
|
||||||
return std::string("SELECT");
|
return std::string("SELECT");
|
||||||
|
|
|
@ -90,7 +90,7 @@ public:
|
||||||
// the following routine shouldn't be needed it should be superceded by a better alternative
|
// the following routine shouldn't be needed it should be superceded by a better alternative
|
||||||
// in the event manager
|
// in the event manager
|
||||||
template <class TState>
|
template <class TState>
|
||||||
bool testCompatibility(CStateInstance *const stateInstance, const TState *const state) const;
|
bool testCompatibility(CStateInstance *const stateInstance, const TState *const state) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// protected data ---------------------------------------------------
|
// protected data ---------------------------------------------------
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue