diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index a8efd9dfa..004dee0db 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -41,10 +41,6 @@ INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) # Force out of source builds. CHECK_OUT_OF_SOURCE() -# Variables which must be set before PROJECT -NL_SETUP_BUILD() -NL_SETUP_BUILD_FLAGS() - CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(RyzomCore CXX C) SET(NL_VERSION_MAJOR 0) @@ -52,6 +48,9 @@ SET(NL_VERSION_MINOR 8) SET(NL_VERSION_PATCH 0) SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}") +NL_SETUP_BUILD() +NL_SETUP_BUILD_FLAGS() + #----------------------------------------------------------------------------- # Redirect output files SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) @@ -101,8 +100,15 @@ IF(WIN32) # convert IDE fullpath to VC++ path STRING(REGEX REPLACE "Common7/IDE/.+" "VC" VC_DIR ${CMAKE_MAKE_PROGRAM}) ELSE(${CMAKE_MAKE_PROGRAM} MATCHES "Common7") - # convert compiler fullpath to VC++ path - STRING(REGEX REPLACE "VC/bin/.+" "VC" VC_DIR ${CMAKE_CXX_COMPILER}) + IF(${CMAKE_CXX_COMPILER} MATCHES "VC") + # convert compiler fullpath to VC++ path + STRING(REGEX REPLACE "VC/bin/.+" "VC" VC_DIR ${CMAKE_CXX_COMPILER}) + ELSE(${CMAKE_CXX_COMPILER} MATCHES "VC") + # Hack for Visual C++ 2010 + GET_FILENAME_COMPONENT(VC_ROOT_PATH "[HKEY_CURRENT_USER\\Software\\Microsoft\\VCExpress\\10.0_Config;InstallDir]" ABSOLUTE) + # convert IDE fullpath to VC++ path + STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${VC_ROOT_PATH}) + ENDIF(${CMAKE_CXX_COMPILER} MATCHES "VC") ENDIF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7") IF(WITH_MFC) @@ -119,6 +125,12 @@ IF(WITH_STATIC) # libxml2 could need winsock2 library SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC) SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${WINSOCK2_LIB}) + + # on Mac OS X libxml2 requieres iconv + IF(APPLE) + FIND_PACKAGE(Iconv REQUIRED) + SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES}) + ENDIF(APPLE) ENDIF(WITH_STATIC) IF(WITH_STLPORT) diff --git a/code/CMakeModules/FindCustomMFC.cmake b/code/CMakeModules/FindCustomMFC.cmake index e37936ef0..7dd87c15f 100644 --- a/code/CMakeModules/FindCustomMFC.cmake +++ b/code/CMakeModules/FindCustomMFC.cmake @@ -40,17 +40,12 @@ ENDIF(WITH_STLPORT OR NOT MFC_FOUND) # Only if using a custom path IF(CUSTOM_MFC_DIR) - IF(NOT CMAKE_SIZEOF_VOID_P) - INCLUDE (CheckTypeSize) - CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P) - ENDIF(NOT CMAKE_SIZEOF_VOID_P) - # Using 32 or 64 bits libraries - IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + IF(TARGET_X64) SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib/amd64") - ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) + ELSE(TARGET_X64) SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib") - ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) + ENDIF(TARGET_X64) # Add MFC libraries directory to default library path LINK_DIRECTORIES(${MFC_LIBRARY_DIR}) diff --git a/code/CMakeModules/FindDirectXSDK.cmake b/code/CMakeModules/FindDirectXSDK.cmake index d21261b95..1f832cf95 100644 --- a/code/CMakeModules/FindDirectXSDK.cmake +++ b/code/CMakeModules/FindDirectXSDK.cmake @@ -30,16 +30,11 @@ ENDMACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME) IF(DXSDK_DIR) SET(DXSDK_INCLUDE_DIR "${DXSDK_DIR}/Include") - IF(NOT CMAKE_SIZEOF_VOID_P) - INCLUDE (CheckTypeSize) - CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P) - ENDIF(NOT CMAKE_SIZEOF_VOID_P) - - IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + IF(TARGET_X64) SET(DXSDK_LIBRARY_DIR "${DXSDK_DIR}/Lib/x64") - ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) + ELSE(TARGET_X64) SET(DXSDK_LIBRARY_DIR "${DXSDK_DIR}/Lib/x86") - ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) + ENDIF(TARGET_X64) FIND_DXSDK_LIBRARY(DXSDK_GUID_LIBRARY dxguid) FIND_DXSDK_LIBRARY(DXSDK_DINPUT_LIBRARY dinput8) @@ -59,7 +54,7 @@ ENDIF(DXSDK_DIR) # all listed variables are TRUE. INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(DIRECTXSDK DEFAULT_MSG DXSDK_DIR DXSDK_GUID_LIBRARY DXSDK_DINPUT_LIBRARY) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(DirectXSDK DEFAULT_MSG DXSDK_DIR DXSDK_GUID_LIBRARY DXSDK_DINPUT_LIBRARY) MARK_AS_ADVANCED(DXSDK_INCLUDE_DIR DXSDK_GUID_LIBRARY diff --git a/code/CMakeModules/FindExternal.cmake b/code/CMakeModules/FindExternal.cmake index 3ca7774ba..436997d99 100644 --- a/code/CMakeModules/FindExternal.cmake +++ b/code/CMakeModules/FindExternal.cmake @@ -7,7 +7,7 @@ # EXTERNAL_FOUND - True if the external libraries are available SET(EXTERNAL_TEMP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external ${CMAKE_CURRENT_SOURCE_DIR}/../external ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty ${EXTERNAL_PATH}) -SET(EXTERNAL_TEMP_FILE "include/png.h") +SET(EXTERNAL_TEMP_FILE "include/zlib.h") SET(EXTERNAL_NAME "external") # If using STLport preprend external_stlport @@ -17,36 +17,35 @@ IF(WITH_STLPORT) SET(EXTERNAL_NAME "external with STLport") ENDIF(WITH_STLPORT) -SET(EXTERNAL_FOUND FALSE) -FOREACH(ITEM ${EXTERNAL_TEMP_PATH}) - IF(EXISTS "${ITEM}/${EXTERNAL_TEMP_FILE}" AND NOT EXTERNAL_FOUND) - SET(EXTERNAL_FOUND TRUE) - # Get absolute path to avoid .. - GET_FILENAME_COMPONENT(ITEM ${ITEM} ABSOLUTE) - SET(EXTERNAL_PATH ${ITEM} CACHE PATH "" FORCE) - ENDIF(EXISTS "${ITEM}/${EXTERNAL_TEMP_FILE}" AND NOT EXTERNAL_FOUND) -ENDFOREACH(ITEM ${EXTERNAL_TEMP_PATH}) +FIND_PATH(EXTERNAL_PATH + ${EXTERNAL_TEMP_FILE} + PATHS + $ENV{EXTERNAL_PATH} + ${EXTERNAL_TEMP_PATH} + /usr/local + /usr + /sw + /opt/local + /opt/csw + /opt +) -IF(EXTERNAL_FOUND) +IF(EXTERNAL_PATH) + SET(EXTERNAL_FOUND TRUE) SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include") - IF(NOT CMAKE_SIZEOF_VOID_P) - INCLUDE (CheckTypeSize) - CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P) - ENDIF(NOT CMAKE_SIZEOF_VOID_P) - # Using 32 or 64 bits libraries - IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + IF(TARGET_X64) SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib64") - ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) + ELSE(TARGET_X64) SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib") - ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) + ENDIF(TARGET_X64) SET(CMAKE_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH};${CMAKE_INCLUDE_PATH}") # Stupid hack for FindOpenAL.cmake SET(CMAKE_INCLUDE_PATH "${EXTERNAL_PATH};${CMAKE_INCLUDE_PATH}") SET(CMAKE_LIBRARY_PATH "${EXTERNAL_LIBRARY_PATH};${CMAKE_LIBRARY_PATH}") -ENDIF(EXTERNAL_FOUND) +ENDIF(EXTERNAL_PATH) IF(EXTERNAL_FOUND) IF(NOT External_FIND_QUIETLY) diff --git a/code/CMakeModules/FindIconv.cmake b/code/CMakeModules/FindIconv.cmake new file mode 100644 index 000000000..5e9e48250 --- /dev/null +++ b/code/CMakeModules/FindIconv.cmake @@ -0,0 +1,83 @@ +# - Try to find Iconv on Mac OS X +# Once done this will define +# +# ICONV_FOUND - system has Iconv +# ICONV_INCLUDE_DIR - the Iconv include directory +# ICONV_LIBRARIES - Link these to use Iconv +# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const +# + +IF(APPLE) + include(CheckCCompilerFlag) + include(CheckCSourceCompiles) + + IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + # Already in cache, be silent + SET(ICONV_FIND_QUIETLY TRUE) + ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + + IF(APPLE) + FIND_PATH(ICONV_INCLUDE_DIR iconv.h + PATHS + /opt/local/include/ + NO_CMAKE_SYSTEM_PATH + ) + + FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c + PATHS + /opt/local/lib/ + NO_CMAKE_SYSTEM_PATH + ) + ENDIF(APPLE) + + FIND_PATH(ICONV_INCLUDE_DIR iconv.h PATHS /opt/local/include /sw/include) + + string(REGEX REPLACE "(.*)/include/?" "\\1" ICONV_INCLUDE_BASE_DIR "${ICONV_INCLUDE_DIR}") + + FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c HINTS "${ICONV_INCLUDE_BASE_DIR}/lib" PATHS /opt/local/lib) + + IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + SET(ICONV_FOUND TRUE) + ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + + set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) + set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) + IF(ICONV_FOUND) + check_c_compiler_flag("-Werror" ICONV_HAVE_WERROR) + set (CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}") + if(ICONV_HAVE_WERROR) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + endif(ICONV_HAVE_WERROR) + check_c_source_compiles(" + #include + int main(){ + iconv_t conv = 0; + const char* in = 0; + size_t ilen = 0; + char* out = 0; + size_t olen = 0; + iconv(conv, &in, &ilen, &out, &olen); + return 0; + } + " ICONV_SECOND_ARGUMENT_IS_CONST ) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") + ENDIF(ICONV_FOUND) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) + + IF(ICONV_FOUND) + IF(NOT ICONV_FIND_QUIETLY) + MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}") + ENDIF(NOT ICONV_FIND_QUIETLY) + ELSE(ICONV_FOUND) + IF(Iconv_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Iconv") + ENDIF(Iconv_FIND_REQUIRED) + ENDIF(ICONV_FOUND) + + MARK_AS_ADVANCED( + ICONV_INCLUDE_DIR + ICONV_LIBRARIES + ICONV_SECOND_ARGUMENT_IS_CONST + ) +ENDIF(APPLE) diff --git a/code/CMakeModules/FindLuabind.cmake b/code/CMakeModules/FindLuabind.cmake index b73530ef5..c94a61e30 100644 --- a/code/CMakeModules/FindLuabind.cmake +++ b/code/CMakeModules/FindLuabind.cmake @@ -6,7 +6,7 @@ IF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR) # in cache already - SET(LUABIND_FIND_QUIETLY TRUE) + SET(Luabind_FIND_QUIETLY TRUE) ENDIF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR) FIND_PATH(LUABIND_INCLUDE_DIR @@ -22,7 +22,7 @@ FIND_PATH(LUABIND_INCLUDE_DIR ) SET(LIBRARY_NAME_RELEASE luabind libluabind) -SET(LIBRARY_NAME_DEBUG luabind_d libluabind_d libluabindd) +SET(LIBRARY_NAME_DEBUG luabind_d luabindd libluabind_d libluabindd) IF(WITH_STLPORT) SET(LIBRARY_NAME_RELEASE luabind_stlport ${LIBRARY_NAME_RELEASE}) @@ -62,30 +62,35 @@ FIND_LIBRARY(LUABIND_LIBRARY_DEBUG FIND_PACKAGE(Boost REQUIRED) IF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR) - IF(LUABIND_LIBRARY_RELEASE) + IF(LUABIND_LIBRARY_RELEASE AND LUABIND_LIBRARY_DEBUG) + # Case where both Release and Debug versions are provided SET(LUABIND_FOUND TRUE) - SET(LUABIND_INCLUDE_DIR ${LUABIND_INCLUDE_DIR} ${Boost_INCLUDE_DIR}) - IF(LUABIND_LIBRARY_DEBUG) - SET(LUABIND_LIBRARIES "optimized;${LUABIND_LIBRARY_RELEASE};debug;${LUABIND_LIBRARY_DEBUG}") - ELSE(LUABIND_LIBRARY_DEBUG) - SET(LUABIND_LIBRARIES "${LUABIND_LIBRARY_RELEASE}") - ENDIF(LUABIND_LIBRARY_DEBUG) - ENDIF(LUABIND_LIBRARY_RELEASE) + SET(LUABIND_LIBRARIES optimized ${LUABIND_LIBRARY_RELEASE} debug ${LUABIND_LIBRARY_DEBUG}) + ELSEIF(LUABIND_LIBRARY_RELEASE) + # Normal case + SET(LUABIND_FOUND TRUE) + SET(LUABIND_LIBRARIES ${LUABIND_LIBRARY_RELEASE}) + ELSEIF(LUABIND_LIBRARY_DEBUG) + # Case where Luabind is compiled from sources (debug version is compiled by default) + SET(LUABIND_FOUND TRUE) + SET(LUABIND_LIBRARIES ${LUABIND_LIBRARY_DEBUG}) + ENDIF(LUABIND_LIBRARY_RELEASE AND LUABIND_LIBRARY_DEBUG) ENDIF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR) IF(LUABIND_FOUND) + SET(LUABIND_INCLUDE_DIR ${LUABIND_INCLUDE_DIR} ${Boost_INCLUDE_DIR}) # Check if luabind/version.hpp exists FIND_FILE(LUABIND_VERSION_FILE luabind/version.hpp PATHS ${LUABIND_INCLUDE_DIR}) IF(LUABIND_VERSION_FILE) SET(LUABIND_DEFINITIONS "-DHAVE_LUABIND_VERSION") ENDIF(LUABIND_VERSION_FILE) - IF(NOT LUABIND_FIND_QUIETLY) + IF(NOT Luabind_FIND_QUIETLY) MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARIES}") - ENDIF(NOT LUABIND_FIND_QUIETLY) + ENDIF(NOT Luabind_FIND_QUIETLY) ELSE(LUABIND_FOUND) - IF(NOT LUABIND_FIND_QUIETLY) + IF(NOT Luabind_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find Luabind!") - ENDIF(NOT LUABIND_FIND_QUIETLY) + ENDIF(NOT Luabind_FIND_QUIETLY) ENDIF(LUABIND_FOUND) MARK_AS_ADVANCED(LUABIND_LIBRARY_RELEASE LUABIND_LIBRARY_DEBUG Boost_LIB_DIAGNOSTIC_DEFINITIONS) diff --git a/code/CMakeModules/FindSTLport.cmake b/code/CMakeModules/FindSTLport.cmake index a235d42f3..22e0745ba 100644 --- a/code/CMakeModules/FindSTLport.cmake +++ b/code/CMakeModules/FindSTLport.cmake @@ -71,9 +71,9 @@ IF(STLPORT_INCLUDE_DIR) IF(STLPORT_LIBRARY_RELEASE) SET(STLPORT_FOUND TRUE) - SET(STLPORT_LIBRARIES "optimized;${STLPORT_LIBRARY_RELEASE}") + SET(STLPORT_LIBRARIES ${STLPORT_LIBRARY_RELEASE}) IF(STLPORT_LIBRARY_DEBUG) - SET(STLPORT_LIBRARIES "${STLPORT_LIBRARIES};debug;${STLPORT_LIBRARY_DEBUG}") + SET(STLPORT_LIBRARIES optimized ${STLPORT_LIBRARIES} debug ${STLPORT_LIBRARY_DEBUG}) ENDIF(STLPORT_LIBRARY_DEBUG) ENDIF(STLPORT_LIBRARY_RELEASE) ENDIF(STLPORT_INCLUDE_DIR) diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index 04059a6a5..30e507f85 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -9,17 +9,32 @@ IF(WINSDK_INCLUDE_DIR) SET(WINSDK_FIND_QUIETLY TRUE) ENDIF(WINSDK_INCLUDE_DIR) +GET_FILENAME_COMPONENT(WINSDK71_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;InstallationFolder]" ABSOLUTE CACHE) +GET_FILENAME_COMPONENT(WINSDK71_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;ProductVersion]" NAME) + +IF(WINSDK71_DIR) + IF(NOT WINSDK_FIND_QUIETLY) + MESSAGE(STATUS "Found Windows SDK ${WINSDK71_VERSION} in ${WINSDK71_DIR}") + ENDIF(NOT WINSDK_FIND_QUIETLY) +ENDIF(WINSDK71_DIR) + +GET_FILENAME_COMPONENT(WINSDKCURRENT_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE) +GET_FILENAME_COMPONENT(WINSDKCURRENT_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentVersion]" NAME) + +IF(WINSDKCURRENT_DIR) + IF(NOT WINSDK_FIND_QUIETLY) + MESSAGE(STATUS "Found Windows SDK ${WINSDKCURRENT_VERSION} in ${WINSDKCURRENT_DIR}") + ENDIF(NOT WINSDK_FIND_QUIETLY) +ENDIF(WINSDKCURRENT_DIR) + FIND_PATH(WINSDK_INCLUDE_DIR Windows.h PATHS - "[HKEY_CURRENT_USER\\Software\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]/Include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]/Include" + ${WINSDK71_DIR}/Include + ${WINSDKCURRENT_DIR}/Include ) IF(WINSDK_INCLUDE_DIR) SET(WINSDK_FOUND TRUE) - IF(NOT WINSDK_FIND_QUIETLY) - MESSAGE(STATUS "Found Windows SDK.") - ENDIF(NOT WINSDK_FIND_QUIETLY) ELSE(WINSDK_INCLUDE_DIR) IF(NOT WINSDK_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find Windows SDK!") diff --git a/code/CMakeModules/FindZLIB.cmake b/code/CMakeModules/FindZLIB.cmake deleted file mode 100644 index cb055740e..000000000 --- a/code/CMakeModules/FindZLIB.cmake +++ /dev/null @@ -1,39 +0,0 @@ -# - Find zlib -# Find the native ZLIB includes and library -# -# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc. -# ZLIB_LIBRARIES - List of libraries when using zlib. -# ZLIB_FOUND - True if zlib found. - -#============================================================================= -# Copyright 2001-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distributed this file outside of CMake, substitute the full -# License text for the above reference.) - -IF (ZLIB_INCLUDE_DIR) - # Already in cache, be silent - SET(ZLIB_FIND_QUIETLY TRUE) -ENDIF (ZLIB_INCLUDE_DIR) - -FIND_PATH(ZLIB_INCLUDE_DIR zlib.h) - -SET(ZLIB_NAMES z zlib zdll) -FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ) -MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR ) - -# Per-recommendation -SET(ZLIB_INCLUDE_DIRS "${ZLIB_INCLUDE_DIR}") -SET(ZLIB_LIBRARIES "${ZLIB_LIBRARY}") - -# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS) diff --git a/code/CMakeModules/PCHSupport.cmake b/code/CMakeModules/PCHSupport.cmake index 74d009864..7bd202d0d 100644 --- a/code/CMakeModules/PCHSupport.cmake +++ b/code/CMakeModules/PCHSupport.cmake @@ -45,8 +45,6 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags) IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY) LIST(APPEND ${_out_compile_flags} "-fPIC") ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY) - ELSE(CMAKE_COMPILER_IS_GNUCXX) - ## TODO ... ? or does it work out of the box ENDIF(CMAKE_COMPILER_IS_GNUCXX) GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES ) @@ -115,6 +113,11 @@ MACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input _output) ENDMACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input) MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use ) + GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) + IF(${oldProps} MATCHES NOTFOUND) + SET(oldProps "") + ENDIF(${oldProps} MATCHES NOTFOUND) + IF(CMAKE_COMPILER_IS_GNUCXX) # to do: test whether compiler flags match between target _targetName # and _pch_output_to_use @@ -123,19 +126,15 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use ) # for use with distcc and gcc >4.0.1 if preprocessed files are accessible # on all remote machines set # PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess - SET(_target_cflags "${PCH_ADDITIONAL_COMPILER_FLAGS}-include ${_input} -Winvalid-pch") + SET(_target_cflags "${oldProps} ${PCH_ADDITIONAL_COMPILER_FLAGS}-include ${_input} -Winvalid-pch") ELSE(CMAKE_COMPILER_IS_GNUCXX) IF(MSVC) - GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) - IF(${oldProps} MATCHES NOTFOUND) - SET(oldProps "") - ENDIF(${oldProps} MATCHES NOTFOUND) - SET(_target_cflags "${oldProps} /Yu\"${_input}\" /FI\"${_input}\" /Fp\"${_pch_output_to_use}\"") ENDIF(MSVC) ENDIF(CMAKE_COMPILER_IS_GNUCXX) SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_target_cflags}) + SET_TARGET_PROPERTIES(${_targetName}_pch_dephelp PROPERTIES COMPILE_FLAGS ${_target_cflags}) ADD_CUSTOM_TARGET(pch_Generate_${_targetName} DEPENDS ${_pch_output_to_use}) ADD_DEPENDENCIES(${_targetName} pch_Generate_${_targetName}) ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index cf6154648..220e4132d 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -37,16 +37,17 @@ ENDMACRO(NL_TARGET_DRIVER) # Argument: ### MACRO(NL_DEFAULT_PROPS name label) + IF(NOT MSVC10) + SET_TARGET_PROPERTIES(${name} PROPERTIES PROJECT_LABEL ${label}) + ENDIF(NOT MSVC10) GET_TARGET_PROPERTY(type ${name} TYPE) IF(${type} STREQUAL SHARED_LIBRARY) # Set versions only if target is a shared library SET_TARGET_PROPERTIES(${name} PROPERTIES - VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR} - INSTALL_NAME_DIR ${NL_LIB_PREFIX} - PROJECT_LABEL ${label}) - ELSE(${type} STREQUAL SHARED_LIBRARY) - SET_TARGET_PROPERTIES(${name} PROPERTIES - PROJECT_LABEL ${label}) + VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR}) + IF(NL_LIB_PREFIX) + SET_TARGET_PROPERTIES(${name} PROPERTIES INSTALL_NAME_DIR ${NL_LIB_PREFIX}) + ENDIF(NL_LIB_PREFIX) ENDIF(${type} STREQUAL SHARED_LIBRARY) IF(WITH_STLPORT AND WIN32) SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "/X") @@ -287,19 +288,56 @@ MACRO(NL_SETUP_BUILD) ENDIF(CMAKE_BUILD_TYPE MATCHES "Release") ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug") + # Determine target CPU +# IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86") + IF(NOT CMAKE_SIZEOF_VOID_P) + INCLUDE (CheckTypeSize) + CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P) + ENDIF(NOT CMAKE_SIZEOF_VOID_P) + + # Using 32 or 64 bits libraries + SET(TARGET_X86 1) + IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(ARCH "x86_64") + SET(TARGET_X64 1) + ADD_DEFINITIONS(-DHAVE_X86_64) + ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(ARCH "x86") + ADD_DEFINITIONS(-DHAVE_X86) + ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) +# ADD_DEFINITIONS(-DHAVE_IA64) +# ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86") + IF(WIN32) - # don't use a /O[012x] flag if you want custom optimizations - SET(SPEED_OPTIMIZATIONS "/Ob2 /Oi /Ot /Oy /GT /GF /GS-") - # without inlining it's unusable, use custom optimizations again - SET(MIN_OPTIMIZATIONS "/Ob1") + IF(MSVC10) + # /Ox is working with VC++ 2010, but custom optimizations don't exist + SET(SPEED_OPTIMIZATIONS "/Ox /GF /GS-") + # without inlining it's unusable, use custom optimizations again + SET(MIN_OPTIMIZATIONS "/Od /Ob1") + ELSE(MSVC10) + # don't use a /O[012x] flag if you want custom optimizations + SET(SPEED_OPTIMIZATIONS "/Ob2 /Oi /Ot /Oy /GT /GF /GS-") + # without inlining it's unusable, use custom optimizations again + SET(MIN_OPTIMIZATIONS "/Ob1") + ENDIF(MSVC10) - SET(PLATFORM_CFLAGS "/D_CRT_SECURE_NO_WARNINGS /DWIN32 /D_WINDOWS /W3 /Zi /Zm1000") - - # Exceptions are only set for C++ - SET(PLATFORM_CXXFLAGS "${PLATFORM_CFLAGS} /EHa") + SET(PLATFORM_CFLAGS "/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /W3 /Zi /Zm1000 /MP /Gy-") # Common link flags SET(PLATFORM_LINKFLAGS "-DEBUG") + + IF(TARGET_X64) + # Fix a bug with Intellisense + SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} /D_WIN64") + # Fix a compilation error for some big C++ files + SET(MIN_OPTIMIZATIONS "${MIN_OPTIMIZATIONS} /bigobj") + ELSE(TARGET_X64) + # Allows 32 bits applications to use 3 GB of RAM + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /LARGEADDRESSAWARE") + ENDIF(TARGET_X64) + + # Exceptions are only set for C++ + SET(PLATFORM_CXXFLAGS "${PLATFORM_CFLAGS} /EHa") SET(NL_DEBUG_CFLAGS "/MDd /RTC1 /D_DEBUG ${MIN_OPTIMIZATIONS}") SET(NL_RELEASE_CFLAGS "/MD /D NDEBUG ${SPEED_OPTIMIZATIONS}") @@ -323,33 +361,10 @@ MACRO(NL_SETUP_BUILD) SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -D_DEBUG") SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O6") - ENDIF(WIN32) - - # Determine host CPU - IF(UNIX AND NOT WIN32) - FIND_PROGRAM(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin ) - IF(CMAKE_UNAME) - EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR) - SET(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL "processor type (i386 and x86_64)") - IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - ADD_DEFINITIONS(-DHAVE_X86_64) - ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64") - ADD_DEFINITIONS(-DHAVE_IA64) - ELSE(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - ADD_DEFINITIONS(-DHAVE_X86) - ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - ELSE(CMAKE_UNAME) # Assume that if uname is not found that we're x86. - ADD_DEFINITIONS(-DHAVE_X86) - ENDIF(CMAKE_UNAME) - ENDIF(UNIX AND NOT WIN32) - ENDMACRO(NL_SETUP_BUILD) MACRO(NL_SETUP_BUILD_FLAGS) - #SET(CMAKE_DEBUG_POSTFIX "_d") - #SET(CMAKE_RELEASE_POSTFIX "_r") - SET(CMAKE_C_FLAGS ${PLATFORM_CFLAGS} CACHE STRING "" FORCE) SET(CMAKE_CXX_FLAGS ${PLATFORM_CXXFLAGS} CACHE STRING "" FORCE) diff --git a/code/nel/include/nel/misc/debug.h b/code/nel/include/nel/misc/debug.h index f794e6fca..af92c4a16 100644 --- a/code/nel/include/nel/misc/debug.h +++ b/code/nel/include/nel/misc/debug.h @@ -169,7 +169,7 @@ void setCrashAlreadyReported(bool state); *\endcode */ #ifdef NL_NO_DEBUG -# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # define nldebug __noop # else # define nldebug 0&& @@ -184,7 +184,7 @@ void setCrashAlreadyReported(bool state); * Same as nldebug but it will be display in debug and in release mode. */ #ifdef NL_NO_DEBUG -# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # define nlinfo __noop # else # define nlinfo 0&& @@ -212,7 +212,7 @@ void setCrashAlreadyReported(bool state); */ #ifdef NL_NO_DEBUG -# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # define nlwarning __noop # else # define nlwarning 0&& @@ -583,7 +583,11 @@ template inline T type_cast(U o) /** Compile time assertion */ -#define nlctassert(cond) sizeof(uint[(cond) ? 1 : 0]) +#ifdef NL_ISO_CPP0X_AVAILABLE +# define nlctassert(cond) static_assert(cond, "Compile time assert in "#cond) +#else +# define nlctassert(cond) sizeof(uint[(cond) ? 1 : 0]) +#endif /** * Allow to verify an object was accessed before its destructor call. diff --git a/code/nel/include/nel/misc/sha1.h b/code/nel/include/nel/misc/sha1.h index 6a32d47e3..d0bee0cd9 100644 --- a/code/nel/include/nel/misc/sha1.h +++ b/code/nel/include/nel/misc/sha1.h @@ -105,4 +105,7 @@ CHashKey getSHA1(const std::string &filename, bool forcePath = false); // This function get a buffer with size and returns his SHA hash key CHashKey getSHA1(const uint8 *buffer, uint32 size); +// This function get a buffer and key with size and returns his HMAC-SHA1 hash key +CHashKey getHMacSHA1(const uint8 *text, uint32 text_len, const uint8 *key, uint32 key_len); + #endif // NL_SHA1_H diff --git a/code/nel/include/nel/misc/smart_ptr.h b/code/nel/include/nel/misc/smart_ptr.h index 50fbf4a4a..81b5c0e75 100644 --- a/code/nel/include/nel/misc/smart_ptr.h +++ b/code/nel/include/nel/misc/smart_ptr.h @@ -352,7 +352,7 @@ public: } }; -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) // This operator only purpose is to compare with NULL value template diff --git a/code/nel/include/nel/misc/sstring.h b/code/nel/include/nel/misc/sstring.h index 7b4fa717d..513c681c9 100644 --- a/code/nel/include/nel/misc/sstring.h +++ b/code/nel/include/nel/misc/sstring.h @@ -945,10 +945,13 @@ inline CSString operator+(const char* s0,const CSString& s1) return CSString(s0)+s1; } +#ifndef NL_COMP_VC10 +// TODO: check if it can be disabled for other compilers too inline CSString operator+(const std::string& s0,const CSString& s1) { return s0+static_cast(s1); } +#endif // NL_COMP_VC10 } // NLMISC diff --git a/code/nel/include/nel/misc/types_nl.h b/code/nel/include/nel/misc/types_nl.h index 04b56f63e..08db88924 100644 --- a/code/nel/include/nel/misc/types_nl.h +++ b/code/nel/include/nel/misc/types_nl.h @@ -51,14 +51,10 @@ # ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0500 // Minimal OS = Windows 2000 (NeL is not supported on Windows 95/98) # endif -# if _MSC_VER >= 1500 +# if _MSC_VER >= 1600 +# define NL_COMP_VC10 +# elif _MSC_VER >= 1500 # define NL_COMP_VC9 -# ifndef _STLPORT_VERSION // STLport doesn't depend on MS STL features -# if defined(_HAS_TR1) && (_HAS_TR1 + 0) // VC9 TR1 feature pack -# define NL_ISO_STDTR1_AVAILABLE -# define NL_ISO_STDTR1_HEADER(header)
-# endif -# endif # elif _MSC_VER >= 1400 # define NL_COMP_VC8 # undef nl_time @@ -79,6 +75,10 @@ # define NL_COMP_VC6 # define NL_COMP_NEED_PARAM_ON_METHOD # endif +# if defined(_HAS_TR1) && (_HAS_TR1 + 0) // VC9 TR1 feature pack or later +# define NL_ISO_STDTR1_AVAILABLE +# define NL_ISO_STDTR1_HEADER(header)
+# endif # ifdef _DEBUG # define NL_DEBUG # elif defined (NDEBUG) @@ -117,6 +117,10 @@ # define NL_COMP_GCC #endif +#if defined(_HAS_CPP0X) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define NL_ISO_CPP0X_AVAILABLE +#endif + // gcc 3.4 introduced ISO C++ with tough template rules // // NL_ISO_SYNTAX can be used using #if NL_ISO_SYNTAX or #if !NL_ISO_SYNTAX @@ -149,7 +153,7 @@ # pragma warning (disable : 4390) // don't warn in empty block "if(exp) ;" # pragma warning (disable : 4996) // 'vsnprintf': This function or variable may be unsafe. Consider using vsnprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. // Debug : Sept 01 2006 -# if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +# if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # pragma warning (disable : 4005) // don't warn on redefinitions caused by xp platform sdk # endif // NL_COMP_VC8 || NL_COMP_VC9 #endif // NL_OS_WINDOWS @@ -287,20 +291,18 @@ typedef unsigned int uint; // at least 32bits (depend of processor) #define __STDC_FORMAT_MACROS #include -#ifdef NL_OS_MAC -#define NL_I64 __PRI_64_LENGTH_MODIFIER__ +#if defined(__PRI_64_LENGTH_MODIFIER__) +# define NL_I64 __PRI_64_LENGTH_MODIFIER__ +#elif defined(__PRI64_PREFIX) +# define NL_I64 __PRI64_PREFIX #else -#define NL_I64 __PRI64_PREFIX +# ifdef _LP64 +# define NL_I64 "l" +# else +# define NL_I64 "ll" +# endif // _LP64 #endif -/* -#ifdef _LP64 -# define NL_I64 "l" -#else -# define NL_I64 "ll" -#endif // _LP64 -*/ - #endif // NL_OS_UNIX // CHashMap, CHashSet and CHashMultiMap definitions @@ -364,7 +366,7 @@ typedef uint16 ucchar; // To define a 64bits constant; ie: UINT64_CONSTANT(0x123456781234) #ifdef NL_OS_WINDOWS -# if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +# if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # define INT64_CONSTANT(c) (c##LL) # define SINT64_CONSTANT(c) (c##LL) # define UINT64_CONSTANT(c) (c##LL) diff --git a/code/nel/samples/3d/font/main.cpp b/code/nel/samples/3d/font/main.cpp index 1a417cae7..e834c4620 100644 --- a/code/nel/samples/3d/font/main.cpp +++ b/code/nel/samples/3d/font/main.cpp @@ -42,7 +42,6 @@ using namespace std; using namespace NL3D; using namespace NLMISC; - #ifdef NL_OS_WINDOWS int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, @@ -139,7 +138,7 @@ int main(int argc, char **argv) tc.setScaleX (scale); tc.setScaleZ (scale); tc.printAt (0.1f, 0.3f, string("printAt Scale String")); - + // display the same string with no scale tc.setHotSpot (CComputedString::TopLeft); tc.setScaleX (1.0f); diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp index 8a9e864cc..a4ccb437a 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp @@ -318,7 +318,7 @@ bool CDriverD3D::setupMaterial(CMaterial &mat) if (!mat._MatDrvInfo) { // Insert into driver list. (so it is deleted when driver is deleted). - ItMatDrvInfoPtrList it= _MatDrvInfos.insert(_MatDrvInfos.end(), NULL); + ItMatDrvInfoPtrList it= _MatDrvInfos.insert(_MatDrvInfos.end(), (NL3D::IMaterialDrvInfos*)NULL); *it = mat._MatDrvInfo = new CMaterialDrvInfosD3D(this, it); diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp index 445b52451..5f1c1bc43 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp @@ -347,7 +347,7 @@ bool CDriverD3D::activeShader(CShader *shd) if ( !shd->_DrvInfo ) { // insert into driver list. (so it is deleted when driver is deleted). - ItShaderDrvInfoPtrList it= _ShaderDrvInfos.insert(_ShaderDrvInfos.end(), NULL); + ItShaderDrvInfoPtrList it= _ShaderDrvInfos.insert(_ShaderDrvInfos.end(), (NL3D::IShaderDrvInfos*)NULL); // create and set iterator, for future deletion. shaderInfo = new CShaderDrvInfosD3D(this, it); *it= shd->_DrvInfo = shaderInfo; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp index 0c10a3eb8..94615628b 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp @@ -514,7 +514,7 @@ bool CDriverD3D::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded if ( !tex.TextureDrvShare ) { // insert into driver list. (so it is deleted when driver is deleted). - ItTexDrvSharePtrList it= _TexDrvShares.insert(_TexDrvShares.end(), NULL); + ItTexDrvSharePtrList it= _TexDrvShares.insert(_TexDrvShares.end(), (NL3D::CTextureDrvShare*)NULL); // create and set iterator, for future deletion. *it= tex.TextureDrvShare= new CTextureDrvShare(this, it, &tex); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp index 9dd08a51f..9a2d6c596 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp @@ -35,10 +35,18 @@ static void convBlend(CMaterial::TBlend blend, GLenum& glenum) case CMaterial::srccolor: glenum=GL_SRC_COLOR; break; case CMaterial::invsrccolor:glenum=GL_ONE_MINUS_SRC_COLOR; break; // Extended Blend modes. +#ifdef USE_OPENGLES + case CMaterial::blendConstantColor: glenum=GL_CONSTANT_COLOR; break; + case CMaterial::blendConstantInvColor: glenum=GL_ONE_MINUS_CONSTANT_COLOR; break; + case CMaterial::blendConstantAlpha: glenum=GL_CONSTANT_ALPHA; break; + case CMaterial::blendConstantInvAlpha: glenum=GL_ONE_MINUS_CONSTANT_ALPHA; break; +#else case CMaterial::blendConstantColor: glenum=GL_CONSTANT_COLOR_EXT; break; case CMaterial::blendConstantInvColor: glenum=GL_ONE_MINUS_CONSTANT_COLOR_EXT; break; case CMaterial::blendConstantAlpha: glenum=GL_CONSTANT_ALPHA_EXT; break; case CMaterial::blendConstantInvAlpha: glenum=GL_ONE_MINUS_CONSTANT_ALPHA_EXT; break; +#endif + default: nlstop; } } @@ -242,7 +250,9 @@ void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr< if (glAddrMode != _CurrentTexAddrMode[stage]) // addressing mode different from the one in the device? { _DriverGLStates.activeTextureARB(stage); +#ifndef USE_OPENGLES glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, glAddrMode); +#endif _CurrentTexAddrMode[stage] = glAddrMode; } } @@ -266,7 +276,7 @@ bool CDriverGL::setupMaterial(CMaterial& mat) if (!mat._MatDrvInfo) { // insert into driver list. (so it is deleted when driver is deleted). - ItMatDrvInfoPtrList it= _MatDrvInfos.insert(_MatDrvInfos.end(), NULL); + ItMatDrvInfoPtrList it= _MatDrvInfos.insert(_MatDrvInfos.end(), (NL3D::IMaterialDrvInfos*)NULL); // create and set iterator, for future deletion. *it= mat._MatDrvInfo= new CShaderGL(this, it); @@ -1971,7 +1981,9 @@ void CDriverGL::endCloudMultiPass() nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud); if (ATICloudShaderHandle) { +#ifndef USE_OPENGLES glDisable(GL_FRAGMENT_SHADER_ATI); +#endif } } @@ -1989,7 +2001,9 @@ sint CDriverGL::beginWaterMultiPass() */ void CDriverGL::setupWaterPassR200(const CMaterial &mat) { - H_AUTO_OGL(CDriverGL_setupWaterPassR200) + H_AUTO_OGL(CDriverGL_setupWaterPassR200); + +#ifndef USE_OPENGLES uint k; ITexture *tex = mat.getTexture(0); if (tex) @@ -2061,6 +2075,7 @@ void CDriverGL::setupWaterPassR200(const CMaterial &mat) float cst[4] = { 1.f, 1.f, 1.f, 0.f }; nglSetFragmentShaderConstantATI(GL_CON_0_ATI, cst); } +#endif } // *************************************************************************** @@ -2068,7 +2083,9 @@ void CDriverGL::setupWaterPassR200(const CMaterial &mat) */ void CDriverGL::setupWaterPassARB(const CMaterial &mat) { - H_AUTO_OGL(CDriverGL_setupWaterPassARB) + H_AUTO_OGL(CDriverGL_setupWaterPassARB); + +#ifndef USE_OPENGLES uint k; ITexture *tex = mat.getTexture(0); if (tex) @@ -2147,6 +2164,7 @@ void CDriverGL::setupWaterPassARB(const CMaterial &mat) } } } +#endif } // *************************************************************************** @@ -2175,6 +2193,7 @@ void CDriverGL::setupWaterPassNV20(const CMaterial &mat) { H_AUTO_OGL(CDriverGL_setupWaterPassNV20) +#ifndef USE_OPENGLES static bool setupDone = false; static CMaterial::CTexEnv texEnvReplace; static CMaterial::CTexEnv texEnvModulate; @@ -2259,6 +2278,7 @@ void CDriverGL::setupWaterPassNV20(const CMaterial &mat) activateTexEnvMode(2, texEnvReplace); activateTexEnvMode(3, texEnvModulate); } +#endif } // *************************************************************************** @@ -2286,7 +2306,9 @@ void CDriverGL::setupWaterPass(uint /* pass */) // *************************************************************************** void CDriverGL::endWaterMultiPass() { - H_AUTO_OGL(CDriverGL_endWaterMultiPass) + H_AUTO_OGL(CDriverGL_endWaterMultiPass); + +#ifndef USE_OPENGLES nlassert(_CurrentMaterial->getShader() == CMaterial::Water); // NB : as fragment shaders / programs bypass the texture envs, no special env enum is added (c.f CTexEnvSpecial) if (_Extensions.NVTextureShader) return; @@ -2298,6 +2320,7 @@ void CDriverGL::endWaterMultiPass() { glDisable(GL_FRAGMENT_SHADER_ATI); } +#endif } } // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_states.h b/code/nel/src/3d/driver/opengl/driver_opengl_states.h index 9a8aa3e4f..e3820c4a8 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_states.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl_states.h @@ -20,11 +20,15 @@ #include "nel/misc/types_nl.h" #include "nel/3d/vertex_buffer.h" -#ifdef NL_OS_MAC -# define GL_GLEXT_LEGACY -# include +#ifdef USE_OPENGLES +# include #else -# include +# ifdef NL_OS_MAC +# define GL_GLEXT_LEGACY +# include +# else +# include +# endif #endif @@ -41,7 +45,7 @@ namespace NL3D - GL_ALPHA_TEST - GL_LIGHTING - GL_LIGHT0 + i ..... - - GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP_ARB. + - GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP_ARB/OES. - GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R - GL_COLOR_MATERIAL - GL_FOG diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp index 6079dc6f3..43c2441d4 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp @@ -155,7 +155,11 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) // check status GLenum status; +#ifdef USE_OPENGLES + status = (GLenum) nglCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES); +#else status = (GLenum) nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); +#endif switch(status) { case GL_FRAMEBUFFER_COMPLETE_EXT: InitFBO = true; @@ -204,12 +208,24 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) // clean up resources if allocation failed if (!InitFBO) { +#ifdef USE_OPENGLES + nglDeleteFramebuffersOES(1, &FBOId); +#else nglDeleteFramebuffersEXT(1, &FBOId); +#endif if (AttachDepthStencil) { +#ifdef USE_OPENGLES + nglDeleteRenderbuffersOES(1, &DepthFBOId); +#else nglDeleteRenderbuffersEXT(1, &DepthFBOId); +#endif if(!UsePackedDepthStencil) +#ifdef USE_OPENGLES + nglDeleteRenderbuffersOES(1, &StencilFBOId); +#else nglDeleteRenderbuffersEXT(1, &StencilFBOId); +#endif } } @@ -226,14 +242,22 @@ bool CTextureDrvInfosGL::activeFrameBufferObject(ITexture * tex) if(initFrameBufferObject(tex)) { glBindTexture(TextureMode, 0); +#ifdef USE_OPENGLES + nglBindFramebufferOES(GL_FRAMEBUFFER_OES, FBOId); +#else nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBOId); +#endif } else return false; } else { +#ifdef USE_OPENGLES + nglBindFramebufferOES(GL_FRAMEBUFFER_OES, 0); +#else nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); +#endif } return true; @@ -602,7 +626,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, { //nldebug("3D: creating CTextureDrvShare()"); // insert into driver list. (so it is deleted when driver is deleted). - ItTexDrvSharePtrList it= _TexDrvShares.insert(_TexDrvShares.end(), NULL); + ItTexDrvSharePtrList it= _TexDrvShares.insert(_TexDrvShares.end(), (NL3D::CTextureDrvShare*)NULL); // create and set iterator, for future deletion. *it= tex.TextureDrvShare= new CTextureDrvShare(this, it, &tex); @@ -840,8 +864,13 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, sint size= tex.getPixels(i).size(); if (bUpload) { +#ifdef USE_OPENGLES + glCompressedTexImage2D (GL_TEXTURE_2D, i-decalMipMapResize, glfmt, + tex.getWidth(i),tex.getHeight(i), 0, size, ptr); +#else nglCompressedTexImage2DARB (GL_TEXTURE_2D, i-decalMipMapResize, glfmt, tex.getWidth(i),tex.getHeight(i), 0, size, ptr); +#endif bAllUploaded = true; } else diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp index 09ff88748..502c971f1 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp @@ -140,7 +140,7 @@ bool CDriverGL::setupVertexBuffer(CVertexBuffer& VB) // 1. Retrieve/Create driver shader. //================================== // insert into driver list. (so it is deleted when driver is deleted). - ItVBDrvInfoPtrList it= _VBDrvInfos.insert(_VBDrvInfos.end(), NULL); + ItVBDrvInfoPtrList it= _VBDrvInfos.insert(_VBDrvInfos.end(), (NL3D::IVBDrvInfos*)NULL); // create and set iterator, for future deletion. CVBDrvInfosGL *info = new CVBDrvInfosGL(this, it, &VB); *it= VB.DrvInfos = info; diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp index 3c74d02b4..ba471b8dd 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp @@ -69,7 +69,7 @@ IVertexBufferHardGL::~IVertexBufferHardGL() H_AUTO_OGL(IVertexBufferHardGL_IVertexBufferHardGLDtor) } - +#ifndef USE_OPENGLES // *************************************************************************** // *************************************************************************** @@ -1133,7 +1133,7 @@ void CVertexArrayRangeMapObjectATI::updateLostBuffers() } #endif - +#endif // USE_OPENGLES // *************************************************************************** @@ -1328,6 +1328,12 @@ CVertexBufferHardARB::CVertexBufferHardARB(CDriverGL *drv, CVertexBuffer *vb) : #ifdef NL_DEBUG _Unmapping = false; #endif + +#ifdef USE_OPENGLES + _Buffer = NULL; + _BufferSize = 0; + _LastBufferSize = 0; +#endif } // *************************************************************************** @@ -1369,6 +1375,14 @@ CVertexBufferHardARB::~CVertexBufferHardARB() _VertexArrayRange->_MappedVBList.erase(_IteratorInMappedVBList); } #endif + +#ifdef USE_OPENGLES + if (_Buffer) + { + delete [] _Buffer; + _Buffer = NULL; + } +#endif } // *************************************************************************** @@ -1450,6 +1464,39 @@ void *CVertexBufferHardARB::lock() beforeLock= CTime::getPerformanceTime(); } _Driver->_DriverGLStates.bindARBVertexBuffer(_VertexObjectId); + +#ifdef USE_OPENGLES + if (_Driver->_Extensions.OESMapBuffer) + { + _VertexPtr = nglMapBufferOES(GL_ARRAY_BUFFER, GL_WRITE_ONLY_OES); + if (!_VertexPtr) + { + nglUnmapBufferOES(GL_ARRAY_BUFFER); + nlassert(glIsBuffer(_VertexObjectId)); + invalidate(); + return &_DummyVB[0]; + } + } + else + { + const uint size = VB->getNumVertices() * VB->getVertexSize(); + + if (size > _BufferSize) + { + if (_Buffer) delete [] _Buffer; + + _Buffer = new uint8[size+3]; + _BufferSize = size; + } + + uint8 offset = (size_t)_Buffer % 4; + + if (offset > 0) offset = 4 - offset; + + _VertexPtr = _Buffer + offset; + _LastBufferSize = size; + } +#else _VertexPtr = nglMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); if (!_VertexPtr) { @@ -1458,6 +1505,8 @@ void *CVertexBufferHardARB::lock() invalidate(); return &_DummyVB[0]; } +#endif + #ifdef NL_DEBUG _VertexArrayRange->_MappedVBList.push_front(this); _IteratorInMappedVBList = _VertexArrayRange->_MappedVBList.begin(); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp index 4c255e1d9..45da4d218 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp @@ -111,7 +111,7 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) } // Insert into driver list. (so it is deleted when driver is deleted). - ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), NULL); + ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); // Create a driver info *it = drvInfo = new CVertexProgamDrvInfosGL (this, it); @@ -1472,7 +1472,7 @@ bool CDriverGL::activeARBVertexProgram (CVertexProgram *program) return false; } // Insert into driver list. (so it is deleted when driver is deleted). - ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), NULL); + ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); // Create a driver info *it = drvInfo = new CVertexProgamDrvInfosGL (this, it); @@ -1554,7 +1554,7 @@ bool CDriverGL::activeEXTVertexShader (CVertexProgram *program) */ // Insert into driver list. (so it is deleted when driver is deleted). - ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), NULL); + ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); // Create a driver info *it = drvInfo = new CVertexProgamDrvInfosGL (this, it); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index 48af6cf05..eb3083729 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -2376,11 +2376,15 @@ void CDriverGL::getWindowSize(uint32 &width, uint32 &height) if (_CurrentMode.OffScreen) { #ifdef NL_OS_WINDOWS + +#ifndef USE_OPENGLES if (_PBuffer) { nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_WIDTH_ARB, (int*)&width ); nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_HEIGHT_ARB, (int*)&height ); } +#endif + #endif } else diff --git a/code/nel/src/3d/fasthls_modifier.cpp b/code/nel/src/3d/fasthls_modifier.cpp index 6f90e574a..fb3fdd31d 100644 --- a/code/nel/src/3d/fasthls_modifier.cpp +++ b/code/nel/src/3d/fasthls_modifier.cpp @@ -109,7 +109,7 @@ CRGBA CFastHLSModifier::convert(uint H, uint L, uint S) return col; } -#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # pragma warning( push ) # pragma warning( disable : 4799 ) #endif @@ -262,7 +262,7 @@ uint16 CFastHLSModifier::applyHLSMod(uint16 colorIn, uint8 dHue, uint dLum, uin #pragma managed(pop) #endif -#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # pragma warning( pop ) #endif diff --git a/code/nel/src/3d/mesh_mrm_skinned.cpp b/code/nel/src/3d/mesh_mrm_skinned.cpp index 8b7f1fa63..f1c49bd56 100644 --- a/code/nel/src/3d/mesh_mrm_skinned.cpp +++ b/code/nel/src/3d/mesh_mrm_skinned.cpp @@ -1867,7 +1867,7 @@ void CMeshMRMSkinnedGeom::updateRawSkinNormal(bool enabled, CMeshMRMSkinnedInst CIndexBufferReadWrite ibaWrite; skinLod.RdrPass[i].lock (ibaWrite); #ifndef NL_SKINNED_MESH_MRM_INDEX16 - nlassert(ibaWrite.getFormat() == CIndexBuffer::Indices32) + nlassert(ibaWrite.getFormat() == CIndexBuffer::Indices32); uint32 *dstTriPtr= (uint32 *) ibaWrite.getPtr(); uint32 numIndices= lod.RdrPass[i].PBlock.size(); for(uint j=0;j +#include // diff --git a/code/nel/src/3d/ps_mesh.cpp b/code/nel/src/3d/ps_mesh.cpp index ca354b09d..1ab6d723f 100644 --- a/code/nel/src/3d/ps_mesh.cpp +++ b/code/nel/src/3d/ps_mesh.cpp @@ -2083,8 +2083,9 @@ static void DuplicatePrimitiveBlock(const CIndexBuffer &srcBlock, CIndexBuffer & CIndexBufferReadWrite ibaWrite; destBlock.lock (ibaWrite); - +#ifdef NL_FORCE_INDEX_BUFFER_16 nlassert(destBlock.getFormat() == CIndexBuffer::Indices16); +#endif // TMP TMP TMP if (ibaRead.getFormat() == CIndexBuffer::Indices16) diff --git a/code/nel/src/georges/form_elm.cpp b/code/nel/src/georges/form_elm.cpp index 528f6eec9..6f2f4c523 100644 --- a/code/nel/src/georges/form_elm.cpp +++ b/code/nel/src/georges/form_elm.cpp @@ -233,6 +233,7 @@ const CType* CFormElm::getType () warning (false, "getType", "This node is not an atom."); return 0; } + // *************************************************************************** bool CFormElm::getValue (string &/* result */, TEval /* evaluate */) const diff --git a/code/nel/src/misc/debug.cpp b/code/nel/src/misc/debug.cpp index 472e2cd35..17cf2fd3b 100644 --- a/code/nel/src/misc/debug.cpp +++ b/code/nel/src/misc/debug.cpp @@ -969,14 +969,12 @@ void force_exception_frame(...) {std::cout.flush();} static void exceptionTranslator(unsigned, EXCEPTION_POINTERS *pexp) { #ifndef NL_NO_DEBUG_FILES - FILE *file = fopen ("exception_catched", "wb"); - fclose (file); + CFile::createEmptyFile(getLogDirectory() + "exception_catched"); #endif if (pexp->ExceptionRecord->ExceptionCode == EXCEPTION_BREAKPOINT) { #ifndef NL_NO_DEBUG_FILES - FILE *file2 = fopen ("breakpointed", "wb"); - fclose (file2); + CFile::createEmptyFile(getLogDirectory() + "breakpointed"); #endif return; } @@ -1683,12 +1681,18 @@ NLMISC_CATEGORISED_COMMAND(nel, writeaccess, "write a uint8 value in an invalid uint8 val = 123; uint8 *adr = (uint8*)0; if(args.size() >= 1) + { #ifdef HAVE_X86_64 - adr = (uint8*)(uint64)atoi(args[0].c_str()); + uint64 addr64; + NLMISC::fromString(args[0], addr64); + adr = (uint8*)addr64; #else - adr = (uint8*)atoi(args[0].c_str()); + uint32 addr32; + NLMISC::fromString(args[0], addr32); + adr = (uint8*)addr32; #endif - if(args.size() >= 2) val = (uint8)atoi(args[1].c_str()); + } + if(args.size() >= 2) NLMISC::fromString(args[1], val); *adr = val; return true; } @@ -1698,11 +1702,17 @@ NLMISC_CATEGORISED_COMMAND(nel, readaccess, "read a uint8 value in an invalid ad uint8 val; uint8 *adr = (uint8*)0; if(args.size() == 1) + { #ifdef HAVE_X86_64 - adr = (uint8*)(uint64)atoi(args[0].c_str()); + uint64 addr64; + NLMISC::fromString(args[0], addr64); + adr = (uint8*)addr64; #else - adr = (uint8*)atoi(args[0].c_str()); + uint32 addr32; + NLMISC::fromString(args[0], addr32); + adr = (uint8*)addr32; #endif + } val = *adr; log.displayNL("value is %hu", (uint16)val); return true; diff --git a/code/nel/src/misc/sha1.cpp b/code/nel/src/misc/sha1.cpp index bb375a928..92929b469 100644 --- a/code/nel/src/misc/sha1.cpp +++ b/code/nel/src/misc/sha1.cpp @@ -187,6 +187,77 @@ CHashKey getSHA1(const string &filename, bool forcePath) return hk; } +/* +* +* HMAC = hash( (Key ^ 0x5c) .. hash( (Key ^0x36) .. Message ) ) +* +*/ + +CHashKey getHMacSHA1(const uint8 *text, uint32 text_len, const uint8 *key, uint32 key_len) +{ + SHA1Context sha; + + uint8_t SHA1_Key[64]; + uint8_t SHA1_Key1[20]; + uint8_t SHA1_Key2[20]; + + string buffer1; + string buffer2; + + // Init some vars + for (uint i = 0; i < 64; i++) + SHA1_Key[i] = 0; + + // If lenght of key > 64 use sha1 hash + if (key_len > 64) { + uint8_t SHA1_Key0[20]; + SHA1Reset(&sha); + SHA1Input(&sha, (const uint8_t*)key, key_len); + SHA1Result(&sha, SHA1_Key0); + CHashKey hk0 (SHA1_Key0); + for (uint i = 0; i < 20; i++) + SHA1_Key[i] = hk0.HashKeyString[i]; + } else { + for (uint i = 0; i < key_len; i++) + SHA1_Key[i] = key[i]; + } + + // Do 0x36 XOR Key + for (uint i = 0; i < 64; i++) + buffer1 += 0x36 ^ SHA1_Key[i]; + + // Append text + for (uint i = 0; i < text_len; i++) + buffer1 += text[i]; + + // Get hash + SHA1Reset(&sha); + SHA1Input(&sha, (const uint8_t*)buffer1.c_str(), (uint)buffer1.size()); + SHA1Result(&sha, SHA1_Key1); + CHashKey hk1 (SHA1_Key1); + + // Do 0x5c XOR Key + for (uint i = 0; i < 64; i++) + buffer2 += 0x5c ^ SHA1_Key[i]; + + // Append previous hash + for (uint i = 0; i < 20; i++) + buffer2 += hk1.HashKeyString[i]; + + // Get new hash + SHA1Reset(&sha); + SHA1Input(&sha, (const uint8_t*)buffer2.c_str(), (uint)buffer2.size()); + SHA1Result(&sha, SHA1_Key2); + CHashKey hk (SHA1_Key2); + + return hk; +} + + +#ifdef _MFC_VER + #pragma runtime_checks( "", off ) +#endif + /* * Define the SHA1 circular left shift macro */ diff --git a/code/nel/src/misc/shared_memory.cpp b/code/nel/src/misc/shared_memory.cpp index 60d63b7d7..bb19981eb 100644 --- a/code/nel/src/misc/shared_memory.cpp +++ b/code/nel/src/misc/shared_memory.cpp @@ -36,8 +36,8 @@ namespace NLMISC { // Storage for file handles, necessary to close the handles map AccessAddressesToHandles; #else - // Storage for shmid, necessary to destroy the segments - map SharedMemIdsToShmids; + // Storage for shmid, necessary to destroy the segments + map SharedMemIdsToShmids; #endif @@ -71,7 +71,7 @@ void *CSharedMemory::createSharedMemory( TSharedMemId sharedMemId, uint32 size #else // Create a shared memory segment - int shmid = shmget( sharedMemId, size, IPC_CREAT | IPC_EXCL | 0666 ); + sint shmid = shmget( sharedMemId, size, IPC_CREAT | IPC_EXCL | 0666 ); if ( shmid == -1 ) return NULL; SharedMemIdsToShmids.insert( make_pair( sharedMemId, shmid ) ); @@ -82,6 +82,7 @@ void *CSharedMemory::createSharedMemory( TSharedMemId sharedMemId, uint32 size return NULL; else return accessAddress; + #endif } diff --git a/code/nel/src/net/sock.cpp b/code/nel/src/net/sock.cpp index 475548821..e2a0c4205 100644 --- a/code/nel/src/net/sock.cpp +++ b/code/nel/src/net/sock.cpp @@ -22,10 +22,8 @@ #include "nel/misc/hierarchical_timer.h" #ifdef NL_OS_WINDOWS -# if defined(NL_COMP_VC7) || defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -# endif # define NOMINMAX +# include # include # define socklen_t int # define ERROR_NUM WSAGetLastError() diff --git a/code/nel/src/net/tcp_sock.cpp b/code/nel/src/net/tcp_sock.cpp index d51281db6..9773e0b00 100644 --- a/code/nel/src/net/tcp_sock.cpp +++ b/code/nel/src/net/tcp_sock.cpp @@ -20,9 +20,7 @@ #include "nel/net/net_log.h" #ifdef NL_OS_WINDOWS -# if defined(NL_COMP_VC7) || defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -# endif +# include # define NOMINMAX # include # define socklen_t int diff --git a/code/nel/src/sound/audio_mixer_user.cpp b/code/nel/src/sound/audio_mixer_user.cpp index 7f17f9d35..a80592727 100644 --- a/code/nel/src/sound/audio_mixer_user.cpp +++ b/code/nel/src/sound/audio_mixer_user.cpp @@ -836,7 +836,7 @@ void CAudioMixerUser::buildSampleBankList() nlinfo("Compiling sample bank [%s]", bankname.c_str()); std::string filename = buildSampleBank(bankDir[i], sbp, bankname); if (bankFile.size() < i + 1) bankFile.resize(i + 1); - else bankFile.insert(bankFile.begin() + i, NULL); + else bankFile.insert(bankFile.begin() + i, std::string()); bankFile[i] = filename; } else if (bankname < CFile::getFilenameWithoutExtension(bankDir[i])) diff --git a/code/nel/src/sound/simple_sound.cpp b/code/nel/src/sound/simple_sound.cpp index dd69a19bb..405b25264 100644 --- a/code/nel/src/sound/simple_sound.cpp +++ b/code/nel/src/sound/simple_sound.cpp @@ -77,7 +77,7 @@ void CSimpleSound::getSubSoundList(std::vector(this)->getBuffer() == 0) - subsounds.push_back(pair(CStringMapper::unmap(_Buffername)+" (sample)", 0)); + subsounds.push_back(pair(CStringMapper::unmap(_Buffername)+" (sample)", (CSound*)NULL)); } diff --git a/code/nel/src/sound/stdsound.h b/code/nel/src/sound/stdsound.h index a4cc08094..a656fa387 100644 --- a/code/nel/src/sound/stdsound.h +++ b/code/nel/src/sound/stdsound.h @@ -36,6 +36,7 @@ #include #include #include +#include #include "nel/misc/vector.h" #include "nel/misc/path.h" diff --git a/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt index 9341954ab..11196091e 100644 --- a/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt @@ -8,6 +8,10 @@ # This tells the application(s) where to fidn the installed data. ADD_DEFINITIONS(-DDATA_DIR="\\"${NL_SHARE_PREFIX}/object_viewer_qt/\\"") +IF(UNIX AND WITH_STATIC) + MESSAGE(FATAL_ERROR "OVQT does not work with static NeL builds on Unix atm.") +ENDIF() + ADD_SUBDIRECTORY(src) INSTALL(DIRECTORY data/ diff --git a/code/nel/tools/3d/object_viewer_qt/doc/ovqt.dox b/code/nel/tools/3d/object_viewer_qt/doc/ovqt.dox index e15e37e5a..b310ad758 100644 --- a/code/nel/tools/3d/object_viewer_qt/doc/ovqt.dox +++ b/code/nel/tools/3d/object_viewer_qt/doc/ovqt.dox @@ -31,7 +31,7 @@ PROJECT_NAME = "Object Viewer Qt" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = r90 +PROJECT_NUMBER = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. @@ -643,7 +643,7 @@ FILE_PATTERNS = *.c \ # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. -RECURSIVE = NO +RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a diff --git a/code/nel/tools/3d/object_viewer_qt/src/description.h b/code/nel/tools/3d/object_viewer_qt/src/description.h index d22a1918b..a1a041de9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/description.h +++ b/code/nel/tools/3d/object_viewer_qt/src/description.h @@ -1,6 +1,6 @@ /** @mainpage Object Viewer Qt -@author Dzmitry Kamiahin , (C) 2010 +@author Dzmitry Kamiahin , (C) 2011 @section introduce Introduce @details @@ -15,130 +15,22 @@ The tool can be used in different tasks: - Create and modify micro-vegetation material (.vegetset files) - Viewing landscape (.zonel files) - Dialog allows to specify graphical, sound, search path and landscape settings. - -@section project_structure Overview of the Object Viewer Qt Project Structure -@details -OVQT - consists of several major subsystems. Each subsystem performs its defined part of the task. -Through Modules:: provides access to all other program subsystems. - -Program has the following subsystems: -- @ref Modules - Main modules aggregated all parts of the program. -- @ref NLQT::CConfiguration - is responsible for loading and saving settings from the configuration file. As well as search path of data. -- @ref NLQT::CObjectViewer - main subsystem of the program, which initializes the driver, creates a scene and other supporting elements. -It is a container for loaded models, which can further be viewed and animated. -- @ref NLQT::CMainWindow - is responsible for the GUI. -- @ref NLQT::CParticleEditor - is responsible for the particle systems and provides access to a container that keeps all the loaded particle systems. -And also allows you to view an animation of particle systems, with the ability to control its parameters. -- @ref NLQT::CVegetableEditor - is responsible for the landscape zones and the editor of vegetation. -Allows you to load and view the landscape. Also has the ability to create and edit the parameters of the micro-vegetation. -- @ref NLQT::CSoundSystem - is responsible for the sound in the program. - - -The structure of the GUI in the editor of the particles. -
-This can be useful for new developers who want to add more new dialogs or to improve the functionality of existing dialogues. -Particle Workspace -ParticleWorkspace dialogue uses the technique of model-view. -Using the signal/slot link QTreeView with QStackWidget, Editor properties dialog. -When you select an item in QTreeView, QStackWidget displays the necessary page(PageWidget) where you can edit the element of the particles system. -Each page is made in the designer and has a separate forms(.ui). -In accordance with the recommendations of dialogues design, with a large number of items,every page uses QTabWidget. -In case when there is a great number of controls, and not everything you want to display, -it's used the dynamic creation of tabs. Moreover, each tab uses a separate forms(.ui). - -@section for_new_developer Guide for new developers of the Object Viewer Qt. -@details - First of all, to begin developing dialogues that add new features ovqt, -it is needed to read the documentation Qt libs (http://doc.qt.nokia.com/) and NeL documentation. - - In order to have convenient using of the tool and its further development, -it is expected to make a unified interface that is why all dialogs should adhere to a standard design, -which will be written further. For this goals program provides some additional widgets, -which are recommended to use. As in the development Qt Designer is actively used. -To get access to founded here widgets from the designer,the technique promotion is used, -which can be found here . -
    -
  1. -CEditRangeUIntWidget / CEditRangeIntWidget / CEditRangeFloatWidget -
    -Widgets provides a slider that allows you to specify an integer (or float, depending on which widget used) number within a set range. -The range is also can be set by the user, or for a more accurate selection of numbers, either for receiving large values. -As there may be situations when the range that a user requests,has to be restricted, and widget provides methods that allow you to do so. -

    -CEditRangeIntWidget -
    -CEditRangeFloatWidget -@see -@ref NLQT::CEditRangeUIntWidget, @ref NLQT::CEditRangeIntWidget, @ref NLQT::CEditRangeFloatWidget - -
  2. -CColorEditWidget -
    -Using this widget you can set the color(RGBA) using the four sliders or through the color selection dialog. -

    -CColorEditWidget -@see -@ref NLQT::CColorEditWidget - -
  3. -CDirectionWidget -
    -This widget helps to choose from several preset directions, or to choose a custom one. -

    -CDirectionWidget -@see -@ref NLQT::CDirectionWidget -


- -To further convinience of instrument using dialogues interface is recommended to make as follows. -The most sophisticated tools of the program, should take the form of three dock windows (example shown in the screenshot). -Object Viewer Qt -
    -
  1. -The first dock window - is a control dock window, it should focus all of the control functions of general purpose -(for example: start/stop/pause animations or particles system). -It is recommended to perform of the horizontal type window and placed in the bottom of the main window. -
  2. -The second dock window - is a list or a tree of items. In which selecting of the current element, -which assumes to modify or viewis possible.Operations "add/remove/insert or other" items are recommended to make as a popur menu. -It is recommended to perform of the vertical type window and placed in the left of the main window. -
  3. -The third dock - is an editor for properties of the element that was selected in the list or in the tree of elements. -As all the controls occupy much space or do not fit at all, you have to use tabs QTabWidget, -which in total can contains quite a lot of elements. -For a small number of tabs it is allowed to use both horizontal and vertical location. -But with a large number of tabs, it is necessary to apply the vertical arrangement. -It is recommended to perform of the vertical type of window and placed in the right of the main window. -
-In the simple dialogues do not necessary to use all three windows, but user has to adhere to the recommendations given above as well. -Also, all dialogs must use the qt layout manager. And if you do not use the designer, -make sure you use the qt tools internationalization applications. -

-In ovqt for most dialogs their owner is NLQT::CMainWindow and in its methods creating and initializing all dependent dialogs occur. -For the convenience of the program using, most dialogues are created in the form of docking windows. -Creating all the dialogues are carried out in a private method NLQT::CMainWindow::createDialogs(). -Hence, it is necessary to add operations in this method to create new dialogues. -But we must take into account that at this moment is fully available only one component of the program CConfiguration, -to read the settings from the configuration file. The remaining components of the program are available only after the main window stays visible. -Calling the dialogues going through the menu or the toolbar, usually it is a checkable item. -Adding of the new menu items or items toolbars is need in methods NLQT::CMainWindow::createMenus(), NLQT::CMainWindow::createToolBars(). +- OVQT supports loading third-party plug-ins. @section license_ovqt License Object Viewer Qt @details - Object Viewer Qt +Object Viewer Qt - MMORPG Framework
- Copyright (C) 2010 Dzmitry Kamiahin +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version.

- This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details.

- This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -

- You should have received a copy of the GNU General Public License - along with this program. If not, see . +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h index e67c9e588..05d4b832c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h @@ -40,7 +40,6 @@ class IPluginSpec; class IPluginManager: public QObject { Q_OBJECT - public: IPluginManager(QObject *parent = 0): QObject(parent) {} virtual ~IPluginManager() {} diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp index 49dcec785..be5f18c74 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp @@ -151,9 +151,9 @@ void CPluginManager::readPluginPaths() { const QDir dir(searchPaths.takeFirst()); #ifdef Q_OS_WIN - const QFileInfoList files = dir.entryInfoList(QStringList() << QString("*.dll"), QDir::Files); + const QFileInfoList files = dir.entryInfoList(QStringList() << QString("ovqt_plugin_*.dll"), QDir::Files); #else - const QFileInfoList files = dir.entryInfoList(QStringList() << QString("*.so"), QDir::Files); + const QFileInfoList files = dir.entryInfoList(QStringList() << QString("libovqt_plugin_*.so"), QDir::Files); #endif Q_FOREACH (const QFileInfo &file, files) pluginsList << file.absoluteFilePath(); @@ -292,4 +292,4 @@ void CPluginManager::deleteAll() } } -}; // namespace NLQT \ No newline at end of file +}; // namespace ExtensionSystem \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h index d1a18485b..4ef3b2208 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h @@ -74,6 +74,6 @@ private: }; // class CPluginManager -} // namespace NLQT +} // namespace ExtensionSystem #endif // PLUGINMANAGER_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp index 7158c8d9f..d77d90962 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp @@ -266,4 +266,4 @@ bool CPluginSpec::reportError(const QString &err) return false; } -} // namespace NLQT \ No newline at end of file +} // namespace ExtensionSystem \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h index e73f3ed93..0cc895ada 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h @@ -79,7 +79,7 @@ private: friend class CPluginManager; }; -} // namespace NLQT +} // namespace ExtensionSystem #endif // PLUGINSPEC_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/main.cpp b/code/nel/tools/3d/object_viewer_qt/src/main.cpp index 64cb1fff2..15173fa5c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main.cpp @@ -38,6 +38,8 @@ #include #include #include +#include +#include static const char *appNameC = "ObjectViewerQt"; @@ -135,7 +137,7 @@ sint main(int argc, char **argv) QTranslator qtTranslator; QString locale = settings->value("Language", QLocale::system().name()).toString(); QString qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); - translator.load("object_viewer_qt_" + locale, ":/"); +// translator.load("object_viewer_qt_" + locale, ":/"); qtTranslator.load("qt_" + locale, qtTrPath); app.installTranslator(&translator); app.installTranslator(&qtTranslator); @@ -149,9 +151,9 @@ sint main(int argc, char **argv) pluginManager.setSettings(settings); QStringList pluginPaths; #if !defined(NL_OS_MAC) - pluginPaths << QString("./plugins"); + pluginPaths << settings->value("PluginPath", "./plugins").toString(); #else - pluginPaths << qApp->applicationDirPath() + QString("/../PlugIns/ovqt"); + pluginPaths << settings->value("PluginPath", qApp->applicationDirPath() + QString("/../PlugIns/ovqt")).toString(); #endif pluginManager.setPluginPaths(pluginPaths); @@ -176,6 +178,15 @@ sint main(int argc, char **argv) QString absolutePaths = absolutePluginPaths.absolutePath(); const QString reason = QCoreApplication::translate("Application", "Could not find ovqt_plugin_core in %1").arg(absolutePaths); displayError(msgCoreLoadFailure(reason)); + + QString newPath = QFileDialog::getExistingDirectory(0, QCoreApplication::translate("Application", "Change the plugins path"), QDir::homePath()); + bool ok; + QString text = QInputDialog::getText(0, QCoreApplication::translate("Application", "Enter the plugins path"), + QCoreApplication::translate("Application", "Plugin path:"), QLineEdit::Normal, + newPath, &ok); + if (ok && !text.isEmpty()) + settings->setValue("PluginPath", text); + settings->sync(); return 1; } if (corePlugin->hasError()) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt index d5a792acd..bec71cf94 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt @@ -1,7 +1,9 @@ ADD_SUBDIRECTORY(core) ADD_SUBDIRECTORY(example) ADD_SUBDIRECTORY(ovqt_sheet_builder) +ADD_SUBDIRECTORY(landscape_editor) ADD_SUBDIRECTORY(log) ADD_SUBDIRECTORY(disp_sheet_id) ADD_SUBDIRECTORY(object_viewer) -ADD_SUBDIRECTORY(zone_painter) \ No newline at end of file +ADD_SUBDIRECTORY(zone_painter) +ADD_SUBDIRECTORY(georges_editor) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt index 726cb4a2d..3140f02fb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt @@ -18,13 +18,18 @@ SET(OVQT_CORE_PLUGIN_HDR core.h main_window.h menu_manager.h + context_manager.h settings_dialog.h search_paths_settings_page.h - plugin_view_dialog.h) + general_settings_page.h + plugin_view_dialog.h +) SET(OVQT_CORE_PLUGIN_UIS settings_dialog.ui plugin_view_dialog.ui - search_paths_settings_page.ui) + general_settings_page.ui + search_paths_settings_page.ui +) SET(OVQT_CORE_PLUGIN_RCS core.qrc) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp new file mode 100644 index 000000000..68e28429d --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp @@ -0,0 +1,150 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "context_manager.h" +#include "icontext.h" +#include "main_window.h" + +// NeL includes +#include + +// Qt includes +#include +#include + +namespace Core +{ + +struct ContextManagerPrivate +{ + explicit ContextManagerPrivate(Core::MainWindow *mainWindow, QTabWidget *tabWidget); + Core::MainWindow *m_mainWindow; + QTabWidget *m_tabWidget; + QVector m_contexts; + int m_oldCurrent; +}; + +ContextManagerPrivate::ContextManagerPrivate(Core::MainWindow *mainWindow, QTabWidget *tabWidget) + : m_mainWindow(mainWindow), + m_tabWidget(tabWidget), + m_oldCurrent(-1) +{ +} + +ContextManager::ContextManager(Core::MainWindow *mainWindow, QTabWidget *tabWidget) + : d(new ContextManagerPrivate(mainWindow, tabWidget)) +{ + QObject::connect(d->m_mainWindow->pluginManager(), SIGNAL(objectAdded(QObject *)), + this, SLOT(objectAdded(QObject *))); + QObject::connect(d->m_mainWindow->pluginManager(), SIGNAL(aboutToRemoveObject(QObject *)), + this, SLOT(aboutToRemoveObject(QObject *))); + + QObject::connect(d->m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); +} + +ContextManager::~ContextManager() +{ + delete d; +} + +Core::IContext *ContextManager::currentContext() const +{ + int currentIndex = d->m_tabWidget->currentIndex(); + if (currentIndex < 0) + return 0; + return d->m_contexts.at(currentIndex); +} + +Core::IContext *ContextManager::context(const QString &id) const +{ + const int index = indexOf(id); + if (index >= 0) + return d->m_contexts.at(index); + return 0; +} + +void ContextManager::activateContext(const QString &id) +{ + const int index = indexOf(id); + if (index >= 0) + d->m_tabWidget->setCurrentIndex(index); +} + +void ContextManager::objectAdded(QObject *obj) +{ + IContext *context = qobject_cast(obj); + if (context) + addContextObject(context); +} + +void ContextManager::aboutToRemoveObject(QObject *obj) +{ + IContext *context = qobject_cast(obj); + if (context) + removeContextObject(context); +} + +void ContextManager::addContextObject(IContext *context) +{ + d->m_contexts.push_back(context); + d->m_mainWindow->addContextObject(context); + + QWidget *tabWidget = new QWidget(d->m_tabWidget); + d->m_tabWidget->addTab(tabWidget, context->icon(), context->trName()); + QGridLayout *gridLayout = new QGridLayout(tabWidget); + gridLayout->setObjectName(QString::fromUtf8("gridLayout_") + context->id()); + gridLayout->setContentsMargins(0, 0, 0, 0); + gridLayout->addWidget(context->widget(), 0, 0, 1, 1); +} + +void ContextManager::removeContextObject(IContext *context) +{ + d->m_mainWindow->removeContextObject(context); + + const int index = indexOf(context->id()); + QWidget *widget = d->m_tabWidget->widget(index); + d->m_tabWidget->removeTab(index); + d->m_contexts.remove(index); + delete widget; +} + +void ContextManager::currentTabChanged(int index) +{ + if (index >= 0) + { + IContext *context = d->m_contexts.at(index); + IContext *oldContext = 0; + if (d->m_oldCurrent >= 0) + oldContext = d->m_contexts.at(d->m_oldCurrent); + d->m_oldCurrent = index; + Q_EMIT currentContextChanged(context, oldContext); + } +} + +int ContextManager::indexOf(const QString &id) const +{ + for (int i = 0; i < d->m_contexts.count(); ++i) + { + if (d->m_contexts.at(i)->id() == id) + return i; + } + nlwarning(QString("Warning, no such context: %1").arg(id).toStdString().c_str()); + return -1; +} + +} /* namespace Core */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.h new file mode 100644 index 000000000..7a3658fff --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.h @@ -0,0 +1,70 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef CONTEXT_MANAGER_H +#define CONTEXT_MANAGER_H + +// Project includes +#include "core_global.h" + +// Qt includes +#include + +QT_BEGIN_NAMESPACE +class QTabWidget; +QT_END_NAMESPACE + +namespace Core +{ +class IContext; +class MainWindow; +struct ContextManagerPrivate; + +class CORE_EXPORT ContextManager : public QObject +{ + Q_OBJECT + +public: + explicit ContextManager(Core::MainWindow *mainWindow, QTabWidget *tabWidget); + virtual ~ContextManager(); + + Core::IContext *currentContext() const; + Core::IContext *context(const QString &id) const; + +Q_SIGNALS: + // the default argument '=0' is important for connects without the oldContext argument. + void currentContextChanged(Core::IContext *context, Core::IContext *oldContext = 0); + +public Q_SLOTS: + void activateContext(const QString &id); + +private Q_SLOTS: + void objectAdded(QObject *obj); + void aboutToRemoveObject(QObject *obj); + void addContextObject(IContext *context); + void removeContextObject(IContext *context); + void currentTabChanged(int index); + +private: + int indexOf(const QString &id) const; + + ContextManagerPrivate *d; +}; + +} // namespace Core + +#endif // CONTEXT_MANAGER_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp index 6c681f15a..fa61b5700 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp @@ -18,6 +18,7 @@ #include "core.h" #include "imenu_manager.h" +#include "context_manager.h" #include "main_window.h" #include "../../extension_system/iplugin_manager.h" @@ -54,6 +55,11 @@ IMenuManager *CoreImpl::menuManager() const return m_mainWindow->menuManager(); } +ContextManager *CoreImpl::contextManager() const +{ + return m_mainWindow->contextManager(); +} + QSettings *CoreImpl::settings() const { return m_mainWindow->settings(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h index d3b25b918..2613a06a5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h @@ -38,6 +38,7 @@ public: QWidget *parent = 0); virtual IMenuManager *menuManager() const; + virtual ContextManager *contextManager() const; virtual QSettings *settings() const; virtual QMainWindow *mainWindow() const; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc index 85b4702b0..a4c87d29c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc @@ -6,6 +6,9 @@ icons/ic_nel_down_item.png icons/ic_nel_generic_settings.png icons/ic_nel_open.png + icons/ic_nel_new.png + icons/ic_nel_save.png + icons/ic_nel_save_as.png icons/ic_nel_path_settings.png icons/ic_nel_pill.png icons/ic_nel_reset_all.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h index 18dc11c87..7f0b5cd15 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h @@ -1,80 +1,103 @@ -// Object Viewer Qt - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// Copyright (C) 2010 Dzmitry Kamiahin -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -#ifndef CORE_CONSTANTS_H -#define CORE_CONSTANTS_H - -namespace Core -{ -namespace Constants -{ - -const char * const OVQT_VERSION_LONG = "0.0.1"; -const char * const OVQT_VENDOR = "Dzmitry Kamiahin"; -const char * const OVQT_YEAR = "2010, 2011"; -const char * const OVQT_CORE_PLUGIN = "Core"; - -//mainwindow -const char * const MAIN_WINDOW = "ObjectViewerQt.MainWindow"; - -//menubar -const char * const MENU_BAR = "ObjectViewerQt.MenuBar"; - -//menus -const char * const M_FILE = "ObjectViewerQt.Menu.File"; -const char * const M_EDIT = "ObjectViewerQt.Menu.Edit"; -const char * const M_VIEW = "ObjectViewerQt.Menu.View"; -const char * const M_SCENE = "ObjectViewerQt.Menu.Scene"; -const char * const M_TOOLS = "ObjectViewerQt.Menu.Tools"; -const char * const M_WINDOW = "ObjectViewerQt.Menu.Window"; -const char * const M_HELP = "ObjectViewerQt.Menu.Help"; - -const char * const M_SHEET = "ObjectViewerQt.Menu.Sheet"; - -//actions -const char * const NEW = "ObjectViewerQt.New"; -const char * const OPEN = "ObjectViewerQt.Open"; -const char * const EXIT = "ObjectViewerQt.Exit"; - -const char * const SETTINGS = "ObjectViewerQt.Settings"; -const char * const TOGGLE_FULLSCREEN = "ObjectViewerQt.ToggleFullScreen"; - -const char * const CLOSE = "ObjectViewerQt.Close"; -const char * const CLOSEALL = "ObjectViewerQt.CloseAll"; -const char * const CLOSEOTHERS = "ObjectViewerQt.CloseOthers"; -const char * const ABOUT = "ObjectViewerQt.About"; -const char * const ABOUT_PLUGINS = "ObjectViewerQt.AboutPlugins"; -const char * const ABOUT_QT = "ObjectViewerQt.AboutQt"; - -//settings -const char * const DATA_PATH_SECTION = "DataPath"; -const char * const SEARCH_PATHS = "SearchPaths"; -const char * const RECURSIVE_SEARCH_PATHS = "RecursiveSearchPathes"; -const char * const LEVELDESIGN_PATH = "LevelDesignPath"; -const char * const ASSETS_PATH = "LevelDesignPath"; - -//resources -const char * const ICON_NEL = ":/core/images/nel.png"; -const char * const ICON_SETTINGS = ":/core/images/preferences.png"; -const char * const ICON_PILL = ":/core/icons/ic_nel_pill.png"; -const char * const ICON_OPEN = ":/core/icons/ic_nel_open.png"; -const char * const ICON_CRASH = ":/core/icons/ic_nel_crash.png"; - -} // namespace Constants -} // namespace Core - -#endif // CORE_CONSTANTS_H +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2010 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef CORE_CONSTANTS_H +#define CORE_CONSTANTS_H + +namespace Core +{ +namespace Constants +{ + +const char * const OVQT_VERSION_LONG = "0.0.1"; +const char * const OVQT_VENDOR = "Ryzom Core"; +const char * const OVQT_YEAR = "2010, 2011"; +const char * const OVQT_CORE_PLUGIN = "Core"; + +//mainwindow +const char * const MAIN_WINDOW = "ObjectViewerQt.MainWindow"; + +//menubar +const char * const MENU_BAR = "ObjectViewerQt.MenuBar"; + +//menus +const char * const M_FILE = "ObjectViewerQt.Menu.File"; +const char * const M_EDIT = "ObjectViewerQt.Menu.Edit"; +const char * const M_VIEW = "ObjectViewerQt.Menu.View"; +const char * const M_SCENE = "ObjectViewerQt.Menu.Scene"; +const char * const M_TOOLS = "ObjectViewerQt.Menu.Tools"; +const char * const M_WINDOW = "ObjectViewerQt.Menu.Window"; +const char * const M_HELP = "ObjectViewerQt.Menu.Help"; + +const char * const M_SHEET = "ObjectViewerQt.Menu.Sheet"; + +//actions +const char * const NEW = "ObjectViewerQt.New"; +const char * const OPEN = "ObjectViewerQt.Open"; +const char * const EXIT = "ObjectViewerQt.Exit"; + +const char * const SETTINGS = "ObjectViewerQt.Settings"; +const char * const TOGGLE_FULLSCREEN = "ObjectViewerQt.ToggleFullScreen"; + +const char * const CLOSE = "ObjectViewerQt.Close"; +const char * const CLOSEALL = "ObjectViewerQt.CloseAll"; +const char * const CLOSEOTHERS = "ObjectViewerQt.CloseOthers"; +const char * const ABOUT = "ObjectViewerQt.About"; +const char * const ABOUT_PLUGINS = "ObjectViewerQt.AboutPlugins"; +const char * const ABOUT_QT = "ObjectViewerQt.AboutQt"; + +//settings +const char * const SETTINGS_CATEGORY_GENERAL = "general"; +const char * const SETTINGS_CATEGORY_GENERAL_ICON = ":/icons/ic_nel_generic_settings.png"; +const char * const SETTINGS_TR_CATEGORY_GENERAL = QT_TR_NOOP("General"); + +const char * const MAIN_WINDOW_SECTION = "MainWindow"; +const char * const MAIN_WINDOW_STATE = "WindowState"; +const char * const MAIN_WINDOW_GEOMETRY = "WindowGeometry"; +const char * const QT_STYLE = "QtStyle"; +const char * const QT_PALETTE = "QtPalette"; + +const char * const LANGUAGE = "Language"; +const char * const PLUGINS_PATH = "PluginPath"; +const char * const DATA_PATH_SECTION = "DataPath"; +const char * const SEARCH_PATHS = "SearchPaths"; +const char * const RECURSIVE_SEARCH_PATHS = "RecursiveSearchPathes"; +const char * const LEVELDESIGN_PATH = "LevelDesignPath"; +const char * const ASSETS_PATH = "AssetsPath"; +const char * const REMAP_EXTENSIONS = "RemapExtensions"; + +const char * const LOG_SECTION = "LogSettings"; +const char * const LOG_ERROR = "LogError"; +const char * const LOG_WARNING = "LogWarning"; +const char * const LOG_DEBUG = "LogDebug"; +const char * const LOG_ASSERT = "LogAssert"; +const char * const LOG_INFO = "LogInfo"; + +//resources +const char * const ICON_NEL = ":/core/images/nel.png"; +const char * const ICON_SETTINGS = ":/core/images/preferences.png"; +const char * const ICON_PILL = ":/core/icons/ic_nel_pill.png"; +const char * const ICON_OPEN = ":/core/icons/ic_nel_open.png"; +const char * const ICON_NEW = ":/core/icons/ic_nel_new.png"; +const char * const ICON_SAVE = ":/core/icons/ic_nel_save.png"; +const char * const ICON_SAVE_AS = ":/core/icons/ic_nel_save_as.png"; +const char * const ICON_CRASH = ":/core/icons/ic_nel_crash.png"; + +} // namespace Constants +} // namespace Core + +#endif // CORE_CONSTANTS_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp index 6d051d64d..92e776068 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp @@ -20,8 +20,8 @@ #include "settings_dialog.h" #include "core_constants.h" #include "search_paths_settings_page.h" +#include "general_settings_page.h" #include "../../extension_system/iplugin_spec.h" -#include "qtwin.h" // NeL includes #include "nel/misc/debug.h" @@ -42,37 +42,40 @@ CorePlugin::CorePlugin() CorePlugin::~CorePlugin() { - Q_FOREACH(QObject *obj, _autoReleaseObjects) + Q_FOREACH(QObject *obj, m_autoReleaseObjects) { - _plugMan->removeObject(obj); + m_plugMan->removeObject(obj); } - qDeleteAll(_autoReleaseObjects); - _autoReleaseObjects.clear(); + qDeleteAll(m_autoReleaseObjects); + m_autoReleaseObjects.clear(); - delete _mainWindow; + delete m_mainWindow; } bool CorePlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); - _plugMan = pluginManager; + m_plugMan = pluginManager; - _mainWindow = new MainWindow(pluginManager); - /*if (QtWin::isCompositionEnabled()) - { - QtWin::extendFrameIntoClientArea(_mainWindow); - _mainWindow->setContentsMargins(0, 0, 0, 0); - }*/ - bool success = _mainWindow->initialize(errorString); - CSearchPathsSettingsPage *serchPathPage = new CSearchPathsSettingsPage(this); - serchPathPage->applySearchPaths(); - addAutoReleasedObject(serchPathPage); + m_mainWindow = new MainWindow(pluginManager); + bool success = m_mainWindow->initialize(errorString); + + GeneralSettingsPage *generalSettings = new GeneralSettingsPage(this); + CSearchPathsSettingsPage *searchPathPage = new CSearchPathsSettingsPage(false, this); + CSearchPathsSettingsPage *recureseSearchPathPage = new CSearchPathsSettingsPage(true, this); + + generalSettings->applyGeneralSettings(); + searchPathPage->applySearchPaths(); + recureseSearchPathPage->applySearchPaths(); + addAutoReleasedObject(generalSettings); + addAutoReleasedObject(searchPathPage); + addAutoReleasedObject(recureseSearchPathPage); return success; } void CorePlugin::extensionsInitialized() { - _mainWindow->extensionsInitialized(); + m_mainWindow->extensionsInitialized(); } void CorePlugin::shutdown() @@ -86,7 +89,7 @@ void CorePlugin::setNelContext(NLMISC::INelContext *nelContext) // This only applies to platforms without PIC, e.g. Windows. nlassert(!NLMISC::INelContext::isContextInitialised()); #endif // NL_OS_WINDOWS - _LibContext = new NLMISC::CLibraryContext(*nelContext); + m_libContext = new NLMISC::CLibraryContext(*nelContext); } QString CorePlugin::name() const @@ -116,8 +119,8 @@ QStringList CorePlugin::dependencies() const void CorePlugin::addAutoReleasedObject(QObject *obj) { - _plugMan->addObject(obj); - _autoReleaseObjects.prepend(obj); + m_plugMan->addObject(obj); + m_autoReleaseObjects.prepend(obj); } Q_EXPORT_PLUGIN(CorePlugin) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h index ef590e1fc..5c95d22c9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h @@ -63,16 +63,16 @@ public: ExtensionSystem::IPluginManager *pluginManager() const { - return _plugMan; + return m_plugMan; } protected: - NLMISC::CLibraryContext *_LibContext; + NLMISC::CLibraryContext *m_libContext; private: - ExtensionSystem::IPluginManager *_plugMan; - MainWindow *_mainWindow; - QList _autoReleaseObjects; + ExtensionSystem::IPluginManager *m_plugMan; + MainWindow *m_mainWindow; + QList m_autoReleaseObjects; }; } // namespace Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp new file mode 100644 index 000000000..51da80f67 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp @@ -0,0 +1,192 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "general_settings_page.h" +#include "core_constants.h" +#include "icore.h" + +// NeL includes +#include + +// Qt includes +#include +#include +#include +#include +#include +#include + +namespace Core +{ + +GeneralSettingsPage::GeneralSettingsPage(QObject *parent) + : IOptionsPage(parent), + m_page(0) +{ + m_originalPalette = QApplication::palette(); +} + +GeneralSettingsPage::~GeneralSettingsPage() +{ +} + +QString GeneralSettingsPage::id() const +{ + return QLatin1String("general_settings"); +} + +QString GeneralSettingsPage::trName() const +{ + return tr("General"); +} + +QString GeneralSettingsPage::category() const +{ + return QLatin1String(Constants::SETTINGS_CATEGORY_GENERAL); +} + +QString GeneralSettingsPage::trCategory() const +{ + return tr(Constants::SETTINGS_TR_CATEGORY_GENERAL); +} + +QIcon GeneralSettingsPage::categoryIcon() const +{ + return QIcon(); +} + +void GeneralSettingsPage::applyGeneralSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + + settings->beginGroup(Constants::MAIN_WINDOW_SECTION); + QApplication::setStyle(QStyleFactory::create(settings->value(Constants::QT_STYLE, "").toString())); + + if (settings->value(Constants::QT_PALETTE, true).toBool()) + QApplication::setPalette(QApplication::style()->standardPalette()); + else + QApplication::setPalette(m_originalPalette); + settings->endGroup(); +} + +QWidget *GeneralSettingsPage::createPage(QWidget *parent) +{ + m_page = new QWidget(parent); + m_ui.setupUi(m_page); + + readSettings(); + connect(m_ui.languageComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(changeLanguage(QString))); + connect(m_ui.pluginsPathButton, SIGNAL(clicked()), this, SLOT(setPluginsPath())); + connect(m_ui.leveldesignPathButton, SIGNAL(clicked()), this, SLOT(setLevelDesignPath())); + connect(m_ui.assetsPathButton, SIGNAL(clicked()), this, SLOT(setAssetsPath())); + return m_page; +} + +void GeneralSettingsPage::apply() +{ + writeSettings(); + applyGeneralSettings(); +} + +void GeneralSettingsPage::finish() +{ + delete m_page; + m_page = 0; +} + +void GeneralSettingsPage::changeLanguage(const QString &lang) +{ + QMessageBox::information(0, tr("Restart required"), + tr("The language change will take effect after a restart of Object Viewer Qt.")); +} + +void GeneralSettingsPage::setPluginsPath() +{ + QString newPath = QFileDialog::getExistingDirectory(0, tr("Set the plugins path"), + m_ui.pluginsPathLineEdit->text()); + if (!newPath.isEmpty()) + { + m_ui.pluginsPathLineEdit->setText(newPath); + } +} + +void GeneralSettingsPage::setLevelDesignPath() +{ + QString newPath = QFileDialog::getExistingDirectory(0, tr("Set the level design path"), + m_ui.leveldesignPathLineEdit->text()); + if (!newPath.isEmpty()) + { + m_ui.leveldesignPathLineEdit->setText(newPath); + } +} + +void GeneralSettingsPage::setAssetsPath() +{ + QString newPath = QFileDialog::getExistingDirectory(0, tr("Set the assets path"), + m_ui.assetsPathLineEdit->text()); + if (!newPath.isEmpty()) + { + m_ui.assetsPathLineEdit->setText(newPath); + } +} + +void GeneralSettingsPage::readSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + + m_ui.pluginsPathLineEdit->setText(settings->value(Core::Constants::PLUGINS_PATH, "./plugins").toString()); + + settings->beginGroup(Constants::MAIN_WINDOW_SECTION); + m_ui.styleComboBox->addItems(QStyleFactory::keys()); + QString style = settings->value(Constants::QT_STYLE, "").toString(); + if (style == "") + m_ui.styleComboBox->setCurrentIndex(0); + else + m_ui.styleComboBox->setCurrentIndex(m_ui.styleComboBox->findText(style)); + m_ui.paletteCheckBox->setChecked(settings->value(Constants::QT_PALETTE, true).toBool()); + settings->endGroup(); + + QStringList paths; + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + m_ui.leveldesignPathLineEdit->setText(settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString()); + m_ui.assetsPathLineEdit->setText(settings->value(Core::Constants::ASSETS_PATH, "w:/database").toString()); + settings->endGroup(); +} + +void GeneralSettingsPage::writeSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + + settings->setValue(Core::Constants::PLUGINS_PATH, m_ui.pluginsPathLineEdit->text()); + + settings->beginGroup(Constants::MAIN_WINDOW_SECTION); + if (m_ui.styleComboBox->currentIndex() == 0) + settings->setValue(Constants::QT_STYLE, ""); + else + settings->setValue(Constants::QT_STYLE, m_ui.styleComboBox->currentText()); + settings->setValue(Constants::QT_PALETTE, m_ui.paletteCheckBox->isChecked()); + settings->endGroup(); + + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + settings->setValue(Core::Constants::LEVELDESIGN_PATH, m_ui.leveldesignPathLineEdit->text()); + settings->setValue(Core::Constants::ASSETS_PATH, m_ui.assetsPathLineEdit->text()); + settings->endGroup(); + settings->sync(); +} + +} /* namespace Core */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.h new file mode 100644 index 000000000..2fbcb842a --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.h @@ -0,0 +1,72 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef GENERAL_SETTINGS_PAGE_H +#define GENERAL_SETTINGS_PAGE_H + +#include + +#include "ioptions_page.h" + +#include "ui_general_settings_page.h" + +class QWidget; + +namespace Core +{ +/** +@class GeneralSettingsPage +*/ +class GeneralSettingsPage : public Core::IOptionsPage +{ + Q_OBJECT + +public: + GeneralSettingsPage(QObject *parent = 0); + ~GeneralSettingsPage(); + + QString id() const; + QString trName() const; + QString category() const; + QString trCategory() const; + QIcon categoryIcon() const; + QWidget *createPage(QWidget *parent); + + void apply(); + void finish(); + + void applyGeneralSettings(); + +private Q_SLOTS: + void changeLanguage(const QString &lang); + void setPluginsPath(); + void setLevelDesignPath(); + void setAssetsPath(); + +private: + void readSettings(); + void writeSettings(); + + QPalette m_originalPalette; + QWidget *m_page; + Ui::GeneralSettingsPage m_ui; +}; + +} // namespace Core + +#endif // GENERAL_SETTINGS_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.ui new file mode 100644 index 000000000..d2aa042e3 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.ui @@ -0,0 +1,199 @@ + + + GeneralSettingsPage + + + + 0 + 0 + 267 + 282 + + + + Form + + + + 6 + + + 3 + + + + + Qt Style + + + + 6 + + + 6 + + + + + + default + + + + + + + + Use style's standard palette + + + + + + + + + + Language + + + + 6 + + + + + false + + + + English + + + + + German + + + + + French + + + + + Russian + + + + + + + + + + + Paths + + + + 6 + + + 6 + + + + + Plugins path: + + + + + + + + 0 + 0 + + + + + + + + ... + + + + + + + Level design path: + + + + + + + + 0 + 0 + + + + + + + + ... + + + + + + + Assets path: + + + + + + + + 0 + 0 + + + + + + + + ... + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_new.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_new.png new file mode 100644 index 000000000..159e3e18e Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_new.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save.png new file mode 100644 index 000000000..5aeb3bbe9 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save_as.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save_as.png new file mode 100644 index 000000000..6cb71a334 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save_as.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h index 776246d8d..8af601418 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h @@ -28,6 +28,7 @@ QT_BEGIN_NAMESPACE class QWidget; +class QUndoStack; QT_END_NAMESPACE namespace Core @@ -56,6 +57,10 @@ public: /// The widget will be destroyed by the widget hierarchy when the main window closes virtual QWidget *widget() = 0; + + virtual QUndoStack *undoStack() = 0; + + virtual void open() = 0; }; } // namespace Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h index 8f0c5b4ca..13b22bfa5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h @@ -36,6 +36,7 @@ class IPluginManager; namespace Core { class IMenuManager; +class ContextManager; class CORE_EXPORT ICore : public QObject { @@ -52,6 +53,7 @@ public: QWidget *parent = 0) = 0; virtual IMenuManager *menuManager() const = 0; + virtual ContextManager *contextManager() const = 0; virtual QSettings *settings() const = 0; virtual QMainWindow *mainWindow() const = 0; @@ -59,6 +61,7 @@ public: virtual ExtensionSystem::IPluginManager *pluginManager() const = 0; Q_SIGNALS: + void changeSettings(); void closeMainWindow(); }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h index 74692833a..4d9ed6fda 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h @@ -27,6 +27,7 @@ QT_BEGIN_NAMESPACE class QWidget; +class QIcon; QT_END_NAMESPACE namespace Core @@ -56,6 +57,8 @@ public: /// trCategory() is the translated category virtual QString trCategory() const = 0; + virtual QIcon categoryIcon() const = 0; + /// createPage() is called to retrieve the widget to show in the preferences dialog /// The widget will be destroyed by the widget hierarchy when the dialog closes virtual QWidget *createPage(QWidget *parent) = 0; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp index 44f415a25..79316424a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp @@ -20,6 +20,7 @@ #include "icontext.h" #include "icore_listener.h" #include "menu_manager.h" +#include "context_manager.h" #include "core.h" #include "core_constants.h" #include "settings_dialog.h" @@ -38,8 +39,10 @@ MainWindow::MainWindow(ExtensionSystem::IPluginManager *pluginManager, QWidget * : QMainWindow(parent), m_pluginManager(0), m_menuManager(0), + m_contextManager(0), m_coreImpl(0), m_lastDir("."), + m_undoGroup(0), m_settings(0) { QCoreApplication::setApplicationName(QLatin1String("ObjectViewerQt")); @@ -59,11 +62,15 @@ MainWindow::MainWindow(ExtensionSystem::IPluginManager *pluginManager, QWidget * m_tabWidget = new QTabWidget(this); m_tabWidget->setTabPosition(QTabWidget::South); - m_tabWidget->setMovable(true); + m_tabWidget->setMovable(false); + m_tabWidget->setDocumentMode(true); setCentralWidget(m_tabWidget); + m_contextManager = new ContextManager(this, m_tabWidget); + setDockNestingEnabled(true); m_originalPalette = QApplication::palette(); + m_undoGroup = new QUndoGroup(this); createDialogs(); createActions(); @@ -91,15 +98,11 @@ bool MainWindow::initialize(QString *errorString) void MainWindow::extensionsInitialized() { - QList listContexts = m_pluginManager->getObjects(); - - Q_FOREACH(IContext *context, listContexts) - { - addContextObject(context); - } - - connect(m_pluginManager, SIGNAL(objectAdded(QObject *)), this, SLOT(checkObject(QObject *))); - readSettings(); + readSettings(); + connect(m_contextManager, SIGNAL(currentContextChanged(Core::IContext*)), + this, SLOT(updateContext(Core::IContext*))); + if (m_contextManager->currentContext() != NULL) + updateContext(m_contextManager->currentContext()); show(); } @@ -108,6 +111,11 @@ IMenuManager *MainWindow::menuManager() const return m_menuManager; } +ContextManager *MainWindow::contextManager() const +{ + return m_contextManager; +} + QSettings *MainWindow::settings() const { return m_settings; @@ -118,11 +126,19 @@ ExtensionSystem::IPluginManager *MainWindow::pluginManager() const return m_pluginManager; } -void MainWindow::checkObject(QObject *obj) +void MainWindow::addContextObject(IContext *context) { - IContext *context = qobject_cast(obj); - if (context) - addContextObject(context); + m_undoGroup->addStack(context->undoStack()); +} + +void MainWindow::removeContextObject(IContext *context) +{ + m_undoGroup->removeStack(context->undoStack()); +} + +void MainWindow::open() +{ + m_contextManager->currentContext()->open(); } bool MainWindow::showOptionsDialog(const QString &group, @@ -133,7 +149,10 @@ bool MainWindow::showOptionsDialog(const QString &group, parent = this; CSettingsDialog settingsDialog(m_pluginManager, group, page, parent); settingsDialog.show(); - return settingsDialog.execDialog(); + bool ok = settingsDialog.execDialog(); + if (ok) + Q_EMIT m_coreImpl->changeSettings(); + return ok; } void MainWindow::about() @@ -143,6 +162,11 @@ void MainWindow::about() "

Ryzom Core team

Compiled on %1 %2").arg(__DATE__).arg(__TIME__)); } +void MainWindow::updateContext(Core::IContext *context) +{ + m_undoGroup->setActiveStack(context->undoStack()); +} + void MainWindow::closeEvent(QCloseEvent *event) { QList listeners = m_pluginManager->getObjects(); @@ -160,16 +184,6 @@ void MainWindow::closeEvent(QCloseEvent *event) event->accept(); } -void MainWindow::addContextObject(IContext *context) -{ - QWidget *tabWidget = new QWidget(m_tabWidget); - m_tabWidget->addTab(tabWidget, context->icon(), context->trName()); - QGridLayout *gridLayout = new QGridLayout(tabWidget); - gridLayout->setObjectName(QString::fromUtf8("gridLayout_") + context->id()); - gridLayout->setContentsMargins(0, 0, 0, 0); - gridLayout->addWidget(context->widget(), 0, 0, 1, 1); -} - void MainWindow::createActions() { m_openAction = new QAction(tr("&Open..."), this); @@ -177,7 +191,7 @@ void MainWindow::createActions() m_openAction->setShortcut(QKeySequence::Open); m_openAction->setStatusTip(tr("Open an existing file")); menuManager()->registerAction(m_openAction, Constants::OPEN); -// connect(m_openAction, SIGNAL(triggered()), this, SLOT(open())); + connect(m_openAction, SIGNAL(triggered()), this, SLOT(open())); m_exitAction = new QAction(tr("E&xit"), this); m_exitAction->setShortcut(QKeySequence(tr("Ctrl+Q"))); @@ -220,10 +234,14 @@ void MainWindow::createMenus() { m_fileMenu = menuBar()->addMenu(tr("&File")); menuManager()->registerMenu(m_fileMenu, Constants::M_FILE); + m_fileMenu->addAction(m_openAction); m_fileMenu->addSeparator(); m_fileMenu->addAction(m_exitAction); m_editMenu = menuBar()->addMenu(tr("&Edit")); + m_editMenu->addAction(m_undoGroup->createUndoAction(this)); + m_editMenu->addAction(m_undoGroup->createRedoAction(this)); + m_editMenu->addSeparator(); menuManager()->registerMenu(m_editMenu, Constants::M_EDIT); m_viewMenu = menuBar()->addMenu(tr("&View")); @@ -260,17 +278,17 @@ void MainWindow::createDialogs() void MainWindow::readSettings() { - m_settings->beginGroup("MainWindow"); - restoreState(m_settings->value("WindowState").toByteArray()); - restoreGeometry(m_settings->value("WindowGeometry").toByteArray()); + m_settings->beginGroup(Constants::MAIN_WINDOW_SECTION); + restoreState(m_settings->value(Constants::MAIN_WINDOW_STATE).toByteArray()); + restoreGeometry(m_settings->value(Constants::MAIN_WINDOW_GEOMETRY).toByteArray()); m_settings->endGroup(); } void MainWindow::writeSettings() { - m_settings->beginGroup("MainWindow"); - m_settings->setValue("WindowState", saveState()); - m_settings->setValue("WindowGeometry", saveGeometry()); + m_settings->beginGroup(Constants::MAIN_WINDOW_SECTION); + m_settings->setValue(Constants::MAIN_WINDOW_STATE, saveState()); + m_settings->setValue(Constants::MAIN_WINDOW_GEOMETRY, saveGeometry()); m_settings->endGroup(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h index 21d091ef3..74ec08957 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h @@ -26,6 +26,7 @@ // Qt includes #include +#include #include namespace Core @@ -35,6 +36,7 @@ class CorePlugin; class IContext; class IMenuManager; class MenuManager; +class ContextManager; class CoreImpl; class MainWindow : public QMainWindow @@ -49,25 +51,28 @@ public: void extensionsInitialized(); IMenuManager *menuManager() const; + ContextManager *contextManager() const; QSettings *settings() const; ExtensionSystem::IPluginManager *pluginManager() const; + void addContextObject(IContext *context); + void removeContextObject(IContext *context); + public Q_SLOTS: bool showOptionsDialog(const QString &group = QString(), const QString &page = QString(), QWidget *parent = 0); private Q_SLOTS: - void checkObject(QObject *obj); + void open(); void about(); + void updateContext(Core::IContext *context); protected: virtual void closeEvent(QCloseEvent *event); private: - void addContextObject(IContext *appPage); - void createActions(); void createMenus(); void createStatusBar(); @@ -79,11 +84,13 @@ private: ExtensionSystem::IPluginManager *m_pluginManager; ExtensionSystem::CPluginView *m_pluginView; MenuManager *m_menuManager; + ContextManager *m_contextManager; CoreImpl *m_coreImpl; QPalette m_originalPalette; QString m_lastDir; + QUndoGroup *m_undoGroup; QSettings *m_settings; QTimer *m_mainTimer; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp index c52624717..355a9c0e3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp @@ -33,8 +33,9 @@ namespace Core QString lastDir = "."; -CSearchPathsSettingsPage::CSearchPathsSettingsPage(QObject *parent) +CSearchPathsSettingsPage::CSearchPathsSettingsPage(bool recurse, QObject *parent) : IOptionsPage(parent), + m_recurse(recurse), m_page(0) { } @@ -45,22 +46,33 @@ CSearchPathsSettingsPage::~CSearchPathsSettingsPage() QString CSearchPathsSettingsPage::id() const { - return QLatin1String("SearchPaths"); + if (m_recurse) + return QLatin1String("search_recurse_paths"); + else + return QLatin1String("search_paths"); } QString CSearchPathsSettingsPage::trName() const { - return tr("Search Paths"); + if (m_recurse) + return tr("Search Recurse Paths"); + else + return tr("Search Paths"); } QString CSearchPathsSettingsPage::category() const { - return QLatin1String("General"); + return QLatin1String(Constants::SETTINGS_CATEGORY_GENERAL); } QString CSearchPathsSettingsPage::trCategory() const { - return tr("General"); + return tr(Constants::SETTINGS_TR_CATEGORY_GENERAL); +} + +QIcon CSearchPathsSettingsPage::categoryIcon() const +{ + return QIcon(); } QWidget *CSearchPathsSettingsPage::createPage(QWidget *parent) @@ -92,17 +104,24 @@ void CSearchPathsSettingsPage::finish() void CSearchPathsSettingsPage::applySearchPaths() { - QStringList paths; + QStringList paths, remapExt; QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); + if (m_recurse) + paths = settings->value(Core::Constants::RECURSIVE_SEARCH_PATHS).toStringList(); + else + paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); + + remapExt = settings->value(Core::Constants::REMAP_EXTENSIONS).toStringList(); settings->endGroup(); + + for (int i = 1; i < remapExt.size(); i += 2) + NLMISC::CPath::remapExtension(remapExt.at(i - 1).toStdString(), remapExt.at(i).toStdString(), true); + Q_FOREACH(QString path, paths) { - NLMISC::CPath::addSearchPath(path.toStdString(), false, false); + NLMISC::CPath::addSearchPath(path.toStdString(), m_recurse, false); } - NLMISC::CPath::remapExtension("png", "tga", true); - NLMISC::CPath::remapExtension("png", "dds", true); } void CSearchPathsSettingsPage::addPath() @@ -156,7 +175,10 @@ void CSearchPathsSettingsPage::readSettings() QStringList paths; QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); + if (m_recurse) + paths = settings->value(Core::Constants::RECURSIVE_SEARCH_PATHS).toStringList(); + else + paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); settings->endGroup(); Q_FOREACH(QString path, paths) { @@ -175,8 +197,12 @@ void CSearchPathsSettingsPage::writeSettings() QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - settings->setValue(Core::Constants::SEARCH_PATHS, paths); + if (m_recurse) + settings->setValue(Core::Constants::RECURSIVE_SEARCH_PATHS, paths); + else + settings->setValue(Core::Constants::SEARCH_PATHS, paths); settings->endGroup(); + settings->sync(); } void CSearchPathsSettingsPage::checkEnabledButton() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h index 15f28f6c8..c7d4c9734 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h @@ -37,18 +37,20 @@ class CSearchPathsSettingsPage : public Core::IOptionsPage Q_OBJECT public: - CSearchPathsSettingsPage(QObject *parent = 0); + explicit CSearchPathsSettingsPage(bool recurse, QObject *parent = 0); ~CSearchPathsSettingsPage(); QString id() const; QString trName() const; QString category() const; QString trCategory() const; + QIcon categoryIcon() const; QWidget *createPage(QWidget *parent); void apply(); void finish(); + // Set of the search paths(not recursive) and the remap extensions (loading from settings file) void applySearchPaths(); private Q_SLOTS: @@ -62,6 +64,7 @@ private: void writeSettings(); void checkEnabledButton(); + bool m_recurse; QWidget *m_page; Ui::CSearchPathsSettingsPage m_ui; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp index 0cb885163..50e7c9db5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp @@ -53,6 +53,11 @@ QString CExampleSettingsPage::trCategory() const return tr("General"); } +QIcon CExampleSettingsPage::categoryIcon() const +{ + return QIcon(); +} + QWidget *CExampleSettingsPage::createPage(QWidget *parent) { _currentPage = new QWidget(parent); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h index 64dd940f8..3475f843f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h @@ -43,6 +43,7 @@ public: virtual QString trName() const; virtual QString category() const; virtual QString trCategory() const; + QIcon categoryIcon() const; virtual QWidget *createPage(QWidget *parent); virtual void apply(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h index d3be3bc38..5077ff59e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h @@ -86,6 +86,15 @@ public: return m_simpleViewer; } + virtual QUndoStack *undoStack() + { + return m_simpleViewer->m_undoStack; + } + + virtual void open() + { + } + CSimpleViewer *m_simpleViewer; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp index 9a67abb80..4872923db 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp @@ -38,6 +38,9 @@ QNLWidget::QNLWidget(QWidget *parent) m_initialized(false), m_interval(25) { + setAttribute(Qt::WA_OpaquePaintEvent); + setAttribute(Qt::WA_NoSystemBackground); + setAttribute(Qt::WA_PaintOnScreen); setMouseTracking(true); setFocusPolicy(Qt::StrongFocus); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp index e128710c4..1f6df9117 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp @@ -37,6 +37,8 @@ CSimpleViewer::CSimpleViewer(QWidget *parent) gridLayout->setContentsMargins(0, 0, 0, 0); NLQT::QNLWidget *_nelWidget = new NLQT::QNLWidget(this); gridLayout->addWidget(_nelWidget, 0, 0, 1, 1); + + m_undoStack = new QUndoStack(this); } bool CCoreListener::closeMainWindow() const diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h index bbff7e9e0..14b782c22 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h @@ -25,7 +25,7 @@ // Qt includes #include - +#include class QWidget; namespace Plugin @@ -37,6 +37,8 @@ class CSimpleViewer : public QWidget public: CSimpleViewer(QWidget *parent = 0); virtual ~CSimpleViewer() {} + + QUndoStack *m_undoStack; }; class CCoreListener : public Core::ICoreListener diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/CMakeLists.txt new file mode 100644 index 000000000..d1dd346ba --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/CMakeLists.txt @@ -0,0 +1,43 @@ +INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${LIBXML2_INCLUDE_DIR} + ${QT_INCLUDES}) + +FILE(GLOB SRC *.cpp *.h) +SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h + ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_manager.h + ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) + +SET(OVQT_PLUG_GEORGES_EDITOR_HDR georges_editor_plugin.h + georges_editor_form.h + georges_dirtree_dialog.h) + +SET(OVQT_PLUG_GEORGES_EDITOR_UIS georges_editor_form.ui + georges_dirtree_form.ui) + +SET(OVQT_PLUGIN_GEORGES_EDITOR_RCS georges_editor.qrc) + +SET(QT_USE_QTGUI TRUE) +SET(QT_USE_QTOPENGL TRUE) + +QT4_ADD_RESOURCES(OVQT_PLUGIN_GEORGES_EDITOR_RC_SRCS ${OVQT_PLUGIN_GEORGES_EDITOR_RCS}) +QT4_WRAP_CPP(OVQT_PLUG_GEORGES_EDITOR_MOC_SRC ${OVQT_PLUG_GEORGES_EDITOR_HDR}) +QT4_WRAP_UI( OVQT_PLUG_GEORGES_EDITOR_UI_HDRS ${OVQT_PLUG_GEORGES_EDITOR_UIS} ) + +SOURCE_GROUP(QtResources FILES ${OVQT_PLUG_GEORGES_EDITOR_UIS} ${OVQT_PLUGIN_GEORGES_EDITOR_RCS}) +SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_PLUG_GEORGES_EDITOR_UI_HDRS}) +SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_GEORGES_EDITOR_MOC_SRC}) +SOURCE_GROUP("Georges Editor Plugin" FILES ${SRC}) +SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) + +ADD_LIBRARY(ovqt_plugin_georges_editor MODULE ${SRC} ${OVQT_PLUG_GEORGES_EDITOR_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_GEORGES_EDITOR_UI_HDRS} ${OVQT_PLUGIN_GEORGES_EDITOR_RC_SRCS}) + +TARGET_LINK_LIBRARIES(ovqt_plugin_georges_editor ovqt_plugin_core nelmisc ${QT_LIBRARIES}) + +NL_DEFAULT_PROPS(ovqt_plugin_georges_editor "NeL, Tools, 3D: Object Viewer Qt Plugin: Georges Editor") +NL_ADD_RUNTIME_FLAGS(ovqt_plugin_georges_editor) +NL_ADD_LIB_SUFFIX(ovqt_plugin_georges_editor) + +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) + +INSTALL(TARGETS ovqt_plugin_georges_editor LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp new file mode 100644 index 000000000..f7e250cce --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp @@ -0,0 +1,99 @@ +// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework +// Copyright (C) 2011 Adrian Jaekel +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "georges_dirtree_dialog.h" + +// Qt includes +#include +#include + +// NeL includes + +//using namespace NLMISC; + +namespace Plugin +{ + +CGeorgesDirTreeDialog::CGeorgesDirTreeDialog(QString ldPath, QWidget *parent) + :QDockWidget(parent), m_ldPath(ldPath) +{ + + m_ui.setupUi(this); + + m_dirModel = new CGeorgesFileSystemModel(m_ldPath); + m_ui.dirTree->setModel(m_dirModel); + + if (m_dirModel->isCorrectLDPath()) + { + m_dirModel->setRootPath(m_ldPath); + m_ui.dirTree->setRootIndex(m_dirModel->index(m_ldPath)); + } + else + { + m_dirModel->setRootPath(QDir::currentPath()); + } + + m_ui.dirTree->setAnimated(false); + m_ui.dirTree->setIndentation(20); + + connect(m_ui.dirTree, SIGNAL(activated(QModelIndex)), + this, SLOT(fileSelected(QModelIndex))); +} + +CGeorgesDirTreeDialog::~CGeorgesDirTreeDialog() +{ + delete m_dirModel; +} + +void CGeorgesDirTreeDialog::fileSelected(QModelIndex index) +{ + QString name; + if (index.isValid() && !m_dirModel->isDir(index)) + { + Q_EMIT selectedForm(m_dirModel->fileName(index)); + } +} + +void CGeorgesDirTreeDialog::changeFile(QString file) +{ + QModelIndex index = m_dirModel->index(file); + m_ui.dirTree->selectionModel()->select(index,QItemSelectionModel::ClearAndSelect); + m_ui.dirTree->scrollTo(index,QAbstractItemView::PositionAtCenter); + fileSelected(index); +} + +void CGeorgesDirTreeDialog::ldPathChanged(QString path) +{ + m_ldPath = path; + + delete m_dirModel; + + m_dirModel = new CGeorgesFileSystemModel(m_ldPath); + m_ui.dirTree->setModel(m_dirModel); + + if (m_dirModel->isCorrectLDPath()) + { + m_dirModel->setRootPath(m_ldPath); + m_ui.dirTree->setRootIndex(m_dirModel->index(m_ldPath)); + } + else + { + m_dirModel->setRootPath(QDir::currentPath()); + } +} + +} /* namespace NLQT */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.h new file mode 100644 index 000000000..3079f76c2 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.h @@ -0,0 +1,62 @@ +// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework +// Copyright (C) 2011 Adrian Jaekel +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef GEORGES_DIRTREE_DIALOG_H +#define GEORGES_DIRTREE_DIALOG_H + +// Qt includes +#include + +// STL includes + +// NeL includes + +// Project includes +#include "ui_georges_dirtree_form.h" +#include "georges_filesystem_model.h" + +namespace Plugin +{ + +class CGeorgesDirTreeDialog: public QDockWidget +{ + Q_OBJECT + +public: + CGeorgesDirTreeDialog(QString ldPath, QWidget *parent = 0); + ~CGeorgesDirTreeDialog(); + + void ldPathChanged(QString); + +private: + Ui::CGeorgesDirTreeDialog m_ui; + + CGeorgesFileSystemModel *m_dirModel; + QString m_ldPath; + +Q_SIGNALS: + void selectedForm(const QString); + +private Q_SLOTS: + void fileSelected(QModelIndex index); + void changeFile(QString file); + + friend class CMainWindow; +}; /* CGEorgesDirTreeDialog */ + +} /* namespace NLQT */ + +#endif // GEORGES_DIRTREE_DIALOG_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_form.ui new file mode 100644 index 000000000..8731d1ca8 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_form.ui @@ -0,0 +1,54 @@ + + + CGeorgesDirTreeDialog + + + + 0 + 0 + 400 + 300 + + + + + 0 + 0 + + + + + 200 + 111 + + + + QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable + + + Leveldesign Path + + + + + 50 + 0 + + + + + + + + 0 + 0 + + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor.qrc b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor.qrc new file mode 100644 index 000000000..3d514dbc0 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor.qrc @@ -0,0 +1,5 @@ + + + images/ic_nel_georges_editor.png + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_constants.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_constants.h new file mode 100644 index 000000000..bb9fe3306 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_constants.h @@ -0,0 +1,31 @@ +// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework +// Copyright (C) 2011 Adrian Jaekel +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef GEORGES_EDITOR_CONSTANTS_H +#define GEORGES_EDITOR_CONSTANTS_H + +namespace Plugin +{ +namespace Constants +{ +//settings +const char * const GEORGES_EDITOR_SECTION = "GeorgesEditor"; + + +} // namespace Constants +} // namespace Plugin + +#endif // GEORGES_EDITOR_CONSTANTS_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp new file mode 100644 index 000000000..aa614a161 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp @@ -0,0 +1,139 @@ +// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework +// Copyright (C) 2011 Adrian Jaekel +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "georges_editor_form.h" +#include "georges_editor_constants.h" +#include "georges_dirtree_dialog.h" + +#include "../core/icore.h" +#include "../core/imenu_manager.h" +#include "../core/core_constants.h" + +// NeL includes +#include + +// Qt includes +#include +#include +#include + +namespace Plugin +{ + +GeorgesEditorForm::GeorgesEditorForm(QWidget *parent) + : QMainWindow(parent), + m_georgesDirTreeDialog(0) +{ + m_ui.setupUi(this); + + m_undoStack = new QUndoStack(this); + + _openAction = new QAction(tr("&Open..."), this); + _openAction->setIcon(QIcon(Core::Constants::ICON_OPEN)); + _openAction->setShortcut(QKeySequence::Open); + _openAction->setStatusTip(tr("Open an existing file")); + connect(_openAction, SIGNAL(triggered()), this, SLOT(open())); + + _newAction = new QAction(tr("&New..."), this); + _newAction->setIcon(QIcon(Core::Constants::ICON_NEW)); + _newAction->setShortcut(QKeySequence::New); + _newAction->setStatusTip(tr("Create a new file")); + connect(_newAction, SIGNAL(triggered()), this, SLOT(newFile())); + + _saveAction = new QAction(tr("&Save..."), this); + _saveAction->setIcon(QIcon(Core::Constants::ICON_SAVE)); + _saveAction->setShortcut(QKeySequence::Save); + _saveAction->setStatusTip(tr("Save the current file")); + connect(_saveAction, SIGNAL(triggered()), this, SLOT(save())); + + _fileToolBar = addToolBar(tr("&File")); + _fileToolBar->addAction(_openAction); + _fileToolBar->addAction(_newAction); + _fileToolBar->addAction(_saveAction); + + readSettings(); + + // create leveldesign directory tree dockwidget + m_georgesDirTreeDialog = new CGeorgesDirTreeDialog(m_leveldesignPath, this); + addDockWidget(Qt::LeftDockWidgetArea, m_georgesDirTreeDialog); + //m_georgesDirTreeDialog->setVisible(false); + connect(Core::ICore::instance(), SIGNAL(changeSettings()), + this, SLOT(settingsChanged())); +} + +GeorgesEditorForm::~GeorgesEditorForm() +{ + writeSettings(); +} + +QUndoStack *GeorgesEditorForm::undoStack() const +{ + return m_undoStack; +} + +void GeorgesEditorForm::open() +{ + // TODO: FileDialog & loadFile(); + //QString fileName = QFileDialog::getOpenFileName(); + //loadFile(fileName); +} + +void GeorgesEditorForm::newFile() +{ + +} + +void GeorgesEditorForm::save() +{ + +} + +void GeorgesEditorForm::readSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::GEORGES_EDITOR_SECTION); + settings->endGroup(); + + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + m_leveldesignPath = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString(); + settings->endGroup(); +} + +void GeorgesEditorForm::writeSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::GEORGES_EDITOR_SECTION); + settings->endGroup(); + settings->sync(); +} + +void GeorgesEditorForm::settingsChanged() +{ + QSettings *settings = Core::ICore::instance()->settings(); + + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + QString oldLDPath = m_leveldesignPath; + m_leveldesignPath = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString(); + settings->endGroup(); + + if (oldLDPath != m_leveldesignPath) + { + m_georgesDirTreeDialog->ldPathChanged(m_leveldesignPath); + } +} + +} /* namespace Plugin */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.h new file mode 100644 index 000000000..96fceb4ed --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.h @@ -0,0 +1,64 @@ +// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework +// Copyright (C) 2011 Adrian Jaekel +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef GEORGES_EDITOR_FORM_H +#define GEORGES_EDITOR_FORM_H + +// Project includes +#include "ui_georges_editor_form.h" + +// Qt includes +#include + +namespace Plugin +{ + +class CGeorgesDirTreeDialog; +class GeorgesEditorForm: public QMainWindow +{ + Q_OBJECT + +public: + GeorgesEditorForm(QWidget *parent = 0); + ~GeorgesEditorForm(); + + QUndoStack *undoStack() const; + +public Q_SLOTS: + void open(); + void newFile(); + void save(); + void settingsChanged(); + +private: + void readSettings(); + void writeSettings(); + + QUndoStack *m_undoStack; + Ui::GeorgesEditorForm m_ui; + + CGeorgesDirTreeDialog *m_georgesDirTreeDialog; + QToolBar *_fileToolBar; + QAction *_openAction; + QAction *_newAction; + QAction *_saveAction; + + QString m_leveldesignPath; +}; /* class GeorgesEditorForm */ + +} /* namespace Plugin */ + +#endif // GEORGES_EDITOR_FORM_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.ui new file mode 100644 index 000000000..905814cc7 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.ui @@ -0,0 +1,28 @@ + + + GeorgesEditorForm + + + + 0 + 0 + 800 + 600 + + + + Georges Editor + + + + QWidget#centralwidget { + image: url(:/images/ic_nel_georges_editor.png); + } + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp new file mode 100644 index 000000000..a97188751 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp @@ -0,0 +1,128 @@ +// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework +// Copyright (C) 2011 Adrian Jaekel +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "georges_editor_plugin.h" +#include "georges_editor_form.h" + +#include "../core/icore.h" +#include "../core/core_constants.h" + +// NeL includes +#include "nel/misc/debug.h" + +// Qt includes +#include + +namespace Plugin +{ + +GeorgesEditorPlugin::~GeorgesEditorPlugin() +{ + Q_FOREACH(QObject *obj, m_autoReleaseObjects) + { + m_plugMan->removeObject(obj); + } + qDeleteAll(m_autoReleaseObjects); + m_autoReleaseObjects.clear(); +} + +bool GeorgesEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) +{ + Q_UNUSED(errorString); + m_plugMan = pluginManager; + + addAutoReleasedObject(new GeorgesEditorContext(this)); + return true; +} + +void GeorgesEditorPlugin::extensionsInitialized() +{ +} + +void GeorgesEditorPlugin::shutdown() +{ +} + +void GeorgesEditorPlugin::setNelContext(NLMISC::INelContext *nelContext) +{ +#ifdef NL_OS_WINDOWS + // Ensure that a context doesn't exist yet. + // This only applies to platforms without PIC, e.g. Windows. + nlassert(!NLMISC::INelContext::isContextInitialised()); +#endif // NL_OS_WINDOWS + m_libContext = new NLMISC::CLibraryContext(*nelContext); +} + +QString GeorgesEditorPlugin::name() const +{ + return tr("Georges Editor"); +} + +QString GeorgesEditorPlugin::version() const +{ + return "0.2"; +} + +QString GeorgesEditorPlugin::vendor() const +{ + return "aquiles"; +} + +QString GeorgesEditorPlugin::description() const +{ + return tr("Tool to create & edit sheets or forms."); +} + +QStringList GeorgesEditorPlugin::dependencies() const +{ + QStringList list; + list.append(Core::Constants::OVQT_CORE_PLUGIN); + list.append("ObjectViewer"); // TODO + return list; +} + +void GeorgesEditorPlugin::addAutoReleasedObject(QObject *obj) +{ + m_plugMan->addObject(obj); + m_autoReleaseObjects.prepend(obj); +} + +GeorgesEditorContext::GeorgesEditorContext(QObject *parent) + : IContext(parent), + m_georgesEditorForm(0) +{ + m_georgesEditorForm = new GeorgesEditorForm(); +} + +QUndoStack *GeorgesEditorContext::undoStack() +{ + return m_georgesEditorForm->undoStack(); +} + +void GeorgesEditorContext::open() +{ + m_georgesEditorForm->open(); +} + +QWidget *GeorgesEditorContext::widget() +{ + return m_georgesEditorForm; +} + +} + +Q_EXPORT_PLUGIN(Plugin::GeorgesEditorPlugin) \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h new file mode 100644 index 000000000..7cc93dfb4 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h @@ -0,0 +1,105 @@ +// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework +// Copyright (C) 2011 Adrian Jaekel +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef GEORGES_EDITOR_PLUGIN_H +#define GEORGES_EDITOR_PLUGIN_H + +// Project includes +#include "../../extension_system/iplugin.h" +#include "../core/icontext.h" + +// NeL includes +#include "nel/misc/app_context.h" + +// Qt includes +#include +#include + +namespace NLMISC +{ +class CLibraryContext; +} + +namespace ExtensionSystem +{ +class IPluginSpec; +} + +namespace Plugin +{ +class GeorgesEditorForm; +class GeorgesEditorPlugin : public QObject, public ExtensionSystem::IPlugin +{ + Q_OBJECT + Q_INTERFACES(ExtensionSystem::IPlugin) +public: + + virtual ~GeorgesEditorPlugin(); + + bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); + void extensionsInitialized(); + void shutdown(); + + void setNelContext(NLMISC::INelContext *nelContext); + + QString name() const; + QString version() const; + QString vendor() const; + QString description() const; + QStringList dependencies() const; + + void addAutoReleasedObject(QObject *obj); + +protected: + NLMISC::CLibraryContext *m_libContext; + +private: + ExtensionSystem::IPluginManager *m_plugMan; + QList m_autoReleaseObjects; +}; + +class GeorgesEditorContext: public Core::IContext +{ + Q_OBJECT +public: + GeorgesEditorContext(QObject *parent = 0); + virtual ~GeorgesEditorContext() {} + + virtual QString id() const + { + return QLatin1String("GeorgesEditorContext"); + } + virtual QString trName() const + { + return tr("Georges Editor"); + } + virtual QIcon icon() const + { + return QIcon(":/images/ic_nel_georges_editor.png"); + } + + virtual void open(); + + virtual QUndoStack *undoStack(); + + virtual QWidget *widget(); + + GeorgesEditorForm *m_georgesEditorForm; +}; + +} // namespace Plugin + +#endif // LANDSCAPE_EDITOR_PLUGIN_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp new file mode 100644 index 000000000..20cb30b33 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp @@ -0,0 +1,95 @@ +// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework +// Copyright (C) 2011 Adrian Jaekel +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "georges_filesystem_model.h" + +#include +#include + +namespace Plugin +{ + +CGeorgesFileSystemModel::CGeorgesFileSystemModel(QString ldPath, QObject *parent) + : QFileSystemModel(parent), + m_ldPath(ldPath), + m_correct(false) +{ + checkLDPath(); +} + +CGeorgesFileSystemModel::~CGeorgesFileSystemModel() +{ + +} + +QVariant CGeorgesFileSystemModel::data(const QModelIndex& index, int role) const +{ + + if (role == Qt::DecorationRole) + { + if (!m_correct) + return QVariant(); + if (isDir(index)) + return QApplication::style()->standardIcon(QStyle::SP_DirIcon); + } + if (!m_correct && role == Qt::DisplayRole) + { + if (index.parent().isValid()) + return QVariant(); + return tr("Set a correct leveldesign path ..."); + } + return QFileSystemModel::data(index, role); +} + +int CGeorgesFileSystemModel::columnCount(const QModelIndex &/*parent*/) const +{ + return 1; +} + +int CGeorgesFileSystemModel::rowCount(const QModelIndex &parent) const +{ + + if (!m_correct) + { + if(parent.isValid()) + { + return 0; + } + else + { + return qMin(QFileSystemModel::rowCount(parent),1); + } + } + return QFileSystemModel::rowCount(parent); +} + +void CGeorgesFileSystemModel::checkLDPath() +{ + QFileInfo check1(QString("%1/game_element").arg(m_ldPath)); + QFileInfo check2(QString("%1/DFN").arg(m_ldPath)); + + if (check1.exists() && check2.exists()) + { + m_correct = true; + } + else + { + m_correct = false; + } +} +} /* namespace NLQT */ + +/* end of file */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.h new file mode 100644 index 000000000..775dcb18d --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.h @@ -0,0 +1,50 @@ +// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework +// Copyright (C) 2011 Adrian Jaekel +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef GEORGES_FILESYSTEM_MODEL_H +#define GEORGES_FILESYSTEM_MODEL_H + +#include + +namespace Plugin +{ + +class CGeorgesFileSystemModel : public QFileSystemModel +{ + QString m_ldPath; + +public: + CGeorgesFileSystemModel(QString ldPath, QObject *parent = 0); + ~CGeorgesFileSystemModel(); + + int columnCount(const QModelIndex &/*parent*/) const; + int rowCount(const QModelIndex &/*parent*/) const; + + QVariant data(const QModelIndex& index, int role) const ; + + bool isCorrectLDPath() + { + return m_correct; + } + void checkLDPath(); + +private: + bool m_correct; +};/* class CGeorgesFileSystemModel */ + +} /* namespace NLQT */ + +#endif // GEORGES_FILESYSTEM_MODEL_H \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/images/ic_nel_georges_editor.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/images/ic_nel_georges_editor.png new file mode 100644 index 000000000..b293fec52 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/images/ic_nel_georges_editor.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt new file mode 100644 index 000000000..3b6a61c5e --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt @@ -0,0 +1,48 @@ +INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${LIBXML2_INCLUDE_DIR} + ${QT_INCLUDES}) + +FILE(GLOB SRC *.cpp *.h) + +SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h + ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_manager.h + ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) + +SET(OVQT_PLUGIN_LANDSCAPE_EDITOR_HDR landscape_editor_plugin.h + landscape_editor_window.h +) + +SET(OVQT_PLUGIN_LANDSCAPE_EDITOR_UIS landscape_editor_window.ui +) + +SET(OVQT_PLUGIN_LANDSCAPE_EDITOR_RCS landscape_editor.qrc) + +SET(QT_USE_QTGUI TRUE) +SET(QT_USE_QTOPENGL TRUE) + +QT4_ADD_RESOURCES(OVQT_PLUGIN_LANDSCAPE_EDITOR_RC_SRCS ${OVQT_PLUGIN_LANDSCAPE_EDITOR_RCS}) +QT4_WRAP_CPP(OVQT_PLUGIN_LANDSCAPE_EDITOR_MOC_SRC ${OVQT_PLUGIN_LANDSCAPE_EDITOR_HDR}) +QT4_WRAP_UI(OVQT_PLUGIN_LANDSCAPE_EDITOR_UI_HDRS ${OVQT_PLUGIN_LANDSCAPE_EDITOR_UIS}) + +SOURCE_GROUP(QtResources FILES ${OVQT_PLUGIN_LANDSCAPE_EDITOR_UIS}) +SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_PLUGIN_LANDSCAPE_EDITOR_UI_HDRS}) +SOURCE_GROUP(QtGeneratedMocQrcSrc FILES ${OVQT_PLUGIN_LANDSCAPE_EDITOR_MOC_SRC} OVQT_PLUGIN_LANDSCAPE_EDITOR_RC_SRCS) +SOURCE_GROUP("Landscape Editor Plugin" FILES ${SRC}) +SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) + +ADD_LIBRARY(ovqt_plugin_landscape_editor MODULE ${SRC} + ${OVQT_PLUGIN_LANDSCAPE_EDITOR_MOC_SRC} + ${OVQT_EXT_SYS_SRC} + ${OVQT_PLUGIN_LANDSCAPE_EDITOR_UI_HDRS} + ${OVQT_PLUGIN_LANDSCAPE_EDITOR_RC_SRCS}) + +TARGET_LINK_LIBRARIES(ovqt_plugin_landscape_editor ovqt_plugin_core nelmisc nel3d ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) + +NL_DEFAULT_PROPS(ovqt_plugin_landscape_editor "NeL, Tools, 3D: Object Viewer Qt Plugin: Landscape Editor") +NL_ADD_RUNTIME_FLAGS(ovqt_plugin_landscape_editor) +NL_ADD_LIB_SUFFIX(ovqt_plugin_landscape_editor) + +ADD_DEFINITIONS(-DLANDSCAPE_EDITOR_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) + +INSTALL(TARGETS ovqt_plugin_landscape_editor LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_item.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_item.png new file mode 100644 index 000000000..7a51400b3 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_item.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_settings.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_settings.png new file mode 100644 index 000000000..4197f7f97 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_settings.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_world_editor.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_world_editor.png new file mode 100644 index 000000000..d41f64e2f Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_world_editor.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zone.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zone.png new file mode 100644 index 000000000..73be27528 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zone.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zonel.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zonel.png new file mode 100644 index 000000000..40f75828b Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zonel.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor.qrc b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor.qrc new file mode 100644 index 000000000..5dba9074b --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor.qrc @@ -0,0 +1,9 @@ + + + icons/ic_nel_landscape_item.png + icons/ic_nel_landscape_settings.png + icons/ic_nel_world_editor.png + icons/ic_nel_zone.png + icons/ic_nel_zonel.png + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_constants.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_constants.h new file mode 100644 index 000000000..52775f4c4 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_constants.h @@ -0,0 +1,37 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef LANDSCAPE_EDITOR_CONSTANTS_H +#define LANDSCAPE_EDITOR_CONSTANTS_H + +namespace LandscapeEditor +{ +namespace Constants +{ +const char * const LANDSCAPE_EDITOR_PLUGIN = "LandscapeEditor"; + +//settings +const char * const LANDSCAPE_EDITOR_SECTION = "LandscapeEditor"; + +//resources +const char * const ICON_LANDSCAPE_ITEM = ":/icons/ic_nel_landscape_item.png"; + + +} // namespace Constants +} // namespace LandscapeEditor + +#endif // LANDSCAPE_EDITOR_CONSTANTS_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_global.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_global.h new file mode 100644 index 000000000..167c8e24f --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_global.h @@ -0,0 +1,30 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef LANDSCAPE_EDITOR_GLOBAL_H +#define LANDSCAPE_EDITOR_GLOBAL_H + +#include + +#if defined(LANDSCAPE_EDITOR_LIBRARY) +# define LANDSCAPE_EDITOR_EXPORT Q_DECL_EXPORT +#else +# define LANDSCAPE_EDITOR_EXPORT Q_DECL_IMPORT +#endif + +#endif // LANDSCAPE_EDITOR_GLOBAL_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.cpp new file mode 100644 index 000000000..ac7782343 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.cpp @@ -0,0 +1,128 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "landscape_editor_plugin.h" +#include "landscape_editor_window.h" + +#include "../core/icore.h" +#include "../core/core_constants.h" + +// NeL includes +#include "nel/misc/debug.h" + +// Qt includes +#include + +namespace LandscapeEditor +{ + +LandscapeEditorPlugin::~LandscapeEditorPlugin() +{ + Q_FOREACH(QObject *obj, m_autoReleaseObjects) + { + m_plugMan->removeObject(obj); + } + qDeleteAll(m_autoReleaseObjects); + m_autoReleaseObjects.clear(); +} + +bool LandscapeEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) +{ + Q_UNUSED(errorString); + m_plugMan = pluginManager; + + addAutoReleasedObject(new LandscapeEditorContext(this)); + return true; +} + +void LandscapeEditorPlugin::extensionsInitialized() +{ +} + +void LandscapeEditorPlugin::shutdown() +{ +} + +void LandscapeEditorPlugin::setNelContext(NLMISC::INelContext *nelContext) +{ +#ifdef NL_OS_WINDOWS + // Ensure that a context doesn't exist yet. + // This only applies to platforms without PIC, e.g. Windows. + nlassert(!NLMISC::INelContext::isContextInitialised()); +#endif // NL_OS_WINDOWS + m_libContext = new NLMISC::CLibraryContext(*nelContext); +} + +QString LandscapeEditorPlugin::name() const +{ + return tr("LandscapeEditor"); +} + +QString LandscapeEditorPlugin::version() const +{ + return "0.0.1"; +} + +QString LandscapeEditorPlugin::vendor() const +{ + return "GSoC2011_dnk-88"; +} + +QString LandscapeEditorPlugin::description() const +{ + return "Landscape editor ovqt plugin."; +} + +QStringList LandscapeEditorPlugin::dependencies() const +{ + QStringList list; + list.append(Core::Constants::OVQT_CORE_PLUGIN); + return list; +} + +void LandscapeEditorPlugin::addAutoReleasedObject(QObject *obj) +{ + m_plugMan->addObject(obj); + m_autoReleaseObjects.prepend(obj); +} + +LandscapeEditorContext::LandscapeEditorContext(QObject *parent) + : IContext(parent), + m_landEditorWindow(0) +{ + m_landEditorWindow = new LandscapeEditorWindow(); +} + +QUndoStack *LandscapeEditorContext::undoStack() +{ + return m_landEditorWindow->undoStack(); +} + +void LandscapeEditorContext::open() +{ + m_landEditorWindow->open(); +} + +QWidget *LandscapeEditorContext::widget() +{ + return m_landEditorWindow; +} + +} + +Q_EXPORT_PLUGIN(LandscapeEditor::LandscapeEditorPlugin) \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.h new file mode 100644 index 000000000..67a3172ee --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.h @@ -0,0 +1,108 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef LANDSCAPE_EDITOR_PLUGIN_H +#define LANDSCAPE_EDITOR_PLUGIN_H + +// Project includes +#include "landscape_editor_constants.h" +#include "../../extension_system/iplugin.h" +#include "../core/icontext.h" + +// NeL includes +#include "nel/misc/app_context.h" + +// Qt includes +#include +#include + +namespace NLMISC +{ +class CLibraryContext; +} + +namespace ExtensionSystem +{ +class IPluginSpec; +} + +namespace LandscapeEditor +{ +class LandscapeEditorWindow; + +class LandscapeEditorPlugin : public QObject, public ExtensionSystem::IPlugin +{ + Q_OBJECT + Q_INTERFACES(ExtensionSystem::IPlugin) +public: + + virtual ~LandscapeEditorPlugin(); + + bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); + void extensionsInitialized(); + void shutdown(); + + void setNelContext(NLMISC::INelContext *nelContext); + + QString name() const; + QString version() const; + QString vendor() const; + QString description() const; + QStringList dependencies() const; + + void addAutoReleasedObject(QObject *obj); + +protected: + NLMISC::CLibraryContext *m_libContext; + +private: + ExtensionSystem::IPluginManager *m_plugMan; + QList m_autoReleaseObjects; +}; + +class LandscapeEditorContext: public Core::IContext +{ + Q_OBJECT +public: + LandscapeEditorContext(QObject *parent = 0); + virtual ~LandscapeEditorContext() {} + + virtual QString id() const + { + return QLatin1String("LandscapeEditorContext"); + } + virtual QString trName() const + { + return tr("Landscape Editor"); + } + virtual QIcon icon() const + { + return QIcon(); + } + + virtual void open(); + + virtual QUndoStack *undoStack(); + + virtual QWidget *widget(); + + LandscapeEditorWindow *m_landEditorWindow; +}; + +} // namespace LandscapeEditor + +#endif // LANDSCAPE_EDITOR_PLUGIN_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp new file mode 100644 index 000000000..4b075adfc --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp @@ -0,0 +1,93 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "landscape_editor_window.h" +#include "landscape_editor_constants.h" + +#include "../core/icore.h" +#include "../core/imenu_manager.h" +#include "../core/core_constants.h" + +// NeL includes +#include + +// Qt includes +#include +#include + +namespace LandscapeEditor +{ +QString _lastDir; + +LandscapeEditorWindow::LandscapeEditorWindow(QWidget *parent) + : QMainWindow(parent) +{ + m_ui.setupUi(this); + + m_undoStack = new QUndoStack(this); + + createMenus(); + readSettings(); +} + +LandscapeEditorWindow::~LandscapeEditorWindow() +{ + writeSettings(); +} + +QUndoStack *LandscapeEditorWindow::undoStack() const +{ + return m_undoStack; +} + +void LandscapeEditorWindow::open() +{ + QStringList fileNames = QFileDialog::getOpenFileNames(this, + tr("Open NeL Ligo land file"), _lastDir, + tr("All NeL Ligo land files (*.land)")); + + setCursor(Qt::WaitCursor); + if (!fileNames.isEmpty()) + { + QStringList list = fileNames; + _lastDir = QFileInfo(list.front()).absolutePath(); + } + setCursor(Qt::ArrowCursor); +} + +void LandscapeEditorWindow::createMenus() +{ + Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); +} + +void LandscapeEditorWindow::readSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::LANDSCAPE_EDITOR_SECTION); + settings->endGroup(); +} + +void LandscapeEditorWindow::writeSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::LANDSCAPE_EDITOR_SECTION); + settings->endGroup(); + settings->sync(); +} + +} /* namespace LandscapeEditor */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.h new file mode 100644 index 000000000..cc17e6cbc --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.h @@ -0,0 +1,56 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef LANDSCAPE_EDITOR_WINDOW_H +#define LANDSCAPE_EDITOR_WINDOW_H + +// Project includes +#include "ui_landscape_editor_window.h" + +// Qt includes +#include + +namespace LandscapeEditor +{ + +class LandscapeEditorWindow: public QMainWindow +{ + Q_OBJECT + +public: + LandscapeEditorWindow(QWidget *parent = 0); + ~LandscapeEditorWindow(); + + QUndoStack *undoStack() const; + +Q_SIGNALS: +public Q_SLOTS: + void open(); + +private Q_SLOTS: +private: + void createMenus(); + void readSettings(); + void writeSettings(); + + QUndoStack *m_undoStack; + Ui::LandscapeEditorWindow m_ui; +}; /* class LandscapeEditorWindow */ + +} /* namespace LandscapeEditor */ + +#endif // LANDSCAPE_EDITOR_WINDOW_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.ui new file mode 100644 index 000000000..5d9606ddf --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.ui @@ -0,0 +1,43 @@ + + + LandscapeEditorWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + :/icons/ic_nel_landscape_item.png:/icons/ic_nel_landscape_item.png + + + + + + + + + + + toolBar + + + TopToolBarArea + + + false + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt index 555eac232..b497e3332 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt @@ -1,7 +1,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${LIBXML2_INCLUDE_DIR} - ${QT_INCLUDES}) + ${CMAKE_CURRENT_SOURCE_DIR} + ${LIBXML2_INCLUDE_DIR} + ${QT_INCLUDES}) FILE(GLOB SRC *.cpp *.h) SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp index 439cce7d9..2f88200ec 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp @@ -1,24 +1,28 @@ -/* -Log Plugin Qt -Copyright (C) 2010 Adrian Jaekel - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -*/ +// Object Viewer Qt - Log Plugin - MMORPG Framework +// Copyright (C) 2011 Adrian Jaekel +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// Project includes #include "log_plugin.h" #include "log_settings_page.h" +#include "qt_displayer.h" + +#include "../core/icore.h" +#include "../core/core_constants.h" +#include "../core/imenu_manager.h" +#include "../../extension_system/iplugin_spec.h" // Qt includes #include @@ -35,103 +39,153 @@ along with this program. If not, see . // NeL includes #include -// Project includes -#include "../core/icore.h" -#include "../core/core_constants.h" -#include "../core/imenu_manager.h" -#include "qt_displayer.h" - -using namespace Plugin; - -namespace ExtensionSystem +namespace Plugin { - class IPluginSpec; -} -CLogPlugin::CLogPlugin(QWidget *parent): QDockWidget(parent) -{ - _ui.setupUi(this); -} + CLogPlugin::CLogPlugin(QWidget *parent): QDockWidget(parent) + { + m_ui.setupUi(this); + } -CLogPlugin::~CLogPlugin() -{ - _plugMan->removeObject(_logSettingsPage); - delete _logSettingsPage; + CLogPlugin::~CLogPlugin() + { + Q_FOREACH(QObject *obj, m_autoReleaseObjects) + { + m_plugMan->removeObject(obj); + } + qDeleteAll(m_autoReleaseObjects); + m_autoReleaseObjects.clear(); - NLMISC::ErrorLog->removeDisplayer(_displayer); - NLMISC::WarningLog->removeDisplayer(_displayer); - NLMISC::DebugLog->removeDisplayer(_displayer); - NLMISC::AssertLog->removeDisplayer(_displayer); - NLMISC::InfoLog->removeDisplayer(_displayer); - delete _displayer; -} + NLMISC::ErrorLog->removeDisplayer(m_displayer); + NLMISC::WarningLog->removeDisplayer(m_displayer); + NLMISC::DebugLog->removeDisplayer(m_displayer); + NLMISC::AssertLog->removeDisplayer(m_displayer); + NLMISC::InfoLog->removeDisplayer(m_displayer); + delete m_displayer; + } -bool CLogPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) -{ - Q_UNUSED(errorString); - _plugMan = pluginManager; - _logSettingsPage = new CLogSettingsPage(this); - _plugMan->addObject(_logSettingsPage); - return true; -} + bool CLogPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) + { + Q_UNUSED(errorString); + m_plugMan = pluginManager; + m_logSettingsPage = new CLogSettingsPage(this); + addAutoReleasedObject(m_logSettingsPage); + return true; + } -void CLogPlugin::extensionsInitialized() -{ - NLMISC::ErrorLog->addDisplayer(_displayer); - NLMISC::WarningLog->addDisplayer(_displayer); - NLMISC::DebugLog->addDisplayer(_displayer); - NLMISC::AssertLog->addDisplayer(_displayer); - NLMISC::InfoLog->addDisplayer(_displayer); + void CLogPlugin::extensionsInitialized() + { + setDisplayers(); - Core::ICore *core = Core::ICore::instance(); - Core::IMenuManager *menuManager = core->menuManager(); - QMenu *viewMenu = menuManager->menu(Core::Constants::M_VIEW); + Core::ICore *core = Core::ICore::instance(); + Core::IMenuManager *menuManager = core->menuManager(); + QMenu *viewMenu = menuManager->menu(Core::Constants::M_VIEW); - QMainWindow *wnd = Core::ICore::instance()->mainWindow(); - wnd->addDockWidget(Qt::RightDockWidgetArea, this); - hide(); + QMainWindow *wnd = Core::ICore::instance()->mainWindow(); + wnd->addDockWidget(Qt::RightDockWidgetArea, this); + hide(); - viewMenu->addAction(this->toggleViewAction()); -} + viewMenu->addAction(this->toggleViewAction()); + } -void CLogPlugin::setNelContext(NLMISC::INelContext *nelContext) -{ -#ifdef NL_OS_WINDOWS - // Ensure that a context doesn't exist yet. - // This only applies to platforms without PIC, e.g. Windows. - nlassert(!NLMISC::INelContext::isContextInitialised()); + void CLogPlugin::setNelContext(NLMISC::INelContext *nelContext) + { +#ifdef NL_OS_WINDOWS + // Ensure that a context doesn't exist yet. + // This only applies to platforms without PIC, e.g. Windows. + nlassert(!NLMISC::INelContext::isContextInitialised()); #endif // fdef NL_OS_WINDOWS^M - _LibContext = new NLMISC::CLibraryContext(*nelContext); + m_libContext = new NLMISC::CLibraryContext(*nelContext); - _displayer = new NLQT::CQtDisplayer(_ui.plainTextEdit); + m_displayer = new NLQT::CQtDisplayer(m_ui.plainTextEdit); + } + + QString CLogPlugin::name() const + { + return "NeL Log"; + } + + QString CLogPlugin::version() const + { + return "1.1"; + } + + QString CLogPlugin::vendor() const + { + return "aquiles"; + } + + QString CLogPlugin::description() const + { + return tr("DockWidget to display all log messages from NeL."); + } + + QStringList CLogPlugin::dependencies() const + { + QStringList list; + list.append(Core::Constants::OVQT_CORE_PLUGIN); + return list; + } + + void CLogPlugin::addAutoReleasedObject(QObject *obj) + { + m_plugMan->addObject(obj); + m_autoReleaseObjects.prepend(obj); + } + + void CLogPlugin::setDisplayers() + { + QSettings *settings = Core::ICore::instance()->settings(); + + settings->beginGroup(Core::Constants::LOG_SECTION); + bool error = settings->value(Core::Constants::LOG_ERROR, true).toBool(); + bool warning = settings->value(Core::Constants::LOG_WARNING, true).toBool(); + bool debug = settings->value(Core::Constants::LOG_DEBUG, true).toBool(); + bool assert = settings->value(Core::Constants::LOG_ASSERT, true).toBool(); + bool info = settings->value(Core::Constants::LOG_INFO, true).toBool(); + settings->endGroup(); + + if (error) { + if (!NLMISC::ErrorLog->attached(m_displayer)) + NLMISC::ErrorLog->addDisplayer(m_displayer); + } else { + if (m_displayer) { + NLMISC::ErrorLog->removeDisplayer(m_displayer); + } + } + if (warning) { + if (!NLMISC::WarningLog->attached(m_displayer)) + NLMISC::WarningLog->addDisplayer(m_displayer); + } else { + if (m_displayer) { + NLMISC::WarningLog->removeDisplayer(m_displayer); + } + } + if (debug) { + if (!NLMISC::DebugLog->attached(m_displayer)) + NLMISC::DebugLog->addDisplayer(m_displayer); + } else { + if (m_displayer) { + NLMISC::DebugLog->removeDisplayer(m_displayer); + } + } + if (assert) { + if (!NLMISC::AssertLog->attached(m_displayer)) + NLMISC::AssertLog->addDisplayer(m_displayer); + } else { + if (m_displayer) { + NLMISC::AssertLog->removeDisplayer(m_displayer); + } + } + if (info) { + if (!NLMISC::InfoLog->attached(m_displayer)) + NLMISC::InfoLog->addDisplayer(m_displayer); + } else { + if (m_displayer) { + NLMISC::InfoLog->removeDisplayer(m_displayer); + } + } + } } - -QString CLogPlugin::name() const -{ - return "LogPlugin"; -} - -QString CLogPlugin::version() const -{ - return "1.0"; -} - -QString CLogPlugin::vendor() const -{ - return "aquiles"; -} - -QString CLogPlugin::description() const -{ - return "DockWidget to display all log messages from NeL."; -} - -QStringList CLogPlugin::dependencies() const -{ - QStringList list; - list.append(Core::Constants::OVQT_CORE_PLUGIN); - return list; -} - -Q_EXPORT_PLUGIN(CLogPlugin) +Q_EXPORT_PLUGIN(Plugin::CLogPlugin) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h index d07469541..6a2d78f79 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h @@ -1,6 +1,6 @@ /* Log Plugin Qt -Copyright (C) 2010 Adrian Jaekel +Copyright (C) 2011 Adrian Jaekel This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,16 +20,16 @@ along with this program. If not, see . #ifndef LOG_PLUGIN_H #define LOG_PLUGIN_H +// Project includes +#include "ui_log_form.h" #include "../../extension_system/iplugin.h" +// NeL includes #include "nel/misc/app_context.h" // Qt includes #include -// Project includes -#include "ui_log_form.h" - namespace NLMISC { class CLibraryContext; @@ -52,7 +52,7 @@ namespace Plugin class CLogPlugin : public QDockWidget, public ExtensionSystem::IPlugin { Q_OBJECT - Q_INTERFACES(ExtensionSystem::IPlugin) + Q_INTERFACES(ExtensionSystem::IPlugin) public: CLogPlugin(QWidget *parent = 0); ~CLogPlugin(); @@ -61,7 +61,7 @@ namespace Plugin void extensionsInitialized(); void setNelContext(NLMISC::INelContext *nelContext); - NLQT::CQtDisplayer* displayer() { return _displayer; } + NLQT::CQtDisplayer* displayer() { return m_displayer; } QString name() const; QString version() const; @@ -69,16 +69,21 @@ namespace Plugin QString description() const; QStringList dependencies() const; + void addAutoReleasedObject(QObject *obj); + + void setDisplayers(); + protected: - NLMISC::CLibraryContext *_LibContext; + NLMISC::CLibraryContext *m_libContext; private: - ExtensionSystem::IPluginManager *_plugMan; - CLogSettingsPage *_logSettingsPage; + ExtensionSystem::IPluginManager *m_plugMan; + QList m_autoReleaseObjects; + CLogSettingsPage *m_logSettingsPage; - Ui::CLogPlugin _ui; + Ui::CLogPlugin m_ui; - NLQT::CQtDisplayer *_displayer; + NLQT::CQtDisplayer *m_displayer; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp index 83cfdc979..f75d6ab37 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp @@ -1,6 +1,6 @@ // Object Viewer Qt - MMORPG Framework // Copyright (C) 2010 Winch Gate Property Limited -// Copyright (C) 2011 Dzmitry Kamiahin +// Copyright (C) 2011 Adrian Jaekel // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as @@ -15,31 +15,43 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +// Project includes #include "log_settings_page.h" - -// Qt includes -#include +#include "log_plugin.h" +#include "../core/core_constants.h" +#include "../core/icore.h" +#include "../../extension_system/plugin_manager.h" // NeL includes -// Project includes +// Qt includes +#include +#include + namespace ExtensionSystem { - class IPluginManager; + class IPluginManager; } namespace Plugin { + class CLogPlugin; + CLogSettingsPage::CLogSettingsPage(QObject *parent) : IOptionsPage(parent), - _currentPage(NULL) + m_currentPage(NULL), + m_error(true), + m_warning(true), + m_debug(true), + m_assert(true), + m_info(true) { } QString CLogSettingsPage::id() const { - return QLatin1String("Log"); + return QLatin1String("log"); } QString CLogSettingsPage::trName() const @@ -49,32 +61,78 @@ namespace Plugin QString CLogSettingsPage::category() const { - return QLatin1String("General"); + return QLatin1String(Core::Constants::SETTINGS_CATEGORY_GENERAL); } QString CLogSettingsPage::trCategory() const { - return tr("General"); + return tr(Core::Constants::SETTINGS_TR_CATEGORY_GENERAL); + } + + QIcon CLogSettingsPage::categoryIcon() const + { + return QIcon(); } QWidget *CLogSettingsPage::createPage(QWidget *parent) { - _currentPage = new QWidget(parent); - _ui.setupUi(_currentPage); - return _currentPage; + m_currentPage = new QWidget(parent); + m_ui.setupUi(m_currentPage); + + readSettings(); + m_ui.errorCheck->setChecked(m_error); + m_ui.warningCheck->setChecked(m_warning); + m_ui.debugCheck->setChecked(m_debug); + m_ui.assertCheck->setChecked(m_assert); + m_ui.infoCheck->setChecked(m_info); + + return m_currentPage; } void CLogSettingsPage::apply() { - //ExtensionSystem::IPluginSpec *spec, _plugMan->plugins() - //ExtensionSystem::IPluginManager; - //if (_ui.errorCheck->isChecked()) { - //displayer(); - //} - //if (_ui.warningCheck->isChecked()); - //if (_ui.debugCheck->isChecked()); - //if (_ui.assertCheck->isChecked()); - //if (_ui.infoCheck->isChecked()); + m_error = m_ui.errorCheck->isChecked(); + m_warning = m_ui.warningCheck->isChecked(); + m_debug = m_ui.debugCheck->isChecked(); + m_assert = m_ui.assertCheck->isChecked(); + m_info = m_ui.infoCheck->isChecked(); + + writeSettings(); + ExtensionSystem::IPluginManager *p = Core::ICore::instance()->pluginManager(); + ExtensionSystem::IPlugin *plugin = p->pluginByName("LogPlugin")->plugin(); + CLogPlugin* lp = dynamic_cast(plugin); + if (lp) + { + lp->setDisplayers(); + } + } + + void CLogSettingsPage::readSettings() + { + QSettings *settings = Core::ICore::instance()->settings(); + + settings->beginGroup(Core::Constants::LOG_SECTION); + m_error = settings->value(Core::Constants::LOG_ERROR, true).toBool(); + m_warning = settings->value(Core::Constants::LOG_WARNING, true).toBool(); + m_debug = settings->value(Core::Constants::LOG_DEBUG, true).toBool(); + m_assert = settings->value(Core::Constants::LOG_ASSERT, true).toBool(); + m_info = settings->value(Core::Constants::LOG_INFO, true).toBool(); + settings->endGroup(); + } + + void CLogSettingsPage::writeSettings() + { + QSettings *settings = Core::ICore::instance()->settings(); + + settings->beginGroup(Core::Constants::LOG_SECTION); + settings->setValue(Core::Constants::LOG_ERROR, m_error); + settings->setValue(Core::Constants::LOG_WARNING, m_warning); + settings->setValue(Core::Constants::LOG_DEBUG, m_debug); + settings->setValue(Core::Constants::LOG_ASSERT, m_assert); + settings->setValue(Core::Constants::LOG_INFO, m_info); + settings->endGroup(); + + settings->sync(); } } /* namespace Plugin */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.h index 396afcdd3..2c0c5ed98 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.h @@ -29,29 +29,39 @@ class QWidget; namespace Plugin { -/** -@class CLogSettingsPage -*/ -class CLogSettingsPage : public Core::IOptionsPage -{ - Q_OBJECT -public: - CLogSettingsPage(QObject *parent = 0); - virtual ~CLogSettingsPage() {} + /** + @class CLogSettingsPage + */ + class CLogSettingsPage : public Core::IOptionsPage + { + Q_OBJECT + public: + CLogSettingsPage(QObject *parent = 0); + virtual ~CLogSettingsPage() {} - virtual QString id() const; - virtual QString trName() const; - virtual QString category() const; - virtual QString trCategory() const; - virtual QWidget *createPage(QWidget *parent); + virtual QString id() const; + virtual QString trName() const; + virtual QString category() const; + virtual QString trCategory() const; + QIcon categoryIcon() const; + virtual QWidget *createPage(QWidget *parent); - virtual void apply(); - virtual void finish() {} + virtual void apply(); + virtual void finish() {} -private: - QWidget *_currentPage; - Ui::CLogSettingsPage _ui; -}; + private: + void readSettings(); + void writeSettings(); + + QWidget *m_currentPage; + Ui::CLogSettingsPage m_ui; + + bool m_error; + bool m_warning; + bool m_debug; + bool m_assert; + bool m_info; + }; } // namespace Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/qt_displayer.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/qt_displayer.cpp index aaeae9a1a..fc694d779 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/qt_displayer.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/qt_displayer.cpp @@ -1,24 +1,21 @@ -/* -Georges Editor Qt -Copyright (C) 2010 Adrian Jaekel - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -*/ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Adrian Jaekel +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . // Nel includes - #include "qt_displayer.h" #include #include diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_form.ui index 90d496d17..3660afe45 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_form.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_form.ui @@ -193,7 +193,7 @@ - :/images/animset.png:/images/animset.png + :/icons/ic_nel_animset.png:/icons/ic_nel_animset.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_form.ui index 404444fc0..77c4b895f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_form.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_form.ui @@ -91,7 +91,7 @@ - true + false diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_form.ui index 971d16c60..bb266f650 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_form.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_form.ui @@ -6,8 +6,8 @@ 0 0 - 195 - 64 + 192 + 52 @@ -21,6 +21,12 @@ + + 3 + + + 3 + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.cpp index 4e11ee15c..6c2736895 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.cpp @@ -25,8 +25,6 @@ // Qt includes #include #include -#include -#include // NeL includes #include @@ -60,6 +58,11 @@ QString GraphicsSettingsPage::trCategory() const return tr("Object Viewer"); } +QIcon GraphicsSettingsPage::categoryIcon() const +{ + return QIcon(); +} + QWidget *GraphicsSettingsPage::createPage(QWidget *parent) { m_page = new QWidget(parent); @@ -75,11 +78,6 @@ QWidget *GraphicsSettingsPage::createPage(QWidget *parent) m_ui.squareBloomCheckBox->setChecked(NL3D::CBloomEffect::instance().getSquareBloom()); m_ui.bloomDensityHorizontalSlider->setValue(NL3D::CBloomEffect::instance().getDensityBloom()); - m_ui.styleComboBox->addItems(QStyleFactory::keys()); - QString style = settings->value(Constants::QT_STYLE, "").toString(); - m_ui.styleComboBox->setCurrentIndex(m_ui.styleComboBox->findText(style)); - m_ui.paletteCheckBox->setChecked(settings->value(Constants::QT_PALETTE, true).toBool()); - settings->endGroup(); connect(m_ui.enableBloomCheckBox, SIGNAL(toggled(bool)), this, SLOT(setEnableBloom(bool))); @@ -103,16 +101,6 @@ void GraphicsSettingsPage::apply() settings->setValue(Constants::ENABLE_BLOOM, m_ui.enableBloomCheckBox->isChecked()); settings->setValue(Constants::ENABLE_SQUARE_BLOOM, m_ui.squareBloomCheckBox->isChecked()); settings->setValue(Constants::BLOOM_DENSITY, m_ui.bloomDensityHorizontalSlider->value()); - settings->setValue(Constants::QT_STYLE, m_ui.styleComboBox->currentText()); - settings->setValue(Constants::QT_PALETTE, m_ui.paletteCheckBox->isChecked()); - - // apply qt style and palette - QApplication::setStyle(QStyleFactory::create(m_ui.styleComboBox->currentText())); - - if (m_ui.paletteCheckBox->isChecked()) - QApplication::setPalette(QApplication::style()->standardPalette()); - else - QApplication::setPalette(Modules::mainWin().getOriginalPalette()); settings->endGroup(); settings->sync(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h index e1402939f..74df1b140 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h @@ -42,6 +42,7 @@ public: virtual QString trName() const; virtual QString category() const; virtual QString trCategory() const; + QIcon categoryIcon() const; virtual QWidget *createPage(QWidget *parent); virtual void apply(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui index 24058d3d3..e6b4952a5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui @@ -117,50 +117,7 @@ - - - - Qt Style - - - - - - - - Style - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - Use style's standard palette - - - - - - - + false @@ -170,14 +127,14 @@ - + false - + false @@ -187,7 +144,7 @@ - + Qt::Vertical diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.cpp index 2a15932b7..93bc1043e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.cpp @@ -49,6 +49,9 @@ namespace NLQT CGraphicsViewport::CGraphicsViewport(QWidget *parent) : QNLWidget(parent) { + setAttribute(Qt::WA_OpaquePaintEvent); + setAttribute(Qt::WA_NoSystemBackground); + setAttribute(Qt::WA_PaintOnScreen); } CGraphicsViewport::~CGraphicsViewport() @@ -77,7 +80,7 @@ void CGraphicsViewport::release() { //H_AUTO2 nldebug("CGraphicsViewport::release"); - + Modules::veget().release(); Modules::psEdit().release(); Modules::objView().release(); @@ -119,39 +122,6 @@ void CGraphicsViewport::resizeEvent(QResizeEvent *resizeEvent) Modules::objView().setSizeViewport(resizeEvent->size().width(), resizeEvent->size().height()); } -#if defined(NL_OS_MAC) -// Qt does not provide wheel events through winEvent() and macEvent() (but it -// does through x11Event(), which is inconsistent...) -// Workaround is to handle wheel events like implemented below. -// -// TODO: this is not a clean solution, because all but wheel events are -// handled using winEvent(), x11Event(), macEvent(). But this seems to be a -// limitation of current (4.7.1) Qt versions. (see e.g. qapplication_mac.mm) -void CGraphicsViewport::wheelEvent(QWheelEvent *event) -{ - // Get relative positions. - float fX = 1.0f - (float)event->pos().x() / this->width(); - float fY = 1.0f - (float)event->pos().y() / this->height(); - - // Get the buttons currently pressed. - uint32 buttons = NLMISC::noButton; - if(event->buttons() & Qt::LeftButton) buttons |= NLMISC::leftButton; - if(event->buttons() & Qt::RightButton) buttons |= NLMISC::rightButton; - if(event->buttons() & Qt::MidButton) buttons |= NLMISC::middleButton; - if(event->modifiers() & Qt::ControlModifier) buttons |= NLMISC::ctrlButton; - if(event->modifiers() & Qt::ShiftModifier) buttons |= NLMISC::shiftButton; - if(event->modifiers() & Qt::AltModifier) buttons |= NLMISC::altButton; - - if(event->delta() > 0) - Modules::objView().getDriver()->EventServer.postEvent( - new NLMISC::CEventMouseWheel(-fX, fY, (NLMISC::TMouseButton)buttons, true, NULL)); - else - Modules::objView().getDriver()->EventServer.postEvent( - new NLMISC::CEventMouseWheel(-fX, fY, (NLMISC::TMouseButton)buttons, false, NULL)); -} -#endif // defined(NL_OS_MAC) - - #if defined(NL_OS_WINDOWS) typedef bool (*winProc)(NL3D::IDriver *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); @@ -164,6 +134,9 @@ bool CGraphicsViewport::winEvent(MSG *message, long *result) if (driver) { winProc proc = (winProc)driver->getWindowProc(); + + // TODO: shouldn't it return false like the others? + // see macEvent() and x11Event() below return proc(driver, message->hwnd, message->message, message->wParam, message->lParam); } } @@ -186,10 +159,12 @@ bool CGraphicsViewport::macEvent(EventHandlerCallRef caller, EventRef event) if (driver) { cocoaProc proc = (cocoaProc)driver->getWindowProc(); - return proc(driver, event); + proc(driver, event); } } + // return false to let Qt handle the event as well, + // else the widget would never get focus return false; } @@ -205,10 +180,13 @@ bool CGraphicsViewport::x11Event(XEvent *event) if (driver) { x11Proc proc = (x11Proc)driver->getWindowProc(); - return proc(driver, event); + proc(driver, event); } } + // return false to let Qt handle the event as well, + // else the widget would never get focus + // TODO: test me please, i have no linux at hand (rti) return false; } #endif diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.h index 00b2c80d2..d810d8c01 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.h @@ -80,10 +80,6 @@ private Q_SLOTS: protected: virtual void resizeEvent(QResizeEvent *resizeEvent); -#if defined(NL_OS_MAC) - virtual void wheelEvent(QWheelEvent *event); -#endif - #if defined(NL_OS_WINDOWS) virtual bool winEvent(MSG *message, long *result); #elif defined(NL_OS_MAC) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp index fa077cfed..dd8a4bb1e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp @@ -66,7 +66,7 @@ CMainWindow::CMainWindow(QWidget *parent) _isGraphicsInitialized(false), _isGraphicsEnabled(false), _isSoundInitialized(false), - _isSoundEnabled(false), + _isSoundEnabled(true), _GraphicsViewport(NULL), _lastDir("."), _mouseMode(NL3D::U3dMouseListener::edit3d) @@ -80,19 +80,6 @@ CMainWindow::CMainWindow(QWidget *parent) setDockNestingEnabled(true); - QSettings *settings = Core::ICore::instance()->settings(); - settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); - - // setup Qt style and palette from config file - _originalPalette = QApplication::palette(); - - QApplication::setStyle(QStyleFactory::create(settings->value(Constants::QT_STYLE, "").toString())); - - if (settings->value(Constants::QT_PALETTE, true).toBool()) - QApplication::setPalette(QApplication::style()->standardPalette()); - else - QApplication::setPalette(_originalPalette); - _GraphicsViewport->init(); _isGraphicsInitialized = true; @@ -102,6 +89,7 @@ CMainWindow::CMainWindow(QWidget *parent) _isSoundInitialized = true; } + _undoStack = new QUndoStack(this); _SkeletonTreeModel = new CSkeletonTreeModel(this); createDialogs(); @@ -111,6 +99,9 @@ CMainWindow::CMainWindow(QWidget *parent) setWindowIcon(QIcon(":/images/nel.png")); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); + restoreState(settings->value("QtWindowState").toByteArray()); restoreGeometry(settings->value("QtWindowGeometry").toByteArray()); @@ -282,8 +273,8 @@ void CMainWindow::createMenus() // add actions in file menu QMenu *fileMenu = menuManager->menu(Core::Constants::M_FILE); QAction *exitAction = menuManager->action(Core::Constants::EXIT); - fileMenu->insertAction(exitAction, _openAction); - fileMenu->insertSeparator(exitAction); + //fileMenu->insertAction(exitAction, _openAction); + //fileMenu->insertSeparator(exitAction); // register actions for view menu menuManager->registerAction(_setBackColorAction, "ObjectViewer.View.SetBackgroundColor"); @@ -484,22 +475,6 @@ bool CMainWindow::loadFile(const QString &fileName, const QString &skelName) return true; } -void CMainWindow::cfcbQtStyle(NLMISC::CConfigFile::CVar &var) -{ - QApplication::setStyle(QStyleFactory::create(var.asString().c_str())); -} - -void CMainWindow::cfcbQtPalette(NLMISC::CConfigFile::CVar &var) -{ - if (var.asBool()) QApplication::setPalette(QApplication::style()->standardPalette()); - else QApplication::setPalette(_originalPalette); -} - -void CMainWindow::cfcbSoundEnabled(NLMISC::CConfigFile::CVar &var) -{ - _isSoundEnabled = var.asBool(); // update loop inits -} - void CMainWindow::updateRender() { if (isVisible()) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.h index 3a6411df2..5a392c191 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.h @@ -25,6 +25,7 @@ // Qt includes #include #include +#include // NeL includes #include @@ -71,15 +72,18 @@ public: { return _SkeletonTreeModel; } - QPalette getOriginalPalette() const + + QUndoStack *getUndoStack() const { - return _originalPalette; + return _undoStack; } -private Q_SLOTS: +public Q_SLOTS: void open(); void resetScene(); void reloadTextures(); + +private Q_SLOTS: void updateStatusBar(); void updateRender(); void setInterval(int value); @@ -96,10 +100,6 @@ private: bool loadFile(const QString &fileName, const QString &skelName); - void cfcbQtStyle(NLMISC::CConfigFile::CVar &var); - void cfcbQtPalette(NLMISC::CConfigFile::CVar &var); - void cfcbSoundEnabled(NLMISC::CConfigFile::CVar &var); - bool _isGraphicsInitialized, _isGraphicsEnabled; bool _isSoundInitialized, _isSoundEnabled; @@ -122,7 +122,6 @@ private: CCameraControl *_cameraControl; - QPalette _originalPalette; QString _lastDir; QTimer *_mainTimer; @@ -139,6 +138,7 @@ private: QAction *_resetSceneAction; QAction *_saveScreenshotAction; QLabel *_statusInfo; + QUndoStack *_undoStack; float _fps; uint _numTri; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp index 76afed779..605f484f7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp @@ -37,7 +37,7 @@ void Modules::init() void Modules::release() { - delete _mainWindow; +// delete _mainWindow; _mainWindow = NULL; delete _particleEditor; _particleEditor = NULL; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp index b48eb82cc..f82789e66 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp @@ -22,7 +22,7 @@ ObjectViewerPlugin::~ObjectViewerPlugin() } qDeleteAll(_autoReleaseObjects); _autoReleaseObjects.clear(); - //Modules::release(); + Modules::release(); } bool ObjectViewerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) @@ -43,7 +43,7 @@ void ObjectViewerPlugin::extensionsInitialized() void ObjectViewerPlugin::shutdown() { - Modules::release(); +// Modules::release(); } void ObjectViewerPlugin::setNelContext(NLMISC::INelContext *nelContext) @@ -89,6 +89,16 @@ void ObjectViewerPlugin::addAutoReleasedObject(QObject *obj) _autoReleaseObjects.prepend(obj); } +void CObjectViewerContext::open() +{ + Modules::mainWin().open(); +} + +QUndoStack *CObjectViewerContext::undoStack() +{ + return Modules::mainWin().getUndoStack(); +} + QWidget *CObjectViewerContext::widget() { return &Modules::mainWin(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h index dae298fce..b5f9c2881 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h @@ -66,14 +66,21 @@ public: { return QLatin1String("ObjectViewer"); } + virtual QString trName() const { return tr("Object Viewer"); } + virtual QIcon icon() const { return QIcon(); } + + virtual QUndoStack *undoStack(); + + virtual void open(); + virtual QWidget *widget(); }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_editor.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_editor.h index da191705f..e4d1605e3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_editor.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_editor.h @@ -214,7 +214,7 @@ public: { return _FontGen; } - + CSchemeManager *getSchemeManager () const { return _SchemeManager; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp index b9c07db1a..072297437 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp @@ -605,25 +605,21 @@ void CParticleSystemPage::setMaxSteps(uint32 value) void CParticleSystemPage::setUserParam1(float value) { _Node->getPSPointer()->setUserParam(0, value); - updateModifiedFlag(); } void CParticleSystemPage::setUserParam2(float value) { _Node->getPSPointer()->setUserParam(1, value); - updateModifiedFlag(); } void CParticleSystemPage::setUserParam3(float value) { _Node->getPSPointer()->setUserParam(2, value); - updateModifiedFlag(); } void CParticleSystemPage::setUserParam4(float value) { _Node->getPSPointer()->setUserParam(3, value); - updateModifiedFlag(); } void CParticleSystemPage::setMaxViewDist(float value) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp index 155e6ad4c..77286ed32 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp @@ -177,7 +177,7 @@ CParticleTreeModel::~CParticleTreeModel() int CParticleTreeModel::columnCount(const QModelIndex &parent) const { if (parent.isValid()) - return static_cast(parent.internalPointer())->columnCount(); + return static_cast(parent.internalPointer())->columnCount(); else return _rootItem->columnCount(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp index 50698198b..858922af1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp @@ -222,24 +222,27 @@ void CParticleWorkspaceDialog::touchPSState(CParticleTreeItem *item) void CParticleWorkspaceDialog::clickedItem(const QModelIndex & index) { - if (_currentItem != NULL) + if (_currentItem != 0) _treeModel->getOwnerNode(_currentItem)->getPSPointer()->setCurrentEditedElement(NULL); _currentItem = static_cast(index.internalPointer()); + if (_currentItem == 0) + return; + if (index.flags() != Qt::NoItemFlags) _PropertyDialog->setCurrentEditedElement(_currentItem); if ((_currentItem->itemType() == ItemType::Workspace) || (_currentItem->itemType() == ItemType::ParticleSystemNotLoaded)) - _currentItem = NULL; + _currentItem = 0; } void CParticleWorkspaceDialog::customContextMenu() { if (!Modules::psEdit().getParticleWorkspace()) return; clickedItem(_ui.treeView->currentIndex()); - if (_currentItem == NULL) return; + if (_currentItem == 0) return; QMenu *popurMenu = new QMenu(this); switch (_currentItem->itemType()) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_manager.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_manager.h index 01a2abb35..8348fae0c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_manager.h @@ -25,10 +25,10 @@ namespace NL3D { - class CPSAttribMakerBase; +class CPSAttribMakerBase; } - -namespace NLQT + +namespace NLQT { class CSchemeManager @@ -50,10 +50,9 @@ public: void remove(NL3D::CPSAttribMakerBase *am); // rename a scheme, given a pointer on it void rename(NL3D::CPSAttribMakerBase *am, const std::string &newName); -protected: - typedef std::pair TSchemeInfo; +protected: typedef std::multimap TSchemeMap; - TSchemeMap _SchemeMap; + TSchemeMap _SchemeMap; }; } /* namespace NLQT */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp index 4c677f4bf..1bceeb80b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp @@ -56,6 +56,11 @@ QString SoundSettingsPage::trCategory() const return tr("Object Viewer"); } +QIcon SoundSettingsPage::categoryIcon() const +{ + return QIcon(); +} + QWidget *SoundSettingsPage::createPage(QWidget *parent) { m_page = new QWidget(parent); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h index c27a82e1f..0e5361f54 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h @@ -44,6 +44,7 @@ public: virtual QString trName() const; virtual QString category() const; virtual QString trCategory() const; + QIcon categoryIcon() const; virtual QWidget *createPage(QWidget *parent); virtual void apply(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_form.ui index f2f883263..8288747ce 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_form.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_form.ui @@ -6,14 +6,14 @@ 0 0 - 460 - 64 + 452 + 52 - 86 - 64 + 0 + 0 @@ -24,6 +24,12 @@ + + 3 + + + 3 + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.cpp index adf91c598..544ceec98 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.cpp @@ -1,18 +1,18 @@ -// Object Viewer Qt - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// Copyright (C) 2011 Dzmitry Kamiahin -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . // Projects include @@ -154,6 +154,9 @@ void CGradientDialog::valueDown() m_ui.listWidget->setCurrentRow(currentRow); } m_ui.listWidget->setCurrentRow(currentRow); + --currentRow; + QListWidgetItem *item = m_ui.listWidget->item(currentRow); + m_clientInterface->displayValue(currentRow, item); } void CGradientDialog::valueUp() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.h index 48da2f600..dc2b366d8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.h @@ -1,18 +1,18 @@ -// Object Viewer Qt - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// Copyright (C) 2011 Dzmitry Kamiahin -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . #ifndef VALUE_GRADIENT_DIALOG_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp index f794e0b73..68a1f4b98 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp @@ -59,6 +59,11 @@ QString VegetableSettingsPage::trCategory() const return tr("Object Viewer"); } +QIcon VegetableSettingsPage::categoryIcon() const +{ + return QIcon(); +} + QWidget *VegetableSettingsPage::createPage(QWidget *parent) { m_page = new QWidget(parent); @@ -81,6 +86,7 @@ QWidget *VegetableSettingsPage::createPage(QWidget *parent) connect(m_ui.coarseToolButton, SIGNAL(clicked()), this, SLOT(setCoarseMeshTexture())); connect(m_ui.addZoneToolButton, SIGNAL(clicked()), this, SLOT(addZone())); connect(m_ui.removeZoneToolButton, SIGNAL(clicked()), this, SLOT(removeZone())); + connect(m_ui.clearButton, SIGNAL(clicked()), m_ui.zonesListWidget, SLOT(clear())); return m_page; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h index bf49e2d2c..b66d070ba 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h @@ -43,6 +43,7 @@ public: virtual QString trName() const; virtual QString category() const; virtual QString trCategory() const; + QIcon categoryIcon() const; virtual QWidget *createPage(QWidget *parent); virtual void apply(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui index 0d4a41cf2..13deb2d4e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui @@ -181,6 +181,17 @@ + + + + + + + + :/icons/ic_nel_reset_all.png:/icons/ic_nel_reset_all.png + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/README b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/README new file mode 100644 index 000000000..c5c895519 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/README @@ -0,0 +1,3 @@ +OVQT Translation Manager plugin +-------------------------------- +http://dev.ryzom.com/wiki/ryzom/OVQTTranslationPluginGSoc2011 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/painter_dock_widget.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/painter_dock_widget.ui index 1a2d7c988..569caa302 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/painter_dock_widget.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/painter_dock_widget.ui @@ -6,13 +6,13 @@ 0 0 - 361 + 206 555 - 300 + 200 83 @@ -33,21 +33,21 @@ - 0 + 2 - Paint Tiles + Tiles - Paint Colors + Colors - Paint Displacement + Displacement diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp index 02197adf1..1bd91f667 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp @@ -1,9 +1,18 @@ #include "zone_painter_main_window.h" #include "ui_zone_painter_main_window.h" +#include +#include +#include +#include +#include + #include "qnel_widget.h" #include "painter_dock_widget.h" -#include + +#include "../core/icore.h" +#include "../core/imenu_manager.h" +#include "../core/core_constants.h" ZonePainterMainWindow::ZonePainterMainWindow(QWidget *parent) : QMainWindow(parent), @@ -13,45 +22,141 @@ ZonePainterMainWindow::ZonePainterMainWindow(QWidget *parent) : m_nelWidget = new NLQT::QNLWidget(this); setCentralWidget(m_nelWidget); + // Load the settings. + loadConfig(); + // Set up dock widget(s) and toolbar. m_painterDockWidget = new PainterDockWidget(this); addDockWidget(Qt::RightDockWidgetArea, m_painterDockWidget); m_painterDockWidget->setVisible(true); // Insert tool modes - _toolModeMenu = new QMenu(tr("Tool Mode"), ui->painterToolBar); - _toolModeMenu->setIcon(QIcon(":/painterTools/images/draw-brush.png")); - ui->painterToolBar->addAction(_toolModeMenu->menuAction()); - //connect(_renderModeMenu->menuAction(), SIGNAL(triggered()), this, SLOT(setRenderMode())); - - //QSignalMapper *modeMapper = new QSignalMapper(this); - - _toolPaintModeAction = _toolModeMenu->addAction(tr("Paint Mode")); - _toolPaintModeAction->setIcon(QIcon(":/painterTools/images/draw-brush.png")); - _toolPaintModeAction->setStatusTip(tr("Set paint mode")); - //connect(_pointRenderModeAction, SIGNAL(triggered()), modeMapper, SLOT(map())); - //modeMapper->setMapping(_pointRenderModeAction, 0); - - _toolFillModeAction = _toolModeMenu->addAction(tr("Fill Mode")); - _toolFillModeAction->setStatusTip(tr("Set fill mode")); - _toolFillModeAction->setIcon(QIcon(":/painterTools/images/color-fill.png")); - //connect(_lineRenderModeAction, SIGNAL(triggered()), modeMapper, SLOT(map())); - //modeMapper->setMapping(_lineRenderModeAction, 1); - - _toolSelectModeAction = _toolModeMenu->addAction(tr("Select mode")); - _toolSelectModeAction->setIcon(QIcon(":/painterTools/images/go-jump-4.png")); - _toolSelectModeAction->setStatusTip(tr("Set select mode")); - //connect(_fillRenderModeAction, SIGNAL(triggered()), modeMapper, SLOT(map())); - //modeMapper->setMapping(_fillRenderModeAction, 2); - - _toolPickModeAction = _toolModeMenu->addAction(tr("Pick mode")); - _toolPickModeAction->setIcon(QIcon(":/painterTools/images/color-picker-black.png")); - _toolPickModeAction->setStatusTip(tr("Set color picking mode")); - //connect(_fillRenderModeAction, SIGNAL(triggered()), modeMapper, SLOT(map())); - //modeMapper->setMapping(_fillRenderModeAction, 2); - - //connect(modeMapper, SIGNAL(mapped(int)), this, SLOT(setRenderMode(int))); + _toolModeMenu = new QMenu(tr("Tool Mode"), ui->painterToolBar); + _toolModeMenu->setIcon(QIcon(":/painterTools/images/draw-brush.png")); + ui->painterToolBar->addAction(_toolModeMenu->menuAction()); + //connect(_renderModeMenu->menuAction(), SIGNAL(triggered()), this, SLOT(setRenderMode())); + + QSignalMapper *modeMapper = new QSignalMapper(this); + + _toolPaintModeAction = _toolModeMenu->addAction(tr("Paint Mode")); + _toolPaintModeAction->setIcon(QIcon(":/painterTools/images/draw-brush.png")); + _toolPaintModeAction->setStatusTip(tr("Set paint mode")); + connect(_toolPaintModeAction, SIGNAL(triggered()), modeMapper, SLOT(map())); + modeMapper->setMapping(_toolPaintModeAction, 0); + + _toolFillModeAction = _toolModeMenu->addAction(tr("Fill Mode")); + _toolFillModeAction->setStatusTip(tr("Set fill mode")); + _toolFillModeAction->setIcon(QIcon(":/painterTools/images/color-fill.png")); + connect(_toolFillModeAction, SIGNAL(triggered()), modeMapper, SLOT(map())); + modeMapper->setMapping(_toolFillModeAction, 1); + + _toolSelectModeAction = _toolModeMenu->addAction(tr("Select mode")); + _toolSelectModeAction->setIcon(QIcon(":/painterTools/images/go-jump-4.png")); + _toolSelectModeAction->setStatusTip(tr("Set select mode")); + connect(_toolSelectModeAction, SIGNAL(triggered()), modeMapper, SLOT(map())); + modeMapper->setMapping(_toolSelectModeAction, 2); + + _toolPickModeAction = _toolModeMenu->addAction(tr("Pick mode")); + _toolPickModeAction->setIcon(QIcon(":/painterTools/images/color-picker-black.png")); + _toolPickModeAction->setStatusTip(tr("Set color picking mode")); + connect(_toolPickModeAction, SIGNAL(triggered()), modeMapper, SLOT(map())); + modeMapper->setMapping(_toolPickModeAction, 2); + + connect(modeMapper, SIGNAL(mapped(int)), this, SLOT(setToolMode(int))); + + m_statusBarTimer = new QTimer(this); + connect(m_statusBarTimer, SIGNAL(timeout()), this, SLOT(updateStatusBar())); + m_statusInfo = new QLabel(this); + m_statusInfo->hide(); + + // Set Background Color Toolbar + + connect(ui->actionBackground_Dlg, SIGNAL(triggered()), this, SLOT(setBackgroundColor())); + + + Core::ICore::instance()->mainWindow()->statusBar()->addPermanentWidget(m_statusInfo); + + +} + +void ZonePainterMainWindow::showEvent(QShowEvent *showEvent) +{ + QMainWindow::showEvent(showEvent); + m_statusBarTimer->start(1000); + m_statusInfo->show(); +} + +void ZonePainterMainWindow::hideEvent(QHideEvent *hideEvent) +{ + m_statusBarTimer->stop(); + m_statusInfo->hide(); + QMainWindow::hideEvent(hideEvent); +} + +void ZonePainterMainWindow::updateStatusBar() +{ + m_statusInfo->setText(QString("Tool Mode: Paint Mode")); +} + +void ZonePainterMainWindow::setToolMode(int value) +{ + switch (value) + { + case 0: + //Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Point); + break; + case 1: + //Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Line); + break; + case 2: + //Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Filled); + break; + } +} + +void ZonePainterMainWindow::setToolMode() +{ + //switch (Modules::objView().getDriver()->getPolygonMode()) + //{ + //case NL3D::UDriver::Filled: + // Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Line); + // break; + //case NL3D::UDriver::Line: + // Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Point); + // break; + //case NL3D::UDriver::Point: + // Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Filled); + // break; + //} +} + +void ZonePainterMainWindow::setBackgroundColor() { + QColor color = QColorDialog::getColor(QColor(m_nelWidget->backgroundColor().R, + m_nelWidget->backgroundColor().G, + m_nelWidget->backgroundColor().B)); + if (color.isValid()) + m_nelWidget->setBackgroundColor(NLMISC::CRGBA(color.red(), color.green(), color.blue())); +} + +void ZonePainterMainWindow::loadConfig() { + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup("ZonePainter"); + + QColor color; + color = settings->value("BackgroundColor", QColor(80, 80, 80)).value(); + m_nelWidget->setBackgroundColor(NLMISC::CRGBA(color.red(), color.green(), color.blue(), color.alpha())); +} + +void ZonePainterMainWindow::saveConfig() { + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup("ZonePainter" ); + + QColor color(m_nelWidget->backgroundColor().R, m_nelWidget->backgroundColor().G, m_nelWidget->backgroundColor().B, m_nelWidget->backgroundColor().A); + settings->setValue("BackgroundColor", color); + + settings->endGroup(); + settings->sync(); } ZonePainterMainWindow::~ZonePainterMainWindow() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h index d4d1584ba..d55eb39e5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h @@ -2,6 +2,9 @@ #define ZONE_PAINTER_MAIN_WINDOW_H #include +#include +#include +#include namespace NLQT { class QNLWidget; @@ -21,16 +24,33 @@ public: explicit ZonePainterMainWindow(QWidget *parent = 0); ~ZonePainterMainWindow(); + void loadConfig(); + void saveConfig(); + +public Q_SLOTS: + void setToolMode(int value); + void setToolMode(); + void updateStatusBar(); + void setBackgroundColor(); + +protected: + virtual void showEvent(QShowEvent *showEvent); + virtual void hideEvent(QHideEvent *hideEvent); + private: Ui::ZonePainterMainWindow *ui; NLQT::QNLWidget *m_nelWidget; PainterDockWidget *m_painterDockWidget; + QTimer *m_statusBarTimer; + QLabel *m_statusInfo; QAction *_toolPaintModeAction; QAction *_toolFillModeAction; QAction *_toolSelectModeAction; QAction *_toolPickModeAction; QMenu *_toolModeMenu; + + //QAction *m_setBackColorAction; }; #endif // ZONE_PAINTER_MAIN_WINDOW_H diff --git a/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.cpp b/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.cpp index 4c6d25b3a..70bf51f81 100644 --- a/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.cpp +++ b/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.cpp @@ -62,7 +62,8 @@ namespace NLQT _CameraFocal(75), _CurrentInstance(""), _BloomEffect(false), _Scene(0), QWidget(parent) { - + setMouseTracking(true); + setFocusPolicy(Qt::StrongFocus); _objectViewerWidget = this; _isGraphicsEnabled = true; @@ -78,7 +79,7 @@ namespace NLQT CObjectViewerWidget::~CObjectViewerWidget() { - + release(); } void CObjectViewerWidget::showEvent ( QShowEvent * event ) @@ -261,7 +262,7 @@ namespace NLQT //updateAnimation(_AnimationDialog->getTime()); - + updateAnimatePS(); // 10. Update Camera (depends on entities) // ... @@ -718,6 +719,19 @@ namespace NLQT //CFile::deleteFile(filename); return icon; } + + void CObjectViewerWidget::updateAnimatePS(uint64 deltaTime) + { + static sint64 firstTime = NLMISC::CTime::getLocalTime(); + static sint64 lastTime = NLMISC::CTime::getLocalTime(); + if (deltaTime == 0) + { + deltaTime = NLMISC::CTime::getLocalTime() - lastTime; + } + lastTime += deltaTime; + float fdelta = 0.001f * (float) (lastTime - firstTime); + _Scene->animate ( fdelta); + } #if defined(NL_OS_WINDOWS) diff --git a/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.h b/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.h index 82bf26f92..15c9b0fa9 100644 --- a/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.h +++ b/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.h @@ -178,6 +178,10 @@ namespace NLQT void updateRender(); private: + + /// Update the animation time for Particle System animation. + /// @param deltaTime - set the manual animation time. + void updateAnimatePS(uint64 deltaTime = 0); static CObjectViewerWidget *_objectViewerWidget; diff --git a/code/nel/tools/misc/extract_filename/extract_filename.cpp b/code/nel/tools/misc/extract_filename/extract_filename.cpp index c8ca13452..39fead0e4 100644 --- a/code/nel/tools/misc/extract_filename/extract_filename.cpp +++ b/code/nel/tools/misc/extract_filename/extract_filename.cpp @@ -23,7 +23,7 @@ using namespace NLMISC; #ifdef NL_DEBUG #define INFO nlinfo #else // NL_DEBUG -# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # define INFO __noop # else # define INFO 0&& diff --git a/code/ryzom/client/src/attached_fx.h b/code/ryzom/client/src/attached_fx.h index c58a9e92c..6cd8d2ef7 100644 --- a/code/ryzom/client/src/attached_fx.h +++ b/code/ryzom/client/src/attached_fx.h @@ -71,6 +71,8 @@ public: const NLMISC::CMatrix *StaticMatrix; // Useful if stick mode is "StaticMatrix" uint MaxNumAnimCount; // Number of frame on which the fx can overlap when it is being shutdown float TimeOut; + double StartTime; + float DelayBeforeStart; public: CBuildInfo() { @@ -80,6 +82,8 @@ public: StaticMatrix = NULL; MaxNumAnimCount = 0; TimeOut = FX_MANAGER_DEFAULT_TIMEOUT; + StartTime = 0.0; + DelayBeforeStart = 0.f; } }; CAttachedFX(); diff --git a/code/ryzom/client/src/character_cl.cpp b/code/ryzom/client/src/character_cl.cpp index 9a651e331..87332f42d 100644 --- a/code/ryzom/client/src/character_cl.cpp +++ b/code/ryzom/client/src/character_cl.cpp @@ -5874,6 +5874,27 @@ void CCharacterCL::updateAttachedFX() CMatrix alignMatrix; buildAlignMatrix(alignMatrix); + std::list::iterator itAttachedFxToStart = _AttachedFXListToStart.begin(); + while(itAttachedFxToStart != _AttachedFXListToStart.end()) + { + if ((*itAttachedFxToStart).DelayBeforeStart < (float)(TimeInSec - (*itAttachedFxToStart).StartTime)) + { + uint index = (*itAttachedFxToStart).MaxNumAnimCount; + (*itAttachedFxToStart).MaxNumAnimCount = 0; + CAttachedFX::TSmartPtr fx = new CAttachedFX; + fx->create(*this, (*itAttachedFxToStart), CAttachedFX::CTargeterInfo()); + if (!fx->FX.empty()) + { + _AuraFX[index] = fx; + } + itAttachedFxToStart = _AttachedFXListToStart.erase(itAttachedFxToStart); + } + else + { + ++itAttachedFxToStart; + } + } + // update tracks & pos for anim attachedfxs std::list::iterator itAttachedFx = _AttachedFXListForCurrentAnim.begin(); while(itAttachedFx != _AttachedFXListForCurrentAnim.end()) @@ -8993,16 +9014,40 @@ void CCharacterCL::setAuraFX(uint index, const CAnimationFX *sheet) } else { + std::list::iterator itAttachedFxToStart = _AttachedFXListToStart.begin(); + while(itAttachedFxToStart != _AttachedFXListToStart.end()) + { + if ((*itAttachedFxToStart).MaxNumAnimCount == index) + return; + } // remove previous aura _AuraFX[index] = NULL; - CAttachedFX::TSmartPtr fx = new CAttachedFX; CAttachedFX::CBuildInfo bi; bi.Sheet = sheet; bi.TimeOut = 0.f; - fx->create(*this, bi, CAttachedFX::CTargeterInfo()); - if (!fx->FX.empty()) + + if (sheet->Sheet->PSName == "misc_caravan_teleportout.ps") { - _AuraFX[index] = fx; + bi.MaxNumAnimCount = index; + bi.StartTime = TimeInSec; + bi.DelayBeforeStart = 12.5f; + _AttachedFXListToStart.push_front(bi); + } + else if (sheet->Sheet->PSName == "misc_kami_teleportout.ps") + { + bi.MaxNumAnimCount = index; + bi.StartTime = TimeInSec; + bi.DelayBeforeStart = 11.5f; + _AttachedFXListToStart.push_front(bi); + } + else + { + CAttachedFX::TSmartPtr fx = new CAttachedFX; + fx->create(*this, bi, CAttachedFX::CTargeterInfo()); + if (!fx->FX.empty()) + { + _AuraFX[index] = fx; + } } } } diff --git a/code/ryzom/client/src/character_cl.h b/code/ryzom/client/src/character_cl.h index 1a0e864d0..a5d7ba880 100644 --- a/code/ryzom/client/src/character_cl.h +++ b/code/ryzom/client/src/character_cl.h @@ -675,6 +675,7 @@ protected: /// List of attached to remove as soon as possible (when there are no particles left) std::list _AttachedFXListToRemove; + std::list _AttachedFXListToStart; CAttachedFX::TSmartPtr _AuraFX[MaxNumAura]; // special case for aura CAttachedFX::TSmartPtr _LinkFX; // special case for link diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 8a73510e1..94900e123 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -1942,7 +1942,7 @@ void CClientConfig::init(const string &configFileName) // save the updated config file NLMISC::COFile configFile(configFileName, false, true, false); - configFile.serialBuffer((uint8*)contentUtf8.c_str(), contentUtf8.size()); + configFile.serialBuffer((uint8*)contentUtf8.c_str(), (uint)contentUtf8.size()); configFile.close(); // now we can continue loading and parsing the config file diff --git a/code/ryzom/client/src/client_chat_manager.cpp b/code/ryzom/client/src/client_chat_manager.cpp index 184c3fac3..0eafbd007 100644 --- a/code/ryzom/client/src/client_chat_manager.cpp +++ b/code/ryzom/client/src/client_chat_manager.cpp @@ -1199,6 +1199,11 @@ class CHandlerTell : public IActionHandler // display msg with good color // TDataSetIndex dsi; // not used .... PeopleInterraction.ChatInput.Tell.displayTellMessage(/*dsi, */finalMsg, receiver, prop.getRGBA()); + + ucstring s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", receiver); + strFindReplace(finalMsg, CI18N::get("youTell"), s); + CInterfaceManager::getInstance()->log(finalMsg); } }; REGISTER_ACTION_HANDLER( CHandlerTell, "tell"); diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 0e27ff487..fbea6da96 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -1271,6 +1271,30 @@ NLMISC_COMMAND(7,"talk in 7th dynamic chat channel"," ") { return talkInChan(7,args); } + + +NLMISC_COMMAND(setItemName, "set name of items, sbrick, etc.."," ") +{ + if (args.size() < 2) return false; + CSheetId id(args[0]); + ucstring name; + name.fromUtf8(args[1]); + ucstring desc; + ucstring desc2; + if (args.size() > 2) + desc.fromUtf8(args[2]); + if (args.size() > 2) + desc2.fromUtf8(args[3]); + + STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); + if (pSMC) + pSMC->replaceSBrickName(id, name, desc, desc2); + else + return false; + return true; +} + + ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// diff --git a/code/ryzom/client/src/cursor_functions.cpp b/code/ryzom/client/src/cursor_functions.cpp index 437624a86..c212dbb0d 100644 --- a/code/ryzom/client/src/cursor_functions.cpp +++ b/code/ryzom/client/src/cursor_functions.cpp @@ -550,7 +550,9 @@ void checkUnderCursor() if (!instref.ContextText.empty()) { selectedInstanceURL = instref.ContextURL; - if(ContextCur.context("WEBIG", 0.f, ucstring(instref.ContextText))) + ucstring contextText; + contextText.fromUtf8(instref.ContextText); + if(ContextCur.context("WEBIG", 0.f, contextText)) return; } } diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 7ae13500c..f94fa8321 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -1326,7 +1326,7 @@ void postlogInit() ProgressBar.newMessage ( ClientCfg.buildLoadingString(nmsg) ); CSBrickManager::getInstance()->init(); // Must be done after sheet loading - STRING_MANAGER::CStringManagerClient::specialWordsMemoryCompress(); // Must be done after brick manager init + //STRING_MANAGER::CStringManagerClient::specialWordsMemoryCompress(); // Must be done after brick manager init initLast = initCurrent; initCurrent = ryzomGetLocalTime(); diff --git a/code/ryzom/client/src/interface_v3/action_handler_item.cpp b/code/ryzom/client/src/interface_v3/action_handler_item.cpp index f6e397c26..819b8c0d4 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_item.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_item.cpp @@ -1761,7 +1761,7 @@ class CHandlerItemMenuCheck : public IActionHandler if (pCS->getInventoryIndex()==INVENTORIES::bag) { bool isTextEditionActive = false; - static const string itemTextEditionPriv = ":DEV:SGM:EM:"; + static const string itemTextEditionPriv = ":DEV:SGM:GM:EM:"; if (!UserPrivileges.empty() && itemTextEditionPriv.find(UserPrivileges)!=std::string::npos) { isTextEditionActive = true; diff --git a/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp b/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp index 4c7c081f8..a24c49ad0 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp @@ -60,6 +60,7 @@ void launchPhraseComposition(bool creation); const std::string PhraseComposition="ui:interface:phrase_composition"; const std::string PhraseCompositionGroup="ui:interface:phrase_composition:header_opened"; const std::string PhraseMemoryCtrlBase= "ui:interface:gestionsets:shortcuts:s"; +const std::string PhraseMemoryAltCtrlBase= "ui:interface:gestionsets2:header_closed:shortcuts:s"; // ********************************************************************************************************** @@ -129,7 +130,11 @@ public: if(pCSDst && pCSDst->isSPhraseId() && pCSDst->isSPhraseIdMemory()) { // then will auto-memorize it in this slot - pPM->CompositionPhraseMemoryLineDest= pPM->getSelectedMemoryLineDB(); + if (pCSDst->isShortCut()) + pPM->CompositionPhraseMemoryLineDest= pPM->getSelectedMemoryLineDB(); + else + pPM->CompositionPhraseMemoryLineDest= 0; + pPM->CompositionPhraseMemorySlotDest= pCSDst->getIndexInDB(); } // else no auto memorize @@ -1110,7 +1115,11 @@ public: return; // Ok, the user try to cast a phrase slot. - sint32 memoryLine= pPM->getSelectedMemoryLineDB(); + sint32 memoryLine; + if (pCSDst->isShortCut()) + memoryLine = pPM->getSelectedMemoryLineDB(); + else + memoryLine = 0; if(memoryLine<0) return; @@ -1249,12 +1258,16 @@ public: { sint shortcut; fromString(Params, shortcut); - if (shortcut>=0 && shortcut <= RYZOM_MAX_SHORTCUT) + if (shortcut>=0 && shortcut <= 2*RYZOM_MAX_SHORTCUT) { CInterfaceManager *pIM= CInterfaceManager::getInstance(); // get the control - CInterfaceElement *elm= pIM->getElementFromId(PhraseMemoryCtrlBase + toString(shortcut) ); + CInterfaceElement *elm; + if (shortcut < RYZOM_MAX_SHORTCUT) + elm = pIM->getElementFromId(PhraseMemoryCtrlBase + toString(shortcut) ); + else + elm = pIM->getElementFromId(PhraseMemoryAltCtrlBase + toString(shortcut-RYZOM_MAX_SHORTCUT) ); CDBCtrlSheet *ctrl= dynamic_cast(elm); if(ctrl) { @@ -1491,7 +1504,11 @@ public: return; // Ok, the user try to cast a phrase slot. - sint32 memoryLine= pPM->getSelectedMemoryLineDB(); + sint32 memoryLine; + if (pCSDst->isShortCut()) + memoryLine = pPM->getSelectedMemoryLineDB(); + else + memoryLine = 0; if(memoryLine<0) return; diff --git a/code/ryzom/client/src/interface_v3/chat_filter.cpp b/code/ryzom/client/src/interface_v3/chat_filter.cpp index 8f5db8f20..ef370b689 100644 --- a/code/ryzom/client/src/interface_v3/chat_filter.cpp +++ b/code/ryzom/client/src/interface_v3/chat_filter.cpp @@ -313,7 +313,7 @@ void CChatTargetFilter::msgEntered(const ucstring &msg, CChatWindow *chatWindow) // the target must be a player, make a tell on him ChatMngr.tell(_TargetPlayer.toString(), msg); // direct output in the chat - chatWindow->displayLocalPlayerTell(msg); + chatWindow->displayLocalPlayerTell(_TargetPlayer.toString(), msg); } else { diff --git a/code/ryzom/client/src/interface_v3/chat_window.cpp b/code/ryzom/client/src/interface_v3/chat_window.cpp index d58ccde77..6f13b1bed 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.cpp +++ b/code/ryzom/client/src/interface_v3/chat_window.cpp @@ -199,7 +199,7 @@ bool CChatWindow::isVisible() const } //================================================================================= -void CChatWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CChatGroup::TGroupType /* gt */, uint32 /* dynamicChatDbIndex */, uint numBlinks /* = 0*/, bool *windowVisible /*= NULL*/) +void CChatWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CChatGroup::TGroupType gt, uint32 dynamicChatDbIndex, uint numBlinks /* = 0*/, bool *windowVisible /*= NULL*/) { if (!_Chat) { @@ -466,7 +466,7 @@ void CChatWindow::setHeaderColor(const std::string &n) } //================================================================================= -void CChatWindow::displayLocalPlayerTell(const ucstring &msg, uint numBlinks /*= 0*/) +void CChatWindow::displayLocalPlayerTell(const ucstring &receiver, const ucstring &msg, uint numBlinks /*= 0*/) { ucstring finalMsg; CInterfaceProperty prop; @@ -484,7 +484,12 @@ void CChatWindow::displayLocalPlayerTell(const ucstring &msg, uint numBlinks /*= prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); encodeColorTag(prop.getRGBA(), finalMsg, true); finalMsg += msg; + + ucstring s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", receiver); + strFindReplace(finalMsg, CI18N::get("youTell"), s); displayMessage(finalMsg, prop.getRGBA(), CChatGroup::tell, 0, numBlinks); + CInterfaceManager::getInstance()->log(finalMsg); } void CChatWindow::encodeColorTag(const NLMISC::CRGBA &color, ucstring &text, bool append) @@ -797,14 +802,6 @@ CGroupContainer *CChatGroupWindow::createFreeTeller(const ucstring &winNameIn, c } } - // Create the free teller in all the desktops - uint8 nMode = pIM->getMode(); - pGC->setActive(false); - for (uint8 m = 0; m < MAX_NUM_MODES; ++m) - { - if (m != nMode) - pIM->updateGroupContainerImage(*pGC, m); - } // the group is only active on the current desktop pGC->setActive(true); } @@ -812,7 +809,7 @@ CGroupContainer *CChatGroupWindow::createFreeTeller(const ucstring &winNameIn, c if (!winColor.empty()) _FreeTellers[i]->setHeaderColor(winColor); - updateFreeTellerHeader(*_FreeTellers[i]); +// updateFreeTellerHeader(*_FreeTellers[i]); return _FreeTellers[i]; } diff --git a/code/ryzom/client/src/interface_v3/chat_window.h b/code/ryzom/client/src/interface_v3/chat_window.h index a18b950f6..5daf24c36 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.h +++ b/code/ryzom/client/src/interface_v3/chat_window.h @@ -143,7 +143,7 @@ public: void setAHOnCloseButtonParams(const std::string &n); void setHeaderColor(const std::string &n); // - void displayLocalPlayerTell(const ucstring &msg, uint numBlinks = 0); + void displayLocalPlayerTell(const ucstring &receiver, const ucstring &msg, uint numBlinks = 0); /// Encode a color tag '@{RGBA}' in the text. If append is true, append at end of text, otherwise, replace the text static void encodeColorTag(const NLMISC::CRGBA &color, ucstring &text, bool append=true); diff --git a/code/ryzom/client/src/interface_v3/ctrl_base_button.h b/code/ryzom/client/src/interface_v3/ctrl_base_button.h index c1d993aec..06a27b276 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_base_button.h +++ b/code/ryzom/client/src/interface_v3/ctrl_base_button.h @@ -114,7 +114,7 @@ public: /// \name Handlers // @{ // Event part - void setActionOnLeftClick (const std::string &actionHandlerName) { _AHOnLeftClick = getAH(actionHandlerName, _AHLeftClickParams); } + void setActionOnLeftClick (const std::string &actionHandlerName) { _AHOnLeftClickString = actionHandlerName; _AHOnLeftClick = getAH(actionHandlerName, _AHLeftClickParams); } void setActionOnRightClick (const std::string &actionHandlerName) { _AHOnRightClick = getAH(actionHandlerName, _AHRightClickParams); } void setActionOnClockTick (const std::string &ahName) { _AHOnClockTick = getAH(ahName, _AHClockTickParams); } void setParamsOnLeftClick (const std::string ¶msHandlerName) { _AHLeftClickParams = paramsHandlerName; } @@ -203,6 +203,7 @@ protected: //@{ IActionHandler *_AHOnOver; CStringShared _AHOverParams; + std::string _AHOnLeftClickString; IActionHandler *_AHOnLeftClick; CStringShared _AHLeftClickParams; IActionHandler *_AHOnLeftDblClick; diff --git a/code/ryzom/client/src/interface_v3/ctrl_button.cpp b/code/ryzom/client/src/interface_v3/ctrl_button.cpp index 17d89e900..fd1ba049b 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_button.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_button.cpp @@ -333,4 +333,16 @@ void CCtrlButton::fitTexture() setH(h); } - +// *************************************************************************** +bool CCtrlButton::getMouseOverShape(string &texName, uint8 &rot, CRGBA &col) +{ + if (_AHOnLeftClickString == "browse") + { + texName = "curs_pick.tga"; + rot= 0; + col = CRGBA::White; + return true; + } + + return false; +} diff --git a/code/ryzom/client/src/interface_v3/ctrl_button.h b/code/ryzom/client/src/interface_v3/ctrl_button.h index 3dcb0f896..ff769e6c4 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_button.h +++ b/code/ryzom/client/src/interface_v3/ctrl_button.h @@ -50,6 +50,8 @@ public: virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } + virtual bool getMouseOverShape(std::string &/* texName */, uint8 &/* rot */, NLMISC::CRGBA &/* col */); + // Display part virtual void draw(); diff --git a/code/ryzom/client/src/interface_v3/group_editbox.cpp b/code/ryzom/client/src/interface_v3/group_editbox.cpp index b87d95f2d..5bc516f47 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox.cpp +++ b/code/ryzom/client/src/interface_v3/group_editbox.cpp @@ -21,6 +21,7 @@ #include "group_editbox.h" #include "interface_manager.h" #include "input_handler_manager.h" +#include "nel/misc/command.h" #include "view_text.h" #include "game_share/xml_auto_ptr.h" #include "interface_options.h" @@ -56,6 +57,7 @@ CGroupEditBox::CGroupEditBox(const TCtorParam ¶m) : _MaxCharsSize(32768), _FirstVisibleChar(0), _LastVisibleChar(0), + _SelectingText(false), _ViewText(NULL), _MaxHistoric(0), _CurrentHistoricIndex(-1), @@ -354,16 +356,27 @@ void CGroupEditBox::paste() if (Driver->pasteTextFromClipboard(sString)) { // append string now - appendString(sString); + appendStringFromClipboard(sString); } } // ---------------------------------------------------------------------------- -void CGroupEditBox::appendString(const ucstring &str) +void CGroupEditBox::appendStringFromClipboard(const ucstring &str) { stopParentBlink(); makeTopWindow(); + writeString(str, true, false); + nlinfo ("Chat input was pasted from the clipboard"); + + triggerOnChangeAH(); + + _CursorAtPreviousLineEnd = false; +} + +// ---------------------------------------------------------------------------- +void CGroupEditBox::writeString(const ucstring &str, bool replace, bool atEnd) +{ sint length = (sint)str.length(); ucstring toAppend; @@ -500,13 +513,41 @@ void CGroupEditBox::appendString(const ucstring &str) length = _MaxNumChar - (sint)_InputString.length(); } ucstring toAdd = toAppend.substr(0, length); - _InputString = _InputString.substr(0, _CursorPos) + toAdd + _InputString.substr(_CursorPos); - _CursorPos += (sint32)toAdd.length(); - nlinfo ("Chat input was pasted from the clipboard"); + sint32 minPos; + sint32 maxPos; + if (_CurrSelection == this) + { + minPos = min(_CursorPos, _SelectCursorPos); + maxPos = max(_CursorPos, _SelectCursorPos); + } + else + { + minPos = _CursorPos; + maxPos = _CursorPos; + } - triggerOnChangeAH(); + nlinfo("%d, %d", minPos, maxPos); + if (replace) + { + _InputString = _InputString.substr(0, minPos) + toAdd + _InputString.substr(maxPos); + _CursorPos = minPos+(sint32)toAdd.length(); + } + else + { + if (atEnd) + { + _InputString = _InputString.substr(0, maxPos) + toAdd + _InputString.substr(maxPos); + _CursorPos = maxPos; + _SelectCursorPos = _CursorPos; - _CursorAtPreviousLineEnd = false; + } + else + { + _InputString = _InputString.substr(0, minPos) + toAdd + _InputString.substr(minPos); + _CursorPos = minPos+(sint32)toAdd.length(); + _SelectCursorPos = maxPos+(sint32)toAdd.length(); + } + } } // ---------------------------------------------------------------------------- @@ -672,7 +713,7 @@ void CGroupEditBox::handleEventChar(const CEventDescriptorKey &rEDK) // ---------------------------------------------------------------------------- void CGroupEditBox::handleEventString(const CEventDescriptorKey &rEDK) { - appendString(rEDK.getString()); + appendStringFromClipboard(rEDK.getString()); } // ---------------------------------------------------------------------------- @@ -862,6 +903,7 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event) // if click, and not frozen, then get the focus if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown && !_Frozen) { + _SelectingText = true; stopParentBlink(); pIM->setCaptureKeyboard (this); // set the right cursor position @@ -872,9 +914,34 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event) _CursorPos = newCurPos; _CursorPos -= (sint32)_Prompt.length(); _CursorPos = std::max(_CursorPos, sint32(0)); + _SelectCursorPos = _CursorPos; + _CurrSelection = NULL; return true; } + // if click, and not frozen, then get the focus + if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove && !_Frozen && _SelectingText) + { + // set the right cursor position + uint newCurPos; + bool cursorAtPreviousLineEnd; + _CurrSelection = this; + _ViewText->getCharacterIndexFromPosition(eventDesc.getX() - _ViewText->getXReal(), eventDesc.getY() - _ViewText->getYReal(), newCurPos, cursorAtPreviousLineEnd); + _SelectCursorPos = newCurPos; + _SelectCursorPos -= (sint32)_Prompt.length(); + _SelectCursorPos = std::max(_SelectCursorPos, sint32(0)); + return true; + } + + // if click, and not frozen, then get the focus + if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup && !_Frozen) + { + _SelectingText = false; + if (_SelectCursorPos == _CursorPos) + _CurrSelection = NULL; + + return true; + } if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown) { diff --git a/code/ryzom/client/src/interface_v3/group_editbox.h b/code/ryzom/client/src/interface_v3/group_editbox.h index 3a067cf25..f2856709a 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox.h +++ b/code/ryzom/client/src/interface_v3/group_editbox.h @@ -125,6 +125,8 @@ public: void copy(); // Paste the selection into buffer void paste(); + // Write the string into buffer + void writeString(const ucstring &str, bool replace = true, bool atEnd = true); // Expand the expression (true if there was a '/' at the start of the line) bool expand(); @@ -217,6 +219,7 @@ protected: // Text selection static sint32 _SelectCursorPos; static CGroupEditBox *_CurrSelection; // the edit box for which the selection is currently active, or NULL if there's none + bool _SelectingText; NLMISC::CRGBA _TextSelectColor; NLMISC::CRGBA _BackSelectColor; @@ -291,7 +294,7 @@ private: void handleEventString(const CEventDescriptorKey &event); void setup(); void triggerOnChangeAH(); - void appendString(const ucstring &str); + void appendStringFromClipboard(const ucstring &str); ucstring getSelection(); diff --git a/code/ryzom/client/src/interface_v3/group_html.cpp b/code/ryzom/client/src/interface_v3/group_html.cpp index 43ff1ca75..dda2250a8 100644 --- a/code/ryzom/client/src/interface_v3/group_html.cpp +++ b/code/ryzom/client/src/interface_v3/group_html.cpp @@ -442,6 +442,9 @@ void CGroupHTML::addText (const char * buf, int len) { if (_Browsing) { + if (_IgnoreText) + return; + // Build a UTF8 string string inputString(buf, buf+len); // inputString.resize (len); @@ -525,6 +528,11 @@ void CGroupHTML::addLink (uint element_number, uint /* attribute_number */, HTCh // in ah: command we don't respect the uri standard so the HTAnchor_address doesn't work correctly _Link.push_back (suri); } + else if (suri[0] == '#') + { + // Direct url (hack for lua beginElement) + _Link.push_back (suri.substr(1)); + } else { HTAnchor * dest = HTAnchor_followMainLink((HTAnchor *) anchor); @@ -839,6 +847,14 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c } } break; + case HTML_DIV: + { + if (present[MY_HTML_DIV_NAME] && value[MY_HTML_DIV_NAME]) + { + _DivName = value[MY_HTML_DIV_NAME]; + } + } + break; case HTML_FONT: { bool found = false; @@ -856,7 +872,7 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c _TextColor.push_back(_TextColor.empty() ? CRGBA::White : _TextColor.back()); } } - break; + break; case HTML_BR: addString(ucstring ("\n")); break; @@ -1372,6 +1388,9 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c _ObjectAction = value[HTML_OBJECT_STANDBY]; _Object = true; + break; + case HTML_STYLE: + _IgnoreText = true; break; } } @@ -1409,6 +1428,10 @@ void CGroupHTML::endElement (uint element_number) case HTML_PRE: popIfNotEmpty (_PRE); break; + case HTML_DIV: + _DivName = ""; + break; + case HTML_TABLE: popIfNotEmpty (_CellParams); popIfNotEmpty (_TR); @@ -1493,6 +1516,9 @@ void CGroupHTML::endElement (uint element_number) popIfNotEmpty (_UL); } break; + case HTML_STYLE: + _IgnoreText = false; + break; case HTML_OBJECT: if (_ObjectType=="application/ryzom-data") { @@ -1560,6 +1586,7 @@ CGroupHTML::CGroupHTML(const TCtorParam ¶m) // init _ParsingLua = false; + _IgnoreText = false; _BrowseNextTime = false; _PostNextTime = false; _Browsing = false; @@ -2506,6 +2533,7 @@ void CGroupHTML::clearContext() _Cells.clear(); _TR.clear(); _Forms.clear(); + _Groups.clear(); _CellParams.clear(); _Title = false; _TextArea = false; @@ -2584,6 +2612,12 @@ void CGroupHTML::addGroup (CInterfaceGroup *group, uint beginSpace) _Paragraph = NULL; } + if (!_DivName.empty()) + { + group->setName(_DivName); + _Groups.push_back(group); + } + group->setSizeRef(CInterfaceElement::width); // Compute begin space between paragraph and tables @@ -3337,6 +3371,171 @@ int CGroupHTML::luaRefresh(CLuaState &ls) return 0; } +// *************************************************************************** +int CGroupHTML::luaRemoveContent(CLuaState &ls) +{ + const char *funcName = "refresh"; + CLuaIHM::checkArgCount(ls, funcName, 0); + removeContent(); + return 0; +} + +// *************************************************************************** +int CGroupHTML::luaInsertText(CLuaState &ls) +{ + const char *funcName = "insertText"; + CLuaIHM::checkArgCount(ls, funcName, 3); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); + CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING); + CLuaIHM::checkArgType(ls, funcName, 3, LUA_TBOOLEAN); + + string name = ls.toString(1); + + ucstring text; + text.fromUtf8(ls.toString(2)); + + if (!_Forms.empty()) { + for (uint i=0; i<_Forms.back().Entries.size(); i++) + { + if (_Forms.back().Entries[i].TextArea && _Forms.back().Entries[i].Name == name) + { + // Get the edit box view + CInterfaceGroup *group = _Forms.back().Entries[i].TextArea->getGroup ("eb"); + if (group) + { + // Should be a CGroupEditBox + CGroupEditBox *editBox = dynamic_cast(group); + if (editBox) + editBox->writeString(text, false, ls.toBoolean(3)); + } + } + } + } + + return 0; +} + +// *************************************************************************** +int CGroupHTML::luaAddString(CLuaState &ls) +{ + const char *funcName = "addString"; + CLuaIHM::checkArgCount(ls, funcName, 1); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); + addString(ucstring(ls.toString(1))); + return 0; +} + +// *************************************************************************** +int CGroupHTML::luaAddImage(CLuaState &ls) +{ + const char *funcName = "addImage"; + CLuaIHM::checkArgCount(ls, funcName, 2); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); + CLuaIHM::checkArgType(ls, funcName, 2, LUA_TBOOLEAN); + if (!_Paragraph) + { + newParagraph(0); + paragraphChange(); + } + string url = getLink(); + if (!url.empty()) { + string params = "name=" + getId() + "|url=" + getLink (); + addButton(CCtrlButton::PushButton, ls.toString(1), ls.toString(1), ls.toString(1), + "", ls.toBoolean(2), "browse", params.c_str(), ""); + } else { + addImage(ls.toString(1), ls.toBoolean(2)); + } + + + return 0; +} + +// *************************************************************************** +int CGroupHTML::luaBeginElement(CLuaState &ls) +{ + const char *funcName = "beginElement"; + CLuaIHM::checkArgCount(ls, funcName, 2); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); + CLuaIHM::checkArgType(ls, funcName, 2, LUA_TTABLE); + + uint element_number = (uint)ls.toNumber(1); + std::vector present; + std::vector value; + present.resize(30, false); + value.resize(30); + + CLuaObject params; + params.pop(ls); + uint max_idx = 0; + + + ENUM_LUA_TABLE(params, it) + { + if (!it.nextKey().isNumber()) + { + nlwarning("%s : bad key encountered with type %s, number expected.", funcName, it.nextKey().getTypename()); + continue; + } + if (!it.nextValue().isString()) + { + nlwarning("%s : bad value encountered with type %s for key %s, string expected.", funcName, it.nextValue().getTypename(), it.nextKey().toString().c_str()); + continue; + } + uint idx = (uint)it.nextKey().toNumber(); + + present.insert(present.begin() + (uint)it.nextKey().toNumber(), true); + + string str = it.nextValue().toString(); + size_t size = str.size() + 1; + char * buffer = new char[ size ]; + strncpy(buffer, str.c_str(), size ); + + value.insert(value.begin() + (uint)it.nextKey().toNumber(), buffer); + } + + beginElement(element_number, &present[0], &value[0]); + if (element_number == HTML_A) + addLink(element_number, 0, NULL, &present[0], &value[0]); + + return 0; +} + + +// *************************************************************************** +int CGroupHTML::luaEndElement(CLuaState &ls) +{ + const char *funcName = "endElement"; + CLuaIHM::checkArgCount(ls, funcName, 1); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); + + uint element_number = (uint)ls.toNumber(1); + endElement(element_number); + + return 0; +} + + +// *************************************************************************** +int CGroupHTML::luaShowDiv(CLuaState &ls) +{ + const char *funcName = "showDiv"; + CLuaIHM::checkArgCount(ls, funcName, 2); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); + CLuaIHM::checkArgType(ls, funcName, 2, LUA_TBOOLEAN); + + if (!_Groups.empty()) { + for (uint i=0; i<_Groups.size(); i++) + { + CInterfaceGroup *group = _Groups[i]; + if (group->getName() == ls.toString(1)) + { + group->setActive(ls.toBoolean(2)); + } + } + } + return 0; +} + // *************************************************************************** void CGroupHTML::setURL(const std::string &url) { diff --git a/code/ryzom/client/src/interface_v3/group_html.h b/code/ryzom/client/src/interface_v3/group_html.h index b4f4ee00b..92cb81e6e 100644 --- a/code/ryzom/client/src/interface_v3/group_html.h +++ b/code/ryzom/client/src/interface_v3/group_html.h @@ -165,10 +165,24 @@ public: int luaBrowse(CLuaState &ls); int luaRefresh(CLuaState &ls); + int luaRemoveContent(CLuaState &ls); + int luaInsertText(CLuaState &ls); + int luaAddString(CLuaState &ls); + int luaAddImage(CLuaState &ls); + int luaBeginElement(CLuaState &ls); + int luaEndElement(CLuaState &ls); + int luaShowDiv(CLuaState &ls); REFLECT_EXPORT_START(CGroupHTML, CGroupScrollText) REFLECT_LUA_METHOD("browse", luaBrowse) REFLECT_LUA_METHOD("refresh", luaRefresh) + REFLECT_LUA_METHOD("removeContent", luaRemoveContent) + REFLECT_LUA_METHOD("insertText", luaInsertText) + REFLECT_LUA_METHOD("addString", luaAddString) + REFLECT_LUA_METHOD("addImage", luaAddImage) + REFLECT_LUA_METHOD("beginElement", luaBeginElement) + REFLECT_LUA_METHOD("endElement", luaEndElement) + REFLECT_LUA_METHOD("showDiv", luaShowDiv) REFLECT_STRING("url", getURL, setURL) REFLECT_FLOAT("timeout", getTimeout, setTimeout) REFLECT_EXPORT_END @@ -290,6 +304,7 @@ protected : // element has been found // True when the element has been encountered bool _ParsingLua; + bool _IgnoreText; // the script to execute std::string _LuaScript; @@ -303,6 +318,7 @@ protected : class CLibWWWData *_LibWWW; // Current paragraph + std::string _DivName; CGroupParagraph* _Paragraph; inline CGroupParagraph *getParagraph() { @@ -442,6 +458,7 @@ protected : std::vector Entries; }; std::vector _Forms; + std::vector _Groups; // Cells parameters class CCellParams diff --git a/code/ryzom/client/src/interface_v3/group_menu.cpp b/code/ryzom/client/src/interface_v3/group_menu.cpp index 93d2ee4bb..22ff2b07c 100644 --- a/code/ryzom/client/src/interface_v3/group_menu.cpp +++ b/code/ryzom/client/src/interface_v3/group_menu.cpp @@ -1156,7 +1156,7 @@ void CGroupSubMenu::addSeparatorAtIndex(uint index, const std::string &id) tmp.CheckBox = NULL; tmp.RightArrow = NULL; _Lines.insert(_Lines.begin() + index, tmp); - _SubMenus.insert(_SubMenus.begin() + index, NULL); + _SubMenus.insert(_SubMenus.begin() + index, (CGroupSubMenu*)NULL); _GroupMenu->invalidateCoords(); } @@ -1304,7 +1304,7 @@ CViewTextMenu* CGroupSubMenu::addLineAtIndex(uint index, const ucstring &name, _Lines.insert(_Lines.begin() + index, tmp); // Add an empty sub menu by default - _SubMenus.insert(_SubMenus.begin() + index, NULL); + _SubMenus.insert(_SubMenus.begin() + index, (CGroupSubMenu*)NULL); _GroupMenu->invalidateCoords(); diff --git a/code/ryzom/client/src/interface_v3/group_quick_help.cpp b/code/ryzom/client/src/interface_v3/group_quick_help.cpp index 9df6c343e..210c7110e 100644 --- a/code/ryzom/client/src/interface_v3/group_quick_help.cpp +++ b/code/ryzom/client/src/interface_v3/group_quick_help.cpp @@ -278,8 +278,11 @@ void CGroupQuickHelp::browse (const char *url) _IsQuickHelp = false; string completeURL = url; - completeURL = completeURL.substr(0, completeURL.size()-5); // Substract the ".html" - completeURL += "_" + ClientCfg.getHtmlLanguageCode() + ".html"; + if (completeURL.substr(completeURL.size()-5, 5) == ".html") + { + completeURL = completeURL.substr(0, completeURL.size()-5); // Substract the ".html" + completeURL += "_" + ClientCfg.getHtmlLanguageCode() + ".html"; + } CGroupHTML::browse (completeURL.c_str()); } diff --git a/code/ryzom/client/src/interface_v3/group_tab.cpp b/code/ryzom/client/src/interface_v3/group_tab.cpp index 33588cbb9..27e6aa3a4 100644 --- a/code/ryzom/client/src/interface_v3/group_tab.cpp +++ b/code/ryzom/client/src/interface_v3/group_tab.cpp @@ -155,7 +155,7 @@ void CGroupTab::addTab(CCtrlTabButton * tabB, sint index) { if(i==index) { - tabB->setId(string("tab") + count); + tabB->setId("tab" + NLMISC::toString(count)); tabB->setParentPos(lastTab); if(i==0) tabB->setParentPosRef(Hotspot_TL); @@ -168,7 +168,7 @@ void CGroupTab::addTab(CCtrlTabButton * tabB, sint index) count++; } - buttons[i]->setId(string("tab") + count); + buttons[i]->setId("tab" + NLMISC::toString(count)); buttons[i]->setParentPos(lastTab); if(i==0 && index!=0) buttons[i]->setParentPosRef(Hotspot_TL); @@ -297,7 +297,7 @@ void CGroupTab::removeTab(sint index) { if(i!=index) { - buttons[i]->setId(string("tab")+count); + buttons[i]->setId("tab"+NLMISC::toString(count)); buttons[i]->setParentPos(lastTab); if((i==0) || (index==0 && i==1)) buttons[i]->setParentPosRef(Hotspot_TL); diff --git a/code/ryzom/client/src/interface_v3/interface_element.h b/code/ryzom/client/src/interface_v3/interface_element.h index c77fc41b6..24982cad2 100644 --- a/code/ryzom/client/src/interface_v3/interface_element.h +++ b/code/ryzom/client/src/interface_v3/interface_element.h @@ -250,6 +250,9 @@ public: /// Accessors : SET void setId (const std::string &newID) { _Id = newID; } + inline void setName(const std::string &name) { _Name = name; } + inline const std::string& getName() { return _Name; } + virtual void setIdRecurse(const std::string &newID); void setParent (CInterfaceGroup *pIG) { _Parent = pIG; } @@ -510,6 +513,8 @@ protected: ///the id of the element std::string _Id; + std::string _Name; + ///is the element active? bool _Active; diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index 45514f3c5..478da960b 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -524,12 +524,12 @@ void CInterfaceManager::initOutGame() ActionsContext.addActionsManager(&Actions, ""); ActionsContext.addActionsManager(&EditActions, RZ_CATEGORY_EDIT); - - if (ClientCfg.SelectCharacter != -1) return; - // Init LUA Scripting initLUA(); + if (ClientCfg.SelectCharacter != -1) + return; + { if (SoundMngr != NULL) { diff --git a/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp b/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp index bbd664ad5..35afeb618 100644 --- a/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp +++ b/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp @@ -113,6 +113,33 @@ void CItemConsumableEffectHelper::getItemConsumableEffectText(const CItemSheet * effects += "\n"; } + if ( name == "SP_LIFE_AURA2" ) + { + + uint16 regenMod; + fromString(params[0].c_str(), regenMod); + uint32 bonus = regenMod * itemQuality; + uint32 duration; + fromString(params[1].c_str(), duration); + uint32 radius; + fromString(params[2].c_str(), radius); + uint32 targetDisableTime; + fromString(params[3].c_str(), targetDisableTime); + uint32 userDisableTime; + fromString(params[4].c_str(), userDisableTime); + + ucstring result = CI18N::get("uiItemConsumableEffectLifeAura"); + strFindReplace(result, "%modifier", toString(bonus)); + strFindReplace(result, "%minutes", toString(duration/60)); + strFindReplace(result, "%secondes", toString(duration%60)); + strFindReplace(result, "%radius", toString(radius)); + strFindReplace(result, "%targetDisableTime", toString(targetDisableTime)); + strFindReplace(result, "%userDisableTime", toString(userDisableTime)); + + effects += result; + effects += "\n"; + } + if ( name == "SP_STAMINA_AURA" ) { @@ -139,6 +166,34 @@ void CItemConsumableEffectHelper::getItemConsumableEffectText(const CItemSheet * effects += "\n"; } + + if ( name == "SP_STAMINA_AURA2" ) + { + + uint16 regenMod; + fromString(params[0].c_str(), regenMod); + uint32 bonus = regenMod * itemQuality; + uint32 duration; + fromString(params[1].c_str(), duration); + uint32 radius; + fromString(params[2].c_str(), radius); + uint32 targetDisableTime; + fromString(params[3].c_str(), targetDisableTime); + uint32 userDisableTime; + fromString(params[4].c_str(), userDisableTime); + + ucstring result = CI18N::get("uiItemConsumableEffectStaminaAura"); + strFindReplace(result, "%modifier", toString(regenMod)); + strFindReplace(result, "%minutes", toString(duration/60)); + strFindReplace(result, "%secondes", toString(duration%60)); + strFindReplace(result, "%radius", toString(radius)); + strFindReplace(result, "%targetDisableTime", toString(targetDisableTime)); + strFindReplace(result, "%userDisableTime", toString(userDisableTime)); + + effects += result; + effects += "\n"; + } + if ( name == "SP_SAP_AURA" ) { @@ -165,6 +220,33 @@ void CItemConsumableEffectHelper::getItemConsumableEffectText(const CItemSheet * effects += "\n"; } + if ( name == "SP_SAP_AURA2" ) + { + + uint16 regenMod; + fromString(params[0].c_str(), regenMod); + uint32 bonus = regenMod * itemQuality; + uint32 duration; + fromString(params[1].c_str(), duration); + uint32 radius; + fromString(params[2].c_str(), radius); + uint32 targetDisableTime; + fromString(params[3].c_str(), targetDisableTime); + uint32 userDisableTime; + fromString(params[4].c_str(), userDisableTime); + + ucstring result = CI18N::get("uiItemConsumableEffectSapAura"); + strFindReplace(result, "%modifier", toString(bonus)); + strFindReplace(result, "%minutes", toString(duration/60)); + strFindReplace(result, "%secondes", toString(duration%60)); + strFindReplace(result, "%radius", toString(radius)); + strFindReplace(result, "%targetDisableTime", toString(targetDisableTime)); + strFindReplace(result, "%userDisableTime", toString(userDisableTime)); + + effects += result; + effects += "\n"; + } + // skill modifier consumables //--------------------------- ucstring result(""); diff --git a/code/ryzom/client/src/interface_v3/lua_ihm.cpp b/code/ryzom/client/src/interface_v3/lua_ihm.cpp index 6fee6811a..cf34912f8 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm.cpp @@ -115,6 +115,7 @@ #include "game_share/scenario_entry_points.h" #include "game_share/bg_downloader_msg.h" #include "game_share/constants.h" +#include "game_share/visual_slot_manager.h" #ifdef LUA_NEVRAX_VERSION #include "lua_ide_dll_nevrax/include/lua_ide_dll/ide_interface.h" // external debugger @@ -1368,6 +1369,8 @@ void CLuaIHM::registerIHM(CLuaState &ls) ls.registerFunc("isPlayerNewbie", isPlayerNewbie); ls.registerFunc("isInRingMode", isInRingMode); ls.registerFunc("getUserRace", getUserRace); + ls.registerFunc("getSheet2idx", getSheet2idx); + // Through LUABind API lua_State *L= ls.getStatePointer(); @@ -4412,3 +4415,25 @@ int CLuaIHM::getUserRace(CLuaState &ls) return 1; } +// *************************************************************************** +int CLuaIHM::getSheet2idx(CLuaState &ls) +{ + CLuaIHM::checkArgCount(ls, "getSheet2idx", 2); + CLuaIHM::checkArgType(ls, "getSheet2idx", 1, LUA_TSTRING); + CLuaIHM::checkArgType(ls, "getSheet2idx", 2, LUA_TNUMBER); + + const std::string & sheedtName = ls.toString(1); + uint32 slotId = (uint32)ls.toNumber(2); + + NLMISC::CSheetId sheetId; + + if (sheetId.buildSheetId(sheedtName)) + { + uint32 idx = CVisualSlotManager::getInstance()->sheet2Index(sheetId, (SLOTTYPE::EVisualSlot)slotId); + ls.push((lua_Number)idx); + } + else + return 0; + return 1; +} + diff --git a/code/ryzom/client/src/interface_v3/lua_ihm.h b/code/ryzom/client/src/interface_v3/lua_ihm.h index f2a0e2628..6a11a5c91 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm.h @@ -351,6 +351,7 @@ private: static int isPlayerNewbie(CLuaState &ls); static int isInRingMode(CLuaState &ls); static int getUserRace(CLuaState &ls); + static int getSheet2idx(CLuaState &ls); // LUA functions exported for Dev only (debug) diff --git a/code/ryzom/client/src/interface_v3/people_interraction.cpp b/code/ryzom/client/src/interface_v3/people_interraction.cpp index 3b5a4fb43..170d20ffd 100644 --- a/code/ryzom/client/src/interface_v3/people_interraction.cpp +++ b/code/ryzom/client/src/interface_v3/people_interraction.cpp @@ -999,7 +999,7 @@ class CHandlerChatGroupFilter : public IActionHandler } - rCTF.setTargetGroup(PeopleInterraction.TheUserChat.Filter.getTargetGroup()); + rCTF.setTargetGroup(PeopleInterraction.TheUserChat.Filter.getTargetGroup(), PeopleInterraction.TheUserChat.Filter.getTargetDynamicChannelDbIndex()); } else { @@ -1813,8 +1813,6 @@ void CPeopleInterraction::setupUserChatFromSummary(const CFilteredChatSummary &s //================================================================================================================= void CPeopleInterraction::setupUserDynChatFromSummary(const CFilteredDynChatSummary &summary, CFilteredChat &dest) { - // User Dest - dest.Filter.setTargetGroup(summary.Target, 0, false); // src for (uint8 i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++) { @@ -2666,12 +2664,12 @@ class CHandlerChatTargetSelected : public IActionHandler // Case of user chat in grouped chat window if (cw == PeopleInterraction.ChatGroup.Window) { - PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup()); + PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup(), cf.getTargetDynamicChannelDbIndex()); CInterfaceManager::getInstance()->runActionHandler("chat_group_filter", NULL, "user"); } if (cw == PeopleInterraction.TheUserChat.Window) { - PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup()); + PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup(), cf.getTargetDynamicChannelDbIndex()); CInterfaceManager::getInstance()->runActionHandler("user_chat_active", NULL, ""); } diff --git a/code/ryzom/client/src/interface_v3/people_list.cpp b/code/ryzom/client/src/interface_v3/people_list.cpp index 66ce8a2a8..cd3d75067 100644 --- a/code/ryzom/client/src/interface_v3/people_list.cpp +++ b/code/ryzom/client/src/interface_v3/people_list.cpp @@ -441,7 +441,7 @@ void CPeopleList::setContactId(uint index, uint32 contactId) } //================================================================== -void CPeopleList::displayLocalPlayerTell(uint index,const ucstring &msg,uint numBlinks /*=0*/) +void CPeopleList::displayLocalPlayerTell(const ucstring &receiver, uint index, const ucstring &msg,uint numBlinks /*=0*/) { if (_ContactType == CPeopleListDesc::Ignore) { @@ -475,7 +475,12 @@ void CPeopleList::displayLocalPlayerTell(uint index,const ucstring &msg,uint num // display msg with good color CInterfaceProperty prop; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); + + ucstring s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", receiver); + strFindReplace(finalMsg, CI18N::get("youTell"), s); gl->addChild(getChatTextMngr().createMsgText(finalMsg, prop.getRGBA())); + CInterfaceManager::getInstance()->log(finalMsg); // if the group is closed, make it blink if (!gc->isOpen()) @@ -924,7 +929,7 @@ class CHandlerContactEntry : public IActionHandler uint index; if (PeopleInterraction.getPeopleFromContainerID(str, peopleList, index)) { - peopleList->displayLocalPlayerTell(index, text); + peopleList->displayLocalPlayerTell(str2, index, text); } } else @@ -948,6 +953,11 @@ class CHandlerContactEntry : public IActionHandler CChatWindow::encodeColorTag(prop.getRGBA(), final, true); final += text; pWin->displayTellMessage(final, prop.getRGBA(), pWin->getFreeTellerName(str)); + + ucstring s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", pWin->getFreeTellerName(str)); + strFindReplace(final, CI18N::get("youTell"), s); + CInterfaceManager::getInstance()->log(final); } } diff --git a/code/ryzom/client/src/interface_v3/people_list.h b/code/ryzom/client/src/interface_v3/people_list.h index 0ab0f3508..a3748c01a 100644 --- a/code/ryzom/client/src/interface_v3/people_list.h +++ b/code/ryzom/client/src/interface_v3/people_list.h @@ -111,7 +111,7 @@ public: * If the window is closed, it causes it to blink (and also the parent window) */ void displayMessage(uint index, const ucstring &msg, NLMISC::CRGBA col, uint numBlinks = 0); - void displayLocalPlayerTell(uint index, const ucstring &msg, uint numBlinks = 0); + void displayLocalPlayerTell(const ucstring &receiver, uint index, const ucstring &msg, uint numBlinks = 0); // Is the given people window visible ? bool isPeopleChatVisible(uint index) const; // reset remove everything from the interface diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp index 8058e41da..6820a10e8 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp @@ -57,6 +57,7 @@ const std::string PhraseMemoryViewNextAction= "ui:interface:gestionsets:shortcu const std::string PhraseMemoryViewCycleAction= "ui:interface:gestionsets:shortcuts:view_cycle_action"; const std::string PhraseMemoryViewSlotBase= "ui:interface:gestionsets:shortcuts:s"; const std::string PhraseMemoryCtrlBase= "ui:interface:gestionsets:shortcuts:s"; +const std::string PhraseMemoryAltCtrlBase= "ui:interface:gestionsets2:header_closed:shortcuts:s"; const std::string PhraseMemoryPhraseMenu= "ui:interface:cm_memory_phrase"; const std::string PhraseMemoryPhraseAction= "cast_phrase_or_create_new"; @@ -118,11 +119,16 @@ void CSPhraseManager::initInGame() _BookDbLeaves[i]= node; } _MemoryDbLeaves.resize(PHRASE_MAX_MEMORY_SLOT, NULL); + _MemoryAltDbLeaves.resize(PHRASE_MAX_MEMORY_SLOT, NULL); + for(i=0;igetDbProp(PHRASE_DB_MEMORY + ":" + toString(i) + ":PHRASE"); node->setValue32(0); _MemoryDbLeaves[i]= node; + CCDBNodeLeaf *node_alt= pIM->getDbProp(PHRASE_DB_MEMORY_ALT + ":" + toString(i) + ":PHRASE"); + node_alt->setValue32(0); + _MemoryAltDbLeaves[i]= node_alt; } // Progression Db leaves @@ -497,6 +503,7 @@ void CSPhraseManager::updateMemoryDBAll() for(uint i=0;isetValue32(0); + _MemoryAltDbLeaves[i]->setValue32(0); } } else @@ -508,6 +515,12 @@ void CSPhraseManager::updateMemoryDBAll() _MemoryDbLeaves[i]->setValue32(0); else _MemoryDbLeaves[i]->setValue32(slot.Id); + + CMemorySlot &slotAlt= _Memories[0].Slot[i]; + if(!slotAlt.isPhrase()) + _MemoryAltDbLeaves[i]->setValue32(0); + else + _MemoryAltDbLeaves[i]->setValue32(slotAlt.Id); } } } @@ -530,6 +543,15 @@ void CSPhraseManager::updateMemoryDBSlot(uint32 memorySlot) else _MemoryDbLeaves[memorySlot]->setValue32(slot.Id); } + + if (_SelectedMemoryDB == 0) + { + CMemorySlot &slotAlt= _Memories[0].Slot[memorySlot]; + if(!slotAlt.isPhrase()) + _MemoryAltDbLeaves[memorySlot]->setValue32(0); + else + _MemoryAltDbLeaves[memorySlot]->setValue32(slotAlt.Id); + } } // *************************************************************************** @@ -873,6 +895,7 @@ void CSPhraseManager::reset() _LastProgressionNumDbFill[i]= 0; } _MemoryDbLeaves.clear(); + _MemoryAltDbLeaves.clear(); _NextExecuteLeaf= NULL; _NextExecuteIsCyclicLeaf= NULL; @@ -2645,7 +2668,13 @@ static sint getRightHandEnchantValue() void CSPhraseManager::updateMemoryCtrlRegenTickRange(uint memorySlot, CDBCtrlSheet *ctrl) { // - uint memoryLine= getSelectedMemoryLineDB(); + sint32 memoryLine; + if (ctrl->isShortCut()) + memoryLine = getSelectedMemoryLineDB(); + else + memoryLine = 0; + if (memoryLine < 0) + return; sint32 phraseId= getMemorizedPhrase(memoryLine, memorySlot); // if(phraseId) @@ -2780,8 +2809,12 @@ void CSPhraseManager::updateMemoryCtrlState(uint memorySlot, CDBCtrlSheet *ctrl, CSBrickManager *pBM = CSBrickManager::getInstance(); CSkillManager *pSM = CSkillManager::getInstance(); + uint memoryLine; // get the slot info - uint memoryLine= getSelectedMemoryLineDB(); + if (ctrl->isShortCut()) // No memoryLine defined + memoryLine= getSelectedMemoryLineDB(); + else + memoryLine= 0; bool newIsMacro= isMemorizedMacro(memoryLine, memorySlot); sint32 macroId= getMemorizedMacro(memoryLine, memorySlot); sint32 phraseId= getMemorizedPhrase(memoryLine, memorySlot); @@ -3004,6 +3037,9 @@ void CSPhraseManager::updateAllMemoryCtrlState() // update the valid state. updateMemoryCtrlState(i, ctrl, itemSkill); } + CDBCtrlSheet *ctrlAlt= dynamic_cast(pIM->getElementFromId(PhraseMemoryAltCtrlBase + toString(i)) ); + if(ctrlAlt) + updateMemoryCtrlState(i, ctrlAlt, itemSkill); } TTicks endTime = CTime::getPerformanceTime(); //nldebug("***** %d ms for CSPhraseManager::updateAllMemoryCtrlState", (int) (1000 * CTime::ticksToSecond(endTime - startTime))); @@ -3030,26 +3066,49 @@ CDBCtrlSheet *CSPhraseManager::getMemorySlotCtrl(uint memorySlot) return dynamic_cast(pIM->getElementFromId(PhraseMemoryCtrlBase + toString(memorySlot))); } +// *************************************************************************** +CDBCtrlSheet *CSPhraseManager::getMemoryAltSlotCtrl(uint memorySlot) +{ + if(memorySlot>=PHRASE_MAX_MEMORY_SLOT) + return NULL; + + // Get the ctrl + CInterfaceManager *pIM= CInterfaceManager::getInstance(); + return dynamic_cast(pIM->getElementFromId(PhraseMemoryAltCtrlBase + toString(memorySlot))); +} + // *************************************************************************** void CSPhraseManager::updateMemoryCtrlState(uint memorySlot) { CDBCtrlSheet *ctrl= getMemorySlotCtrl(memorySlot); + CDBCtrlSheet *ctrlAlt= getMemoryAltSlotCtrl(memorySlot); if(ctrl) { // update the valid state. updateMemoryCtrlState(memorySlot, ctrl, getRightHandItemSkill()); } + if(ctrlAlt) + { + // update the valid state. + updateMemoryCtrlState(memorySlot, ctrlAlt, getRightHandItemSkill()); + } } // *************************************************************************** void CSPhraseManager::updateMemoryCtrlRegenTickRange(uint memorySlot) { CDBCtrlSheet *ctrl= getMemorySlotCtrl(memorySlot); + CDBCtrlSheet *ctrlAlt= getMemoryAltSlotCtrl(memorySlot); if(ctrl) { // update the valid state. updateMemoryCtrlRegenTickRange(memorySlot, ctrl); } + if(ctrlAlt) + { + // update the valid state. + updateMemoryCtrlRegenTickRange(memorySlot, ctrlAlt); + } } // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.h b/code/ryzom/client/src/interface_v3/sphrase_manager.h index 0a934f4e2..bf40dcc35 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.h +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.h @@ -34,6 +34,7 @@ const std::string PHRASE_DB_BOOK="UI:PHRASE:BOOK"; const std::string PHRASE_DB_PROGRESSION[2]= {"UI:PHRASE:PROGRESS_ACTIONS", "UI:PHRASE:PROGRESS_UPGRADES"}; const std::string PHRASE_DB_MEMORY="UI:PHRASE:MEMORY"; +const std::string PHRASE_DB_MEMORY_ALT="UI:PHRASE:MEMORY_ALT"; const std::string PHRASE_DB_EXECUTE_NEXT="UI:PHRASE:EXECUTE_NEXT:PHRASE"; const std::string PHRASE_DB_EXECUTE_NEXT_IS_CYCLIC="UI:PHRASE:EXECUTE_NEXT:ISCYCLIC"; const std::string PHRASE_DB_BOTCHAT="LOCAL:TRADING"; @@ -458,6 +459,7 @@ private: // Shortcut To Phrases Leaves std::vector _BookDbLeaves; std::vector _MemoryDbLeaves; + std::vector _MemoryAltDbLeaves; CCDBNodeLeaf *_NextExecuteLeaf; CCDBNodeLeaf *_NextExecuteIsCyclicLeaf; @@ -698,6 +700,7 @@ private: void updateMemoryCtrlRegenTickRange(uint memorySlot); CDBCtrlSheet *getMemorySlotCtrl(uint memorySlot); + CDBCtrlSheet *getMemoryAltSlotCtrl(uint memorySlot); CTickRange getRegenTickRange(const CSPhraseCom &phrase) const; diff --git a/code/ryzom/client/src/libwww.cpp b/code/ryzom/client/src/libwww.cpp index dc5c151bd..c4695840d 100644 --- a/code/ryzom/client/src/libwww.cpp +++ b/code/ryzom/client/src/libwww.cpp @@ -218,6 +218,14 @@ HTAttr p_attr[] = HTML_ATTR(P,QUICK_HELP_CONDITION), HTML_ATTR(P,QUICK_HELP_EVENTS), HTML_ATTR(P,QUICK_HELP_LINK), + HTML_ATTR(P,NAME), + { 0 } +}; + + +HTAttr div_attr[] = +{ + HTML_ATTR(DIV,NAME), { 0 } }; @@ -684,6 +692,8 @@ void initLibWWW() HTML_DTD->tags[HTML_A].number_of_attributes = sizeof(a_attr) / sizeof(HTAttr) - 1; //HTML_DTD->tags[HTML_I].attributes = a_attr; HTML_DTD->tags[HTML_I].number_of_attributes = 0; + HTML_DTD->tags[HTML_DIV].attributes = div_attr; + HTML_DTD->tags[HTML_DIV].number_of_attributes = sizeof(div_attr) / sizeof(HTAttr) - 1; // Set a request timeout // HTHost_setEventTimeout (30000); diff --git a/code/ryzom/client/src/libwww.h b/code/ryzom/client/src/libwww.h index f3f681268..5c686e39b 100644 --- a/code/ryzom/client/src/libwww.h +++ b/code/ryzom/client/src/libwww.h @@ -201,8 +201,15 @@ enum HTML_ATTR(P,QUICK_HELP_CONDITION) = 0, HTML_ATTR(P,QUICK_HELP_EVENTS), HTML_ATTR(P,QUICK_HELP_LINK), + HTML_ATTR(P,NAME), }; +enum +{ + HTML_ATTR(DIV,NAME) = 0, +}; + + #undef HTML_ATTR // *************************************************************************** diff --git a/code/ryzom/client/src/motion/user_controls.cpp b/code/ryzom/client/src/motion/user_controls.cpp index 8b20ae026..7ce5523b2 100644 --- a/code/ryzom/client/src/motion/user_controls.cpp +++ b/code/ryzom/client/src/motion/user_controls.cpp @@ -619,6 +619,7 @@ void CUserControls::commonMove() // MOUSE WHEEL // CEventsListener::TWheelState wheelState = EventsListener.getWheelState(); // Done all the time, to reset the state View.changeCameraDist((wheelState == CEventsListener::foreward), (wheelState == CEventsListener::backward)); + View.changeCameraDist(Actions.valide("camera_foreward"), Actions.valide("camera_backward")); // Camera Up/Down. View.changeCameraHeight(Actions.valide("camera_up"), Actions.valide("camera_down")); ////////////////// diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 608eae45b..36a0767cd 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -895,6 +895,7 @@ void CInterfaceChatDisplayer::displayTell(/*TDataSetIndex senderIndex, */const u colorizeSender(finalString, senderPart, prop.getRGBA()); PeopleInterraction.ChatInput.Tell.displayTellMessage(/*senderIndex, */finalString, goodSenderName, prop.getRGBA(), 2, &windowVisible); + CInterfaceManager::getInstance()->log(finalString); // Open the free teller window CChatGroupWindow *pCGW = PeopleInterraction.getChatGroupWindow(); @@ -3216,9 +3217,13 @@ private: // get the content string (should have been received!) ucstring contentStr; + ucstring titleStr; if(!pSMC->getDynString(_TextId[ContentType], contentStr)) return; + if(!pSMC->getDynString(_TextId[TitleType], titleStr)) + return; + // if the string start with a @{Wxxxx} code, remove it and get the wanted window size sint w = 256; // default size to 256 !! bool is_webig = false; @@ -3273,23 +3278,36 @@ private: if (is_webig) { - CGroupHTML *groupHtml = dynamic_cast(pIM->getElementFromId("ui:interface:webig:content:html")); + CGroupHTML *groupHtml; + string group = titleStr.toString(); + // + group = group.substr(9, group.size()-10); + nlinfo("group = %s", group.c_str()); + groupHtml = dynamic_cast(pIM->getElementFromId("ui:interface:"+group+":content:html")); + if (!groupHtml) + { + groupHtml = dynamic_cast(pIM->getElementFromId("ui:interface:webig:content:html")); + group = "webig"; + } + if (groupHtml) { - - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:webig")); - - if (contentStr.empty()) + CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:"+group)); + if (pGC) { - pGC->setActive(false); - } - else - { - pGC->setActive(true); - string url = contentStr.toString(); - addWebIGParams(url); - groupHtml->browse(url.c_str()); - pIM->setTopWindow(pGC); + if (contentStr.empty()) + { + pGC->setActive(false); + } + else + { + if (group == "webig") + pGC->setActive(true); + string url = contentStr.toString(); + addWebIGParams(url); + groupHtml->browse(url.c_str()); + pIM->setTopWindow(pGC); + } } } } diff --git a/code/ryzom/client/src/r2/displayer_visual_entity.cpp b/code/ryzom/client/src/r2/displayer_visual_entity.cpp index f8f6bfd9d..20f84c90f 100644 --- a/code/ryzom/client/src/r2/displayer_visual_entity.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_entity.cpp @@ -986,7 +986,7 @@ void CDisplayerVisualEntity::updateName() } std::string firstPart = ""; if(actNb>0) - firstPart = CI18N::get("uiR2EDDefaultActTitle").toString() + " " + actNb; + firstPart = CI18N::get("uiR2EDDefaultActTitle").toString() + " " + NLMISC::toString(actNb); if (act->isString("Name")) actName = act->toString("Name"); diff --git a/code/ryzom/client/src/stdpch.h b/code/ryzom/client/src/stdpch.h index fdb16ef93..48c1a3c06 100644 --- a/code/ryzom/client/src/stdpch.h +++ b/code/ryzom/client/src/stdpch.h @@ -37,6 +37,7 @@ #include #include #include +#include #include #include diff --git a/code/ryzom/client/src/string_manager_client.cpp b/code/ryzom/client/src/string_manager_client.cpp index e46895368..6fd3400ae 100644 --- a/code/ryzom/client/src/string_manager_client.cpp +++ b/code/ryzom/client/src/string_manager_client.cpp @@ -1641,8 +1641,6 @@ const ucchar *CStringManagerClient::getSquadLocalizedDescription(NLMISC::CSheetI // *************************************************************************** void CStringManagerClient::replaceSBrickName(NLMISC::CSheetId id, const ucstring &name, const ucstring &desc, const ucstring &desc2) { - nlassert(!_SpecItem_MemoryCompressed); - std::string label= id.toString(); if (label.empty()) { @@ -1654,14 +1652,57 @@ void CStringManagerClient::replaceSBrickName(NLMISC::CSheetId id, const ucstrin lwrLabel= label; strlwr(lwrLabel); - map::iterator it(_SpecItem_TempMap.find(lwrLabel)); - if (it == _SpecItem_TempMap.end()) - return; + if (_SpecItem_MemoryCompressed) + { + ucchar *strName = (ucchar *)name.c_str(); + ucchar *strDesc = (ucchar *)desc.c_str(); + ucchar *strDesc2 = (ucchar *)desc2.c_str(); + CItemLight tmp; + tmp.Label = (char*)lwrLabel.c_str(); + vector::iterator it = lower_bound(_SpecItems.begin(), _SpecItems.end(), tmp, CItemLightComp()); - // Then replace - it->second.Name= name; - it->second.Desc= desc; - it->second.Desc2= desc2; + if (it != _SpecItems.end()) + { + if (strcmp(it->Label, lwrLabel.c_str()) == 0) + { + it->Name = strName; + it->Desc = strDesc; + it->Desc2 = strDesc2; + } + else + { + it->Label = tmp.Label; + it->Name = strName; + it->Desc = strDesc; + it->Desc2 = strDesc2; + } + } + else + { + tmp.Name = strName; + tmp.Desc = strDesc; + tmp.Desc2 = strDesc2; + _SpecItems.push_back(tmp); + } + } + else + { + map::iterator it(_SpecItem_TempMap.find(lwrLabel)); + if (it != _SpecItem_TempMap.end()) + { + it->second.Name= name; + it->second.Desc= desc; + it->second.Desc2= desc2; + } + else + { + CItem newItem; + newItem.Name = name; + newItem.Desc = desc; + newItem.Desc2 = desc2; + _SpecItem_TempMap.insert(pair(lwrLabel,newItem)); + } + } } diff --git a/code/ryzom/common/src/game_share/action_nature.cpp b/code/ryzom/common/src/game_share/action_nature.cpp index 04d8fc132..456cfcbc1 100644 --- a/code/ryzom/common/src/game_share/action_nature.cpp +++ b/code/ryzom/common/src/game_share/action_nature.cpp @@ -38,6 +38,7 @@ namespace ACTNATURE NL_STRING_CONVERSION_TABLE_ENTRY(DODGE) NL_STRING_CONVERSION_TABLE_ENTRY(PARRY) NL_STRING_CONVERSION_TABLE_ENTRY(SHIELD_USE) + NL_STRING_CONVERSION_TABLE_ENTRY(RECHARGE) NL_END_STRING_CONVERSION_TABLE(TActionNature, ActionNatureConversion, UNKNOWN) diff --git a/code/ryzom/common/src/game_share/action_nature.h b/code/ryzom/common/src/game_share/action_nature.h index 36494b1ff..333656101 100644 --- a/code/ryzom/common/src/game_share/action_nature.h +++ b/code/ryzom/common/src/game_share/action_nature.h @@ -35,6 +35,7 @@ namespace ACTNATURE DODGE, PARRY, SHIELD_USE, + RECHARGE, NEUTRAL, //only for multi effect on spell,progression consider it as OFFENSIVE_MAGIC diff --git a/code/ryzom/common/src/game_share/character_sync_itf.h b/code/ryzom/common/src/game_share/character_sync_itf.h index 728104322..840dd2845 100644 --- a/code/ryzom/common/src/game_share/character_sync_itf.h +++ b/code/ryzom/common/src/game_share/character_sync_itf.h @@ -21,9 +21,7 @@ #ifndef CHARACTER_SYNC_ITF #define CHARACTER_SYNC_ITF #include "nel/misc/types_nl.h" -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/common/src/game_share/magic_fx.h b/code/ryzom/common/src/game_share/magic_fx.h index df1d927ad..1d1df3bc4 100644 --- a/code/ryzom/common/src/game_share/magic_fx.h +++ b/code/ryzom/common/src/game_share/magic_fx.h @@ -133,6 +133,9 @@ namespace MAGICFX WaterWall = 11, ThornWall = 12, LightningWall = 13, + OtherFireWall = 14, + TeleportKami = 15, // No effect aura + TeleportKara = 16, // No effect aura }; } diff --git a/code/ryzom/common/src/game_share/mirror_prop_value.h b/code/ryzom/common/src/game_share/mirror_prop_value.h index 553c73b96..08e96761d 100644 --- a/code/ryzom/common/src/game_share/mirror_prop_value.h +++ b/code/ryzom/common/src/game_share/mirror_prop_value.h @@ -1022,14 +1022,14 @@ struct _CMirrorPropValueListIterator CMirrorPropValueList *_ParentList; TSharedListRow _Index; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - // typedef typename std::forward_iterator_tag iterator_category; + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef size_t size_type; + typedef ptrdiff_t difference_type; + // typedef typename std::forward_iterator_tag iterator_category; }; @@ -1050,15 +1050,14 @@ struct _CCMirrorPropValueListIterator CMirrorPropValueList *_ParentList; TSharedListRow _Index; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - // typedef typename std::forward_iterator_tag iterator_category; - + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef size_t size_type; + typedef ptrdiff_t difference_type; + // typedef typename std::forward_iterator_tag iterator_category; }; @@ -1232,7 +1231,7 @@ class CMirrorPropValueList { public: - typedef CPropLocationUnpacked CPropLocationClass; + typedef CPropLocationUnpacked CPropLocationClass; typedef uint32 size_type; typedef _CMirrorPropValueListIterator iterator; diff --git a/code/ryzom/common/src/game_share/msg_ais_egs_gen.h b/code/ryzom/common/src/game_share/msg_ais_egs_gen.h index 99de7c001..d7bfc39e7 100644 --- a/code/ryzom/common/src/game_share/msg_ais_egs_gen.h +++ b/code/ryzom/common/src/game_share/msg_ais_egs_gen.h @@ -21,9 +21,7 @@ #ifndef MSG_AIS_EGS_GEN #define MSG_AIS_EGS_GEN #include "nel/misc/types_nl.h" -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/common/src/game_share/r2_modules_itf.h b/code/ryzom/common/src/game_share/r2_modules_itf.h index e8626cafd..d44f0ea5a 100644 --- a/code/ryzom/common/src/game_share/r2_modules_itf.h +++ b/code/ryzom/common/src/game_share/r2_modules_itf.h @@ -21,9 +21,7 @@ #ifndef R2_MODULES_ITF #define R2_MODULES_ITF #include "nel/misc/types_nl.h" -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/common/src/game_share/r2_share_itf.h b/code/ryzom/common/src/game_share/r2_share_itf.h index 0d2956089..4e2abdf10 100644 --- a/code/ryzom/common/src/game_share/r2_share_itf.h +++ b/code/ryzom/common/src/game_share/r2_share_itf.h @@ -21,9 +21,7 @@ #ifndef R2_SHARE_ITF #define R2_SHARE_ITF #include "nel/misc/types_nl.h" -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/server/src/ai_service/commands.cpp b/code/ryzom/server/src/ai_service/commands.cpp index f3317e68f..49b5af2a8 100644 --- a/code/ryzom/server/src/ai_service/commands.cpp +++ b/code/ryzom/server/src/ai_service/commands.cpp @@ -2437,7 +2437,7 @@ NLMISC_COMMAND(setGrpTimers,"set the timer values for a given group"," < void cbTick(); extern uint ForceTicks; -NLMISC_COMMAND(updateAI,"call CAIS::update() (simulate a tick off-line)","") +NLMISC_COMMAND(updateAI,"call CAIS::update() (simulate a tick off-line)","[tick]") { if(args.size() >1) return false; diff --git a/code/ryzom/server/src/ai_service/nf_static.cpp b/code/ryzom/server/src/ai_service/nf_static.cpp index 0168d80ad..fa1699b4b 100644 --- a/code/ryzom/server/src/ai_service/nf_static.cpp +++ b/code/ryzom/server/src/ai_service/nf_static.cpp @@ -674,7 +674,7 @@ void md5sum_s_s(CStateInstance* entity, CScriptStack& stack) { std::string str = (std::string)stack.top(); - std::string value = NLMISC::getMD5((uint8*)&str[0], str.size() ).toString(); + std::string value = NLMISC::getMD5((uint8*)&str[0], (uint32)str.size() ).toString(); nlinfo(value.c_str()); stack.top() = value; } diff --git a/code/ryzom/server/src/ai_service/stdpch.h b/code/ryzom/server/src/ai_service/stdpch.h index c2f2190e4..0ff2ba7ea 100644 --- a/code/ryzom/server/src/ai_service/stdpch.h +++ b/code/ryzom/server/src/ai_service/stdpch.h @@ -34,6 +34,7 @@ #include #include +#include #include @@ -51,6 +52,7 @@ #include #include #include +#include //---------------------------------------------------------------- diff --git a/code/ryzom/server/src/entities_game_service/guild_manager/guild_unifier_itf.h b/code/ryzom/server/src/entities_game_service/guild_manager/guild_unifier_itf.h index 663497b62..1280fe6c2 100644 --- a/code/ryzom/server/src/entities_game_service/guild_manager/guild_unifier_itf.h +++ b/code/ryzom/server/src/entities_game_service/guild_manager/guild_unifier_itf.h @@ -21,9 +21,7 @@ #ifndef GUILD_UNIFIER_ITF #define GUILD_UNIFIER_ITF #include "nel/misc/types_nl.h" -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/faber_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/faber_phrase.cpp index 79c0429d0..f83c8ec25 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/faber_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/faber_phrase.cpp @@ -454,8 +454,8 @@ void CFaberPhrase::apply() return; } - neededMp = _RootFaberPlan->Faber->NeededMps.size(); - EGSPD::CPeople::TPeople civRestriction = _RootFaberPlan->CivRestriction; + neededMp = (uint32)_RootFaberPlan->Faber->NeededMps.size(); + EGSPD::CPeople::TPeople civRestriction = _RootFaberPlan->CivRestriction; uint32 usedMp=0; vector< const CStaticItem * > usedMps = _Mps; diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.h b/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.h index 1f4616b63..85d09a655 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.h +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.h @@ -52,10 +52,11 @@ struct CCyclicActionInfos TDataSetRow TargetRowId; std::vector CyclicActionBricks; + CCyclicActionInfos() { } inline void reset() { CyclicActionBricks.clear(); } }; -static const CCyclicActionInfos NoCyclicInfo; +static const CCyclicActionInfos NoCyclicInfo = CCyclicActionInfos(); class CPhraseManager; diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp index 0d244fb46..510ae28da 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -344,7 +344,6 @@ CCharacter::CCharacter(): CEntityBase(false), _AggroableSave(true), _GodModeSave(false) { - // todo : uncomment that when sadge item api is plugged _AggroCount = 0; // _Bulk = 0; diff --git a/code/ryzom/server/src/entities_game_service/stdpch.h b/code/ryzom/server/src/entities_game_service/stdpch.h index 8989c1d04..f368c741d 100644 --- a/code/ryzom/server/src/entities_game_service/stdpch.h +++ b/code/ryzom/server/src/entities_game_service/stdpch.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include diff --git a/code/ryzom/server/src/frontend_service/distance_prioritizer.h b/code/ryzom/server/src/frontend_service/distance_prioritizer.h index 2698eb4aa..3ce4a94bc 100644 --- a/code/ryzom/server/src/frontend_service/distance_prioritizer.h +++ b/code/ryzom/server/src/frontend_service/distance_prioritizer.h @@ -549,13 +549,13 @@ public: bool discreetPropertyHasChanged(const CPropertyHistory::CPropertyEntry& entry, const CMirrorPropValueRO& currentValue, CLFECOMMON::TPropIndex propIndex, T* ) const { // Although the client should already know the sheet id of the controlled player, let's send it - //if ( (propIndex==PROPERTY_SHEET) && (TVPNodeServer::PrioContext.Slot == 0) ) + //if ( (propIndex==CLFECOMMON::PROPERTY_SHEET) && (TVPNodeServer::PrioContext.Slot == 0) ) // return false; if (entry.HasValue) { #ifdef NL_DEBUG - if ( (propIndex==PROPERTY_SHEET) && (currentValue() != *((T*)&(entry.LastSent))) ) + if ( (propIndex==CLFECOMMON::PROPERTY_SHEET) && (currentValue() != *((T*)&(entry.LastSent))) ) LOG_WHAT_IS_SENT( "C%hu S%hu: sheet changes from %u to %u", TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.Slot, (uint32)entry.LastSent, asUInt32(currentValue()) ); #endif return (currentValue() != *((T*)&(entry.LastSent))); @@ -569,7 +569,7 @@ public: { // Not sent yet //nldebug( "No history yet for C%hu - slot %hu - prop %hu", TVPNodeServer::PrioContext.ClientHost->clientId(), (uint16)TVPNodeServer::PrioContext.Slot, propIndex ); - if ( (propIndex==PROPERTY_SHEET) ) + if ( (propIndex==CLFECOMMON::PROPERTY_SHEET) ) { CMirrorPropValueRO currentValue( TheDataset, TVPNodeServer::PrioContext.EntityIndex, dsPropertyIndex ); LOG_WHAT_IS_SENT( "C%hu S%hu: sheet initializes to %u", TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.Slot, asUInt32(currentValue()) ); @@ -614,7 +614,7 @@ public: bool discreetPropertyHasChanged(const CPropertyHistory::CPropertyEntry& entry, TPropIndex propIndex, T* ) const { // Although the client should already know the sheet id of the controlled player, let's send it - //if ( (propIndex==PROPERTY_SHEET) && (TVPNodeServer::PrioContext.Slot == 0) ) + //if ( (propIndex==CLFECOMMON::PROPERTY_SHEET) && (TVPNodeServer::PrioContext.Slot == 0) ) // return false; TPropertyIndex dsPropertyIndex = CEntityContainer::propertyIndexInDataSetToVisualPropIndex( propIndex ); @@ -625,7 +625,7 @@ public: CMirrorPropValueRO currentValue( TheDataset, TVPNodeServer::PrioContext.EntityIndex, dsPropertyIndex ); #ifdef NL_DEBUG - if ( (propIndex==PROPERTY_SHEET) && (currentValue() != *((T*)&(entry.LastSent))) ) + if ( (propIndex==CLFECOMMON::PROPERTY_SHEET) && (currentValue() != *((T*)&(entry.LastSent))) ) LOG_WHAT_IS_SENT( "C%hu S%hu: sheet changes from %u to %u", TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.Slot, (uint32)entry.LastSent, asUInt32(currentValue()) ); #endif @@ -639,7 +639,7 @@ public: { // Not sent yet //nldebug( "No history yet for C%hu - slot %hu - prop %hu", TVPNodeServer::PrioContext.ClientHost->clientId(), (uint16)TVPNodeServer::PrioContext.Slot, propIndex ); - if ( (propIndex==PROPERTY_SHEET) ) + if ( (propIndex==CLFECOMMON::PROPERTY_SHEET) ) { CMirrorPropValueRO currentValue( TheDataset, TVPNodeServer::PrioContext.EntityIndex, dsPropertyIndex ); LOG_WHAT_IS_SENT( "C%hu S%hu: sheet initializes to %u", TVPNodeServer::PrioContext.ClientId, TVPNodeServer::PrioContext.Slot, asUInt32(currentValue()) ); @@ -681,7 +681,7 @@ public: bool targetListHasChanged(const CPropertyHistory::CPropertyEntry& entry, CLFECOMMON::TPropIndex propIndex, T* ) const { // Although the client should already know the sheet id of the controlled player, let's send it - //if ( (propIndex==PROPERTY_SHEET) && (TVPNodeServer::PrioContext.Slot == 0) ) + //if ( (propIndex==CLFECOMMON::PROPERTY_SHEET) && (TVPNodeServer::PrioContext.Slot == 0) ) // return false; TPropertyIndex dsPropertyIndex = CEntityContainer::propertyIndexInDataSetToVisualPropIndex( propIndex ); diff --git a/code/ryzom/server/src/frontend_service/stdpch.h b/code/ryzom/server/src/frontend_service/stdpch.h index 9cb7e70e1..2575817c5 100644 --- a/code/ryzom/server/src/frontend_service/stdpch.h +++ b/code/ryzom/server/src/frontend_service/stdpch.h @@ -18,6 +18,7 @@ #include #include +#include #include #include diff --git a/code/ryzom/server/src/gpm_service/CMakeLists.txt b/code/ryzom/server/src/gpm_service/CMakeLists.txt index bee0c0e7c..802380761 100644 --- a/code/ryzom/server/src/gpm_service/CMakeLists.txt +++ b/code/ryzom/server/src/gpm_service/CMakeLists.txt @@ -20,4 +20,8 @@ NL_ADD_RUNTIME_FLAGS(ryzom_gpm_service) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(ryzom_gpm_service ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS ryzom_gpm_service RUNTIME DESTINATION sbin COMPONENT services) diff --git a/code/ryzom/server/src/gpm_service/cell.cpp b/code/ryzom/server/src/gpm_service/cell.cpp index d5e0a01a1..b67989b69 100644 --- a/code/ryzom/server/src/gpm_service/cell.cpp +++ b/code/ryzom/server/src/gpm_service/cell.cpp @@ -16,6 +16,7 @@ +#include "stdpch.h" #include "cell.h" using namespace std; diff --git a/code/ryzom/server/src/gpm_service/client_messages.cpp b/code/ryzom/server/src/gpm_service/client_messages.cpp index df1521dbf..cdf4fffe2 100644 --- a/code/ryzom/server/src/gpm_service/client_messages.cpp +++ b/code/ryzom/server/src/gpm_service/client_messages.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . +#include "stdpch.h" // include files #include "nel/misc/types_nl.h" diff --git a/code/ryzom/server/src/gpm_service/commands.cpp b/code/ryzom/server/src/gpm_service/commands.cpp index d24f830e7..c1d3e9296 100644 --- a/code/ryzom/server/src/gpm_service/commands.cpp +++ b/code/ryzom/server/src/gpm_service/commands.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . +#include "stdpch.h" // Nel Misc #include "nel/misc/command.h" diff --git a/code/ryzom/server/src/gpm_service/gpm_service.cpp b/code/ryzom/server/src/gpm_service/gpm_service.cpp index 14583f01b..7e82d1d3d 100644 --- a/code/ryzom/server/src/gpm_service/gpm_service.cpp +++ b/code/ryzom/server/src/gpm_service/gpm_service.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . +#include "stdpch.h" // misc #include "nel/misc/command.h" diff --git a/code/ryzom/server/src/gpm_service/messages.cpp b/code/ryzom/server/src/gpm_service/messages.cpp index 8fd774750..b2a47a576 100644 --- a/code/ryzom/server/src/gpm_service/messages.cpp +++ b/code/ryzom/server/src/gpm_service/messages.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdpch.h" // include files #include "nel/misc/types_nl.h" diff --git a/code/ryzom/server/src/gpm_service/move_checker.cpp b/code/ryzom/server/src/gpm_service/move_checker.cpp index beca3531a..f8415761e 100644 --- a/code/ryzom/server/src/gpm_service/move_checker.cpp +++ b/code/ryzom/server/src/gpm_service/move_checker.cpp @@ -14,6 +14,8 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdpch.h" + #include "nel/misc/common.h" #include "game_share/utils.h" diff --git a/code/ryzom/server/src/gpm_service/patat_grid.cpp b/code/ryzom/server/src/gpm_service/patat_grid.cpp index eef3e5886..fc48fc717 100644 --- a/code/ryzom/server/src/gpm_service/patat_grid.cpp +++ b/code/ryzom/server/src/gpm_service/patat_grid.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . +#include "stdpch.h" #include "patat_grid.h" diff --git a/code/ryzom/server/src/gpm_service/patat_subscribe_manager.cpp b/code/ryzom/server/src/gpm_service/patat_subscribe_manager.cpp index 9e5c6a67d..6616ad4e6 100644 --- a/code/ryzom/server/src/gpm_service/patat_subscribe_manager.cpp +++ b/code/ryzom/server/src/gpm_service/patat_subscribe_manager.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . +#include "stdpch.h" #include "patat_subscribe_manager.h" diff --git a/code/ryzom/server/src/gpm_service/sheets.cpp b/code/ryzom/server/src/gpm_service/sheets.cpp index 6d0e43c87..bdad20489 100644 --- a/code/ryzom/server/src/gpm_service/sheets.cpp +++ b/code/ryzom/server/src/gpm_service/sheets.cpp @@ -16,6 +16,7 @@ +#include "stdpch.h" // Misc #include "nel/misc/path.h" diff --git a/code/ryzom/server/src/gpm_service/stdpch.cpp b/code/ryzom/server/src/gpm_service/stdpch.cpp new file mode 100644 index 000000000..d4b14ffe2 --- /dev/null +++ b/code/ryzom/server/src/gpm_service/stdpch.cpp @@ -0,0 +1,17 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdpch.h" diff --git a/code/ryzom/server/src/gpm_service/stdpch.h b/code/ryzom/server/src/gpm_service/stdpch.h new file mode 100644 index 000000000..72a71657d --- /dev/null +++ b/code/ryzom/server/src/gpm_service/stdpch.h @@ -0,0 +1,98 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "nel/misc/types_nl.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +// STL +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// NeL georges +#include "nel/georges/u_form.h" +#include "nel/georges/u_form_elm.h" + +// NeL ligo +#include "nel/ligo/ligo_config.h" +#include "nel/ligo/primitive.h" + +// NeL misc +#include "nel/misc/aabbox.h" +#include "nel/misc/block_memory.h" +#include "nel/misc/command.h" +#include "nel/misc/common.h" +#include "nel/misc/debug.h" +#include "nel/misc/entity_id.h" +#include "nel/misc/file.h" +#include "nel/misc/hierarchical_timer.h" +#include "nel/misc/i_xml.h" +#include "nel/misc/path.h" +#include "nel/misc/sheet_id.h" +#include "nel/misc/smart_ptr.h" +#include "nel/misc/stream.h" +#include "nel/misc/time_nl.h" +#include "nel/misc/variable.h" +#include "nel/misc/vector.h" +#include "nel/misc/vector_2d.h" +#include "nel/misc/vectord.h" + +// NeL net +#include "nel/net/message.h" +#include "nel/net/service.h" +#include "nel/net/unified_network.h" + +// NeL pacs +#include "nel/pacs/u_collision_desc.h" +#include "nel/pacs/u_global_position.h" +#include "nel/pacs/u_global_retriever.h" +#include "nel/pacs/u_move_container.h" +#include "nel/pacs/u_move_primitive.h" +#include "nel/pacs/u_primitive_block.h" + +// GameShare +#include "game_share/mirror_prop_value.h" +#include "game_share/player_vision_delta.h" +#include "game_share/ryzom_entity_id.h" +#include "game_share/ryzom_mirror_properties.h" +#include "game_share/synchronised_message.h" +#include "game_share/tick_event_handler.h" +#include "game_share/utils.h" + +// ServerShare +#include "server_share/effect_manager.h" +#include "server_share/msg_gpm_service.h" +#include "server_share/pet_interface_msg.h" +#include "server_share/r2_variables.h" +#include "server_share/r2_vision.h" +#include "server_share/used_continent.h" diff --git a/code/ryzom/server/src/gpm_service/variables.cpp b/code/ryzom/server/src/gpm_service/variables.cpp index 82ce9e605..6634431fa 100644 --- a/code/ryzom/server/src/gpm_service/variables.cpp +++ b/code/ryzom/server/src/gpm_service/variables.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . +#include "stdpch.h" #include "variables.h" diff --git a/code/ryzom/server/src/gpm_service/vision_delta_manager.cpp b/code/ryzom/server/src/gpm_service/vision_delta_manager.cpp index 32aea0c0e..fa337c2cd 100644 --- a/code/ryzom/server/src/gpm_service/vision_delta_manager.cpp +++ b/code/ryzom/server/src/gpm_service/vision_delta_manager.cpp @@ -14,6 +14,8 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdpch.h" + #include "nel/net/unified_network.h" #include "vision_delta_manager.h" #include "gpm_service.h" diff --git a/code/ryzom/server/src/gpm_service/world_entity.cpp b/code/ryzom/server/src/gpm_service/world_entity.cpp index fd6725598..23e1debcb 100644 --- a/code/ryzom/server/src/gpm_service/world_entity.cpp +++ b/code/ryzom/server/src/gpm_service/world_entity.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . +#include "stdpch.h" #include "world_entity.h" #include "sheets.h" diff --git a/code/ryzom/server/src/gpm_service/world_position_manager.cpp b/code/ryzom/server/src/gpm_service/world_position_manager.cpp index cd2e563c2..ef11c30d2 100644 --- a/code/ryzom/server/src/gpm_service/world_position_manager.cpp +++ b/code/ryzom/server/src/gpm_service/world_position_manager.cpp @@ -14,6 +14,8 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdpch.h" + // Nel Misc #include "nel/misc/types_nl.h" #include "nel/misc/file.h" diff --git a/code/ryzom/server/src/input_output_service/stdpch.h b/code/ryzom/server/src/input_output_service/stdpch.h index 62e634de7..c1a8fea5c 100644 --- a/code/ryzom/server/src/input_output_service/stdpch.h +++ b/code/ryzom/server/src/input_output_service/stdpch.h @@ -25,6 +25,7 @@ #include #include #include +#include #include "nel/georges/load_form.h" #include "nel/georges/u_form.h" diff --git a/code/ryzom/server/src/logger_service/log_query.h b/code/ryzom/server/src/logger_service/log_query.h index 8fab1be35..60d6206fb 100644 --- a/code/ryzom/server/src/logger_service/log_query.h +++ b/code/ryzom/server/src/logger_service/log_query.h @@ -21,6 +21,7 @@ #include "nel/misc/types_nl.h" #include +#include #include "nel/misc/common.h" diff --git a/code/ryzom/server/src/monitor_service/CMakeLists.txt b/code/ryzom/server/src/monitor_service/CMakeLists.txt index 29379371c..b2400918b 100644 --- a/code/ryzom/server/src/monitor_service/CMakeLists.txt +++ b/code/ryzom/server/src/monitor_service/CMakeLists.txt @@ -1,9 +1,9 @@ FILE(GLOB SRC *.cpp *.h) -ADD_EXECUTABLE(monitor_service WIN32 ${SRC}) +ADD_EXECUTABLE(ryzom_monitor_service WIN32 ${SRC}) INCLUDE_DIRECTORIES(${RZ_SERVER_SRC_DIR} ${LIBXML2_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(monitor_service +TARGET_LINK_LIBRARIES(ryzom_monitor_service ryzom_gameshare ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARY} @@ -12,15 +12,15 @@ TARGET_LINK_LIBRARIES(monitor_service nelnet nelgeorges) -NL_DEFAULT_PROPS(monitor_service "Ryzom, Services: Monitor Service (MOS)") -NL_ADD_RUNTIME_FLAGS(monitor_service) +NL_DEFAULT_PROPS(ryzom_monitor_service "Ryzom, Services: Monitor Service (MOS)") +NL_ADD_RUNTIME_FLAGS(ryzom_monitor_service) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) IF(WITH_PCH) - ADD_NATIVE_PRECOMPILED_HEADER(monitor_service ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) + ADD_NATIVE_PRECOMPILED_HEADER(ryzom_monitor_service ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS monitor_service RUNTIME DESTINATION sbin COMPONENT services) +INSTALL(TARGETS ryzom_monitor_service RUNTIME DESTINATION sbin COMPONENT services) diff --git a/code/ryzom/server/src/monitor_service/stdpch.h b/code/ryzom/server/src/monitor_service/stdpch.h index 77da84ad4..dd5068a0c 100644 --- a/code/ryzom/server/src/monitor_service/stdpch.h +++ b/code/ryzom/server/src/monitor_service/stdpch.h @@ -32,6 +32,7 @@ #include #include +#include #include diff --git a/code/ryzom/server/src/server_share/login_service_itf.h b/code/ryzom/server/src/server_share/login_service_itf.h index 3095b5d3b..bac7e2105 100644 --- a/code/ryzom/server/src/server_share/login_service_itf.h +++ b/code/ryzom/server/src/server_share/login_service_itf.h @@ -21,9 +21,7 @@ #ifndef LOGIN_SERVICE_ITF #define LOGIN_SERVICE_ITF #include "nel/misc/types_nl.h" -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/server/src/server_share/stdpch.h b/code/ryzom/server/src/server_share/stdpch.h index 2a4418a54..7a9c49c2f 100644 --- a/code/ryzom/server/src/server_share/stdpch.h +++ b/code/ryzom/server/src/server_share/stdpch.h @@ -18,6 +18,7 @@ #include #include +#include #include #include diff --git a/code/ryzom/server/src/shard_unifier_service/database_mapping.h b/code/ryzom/server/src/shard_unifier_service/database_mapping.h index 19503aa8e..d6f9b8689 100644 --- a/code/ryzom/server/src/shard_unifier_service/database_mapping.h +++ b/code/ryzom/server/src/shard_unifier_service/database_mapping.h @@ -21,9 +21,7 @@ #ifndef DATABASE_MAPPING #define DATABASE_MAPPING #include "nel/misc/types_nl.h" -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.h b/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.h index baae9bc4f..4081db824 100644 --- a/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.h +++ b/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.h @@ -21,9 +21,7 @@ #ifndef NEL_DATABASE_MAPPING #define NEL_DATABASE_MAPPING #include "nel/misc/types_nl.h" -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/tools/leveldesign/CMakeLists.txt b/code/ryzom/tools/leveldesign/CMakeLists.txt index bcd1ed9a6..c490de731 100644 --- a/code/ryzom/tools/leveldesign/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/CMakeLists.txt @@ -3,14 +3,19 @@ ADD_SUBDIRECTORY(prim_export) ADD_SUBDIRECTORY(uni_conv) ADD_SUBDIRECTORY(csv_transform) ADD_SUBDIRECTORY(icon_search) +ADD_SUBDIRECTORY(mission_compiler_lib) ADD_SUBDIRECTORY(mp_generator) ADD_SUBDIRECTORY(named_items_2_csv) IF(WIN32) ADD_SUBDIRECTORY(export) ADD_SUBDIRECTORY(world_editor) + IF(WITH_MFC) + ADD_SUBDIRECTORY(mission_compiler_fe) + ENDIF(WITH_MFC) ENDIF(WIN32) + IF(WITH_QT) ADD_SUBDIRECTORY(georges_editor_qt) ENDIF(WITH_QT) @@ -24,8 +29,6 @@ ENDIF(WITH_QT) #icon_search #install #master -#mission_compiler_fe -#mission_compiler_lib #mission_simulator # #primitive_id_assignator diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp index dea8d8ce7..b2c3d5a64 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp @@ -222,7 +222,7 @@ namespace NLQT { COFile file; - std::string s = CPath::lookup(loadedForm.toStdString()); + std::string s = CPath::lookup(loadedForm.toStdString(), false); if (file.open (s)) { try @@ -323,6 +323,8 @@ namespace NLQT path, "Images (*.png *.tga)" ); + if (file.isNull()) + return; QFileInfo info = QFileInfo(file); // TODO? @@ -333,7 +335,7 @@ namespace NLQT } else { - if (path.contains(".shape")) + if (path.contains(".shape") || path.contains(".ps")) { if (Modules::objViewInt()) { diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_form.ui b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_form.ui index 4cff36c92..f5c283b55 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_form.ui +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_form.ui @@ -57,6 +57,9 @@ 0 + + true + diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp index ab3092455..956380851 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp @@ -184,10 +184,17 @@ namespace NLQT if (Modules::objViewInt()) { QIcon *icon = Modules::objViewInt()->saveOneImage(value.toStdString()); - if (icon->isNull()) - return QIcon(":/images/pqrticles.png"); + if (icon) + { + if(icon->isNull()) + return QIcon(":/images/pqrticles.png"); + else + return QIcon(*icon); + } else - return QIcon(*icon); + { + return QIcon(); + } } } else if(value.contains(".tga") || value.contains(".png")) diff --git a/code/ryzom/tools/leveldesign/mission_compiler_fe/CMakeLists.txt b/code/ryzom/tools/leveldesign/mission_compiler_fe/CMakeLists.txt new file mode 100644 index 000000000..572060089 --- /dev/null +++ b/code/ryzom/tools/leveldesign/mission_compiler_fe/CMakeLists.txt @@ -0,0 +1,16 @@ +FILE(GLOB SRC *.cpp *.h) + +ADD_DEFINITIONS(${MFC_DEFINITIONS}) +SET(CMAKE_MFC_FLAG 2) +ADD_EXECUTABLE(ryzom_mission_compiler_fe WIN32 ${SRC} mission_compiler_fe.rc) + +TARGET_LINK_LIBRARIES(ryzom_mission_compiler_fe nelmisc nelligo ryzom_mission_compiler_lib) + +NL_DEFAULT_PROPS(ryzom_mission_compiler_fe "Ryzom, Tools, Misc: Mission Compiler Frontend") +NL_ADD_RUNTIME_FLAGS(ryzom_mission_compiler_fe) + +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(ryzom_mission_compiler_fe ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) +ENDIF(WITH_PCH) + +INSTALL(TARGETS ryzom_mission_compiler_fe RUNTIME DESTINATION bin COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/mission_compiler_lib/CMakeLists.txt b/code/ryzom/tools/leveldesign/mission_compiler_lib/CMakeLists.txt new file mode 100644 index 000000000..c2dd48d41 --- /dev/null +++ b/code/ryzom/tools/leveldesign/mission_compiler_lib/CMakeLists.txt @@ -0,0 +1,27 @@ +FILE(GLOB LIBSRC mission_compiler.cpp + mission_compiler.h + step.h + step_content.cpp + steps.cpp + variables.cpp) + +INCLUDE_DIRECTORIES(${NEL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + +NL_TARGET_LIB(ryzom_mission_compiler_lib ${LIBSRC}) + +TARGET_LINK_LIBRARIES(ryzom_mission_compiler_lib nelmisc nelligo) +NL_DEFAULT_PROPS(ryzom_mission_compiler_lib "Ryzom, Library: Mission Compiler") +NL_ADD_RUNTIME_FLAGS(ryzom_mission_compiler_lib) +NL_ADD_LIB_SUFFIX(ryzom_mission_compiler_lib) + +INSTALL(TARGETS ryzom_mission_compiler_lib LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) + +FILE(GLOB EXESRC main.cpp) + +ADD_EXECUTABLE(ryzom_mission_compiler ${EXESRC}) + +TARGET_LINK_LIBRARIES(ryzom_mission_compiler ryzom_mission_compiler_lib) +NL_DEFAULT_PROPS(ryzom_mission_compiler "Ryzom, Tools, Misc: Mission Compiler") +NL_ADD_RUNTIME_FLAGS(ryzom_mission_compiler) + +INSTALL(TARGETS ryzom_mission_compiler RUNTIME DESTINATION bin COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp b/code/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp index bc3b21cb8..814239949 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp +++ b/code/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp @@ -17,6 +17,7 @@ #include "mission_compiler.h" #include "step.h" #include "nel/misc/i18n.h" +#include "nel/ligo/primitive_utils.h" using namespace std; using namespace NLMISC; @@ -526,7 +527,12 @@ bool CMissionCompiler::compileMission(NLLIGO::IPrimitive *rootPrim, const std::s } // first, start by reading mission variables - IPrimitive *variables = getPrimitiveChild(mission, TPrimitiveClassPredicate("variables")); + IPrimitive *variables; + { + TPrimitiveClassPredicate predTmp("variables"); + variables= NLLIGO::getPrimitiveChild(mission, predTmp); + } + if (!variables) { nlwarning("Can't find variables !"); @@ -540,7 +546,12 @@ bool CMissionCompiler::compileMission(NLLIGO::IPrimitive *rootPrim, const std::s // now, we can init the mission header phrase (they need variable knwoled) md.initHeaderPhrase(rootPrim); - IPrimitive *preReq = getPrimitiveChild(mission, TPrimitiveClassPredicate("pre_requisite")); + IPrimitive *preReq; + { + TPrimitiveClassPredicate predTmp("pre_requisite"); + preReq = getPrimitiveChild(mission, predTmp); + } + if (!preReq) { nlwarning("Can't find pre requisite !"); @@ -598,7 +609,8 @@ bool CMissionCompiler::compileMissions(IPrimitive *rootPrim, const std::string & CPrimitiveSet scriptsSet; - scriptsSet.buildSet(rootPrim, TPrimitiveClassPredicate("mission_tree"), missionTrees); + TPrimitiveClassPredicate pred("mission_tree"); + scriptsSet.buildSet(rootPrim, pred, missionTrees); nlinfo("Found %u mission tree in the primitive file", missionTrees.size()); @@ -667,7 +679,8 @@ bool CMissionCompiler::installCompiledMission(NLLIGO::CLigoConfig &ligoConfig, c TPrimitiveSet scripts; CPrimitiveSet filter; - filter.buildSet(primDoc->RootNode, TPrimitiveClassPredicate("mission"), scripts); + TPrimitiveClassPredicate pred("mission"); + filter.buildSet(primDoc->RootNode, pred, scripts); // for each script, check if it was generated, and if so, check the name // of the source primitive file. @@ -732,7 +745,8 @@ bool CMissionCompiler::installCompiledMission(NLLIGO::CLigoConfig &ligoConfig, c TPrimitiveSet bots; CPrimitiveSet filter; - filter.buildSet(primDoc->RootNode, TPrimitiveClassAndNamePredicate("npc_bot", mission.getGiverName()), bots); + TPrimitiveClassAndNamePredicate pred("npc_bot", mission.getGiverName()); + filter.buildSet(primDoc->RootNode, pred, bots); if (bots.empty()) { @@ -961,7 +975,8 @@ bool CMissionCompiler::parseOneStep(CMissionData &md, IPrimitive *stepToParse, I bool CMissionCompiler::parseSteps(CMissionData &md, IPrimitive *steps, IStep *parent) { TPrimitiveSet childs; - filterPrimitiveChilds(steps, TPrimitivePropertyPredicate("step_tag", "true"), childs); + TPrimitivePropertyPredicate pred("step_tag", "true"); + filterPrimitiveChilds(steps, pred, childs); if (childs.empty()) { diff --git a/code/ryzom/tools/leveldesign/mission_compiler_lib/steps.cpp b/code/ryzom/tools/leveldesign/mission_compiler_lib/steps.cpp index 10842c97c..44e6e96cc 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_lib/steps.cpp +++ b/code/ryzom/tools/leveldesign/mission_compiler_lib/steps.cpp @@ -55,7 +55,11 @@ IStep::IStep(CMissionData &md, NLLIGO::IPrimitive *prim) // parse the sub prim to create action & objectives; IPrimitive *child; // parse the preactions - child = getPrimitiveChild(prim, TPrimitiveClassAndNamePredicate("actions", "pre_actions")); + { + TPrimitiveClassAndNamePredicate pred("actions", "pre_actions"); + child = getPrimitiveChild(prim, pred); + } + if (child) { for (uint i=0; igetNumChildren(); ++i) @@ -72,7 +76,10 @@ IStep::IStep(CMissionData &md, NLLIGO::IPrimitive *prim) } } // parse the objectives - child = getPrimitiveChild(prim, TPrimitiveClassAndNamePredicate("mission_objectives", "objectives")); + { + TPrimitiveClassAndNamePredicate pred("mission_objectives", "objectives"); + child = getPrimitiveChild(prim, pred); + } if (child) { for (uint i=0; igetNumChildren(); ++i) @@ -89,7 +96,10 @@ IStep::IStep(CMissionData &md, NLLIGO::IPrimitive *prim) } } // parse the post actions - child = getPrimitiveChild(prim, TPrimitiveClassAndNamePredicate("actions", "post_actions")); + { + TPrimitiveClassAndNamePredicate pred("actions", "post_actions"); + child = getPrimitiveChild(prim, pred); + } if (child) { for (uint i=0; igetNumChildren(); ++i) @@ -447,7 +457,10 @@ public: // parse the sub prim to create action & objectives; IPrimitive *child; // parse the pre-actions - child = getPrimitiveChild(prim, TPrimitiveClassAndNamePredicate("actions", "actions")); + { + TPrimitiveClassAndNamePredicate pred("actions", "actions"); + child = getPrimitiveChild(prim, pred); + } if (child) { for (uint i=0; igetNumChildren(); ++i) @@ -464,7 +477,10 @@ public: } } // look for an optional jump - child = getPrimitiveChild(prim, TPrimitiveClassPredicate("jump_to")); + { + TPrimitiveClassPredicate pred("jump_to"); + child = getPrimitiveChild(prim, pred); + } if (child) { // ok, we have a jump at end of fail step @@ -515,7 +531,10 @@ public: // parse the sub prim to create action & objectives; IPrimitive *child; // parse the pre-actions - child = getPrimitiveChild(prim, TPrimitiveClassAndNamePredicate("actions", "actions")); + { + TPrimitiveClassAndNamePredicate pred("actions", "actions"); + child = getPrimitiveChild(prim, pred); + } if (child) { for (uint i=0; igetNumChildren(); ++i) @@ -546,7 +565,10 @@ public: } // look for an optional jump - child = getPrimitiveChild(prim, TPrimitiveClassPredicate("jump_to")); + { + TPrimitiveClassPredicate pred("jump_to"); + child = getPrimitiveChild(prim, pred); + } if (child) { // ok, we have a jump at end of fail step @@ -607,14 +629,20 @@ CStepPlayerReconnect::CStepPlayerReconnect(CMissionData &md, IPrimitive *prim) : IPrimitive *child; TPrimitiveSet resp; - filterPrimitiveChilds(prim, TPrimitivePropertyPredicate("step_tag", "true"), resp); + { + TPrimitivePropertyPredicate pred("step_tag", "true"); + filterPrimitiveChilds(prim, pred, resp); + } for (uint i=0; i noSteps; // Get the 'yes branch' jump point - filterPrimitiveChilds(_SubBranchs[1], TPrimitivePropertyPredicate("step_tag", "true"), childs); + { + TPrimitivePropertyPredicate pred("step_tag", "true"); + filterPrimitiveChilds(_SubBranchs[1], pred, childs); + } if (!childs.empty()) { for (i = 0; i < _SubSteps.size(); ++i) @@ -1071,7 +1115,10 @@ string CStepIf::genCode(CMissionData &md) // Get the 'no branch' jump point childs.clear(); - filterPrimitiveChilds(_SubBranchs[0], TPrimitivePropertyPredicate("step_tag", "true"), childs); + { + TPrimitivePropertyPredicate pred("step_tag", "true"); + filterPrimitiveChilds(_SubBranchs[0], pred, childs); + } if (!childs.empty()) { for (i = 0; i < _SubSteps.size(); ++i) diff --git a/code/ryzom/tools/leveldesign/mp_generator/main.cpp b/code/ryzom/tools/leveldesign/mp_generator/main.cpp index bbd7102b8..68e18172e 100644 --- a/code/ryzom/tools/leveldesign/mp_generator/main.cpp +++ b/code/ryzom/tools/leveldesign/mp_generator/main.cpp @@ -1305,7 +1305,7 @@ void ItemNamesSave() output = "i"; output += data.splitTo( "prospector", true ); - set::iterator it = itemNames.begin(); + CSortedStringSet::const_iterator it = itemNames.begin(); while ( it != itemNames.end() ) { diff --git a/code/ryzom/tools/translation_tools/main.cpp b/code/ryzom/tools/translation_tools/main.cpp index 5655442e9..0a664a137 100644 --- a/code/ryzom/tools/translation_tools/main.cpp +++ b/code/ryzom/tools/translation_tools/main.cpp @@ -78,6 +78,7 @@ #include #include #include +#include using namespace std; using namespace NLMISC; diff --git a/code/tool/visual_studio_macros/autoexp_vc10.dat b/code/tool/visual_studio_macros/autoexp_vc10.dat new file mode 100644 index 000000000..c39287ebd --- /dev/null +++ b/code/tool/visual_studio_macros/autoexp_vc10.dat @@ -0,0 +1,6130 @@ +; AutoExp.Dat - templates for automatically expanding data +; Copyright(c) Microsoft Corporation. All Rights Reserved. +;--------------------------------------------------------------- +; +; Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\autoexp.dat +; +; While debugging, Data Tips and items in the Watch and Variable +; windows are automatically expanded to show their most important +; elements. The expansion follows the format given by the rules +; in this file. You can add rules for your types or change the +; predefined rules. +; +; For good examples, read the rules in this file. +; +; To find what the debugger considers the type of a variable to +; be, add it to the Watch window and look at the Type column. +; +; An AutoExpand rule is a line with the name of a type, an equals +; sign, and text with replaceable parts in angle brackets. The +; part in angle brackets names a member of the type and an +; optional Watch format specifier. +; +; AutoExpand rules use the following syntax. The equals sign (=), +; angle brackets (<>), and comma are taken literally. Square +; brackets ([]) indicate optional items. +; +; type=[text]... +; +; type Name of the type (may be followed by <*> for template +; types such as the ATL types listed below). +; +; text Any text.Usually the name of the member to display, +; or a shorthand name for the member. +; +; member Name of a member to display. +; +; format Watch format specifier. One of the following: +; +; Letter Description Sample Display +; ------ -------------------------- ------------ ------------- +; d,i Signed decimal integer 0xF000F065,d -268373915 +; u Unsigned decimal integer 0x0065,u 101 +; o Unsigned octal integer 0xF065,o 0170145 +; x,X Hexadecimal integer 61541,X 0X0000F065 +; l,h long or short prefix for 00406042,hx 0x0c22 +; d, i, u, o, x, X +; f Signed floating-point 3./2.,f 1.500000 +; e Signed scientific-notation 3./2.,e 1.500000e+000 +; g Shorter of e and f 3./2.,g 1.5 +; c Single character 0x0065,c 'e' +; s Zero-terminated string pVar,s "Hello world" +; su Unicode string pVar,su "Hello world" +; +; For details of other format specifiers see Help under: +; "format specifiers/watch variable" +; +; The special format <,t> specifies the name of the most-derived +; type of the object. This is especially useful with pointers or +; references to a base class. +; +; If there is no rule for a class, the base classes are checked for +; a matching rule. +; +; There are some special entries allowed in the AutoExpand section: +; $BUILTIN is used to display more complex types that need to do more +; than just show a member variable or two. +; $ADDIN allows external DLLs to be added to display even more complex +; types via the EE Add-in API. The first argument is the DLL name, the +; second argument is the name of the export from the DLL to use. For +; further information on this API see the sample called EEAddIn. +; +; WARNING: if hexadecimal mode is on in the watch window, all numbers here are +; evaluated in hex, e.g. 42 becomes 0x42 + +[AutoExpand] + +; from windef.h +tagPOINT =x= y= +tagRECT =top= bottom= left= right= + +; from winuser.h +tagMSG =msg= wp= lp= + +; intrinsics +__m64 = +__m128=$BUILTIN(M128) +__m128i=$BUILTIN(M128I) +__m128d=$BUILTIN(M128D) + +; from afxwin.h +CDC =hDC= attrib= +CPaintDC =<,t> hWnd= +CPoint =x= y= +CRect =top= bottom= left= right= +CSize =cx= cy= +CWnd =<,t> hWnd= +CWinApp =<,t> +CWinThread =<,t> h= proc= + +; from afxcoll.h +CPtrList =cnt= + +; from afxstat_.h +CProcessLocalObject =<,t> +CThreadLocalObject =<,t> + +; from afx.h +CArchiveException =cause= +CFile =hFile= name= +CFileException =cause= OS Error=m_lOsError +CMemFile =pos= size= +CObject =<,t> +CRuntimeClass = +CStdioFile =FILE*= name= +CTimeSpan =time= +CTime =time= + +; from afxcoll.h +CByteArray =count= +CStringList =count= +; same for all CXXXArray classes +; same for CXXXList +; same for CMapXXToXX + +; various string classes from MFC & ATL + +_com_error= +_bstr_t=m_wstr,su> (m_RefCount,u>) +_com_ptr_t<*>= +_LARGE_INTEGER= +_ULARGE_INTEGER= +ATL::CComPtr<*>=

+ +ATL::CComQIPtr<*>=

+ +tagVARIANT=$BUILTIN(VARIANT) +VARIANT=$BUILTIN(VARIANT) +_GUID=$BUILTIN(GUID) + +; see EEAddIn sample for how to use these +;_SYSTEMTIME=$ADDIN(EEAddIn.dll,AddIn_SystemTime) +;_FILETIME=$ADDIN(EEAddIn.dll,AddIn_FileTime) + +; Qt autoexpand +QByteArray=data,s> size=size,u> +QPoint =x= y= +QPointF =x= y= +QRect =x1= y1= x2= y2= +QRectF =x= y= w= h= +QSize =width= height= +QSizeF =width= height= +QHash<*> =size=size> +QVarLengthArray<*> =size= data= + +[Visualizer] +; This section contains visualizers for STL and ATL containers +; DO NOT MODIFY +ATL::CStringT|CSimpleStringT|ATL::CSimpleStringT{ + preview ([$e.m_pszData,s]) + stringview ([$e.m_pszData,sb]) +} +ATL::CStringT|CSimpleStringT|ATL::CSimpleStringT|ATL::CStringT|CSimpleStringT|ATL::CSimpleStringT{ + preview ([$e.m_pszData,su]) + stringview ([$e.m_pszData,sub]) +} +ATL::CComBSTR{ + preview ([$e.m_str,su]) + stringview ([$e.m_str,sub]) +} + + +; Many visualizers use nested #()s. +; Why not use #(foo, bar) instead of #(#(foo), #(bar))? +; The former alphabetically sorts its fields, while the latter does not. + +;------------------------------------------------------------------------------ +; std::pair from +;------------------------------------------------------------------------------ +std::pair<*>{ + ; pair is previewed with "(, )". + preview ( + #( + "(", + $e.first, + ", ", + $e.second, + ")" + ) + ) + + ; We gloss over the fact that first and second are actually stored in _Pair_base. + children ( + #( + #(first : $e.first), + #(second : $e.second) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::plus, etc. from +;------------------------------------------------------------------------------ +; STL functors are previewed with their names. +; They have no state, so they have no children. +std::plus<*>{ + preview ( "plus" ) + children ( #array(expr: 0, size: 0) ) +} +std::minus<*>{ + preview ( "minus" ) + children ( #array(expr: 0, size: 0) ) +} +std::multiplies<*>{ + preview ( "multiplies" ) + children ( #array(expr: 0, size: 0) ) +} +std::divides<*>{ + preview ( "divides" ) + children ( #array(expr: 0, size: 0) ) +} +std::modulus<*>{ + preview ( "modulus" ) + children ( #array(expr: 0, size: 0) ) +} +std::negate<*>{ + preview ( "negate" ) + children ( #array(expr: 0, size: 0) ) +} +std::equal_to<*>{ + preview ( "equal_to" ) + children ( #array(expr: 0, size: 0) ) +} +std::not_equal_to<*>{ + preview ( "not_equal_to" ) + children ( #array(expr: 0, size: 0) ) +} +std::greater<*>{ + preview ( "greater" ) + children ( #array(expr: 0, size: 0) ) +} +std::less<*>{ + preview ( "less" ) + children ( #array(expr: 0, size: 0) ) +} +std::greater_equal<*>{ + preview ( "greater_equal" ) + children ( #array(expr: 0, size: 0) ) +} +std::less_equal<*>{ + preview ( "less_equal" ) + children ( #array(expr: 0, size: 0) ) +} +std::logical_and<*>{ + preview ( "logical_and" ) + children ( #array(expr: 0, size: 0) ) +} +std::logical_or<*>{ + preview ( "logical_or" ) + children ( #array(expr: 0, size: 0) ) +} +std::logical_not<*>{ + preview ( "logical_not" ) + children ( #array(expr: 0, size: 0) ) +} + +;------------------------------------------------------------------------------ +; std::not1() from +; std::not2() from +;------------------------------------------------------------------------------ +; STL negators are previewed with "not[12]()". +; They have a child with the fake name of [pred], so that the +; stored functor can be inspected. +std::unary_negate<*>{ + preview ( + #( + "not1(", + $e._Functor, + ")" + ) + ) + + children ( + #([pred] : $e._Functor) + ) +} +std::binary_negate<*>{ + preview ( + #( + "not2(", + $e._Functor, + ")" + ) + ) + + children ( + #([pred] : $e._Functor) + ) +} + +;------------------------------------------------------------------------------ +; std::bind1st() from +; std::bind2nd() from +;------------------------------------------------------------------------------ +; STL binders are previewed with "bind1st(, )" or "bind2nd(, )". +; We gloss over the fact that they derive from unary_function. +std::binder1st<*>{ + preview ( + #( + "bind1st(", + $e.op, + ", ", + $e.value, + ")" + ) + ) + + children ( + #( + #(op : $e.op), + #(value : $e.value) + ) + ) +} +std::binder2nd<*>{ + preview ( + #( + "bind2nd(", + $e.op, + ", ", + $e.value, + ")" + ) + ) + + children ( + #( + #(op : $e.op), + #(value : $e.value) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::ptr_fun() from +;------------------------------------------------------------------------------ +; STL function pointer adaptors are previewed with "ptr_fun()". +; Function pointers have no children, so the adaptors have no children. +std::pointer_to_unary_function<*>|std::pointer_to_binary_function<*>{ + preview ( + #( + "ptr_fun(", + $e._Pfun, + ")" + ) + ) + + children ( #array(expr: 0, size: 0) ) +} + +;------------------------------------------------------------------------------ +; std::mem_fun() from +; std::mem_fun_ref() from +;------------------------------------------------------------------------------ +; See ptr_fun(). +std::mem_fun_t<*>|std::mem_fun1_t<*>|std::const_mem_fun_t<*>|std::const_mem_fun1_t<*>{ + preview ( + #( + "mem_fun(", + $e._Pmemfun, + ")" + ) + ) + + children ( #array(expr: 0, size: 0) ) +} +std::mem_fun_ref_t<*>|std::mem_fun1_ref_t<*>|std::const_mem_fun_ref_t<*>|std::const_mem_fun1_ref_t<*>{ + preview ( + #( + "mem_fun_ref(", + $e._Pmemfun, + ")" + ) + ) + + children ( #array(expr: 0, size: 0) ) +} + +;------------------------------------------------------------------------------ +; std::auto_ptr from +;------------------------------------------------------------------------------ +std::auto_ptr<*>{ + ; An empty auto_ptr is previewed with "empty". + ; Otherwise, it is previewed with "auto_ptr ". + preview ( + #if ($e._Myptr == 0) ( + "empty" + ) #else ( + #( + "auto_ptr ", + *$e._Myptr + ) + ) + ) + + ; An empty auto_ptr has no children. + ; Otherwise, it has a single child, its stored pointer, with a fake name of [ptr]. + children ( + #if ($e._Myptr == 0) ( + #array(expr: 0, size: 0) + ) #else ( + #([ptr] : $e._Myptr) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::basic_string from +;------------------------------------------------------------------------------ +; basic_string is previewed with its stored string. +; It has [size] and [capacity] children, followed by [0], [1], [2], etc. children +; displaying its stored characters. +; The ($e._Myres) < ($e._BUF_SIZE) test determines whether the Small String Optimization +; is in effect. +; NOTE: The parentheses in ($e._Myres) < ($e._BUF_SIZE) are necessary. +std::basic_string{ + preview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,s] ) #else ( [$e._Bx._Ptr,s] )) + stringview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,sb] ) #else ( [$e._Bx._Ptr,sb] )) + + children ( + #( + #([size] : $e._Mysize), + #([capacity] : $e._Myres), + #if (($e._Myres) < ($e._BUF_SIZE)) ( + #array(expr: $e._Bx._Buf[$i], size: $e._Mysize) + ) #else ( + #array(expr: $e._Bx._Ptr[$i], size: $e._Mysize) + ) + ) + ) +} +std::basic_string|std::basic_string{ + preview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,su] ) #else ( [$e._Bx._Ptr,su] )) + stringview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,sub] ) #else ( [$e._Bx._Ptr,sub] )) + + children ( + #( + #([size] : $e._Mysize), + #([capacity] : $e._Myres), + #if (($e._Myres) < ($e._BUF_SIZE)) ( + #array(expr: $e._Bx._Buf[$i], size: $e._Mysize) + ) #else ( + #array(expr: $e._Bx._Ptr[$i], size: $e._Mysize) + ) + ) + ) +} +std::_String_iterator|std::_String_const_iterator{ + preview ( [$e._Ptr,s] ) + stringview ( [$e._Ptr,sb] ) + children ( #([ptr] : $e._Ptr) ) +} +std::_String_iterator|std::_String_const_iterator|std::_String_iterator|std::_String_const_iterator{ + preview ( [$e._Ptr,su] ) + stringview ( [$e._Ptr,sub] ) + children ( #([ptr] : $e._Ptr) ) +} + +;------------------------------------------------------------------------------ +; std::vector from +;------------------------------------------------------------------------------ +; Despite its packed representation, vector is visualized like vector. +std::vector{ + preview ( + #( + "[", + $e._Mysize, + "](", + #array( + expr: (bool)(($e._Myvec._Myfirst[$i / _VBITS] >> ($i % _VBITS)) & 1), + size: $e._Mysize + ), + ")" + ) + ) + + children ( + #( + #([size] : $e._Mysize), + #([capacity] : ($e._Myvec._Myend - $e._Myvec._Myfirst) * _VBITS), + #array( + expr: (bool)(($e._Myvec._Myfirst[$i / _VBITS] >> ($i % _VBITS)) & 1), + size: $e._Mysize + ) + ) + ) +} +std::_Vb_reference<*>|std::_Vb_iterator<*>|std::_Vb_const_iterator<*>{ + preview ( + (bool)((*$e._Myptr >> $e._Myoff) & 1) + ) + + children ( + #( + #([ptr] : $e._Myptr), + #([offset] : $e._Myoff) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::vector from +;------------------------------------------------------------------------------ +; vector is previewed with "[]()". +; It has [size] and [capacity] children, followed by its elements. +; The other containers follow its example. +std::vector<*>{ + preview ( + #( + "[", + $e._Mylast - $e._Myfirst, + "](", + #array( + expr: $e._Myfirst[$i], + size: $e._Mylast - $e._Myfirst + ), + ")" + ) + ) + + children ( + #( + #([size] : $e._Mylast - $e._Myfirst), + #([capacity] : $e._Myend - $e._Myfirst), + #array( + expr: $e._Myfirst[$i], + size: $e._Mylast - $e._Myfirst + ) + ) + ) +} +std::_Vector_iterator<*>|std::_Vector_const_iterator<*>{ + preview ( + *$e._Ptr + ) + + children ( + #([ptr] : $e._Ptr) + ) +} + +;------------------------------------------------------------------------------ +; std::deque from +;------------------------------------------------------------------------------ +std::deque<*>{ + preview ( + #( + "[", + $e._Mysize, + "](", + #array( + expr: $e._Map[(($i + $e._Myoff) / $e._EEN_DS) % $e._Mapsize][($i + $e._Myoff) % $e._EEN_DS], + size: $e._Mysize + ), + ")" + ) + ) + + children ( + #( + #array( + expr: $e._Map[(($i + $e._Myoff) / $e._EEN_DS) % $e._Mapsize][($i + $e._Myoff) % $e._EEN_DS], + size: $e._Mysize + ) + ) + ) +} +std::_Deque_iterator<*,*>|std::_Deque_const_iterator<*,*>{ + preview ( + #if ($e._Myoff >= ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Myoff + ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mysize) ( + "end" + ) #else ( + ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Map[($e._Myoff / ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mapsize][$e._Myoff % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS] + ) + ) + + children ( + #if ($e._Myoff >= ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Myoff + ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mysize) ( + #array(expr: 0, size: 0) + ) #else ( + #( + #([index] : $e._Myoff - ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Myoff), + #([ptr] : &((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Map[($e._Myoff / ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mapsize][$e._Myoff % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS] ) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::list from +;------------------------------------------------------------------------------ +std::list<*>{ + preview ( + #( + "[", + $e._Mysize, + "](", + #list( + head: $e._Myhead->_Next, + size: $e._Mysize, + next: _Next + ) : $e._Myval, + ")" + ) + ) + + children ( + #list( + head: $e._Myhead->_Next, + size: $e._Mysize, + next: _Next + ) : $e._Myval + ) +} +std::_List_iterator<*>|std::_List_const_iterator<*>{ + preview ( $e._Ptr->_Myval ) + children ( #([ptr] : &$e._Ptr->_Myval) ) +} + +;------------------------------------------------------------------------------ +; std::queue from +; std::stack from +;------------------------------------------------------------------------------ +std::queue<*>|std::stack<*>{ + preview ( $e.c ) + children ( #(c : $e.c) ) +} + +;------------------------------------------------------------------------------ +; std::priority_queue from +;------------------------------------------------------------------------------ +std::priority_queue<*>{ + preview ( $e.c ) + + children ( + #( + #(c [heap]: $e.c), + #(comp : $e.comp) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::map from +; std::multimap from +; std::set from +; std::multiset from +;------------------------------------------------------------------------------ +std::map<*>|std::multimap<*>|std::set<*>|std::multiset<*>{ + preview ( + #( + "[", + $e._Mysize, + "](", + #tree( + head: $e._Myhead->_Parent, + skip: $e._Myhead, + left: _Left, + right: _Right, + size: $e._Mysize + ) : $e._Myval, + ")" + ) + ) + + children ( + #( + #([comp] : $e.comp), + #tree( + head: $e._Myhead->_Parent, + skip: $e._Myhead, + left: _Left, + right: _Right, + size: $e._Mysize + ) : $e._Myval + ) + ) +} +std::_Tree_iterator<*>|std::_Tree_const_iterator<*>{ + preview ( $e._Ptr->_Myval ) + children ( #([ptr] : &$e._Ptr->_Myval) ) +} + +;------------------------------------------------------------------------------ +; std::bitset from +;------------------------------------------------------------------------------ +std::bitset<*>{ + preview ( + #( + "[", + $e._EEN_BITS, + "](", + #array( + expr: [($e._Array[$i / $e._Bitsperword] >> ($i % $e._Bitsperword)) & 1,d], + size: $e._EEN_BITS + ), + ")" + ) + ) + + children ( + #array( + expr: [($e._Array[$i / $e._Bitsperword] >> ($i % $e._Bitsperword)) & 1,d], + size: $e._EEN_BITS + ) + ) +} +std::bitset<*>::reference{ + preview ( + [($e._Pbitset->_Array[$i / $e._Pbitset->_Bitsperword] >> ($e._Mypos % $e._Pbitset->_Bitsperword)) & 1,d] + ) + + children ( + #( + #([bitset] : $e._Pbitset), + #([pos] : $e._Mypos) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::reverse_iterator from +;------------------------------------------------------------------------------ +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + $e.current._Ptr[-1] + ) + ) + + children ( + #( + #([to] : $e.current._Ptr - 1), + #(current : $e.current) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + #if ($e.current._Myoff != 0) ( + (bool)((*$e.current._Myptr >> ($e.current._Myoff - 1)) & 1) + ) #else ( + (bool)(($e.current._Myptr[-1] >> (_VBITS - 1)) & 1) + ) + ) + ) + + children ( + #if ($e.current._Myoff != 0) ( + #( + #([to ptr] : $e.current._Myptr), + #([to offset] : $e.current._Myoff - 1), + #(current : $e.current) + ) + ) #else ( + #( + #([to ptr] : $e.current._Myptr - 1), + #([to offset] : _VBITS - 1), + #(current : $e.current) + ) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + $e.current._Ptr[-1] + ) + ) + + children ( + #( + #([to] : $e.current._Ptr - 1), + #(current : $e.current) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + #if ($e.current._Myoff == ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Myoff) ( + "end" + ) #else ( + ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Map[(($e.current._Myoff - 1) / ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Mapsize][($e.current._Myoff - 1) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS] + ) + ) + ) + + children ( + #if ($e.current._Myoff == ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Myoff) ( + #(current : $e.current) + ) #else ( + #( + #([to index] : ($e.current._Myoff - 1) - ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Myoff), + #([to ptr] : &((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Map[(($e.current._Myoff - 1) / ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Mapsize][($e.current._Myoff - 1) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS] ), + #(current : $e.current) + ) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + $e.current._Ptr->_Prev->_Myval + ) + ) + + children ( + #( + #([to] : &$e.current._Ptr->_Prev->_Myval), + #(current : $e.current) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + #if ($e.current._EEN_IDL == 0) ( + $e.current._Ptr[-1] + ) #else ( + #if ($e.current._Idx == 0) ( + "end" + ) #else ( + $e.current._Ptr[$e.current._Idx - 1] + ) + ) + ) + ) + + children ( + #if ($e.current._EEN_IDL == 0) ( + #( + #([to] : $e.current._Ptr - 1), + #(current : $e.current) + ) + ) #else ( + #if ($e.current._Idx == 0) ( + #(current : $e.current) + ) #else ( + #( + #([to] : $e.current._Ptr + $e.current._Idx - 1), + #(current : $e.current) + ) + ) + ) + ) +} +std::reverse_iterator<*>{ + preview ( + #( + "reverse_iterator current ", + $e.current + ) + ) + + children ( + #(current : $e.current) + ) +} + +;------------------------------------------------------------------------------ +; std::complex from +;------------------------------------------------------------------------------ +std::complex<*>{ + preview ( + #if ($e._Val[1] == 0) ( + ; Purely real. + $e._Val[0] + ) #else ( + #if ($e._Val[0] == 0) ( + ; Purely imaginary. + #if ($e._Val[1] < 0) ( + #("-i*", -$e._Val[1]) + ) #else ( + #("i*", $e._Val[1]) + ) + ) #else ( + ; Mixed. + #if ($e._Val[1] < 0) ( + #($e._Val[0], "-i*", -$e._Val[1]) + ) #else ( + #($e._Val[0], "+i*", $e._Val[1]) + ) + ) + ) + ) + + children ( + #( + #(real : $e._Val[0]), + #(imag : $e._Val[1]) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::valarray from +;------------------------------------------------------------------------------ +std::valarray<*>{ + preview ( + #( + "[", + $e._Mysize, + "](", + #array( + expr: $e._Myptr[$i], + size: $e._Mysize + ), + ")" + ) + ) + + children ( + #array( + expr: $e._Myptr[$i], + size: $e._Mysize + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::reference_wrapper from +;------------------------------------------------------------------------------ +std::tr1::reference_wrapper<*>{ + preview ( + #if ($e._Callee._EEN_INDIRECT == 1) ( + ; For ordinary T, reference_wrapper stores a T * _Callee._Ptr + ; which is non-null. Actual references are previewed with what they + ; refer to, so reference_wrapper is previewed with dereferencing its + ; stored pointer. + *$e._Callee._Ptr + ) #else ( + ; When T is a pointer to data member type, reference_wrapper + ; stores a T _Callee._Object directly. + $e._Callee._Object + ) + ) + + children ( + #if ($e._Callee._EEN_INDIRECT == 1) ( + ; Actual references have the same children as what they refer to. + ; Unfortunately, there appears to be no way to imitate this exactly. + ; Therefore, we make reference_wrapper appear to have a single + ; child, its stored pointer, with a fake name of [ptr]. + #([ptr] : $e._Callee._Ptr) + ) #else ( + ; When T is a pointer to data member type, T has no children, + ; so we make reference_wrapper appear to have no children. + #array(expr: 0, size: 0) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::shared_ptr from +;------------------------------------------------------------------------------ +std::tr1::_Ref_count<*>{ + preview ( "default" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ref_count_del<*>{ + preview ( "custom deleter" ) + children ( #([deleter] : $e._Dtor) ) +} +std::tr1::_Ref_count_del_alloc<*>{ + preview ( "custom deleter, custom allocator" ) + children ( + #( + #([deleter] : $e._Dtor), + #([allocator] : $e._Myal) + ) + ) +} +std::tr1::_Ref_count_obj<*>{ + preview ( "make_shared" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ref_count_obj_alloc<*>{ + preview ( "allocate_shared" ) + children ( #([allocator] : $e._Myal) ) +} +std::tr1::shared_ptr<*>{ + preview ( + ; shared_ptr stores a T * _Ptr . + #if ($e._Ptr == 0) ( + ; A default-constructed shared_ptr has a null _Ptr and a null _Rep, + ; and is formally said to be empty. + ; A shared_ptr constructed from a null pointer has a null _Ptr + ; and a NON-null _Rep . It is formally said to own the null pointer. + ; We preview both with "empty". + "empty" + ) #else ( + ; Raw pointers are previewed with " ". + ; auto_ptr is previewed with "auto_ptr ". + ; Following these examples, shared_ptr is previewed with + ; "shared_ptr [N strong refs, M weak refs]". + #( + "shared_ptr ", + *$e._Ptr, + " [", + $e._Rep->_Uses, + #if ($e._Rep->_Uses == 1) (" strong ref") #else (" strong refs"), + #if ($e._Rep->_Weaks - 1 > 0) ( + #( + ", ", + $e._Rep->_Weaks - 1, + #if ($e._Rep->_Weaks - 1 == 1) (" weak ref") #else (" weak refs") + ) + ), + "] [", + *$e._Rep, + "]" + ) + ; Note: _Rep->_Uses counts how many shared_ptrs share ownership of the object, + ; so we directly display it as the strong reference count. + ; _Rep->_Weaks counts how many shared_ptrs and weak_ptrs share ownership of + ; the "representation object" (or "control block"). All of the shared_ptrs are + ; counted as a single owner. That is, _Weaks is initialized to 1, and when + ; _Uses falls to 0, _Weaks is decremented. This avoids incrementing and decrementing + ; _Weaks every time that a shared_ptr gains or loses ownership. Therefore, + ; _Weaks - 1 is the weak reference count, the number of weak_ptrs that are observing + ; the shared object. + ) + ) + + children ( + #if ($e._Ptr == 0) ( + ; We make empty shared_ptrs (and shared_ptrs that own + ; the null pointer) appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + #( + ; We make shared_ptr appear to have two children: + + ; Its stored pointer, with a fake name of [ptr]. + #([ptr] : $e._Ptr), + + ; Its deleter and allocator, which may be default or custom. + #([deleter and allocator] : *$e._Rep) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::weak_ptr from +;------------------------------------------------------------------------------ +std::tr1::weak_ptr<*>{ + preview ( + #if ($e._Ptr == 0) ( + "empty" + ) #elif ($e._Rep->_Uses == 0) ( + ; weak_ptr is just like shared_ptr, except that a weak_ptr can be expired. + #( + "expired [", + *$e._Rep, + "]" + ) + ) #else ( + #( + "weak_ptr ", + *$e._Ptr, + " [", + $e._Rep->_Uses, + #if ($e._Rep->_Uses == 1) (" strong ref") #else (" strong refs"), + #if ($e._Rep->_Weaks - 1 > 0) ( + #( + ", ", + $e._Rep->_Weaks - 1, + #if ($e._Rep->_Weaks - 1 == 1) (" weak ref") #else (" weak refs") + ) + ), + "] [", + *$e._Rep, + "]" + ) + ) + ) + + children ( + #if ($e._Ptr == 0) ( + #array(expr: 0, size: 0) + ) #elif ($e._Rep->_Uses == 0) ( + ; When a weak_ptr is expired, we show its deleter and allocator. + ; The deleter has already been used, but the control block has not yet been deallocated. + #([deleter and allocator] : *$e._Rep) + ) #else ( + #( + #([ptr] : $e._Ptr), + #([deleter and allocator] : *$e._Rep) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::mem_fn() from +;------------------------------------------------------------------------------ +; Note that when mem_fn() is given a data member pointer, it returns a _Call_wrapper<_Callable_pmd<*> > . +; Data member pointers themselves don't have useful previews, so we don't attempt to visualize this. +; When mem_fn() is given a member function pointer, it returns a _Mem_fn[N], which we can visualize. +std::tr1::_Mem_fn1<*>|std::tr1::_Mem_fn2<*>|std::tr1::_Mem_fn3<*>|std::tr1::_Mem_fn4<*>|std::tr1::_Mem_fn5<*>|std::tr1::_Mem_fn6<*>|std::tr1::_Mem_fn7<*>|std::tr1::_Mem_fn8<*>|std::tr1::_Mem_fn9<*>|std::tr1::_Mem_fn10<*>{ + preview ( + ; We preview the functor returned by mem_fn() with "mem_fn()". + #( + "mem_fn(", + $e._Callee._Object, + ")" + ) + ) + + children ( + ; Member function pointers have no children. + #array(expr: 0, size: 0) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::bind() from +;------------------------------------------------------------------------------ +; bind() placeholders are previewed with their names. +; They have no state, so they have no children. +std::tr1::_Ph<1>{ + preview ( "_1" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<2>{ + preview ( "_2" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<3>{ + preview ( "_3" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<4>{ + preview ( "_4" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<5>{ + preview ( "_5" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<6>{ + preview ( "_6" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<7>{ + preview ( "_7" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<8>{ + preview ( "_8" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<9>{ + preview ( "_9" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<10>{ + preview ( "_10" ) + children ( #array(expr: 0, size: 0) ) +} + +; The functor returned by bind(f, t1, t2) is previewed with "bind(f, t1, t2)". +; It has children with the fake names of [f], [t1], [t2], etc. +std::tr1::_Bind<*,*,std::tr1::_Bind0<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind0<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind1<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind1<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind2<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind2<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind3<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind3<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind4<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind4<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind5<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind5<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind6<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind6<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind7<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind7<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ", ", $e._Bx._Vx6, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5), + #([t7] : $e._Bx._Vx6) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind8<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind8<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ", ", $e._Bx._Vx6, + ", ", $e._Bx._Vx7, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5), + #([t7] : $e._Bx._Vx6), + #([t8] : $e._Bx._Vx7) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind9<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind9<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ", ", $e._Bx._Vx6, + ", ", $e._Bx._Vx7, + ", ", $e._Bx._Vx8, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5), + #([t7] : $e._Bx._Vx6), + #([t8] : $e._Bx._Vx7), + #([t9] : $e._Bx._Vx8) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind10<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind10<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ", ", $e._Bx._Vx6, + ", ", $e._Bx._Vx7, + ", ", $e._Bx._Vx8, + ", ", $e._Bx._Vx9, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5), + #([t7] : $e._Bx._Vx6), + #([t8] : $e._Bx._Vx7), + #([t9] : $e._Bx._Vx8), + #([t10] : $e._Bx._Vx9) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::function from +;------------------------------------------------------------------------------ +std::tr1::_Impl_no_alloc0<*>|std::tr1::_Impl_no_alloc1<*>|std::tr1::_Impl_no_alloc2<*>|std::tr1::_Impl_no_alloc3<*>|std::tr1::_Impl_no_alloc4<*>|std::tr1::_Impl_no_alloc5<*>|std::tr1::_Impl_no_alloc6<*>|std::tr1::_Impl_no_alloc7<*>|std::tr1::_Impl_no_alloc8<*>|std::tr1::_Impl_no_alloc9<*>|std::tr1::_Impl_no_alloc10<*>{ + preview ( $e._Callee._Object ) + children ( #([functor] : $e._Callee._Object) ) +} +std::tr1::_Impl0<*>|std::tr1::_Impl1<*>|std::tr1::_Impl2<*>|std::tr1::_Impl3<*>|std::tr1::_Impl4<*>|std::tr1::_Impl5<*>|std::tr1::_Impl6<*>|std::tr1::_Impl7<*>|std::tr1::_Impl8<*>|std::tr1::_Impl9<*>|std::tr1::_Impl10<*>{ + preview ( $e._Callee._Object ) + children ( + #( + #([functor] : $e._Callee._Object), + #([allocator] : $e._Myal) + ) + ) +} +std::tr1::function<*>{ + preview ( + #if ($e._Impl == 0) ( + ; Detecting empty functions is trivial. + "empty" + ) #else ( + *$e._Impl + ) + ) + + children ( + #if ($e._Impl == 0) ( + ; We make empty functions appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + #([functor and allocator] : *$e._Impl) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::tuple from +;------------------------------------------------------------------------------ +; tuple is visualized like pair, except that we have to give fake names to tuple's children. +std::tr1::tuple{ + preview ( + "()" + ) + + children ( + #array(expr: 0, size: 0) + ) +} +std::tr1::tuple<*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value + ) + ) +} +std::tr1::tuple<*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [7] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,*,*,*,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [7] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [8] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,*,*,*,*>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [7] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [8] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [9] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::array from +;------------------------------------------------------------------------------ +std::tr1::array<*>{ + preview ( + ; An actual array is previewed with its address. + ; array is previewed like vector. + #( + "[", + $e._EEN_SIZE, + "](", + #array(expr: $e._Elems[$i], size: $e._EEN_SIZE), + ")" + ) + ) + + children ( + ; Just like an actual array. + #array(expr: $e._Elems[$i], size: $e._EEN_SIZE) + ) +} +std::_Array_iterator<*>|std::_Array_const_iterator<*>{ + preview ( + #if ($e._EEN_IDL == 0) ( + *$e._Ptr + ) #else ( + #if ($e._Idx == $e._EEN_SIZE) ( + ; array iterators are represented by _Ptr + _Idx, + ; and they know how large their parent arrays are. Therefore, detecting + ; end iterators is trivial. + "end" + ) #else ( + ; Like vector iterators, array iterators are previewed with what they point to. + $e._Ptr[$e._Idx] + ) + ) + ) + + children ( + #if ($e._EEN_IDL == 0) ( + #([ptr] : $e._Ptr) + ) #else ( + #if ($e._Idx == $e._EEN_SIZE) ( + ; We make end iterators appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + ; An array iterator is conceptually a pointer, so we make it appear to store one. + #([ptr] : $e._Ptr + $e._Idx) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; stdext::hash_map from +; stdext::hash_multimap from +; stdext::hash_set from +; stdext::hash_multiset from +;------------------------------------------------------------------------------ +stdext::hash_map<*>|stdext::hash_multimap<*>|stdext::hash_set<*>|stdext::hash_multiset<*>{ + preview ( + #( + "[", + $e._List._Mysize, + "](", + #list( + head: $e._List._Myhead->_Next, + size: $e._List._Mysize, + next: _Next + ) : $e._Myval, + ")" + ) + ) + + children ( + #list( + head: $e._List._Myhead->_Next, + size: $e._List._Mysize, + next: _Next + ) : $e._Myval + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::unordered_map from +; std::tr1::unordered_multimap from +; std::tr1::unordered_set from +; std::tr1::unordered_multiset from +;------------------------------------------------------------------------------ +std::hash<*>{ + preview ( "hash" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::unordered_map<*>|std::tr1::unordered_multimap<*>|std::tr1::unordered_set<*>|std::tr1::unordered_multiset<*>{ + preview ( + #( + "[", + $e._List._Mysize, + "](", + #list( + head: $e._List._Myhead->_Next, + size: $e._List._Mysize, + next: _Next + ) : $e._Myval, + ")" + ) + ) + + children ( + #( + #([hash] : $e.comp._Hashobj), + #([equal] : $e.comp._Keyeqobj), + #list( + head: $e._List._Myhead->_Next, + size: $e._List._Mysize, + next: _Next + ) : $e._Myval + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::basic_regex from +;------------------------------------------------------------------------------ +std::tr1::basic_regex<*>{ + preview ( + #if ($e._Rep == 0) ( + ; Default construction creates an empty basic_regex. + "empty" + ) #elif ($e._EEN_VIS == 1) ( + ; By default, _ENHANCED_REGEX_VISUALIZER is defined to be 1 in debug and 0 in ship. + ; When it is 1, basic_regex stores the string from which it was constructed. + ; When it is 0, basic_regex stores only the resulting finite state machine. + $e._Visualization + ) #else ( + ; basic_regex contains many static const flags, which would be shown in the preview by default. + ; Its actual members are _Rep and _Traits. _Rep holds the finite state machine, so we + ; use it to preview basic_regex. (It does contain some human-readable information.) + *$e._Rep + ) + ) + + children ( + #if ($e._Rep == 0) ( + ; We make empty basic_regexes appear to have no children. + #array(expr: 0, size: 0) + ) #elif ($e._EEN_VIS == 1) ( + ; We want to hide those static const flags. + ; We also want to give _Visualization a fake name. + #( + #([str] : $e._Visualization), + #(_Rep : $e._Rep), + #(_Traits : $e._Traits) + ) + ) #else ( + ; We want to hide those static const flags. + #( + _Rep : $e._Rep, + _Traits : $e._Traits + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::sub_match from +;------------------------------------------------------------------------------ +std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match{ + preview ( + ; It would be nice if we could preview sub_match with its str(). + ; However, visualizers cannot handle strings represented by pointer pairs. + ; Therefore, our preview contains more limited information. + #if ($e.matched) ( + ; If this sub_match participated in a match, + ; we preview it with its length(). + $e.second - $e.first + ) #else ( + ; Otherwise, we preview it with its matched bool (i.e. "false"). + ; (Why not length() (i.e. "0")? It's meaningful to have + ; matched == true and length() == 0. + "false" + ) + ) + + children ( + #( + ; sub_match's three data members are public, but we list them here + ; (a) to display matched before first and second, and + ; (b) to gloss over the fact that sub_match derives from std::pair. + #(matched : $e.matched), + #(first : $e.first), + #(second : $e.second) + ) + ) +} +std::tr1::sub_match >|std::tr1::sub_match >{ + preview ( + #if ($e.matched) ( + ; We visualize ssub_match and wssub_match just like csub_match and wcsub_match, + ; except that when determining the length(), we can't subtract iterators. + ; We have to subtract their stored pointers. + $e.second._Ptr - $e.first._Ptr + ) #else ( + "false" + ) + ) + + children ( + #( + #(matched : $e.matched), + #(first : $e.first), + #(second : $e.second) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::match_results from +;------------------------------------------------------------------------------ +std::tr1::match_results<*>{ + preview ( + ; A match_results object is empty iff its vector _Matches is empty. + #if ($e._Matches._Myfirst == $e._Matches._Mylast) ( + "empty" + ) #else ( + ; We preview a non-empty match_results object with its vector. + $e._Matches + ) + ) + + children ( + #if ($e._Matches._Myfirst == $e._Matches._Mylast) ( + ; We make empty match_results appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + ; As match_results has operator[](), prefix(), and suffix() member functions, + ; we make it appear to directly contain [0], [1], [2], etc. elements, + ; as well as [prefix] and [suffix] elements. + #( + #array(expr: $e._Matches._Myfirst[$i], size: $e._Matches._Mylast - $e._Matches._Myfirst), + #([prefix] : $e._Prefix), + #([suffix] : $e._Suffix) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::regex_iterator from +;------------------------------------------------------------------------------ +std::tr1::regex_iterator<*>{ + preview ( + #if ($e._MyRe == 0) ( + ; We represent end-of-sequence regex_iterators with null regex pointers. + "end" + ) #else ( + ; Dereferenceable regex_iterators return match_results when dereferenced, + ; so we'll preview them with that. + $e._MyVal + ) + ) + + children ( + #if ($e._MyRe == 0) ( + ; We make end-of-sequence regex_iterators appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + ; For ease of understanding, we make dereferenceable regex_iterators + ; appear to have data members with the "for exposition only" names from TR1. + #( + #([begin] : $e._Begin), + #([end] : $e._End), + #([pregex] : $e._MyRe), + #([flags] : $e._Flags), + #([match] : $e._MyVal) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::regex_token_iterator from +;------------------------------------------------------------------------------ +std::tr1::regex_token_iterator<*>{ + preview ( + #if ($e._Res == 0) ( + ; We represent end-of-sequence regex_token_iterators with null result pointers. + "end" + ) #else ( + ; Dereferenceable regex_token_iterators return *result when dereferenced, + ; so we'll preview them with that. + *$e._Res + ) + ) + + children ( + #if ($e._Res == 0) ( + ; We make end-of-sequence regex_token_iterators appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + ; For ease of understanding, we make dereferenceable regex_token_iterators + ; appear to have data members with the "for exposition only" names from TR1. + #( + #([position] : $e._Pos), + #([result] : $e._Res), + #([suffix] : $e._Suffix), + #([N] : $e._Cur), + #([subs] : $e._Subs) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::identity, etc. from +;------------------------------------------------------------------------------ +std::identity<*>{ + preview ( "identity" ) + children ( #array(expr: 0, size: 0) ) +} +std::bit_and<*>{ + preview ( "bit_and" ) + children ( #array(expr: 0, size: 0) ) +} +std::bit_or<*>{ + preview ( "bit_or" ) + children ( #array(expr: 0, size: 0) ) +} +std::bit_xor<*>{ + preview ( "bit_xor" ) + children ( #array(expr: 0, size: 0) ) +} + +;------------------------------------------------------------------------------ +; std::unique_ptr from +;------------------------------------------------------------------------------ +std::unique_ptr<*>{ + preview ( + #if ($e._Myptr == 0) ( + "empty" + ) #else ( + #( + "unique_ptr ", + *$e._Myptr + ) + ) + ) + + children ( + #if ($e._Myptr == 0) ( + #array(expr: 0, size: 0) + ) #else ( + #([ptr] : $e._Myptr) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::forward_list from +;------------------------------------------------------------------------------ +std::forward_list<*>{ + preview ( + #( + "(", + #list( + head: $e._Myhead, + next: _Next + ) : $e._Myval, + ")" + ) + ) + + children ( + #list( + head: $e._Myhead, + next: _Next + ) : $e._Myval + ) +} +std::_Flist_iterator<*>|std::_Flist_const_iterator<*>{ + preview ( + #if ($e._Ptr == 0) ( + "end" + ) #else ( + $e._Ptr->_Myval + ) + ) + + children ( + #if ($e._Ptr == 0) ( + #array(expr: 0, size: 0) + ) #else ( + #([ptr] : &$e._Ptr->_Myval) + ) + ) +} + + +;------------------------------------------------------------------------------ +; PROPVARIANT +;------------------------------------------------------------------------------ +; Visualizers for VT_VECTOR C arrays +tagCAC|tagCAUB|tagCAI|tagCAUI|tagCAL|tagCAUL|tagCAFLT|tagCADBL|tagCACY|tagCADATE|tagCABSTR|tagCABSTRBLOB|tagCABOOL|tagCASCODE|tagCAPROPVARIANT|tagCAH|tagCAUH|tagCALPSTR|tagCALPWSTR|tagCAFILETIME|tagCACLIPDATA|tagCACLSID{ + preview( + #( + "[", $e.cElems , "](", + #array + ( + expr : ($e.pElems)[$i], + size : $e.cElems + ), + ")" + ) + ) + children + ( + #array + ( + expr : ($e.pElems)[$i], + size : $e.cElems + ) + ) +} +; Visualizers for SAFE ARRAY +tagSAFEARRAY|SAFEARRAY{ + preview( + #if ($e.fFeatures & 0x0080) ; FADF_HAVEVARTYPE + ( + ; Switch on the variant type field - which is stored 4 bytes + ; before the beginning of the SAFEARRAY type + #switch( ((unsigned *)&($e))[-1] ) + #case 0x2 ; VT_I2 | VT_ARRAY + ( + #( + "safearray of I2 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((signed short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x3 ; VT_I4 | VT_ARRAY + ( + #( + "safearray of I4 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((signed int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x4 ; VT_R4 | VT_ARRAY + ( + #( + "safearray of R4 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((float *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x5 ; VT_R8 | VT_ARRAY + ( + #( + "safearray of R8 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((double *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x6 ; VT_CY | VT_ARRAY + ( + #( + "safearray of CY = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((CY *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x7 ; VT_DATE | VT_ARRAY + ( + #( + "safearray of DATE = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((DATE *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x8 ; VT_BSTR | VT_ARRAY + ( + #( + "safearray of BSTR = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((wchar_t **)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0xa ; VT_ERROR | VT_ARRAY + ( + #( + "safearray of ERROR = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((long *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0xb ; VT_BOOL | VT_ARRAY + ( + #( + "safearray of BOOL = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0xc ; VT_VARIANT | VT_ARRAY + ( + #( + "safearray of VARIANT = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((tagVARIANT *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x10 ; VT_I1 | VT_ARRAY + ( + #( + "safearray of I1 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((signed char *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x11 ; VT_UI1 | VT_ARRAY + ( + #( + "safearray of UI1 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned char *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x12 ; VT_UI2 | VT_ARRAY + ( + #( + "safearray of UI2 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x13 ; VT_UI4 | VT_ARRAY + ( + #( + "safearray of UI4 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x14 ; VT_I8 | VT_ARRAY + ( + #( + "safearray of I8 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((signed __int64 *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x15 ; VT_UI8 | VT_ARRAY + ( + #( + "safearray of UI8 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned __int64 *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x16 ; VT_INT | VT_ARRAY + ( + #( + "safearray of INT = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x17 ; VT_UINT | VT_ARRAY + ( + #( + "safearray of UINT = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x1e ; VT_LPSTR | VT_ARRAY + ( + #( + "safearray of LPSTR = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((char **)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x1f ; VT_LPWSTR | VT_ARRAY + ( + #( + "safearray of LPWSTR = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((wchar_t **)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x40 ; VT_FILETIME | VT_ARRAY + ( + #( + "safearray of FILETIME = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((FILETIME *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x47 ; VT_CLIPDATA | VT_ARRAY + ( + #( + "safearray of CLIPDATA = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((CLIPDATA *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x48 ; VT_CLSID | VT_ARRAY + ( + #( + "safearray of CLSID = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((CLSID *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + ) + #elif ($e.fFeatures & 0x0100) ; FADF_BSTR + ( + #("safearray of BSTR = ",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims) : #("[",$e,"]"), "(", #array(expr: ((wchar_t * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") + ) + #elif ($e.fFeatures & 0x0200) ; FADF_UNKNOWN + ( + #("safearray of IUnknown* = [",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims), "](", #array(expr: ((IUnknown * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") + ) + #elif ($e.fFeatures & 0x0400) ; FADF_DISPATCH + ( + #("safearray of IDispatch* = [",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims), "](", #array(expr: ((IDispatch * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") + ) + #elif ($e.fFeatures & 0x0800) ; FADF_VARIANT + ( + #("safearray of VARIANT = ",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims) : #("[",$e,"]"), "(", #array(expr: ((tagVARIANT *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") + ) + ) + children + ( + #( ;[actual members]: [$e,!], + #if ($e.fFeatures & 0x0080) ; FADF_HAVEVARTYPE + ( + #switch( ((unsigned *)&($e))[-1] ) ; for some reason the VT field is before the SAFEARRAY struct + #case 2 ; VT_I2|VT_ARRAY + ( + #array( + expr: ((signed short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 3 ; VT_I4|VT_ARRAY + ( + #array( + expr: ((signed int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 4 ; VT_R4|VT_ARRAY + ( + #array( + expr: ((float *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 5 ; VT_R8|VT_ARRAY + ( + #array( + expr: ((double *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x10 ; VT_I1|VT_ARRAY + ( + #array( + expr: ((signed char *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x11 ; VT_UI1|VT_ARRAY + ( + #array( + expr: ((unsigned char *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x12 ; VT_UI2|VT_ARRAY + ( + #array( + expr: ((unsigned short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x13 ; VT_UI4|VT_ARRAY + ( + #array( + expr: ((unsigned int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x14 ; VT_I8|VT_ARRAY + ( + #array( + expr: ((signed __int64 *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x15 ; VT_UI8|VT_ARRAY + ( + #array( + expr: ((unsigned __int64 *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x1e ; VT_LPSTR|VT_ARRAY + ( + #array( + expr: ((char * *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x1f ; VT_LPWSTR|VT_ARRAY + ( + #array( + expr: ((wchar_t **)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0xc ; VT_VARIANT|VT_ARRAY + ( + #array( + expr: ((tagVARIANT *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0xb ; VT_BOOL|VT_ARRAY + ( + #array( + expr: ((short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0xa ; VT_ERROR|VT_ARRAY + ( + #array( + expr: ((long *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 6 ; VT_CY|VT_ARRAY + ( + #array( + expr: ((CY *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 7 ; VT_DATE|VT_ARRAY + ( + #array( + expr: ((DATE *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x40 ; VT_FILETIME|VT_ARRAY + ( + #array( + expr: ((FILETIME *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x48 ; VT_CLSID|VT_ARRAY + ( + #array( + expr: ((CLSID *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x47 ; VT_CF|VT_ARRAY + ( + #array( + expr: ((CLIPDATA *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 8 ; VT_BSTR|VT_ARRAY + ( + #array( + expr: ((wchar_t * *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x16 ; VT_INT|VT_ARRAY + ( + #array( + expr: ((int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x17 ; VT_UINT|VT_ARRAY + ( + #array( + expr: ((unsigned int*)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #default + ( + #([actual members]: [$e,!]) + ) + #except + ( + #([actual members]: [$e,!]) + ) + ) + #elif ($e.fFeatures & 0x0100) ; FADF_BSTR + ( + #array(expr: ((wchar_t * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) + ) + #elif ($e.fFeatures & 0x0200) ; FADF_UNKNOWN + ( + #array(expr: ((IUnknown * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) + ) + #elif ($e.fFeatures & 0x0400) ; FADF_DISPATCH + ( + #array(expr: ((IDispatch * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) + ) + #elif ($e.fFeatures & 0x0800) ; FADF_VARIANT + ( + #array(expr: ((tagVARIANT *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) + ) + ) + ) +} +tagPROPVARIANT|tagVARIANT|PROPVARIANT|VARIANT{ + preview( + #switch ($e.vt) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Base Types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0 ( #("Empty") ) ; VT_EMPTY + #case 1 ( #("NULL") ) ; VT_NULL + #case 2 ( #("I2 = ", $e.iVal) ) ; VT_I2 + #case 3 ( #("I4 = ", $e.lVal) ) ; VT_I4 + #case 4 ( #("R4 = ", $e.fltVal) ) ; VT_R4 + #case 5 ( #("R8 = ", $e.dblVal) ) ; VT_R8 + #case 6 ( #("CY = ", $e.cyVal) ) ; VT_CY + #case 7 ( #("DATE = ", $e.date) ) ; VT_DATE + #case 8 ( #("BSTR = ", $e.bstrVal) ) ; VT_BSTR + #case 9 ( #("DISPATCH = ", $e.pdispVal) ) ; VT_DISPATCH + #case 10 ( #("ERROR = ", $e.scode) ) ; VT_ERROR + #case 0xB ( #("BOOL = ", $e.boolVal) ) ; VT_BOOL + #case 0xC ( #("VARIANT ") ) ; VT_VARIANT + #case 0xD ( #("UNKNOWN = ", $e.punkVal) ) ; VT_UNKOWN + #case 0xE ( #("DECIMAL = ", $e.decVal) ) ; VT_DECIMAL + #case 0x10 ( #("I1 = ", $e.cVal) ) ; VT_I1 + #case 0x11 ( #("UI1 = ", $e.bVal) ) ; VT_UI1 + #case 0x12 ( #("UI2 = ", $e.uiVal) ) ; VT_UI2 + #case 0x13 ( #("UI4 = ", $e.ulVal) ) ; VT_UI4 + #case 0x14 ( #("I8 = ", *(__int64*)&$e.dblVal) ) ; VT_I8 + #case 0x15 ( #("UI8 = ", *(unsigned __int64*)&$e.dblVal) ) ; VT_UI8 + #case 0x16 ( #("INT = ", $e.intVal) ) ; VT_INT + #case 0x17 ( #("UINT = ", $e.uintVal) ) ; VT_UINT + #case 0x18 ( #("VOID ") ) ; VT_VOID + #case 0x19 ( #("HRESULT ") ) ; VT_HRESULT + #case 0x1A ( #("PTR ") ) ; VT_PTR + #case 0x1B ( #("SAFEARRAY ") ) ; VT_SAFEARRAY + #case 0x1C ( #("CARRAY ") ) ; VT_CARRAY + #case 0x1D ( #("USERDEFINED ") ) ; VT_USERDEFINED + #case 0x1E ( #("LPSTR = ", $e.pszVal) ) ; VT_LPSTR + #case 0x1F ( #("LPWSTR = ", $e.pwszVal) ) ; VT_LPWSTR + #case 0x24 ( #("RECORD ") ) ; VT_RECORD + #case 0x26 ( #("UINT_PTR ") ) ; VT_UINT_PTR + #case 0x40 ( #("FILETIME = ", $e.filetime) ) ; VT_FILETIME + #case 0x42 ( #("STREAM = ", $e.pStream) ) ; VT_STREAM + #case 0x43 ( #("STORAGE = ", $e.pStorage) ) ; VT_STORAGE + #case 0x44 ( #("STREAMED_OBJECT = ", $e.pStream) ) ; VT_STREAMED_OBJECT + #case 0x45 ( #("STORED_OBJECT = ", $e.pStorage) ) ; VT_STORED_OBJECT + #case 0x46 ( #("BLOB_OBJECT = ", $e.blob ) ) ; VT_BLOB_OBJECT + #case 0x47 ( #("CF = ", $e.pclipdata) ) ; VT_CF + #case 0x48 ( #("CLSID = ", $e.puuid) ) ; VT_CLSID + #case 0x49 ( #("VERSIONED_STREAM = ", $e.pVersionedStream) ) ; VT_VERSIONED_STREAM + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Vector types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x1002 ( #("vector of I2 = ", $e.cai) ) ; VT_I2|VT_VECTOR + #case 0x1003 ( #("vector of I4 = ", $e.cal) ) ; VT_I4|VT_VECTOR + #case 0x1004 ( #("vector of R4 = ", $e.caflt) ) ; VT_R4|VT_VECTOR + #case 0x1005 ( #("vector of R8 = ", $e.cadbl) ) ; VT_R8|VT_VECTOR + #case 0x1010 ( #("vector of I1 = ", $e.cac) ) ; VT_I1|VT_VECTOR + #case 0x1011 ( #("vector of UI1 = ", $e.caub) ) ; VT_UI1|VT_VECTOR + #case 0x1012 ( #("vector of UI2 = ", $e.caui) ) ; VT_UI2|VT_VECTOR + #case 0x1013 ( #("vector of UI4 = ", $e.caul) ) ; VT_UI4|VT_VECTOR + #case 0x1014 ( #("vector of I8 = ", $e.cah) ) ; VT_I8|VT_VECTOR + #case 0x1015 ( #("vector of UI8 = ", $e.cauh) ) ; VT_UI8|VT_VECTOR + #case 0x101E ( #("vector of LPSTR = ", $e.calpstr) ) ; VT_LPSTR|VT_VECTOR + #case 0x101F ( #("vector of LPWSTR = ", $e.calpwstr) ) ; VT_LPWSTR|VT_VECTOR + #case 0x100C ( #("vector of VARIANT ", $e.capropvar) ) ; VT_VARIANT|VT_VECTOR + #case 0x100B ( #("vector of BOOL = ", $e.cabool) ) ; VT_BOOL|VT_VECTOR + #case 0x100A ( #("vector of ERROR = ", $e.cascode) ) ; VT_ERROR|VT_VECTOR + #case 0x1006 ( #("vector of CY = ", $e.cacy) ) ; VT_CY|VT_VECTOR + #case 0x1007 ( #("vector of DATE = ", $e.cadate) ) ; VT_DATE|VT_VECTOR + #case 0x1040 ( #("vector of FILETIME = ", $e.cafiletime) ) ; VT_FILETIME|VT_VECTOR + #case 0x1048 ( #("vector of CLSID = ", $e.cauuid) ) ; VT_CLSID|VT_VECTOR + #case 0x1047 ( #("vector of CF = ", $e.caclipdata) ) ; VT_CF|VT_VECTOR + #case 0x1008 ( #("vector of BSTR = ", $e.cabstr) ) ; VT_BSTR|VT_VECTOR + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Byref Types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x4016 ( #("byref of INT = ", $e.pintVal) ) ; VT_INT|VT_BYREF + #case 0x4017 ( #("byref of UINT = ", $e.puintVal) ) ; VT_UINT|VT_BYREF + #case 0x4002 ( #("byref of I2 = ", $e.piVal) ) ; VT_I2|VT_BYREF + #case 0x4003 ( #("byref of I4 = ", $e.plVal) ) ; VT_I4|VT_BYREF + #case 0x4004 ( #("byref of R4 = ", $e.pfltVal) ) ; VT_R4|VT_BYREF + #case 0x4005 ( #("byref of R8 = ", $e.pdblVal) ) ; VT_R8|VT_BYREF + #case 0x4010 ( #("byref of I1 = ", $e.pcVal) ) ; VT_I1|VT_BYREF + #case 0x4011 ( #("byref of UI1 = ", $e.pbVal) ) ; VT_UI1|VT_BYREF + #case 0x4012 ( #("byref of UI2 = ", $e.puiVal) ) ; VT_UI2|VT_BYREF + #case 0x4013 ( #("byref of UI4 = ", $e.pulVal) ) ; VT_UI4|VT_BYREF + #case 0x4014 ( #("byref of I8 = ", (__int64*)$e.pdblVal) ) ; VT_I8|VT_BYREF + #case 0x4015 ( #("byref of UI8 = ", (unsigned __int64*)$e.pudblVal) ) ; VT_UI8|VT_BYREF + #case 0x400C ( #("byref of VARIANT ", $e.pvarVal) ) ; VT_VARIANT|VT_BYREF + #case 0x400B ( #("byref of BOOL = ", $e.pboolVal) ) ; VT_BOOL|VT_BYREF + #case 0x400A ( #("byref of ERROR = ", $e.pscode) ) ; VT_ERROR|VT_BYREF + #case 0x4006 ( #("byref of CY = ", $e.pcyVal) ) ; VT_CY|VT_BYREF + #case 0x4007 ( #("byref of DATE = ", $e.pdate) ) ; VT_DATE|VT_BYREF + #case 0x4008 ( #("byref of BSTR = ", $e.pbstrVal) ) ; VT_BSTR|VT_BYREF + #case 0x400E ( #("byref of DECIMAL = ", $e.pdecVal) ) ; VT_DECIMAL|VT_BYREF + #case 0x400D ( #("byref of UNKNOWN = ", $e.ppunkVal) ) ; VT_UNKOWN|VT_BYREF + #case 0x4009 ( #("byref of DISPATCH = ", $e.ppdispVal) ) ; VT_DISPATCH|VT_BYREF + #case 0x6000 ( #("byref of ARRAY = ", $e.pparray) ) ; VT_ARRAY|VT_BYREF + #default + ( + #if ($e.vt & 0x2000) ( $e.parray) + #else ( #("Unknown vt type = ", $e.vt)) + ) + ) + children( + #( + vt: $e.vt, + #switch ($e.vt) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Base Types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x2 ( #(I2 : $e.iVal) ) ; VT_I2 + #case 0x3 ( #(I4 : $e.lVal) ) ; VT_I4 + #case 0x4 ( #(R4 : $e.fltVal) ) ; VT_R4 + #case 0x5 ( #(R8 : $e.dblVal) ) ; VT_R8 + #case 0x6 ( #(CY : $e.cyVal) ) ; VT_CY + #case 0x7 ( #(DATE : $e.date) ) ; VT_DATE + #case 0x8 ( #(BSTR : $e.bstrVal) ) ; VT_BSTR + #case 0x9 ( #(DISPATCH : $e.pdispVal) ) ; VT_DISPATCH + #case 0xA ( #(ERROR : $e.scode) ) ; VT_ERROR + #case 0xB ( #(BOOL : $e.boolVal) ) ; VT_BOOL + #case 0xD ( #(UNKNOWN : $e.punkVal) ) ; VT_UNKOWN + #case 0xE ( #(DECIMAL : $e.decVal) ) ; VT_DECIMAL + #case 0x10 ( #(I1 : $e.cVal) ) ; VT_I1 + #case 0x11 ( #(UI1 : $e.bVal) ) ; VT_UI1 + #case 0x12 ( #(UI2 : $e.uiVal) ) ; VT_UI2 + #case 0x13 ( #(UI4 : $e.ulVal) ) ; VT_UI4 + #case 0x14 ( #(I8 : *(__int64*)&$e.dblVal) ) ; VT_I8 + #case 0x15 ( #(UI8 : *(unsigned __int64*)&$e.dblVal) ) ; VT_UI8 + #case 0x16 ( #(INT : $e.intVal) ) ; VT_INT + #case 0x17 ( #(UINT : $e.uintVal) ) ; VT_UINT + #case 0x1E ( #(LPSTR : $e.pszVal) ) ; VT_LPSTR + #case 0x1F ( #(LPWSTR : $e.pwszVal) ) ; VT_LPWSTR + #case 0x40 ( #(FILETIME : $e.filetime) ) ; VT_FILETIME + #case 0x42 ( #(STREAM : $e.pStream) ) ; VT_STREAM + #case 0x43 ( #(STORAGE : $e.pStorage) ) ; VT_STORAGE + #case 0x44 ( #(STREAMED_OBJECT : $e.pStream) ) ; VT_STREAMED_OBJECT + #case 0x45 ( #(STORED_OBJECT : $e.pStorage) ) ; VT_STORED_OBJECT + #case 0x46 ( #(BLOB_OBJECT : $e.blob ) ) ; VT_BLOB_OBJECT + #case 0x47 ( #(CF : $e.pclipdata) ) ; VT_CF + #case 0x48 ( #(CLSID : $e.puuid) ) ; VT_CLSID + #case 0x49 ( #(VERSIONED_STREAM : $e.pVersionedStream) ) ; VT_VERSIONED_STREAM + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Vector types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x1002 ( #(vector of I2 : $e.cai) ) ; VT_I2|VT_VECTOR + #case 0x1003 ( #(vector of I4 : $e.cal) ) ; VT_I4|VT_VECTOR + #case 0x1004 ( #(vector of R4 : $e.caflt) ) ; VT_R4|VT_VECTOR + #case 0x1005 ( #(vector of R8 : $e.cadbl) ) ; VT_R8|VT_VECTOR + #case 0x1010 ( #(vector of I1 : $e.cac) ) ; VT_I1|VT_VECTOR + #case 0x1011 ( #(vector of UI1 : $e.caub) ) ; VT_UI1|VT_VECTOR + #case 0x1012 ( #(vector of UI2 : $e.caui) ) ; VT_UI2|VT_VECTOR + #case 0x1013 ( #(vector of UI4 : $e.caul) ) ; VT_UI4|VT_VECTOR + #case 0x1014 ( #(vector of I8 : $e.cah) ) ; VT_I8|VT_VECTOR + #case 0x1015 ( #(vector of UI8 : $e.cauh) ) ; VT_UI8|VT_VECTOR + #case 0x101E ( #(vector of LPSTR : $e.calpstr) ) ; VT_LPSTR|VT_VECTOR + #case 0x101F ( #(vector of LPWSTR : $e.calpwstr) ) ; VT_LPWSTR|VT_VECTOR + #case 0x100C ( #(vector of VARIANT : $e.capropvar) ) ; VT_VARIANT|VT_VECTOR + #case 0x100B ( #(vector of BOOL : $e.cabool) ) ; VT_BOOL|VT_VECTOR + #case 0x100A ( #(vector of ERROR : $e.cascode) ) ; VT_ERROR|VT_VECTOR + #case 0x1006 ( #(vector of CY : $e.cacy) ) ; VT_CY|VT_VECTOR + #case 0x1007 ( #(vector of DATE : $e.cadate) ) ; VT_DATE|VT_VECTOR + #case 0x1040 ( #(vector of FILETIME : $e.cafiletime) ) ; VT_FILETIME|VT_VECTOR + #case 0x1048 ( #(vector of CLSID : $e.cauuid) ) ; VT_CLSID|VT_VECTOR + #case 0x1047 ( #(vector of CF : $e.caclipdata) ) ; VT_CF|VT_VECTOR + #case 0x1008 ( #(vector of BSTR : $e.cabstr) ) ; VT_BSTR|VT_VECTOR + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Byref Types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x4016 ( #(byref of INT : $e.pintVal) ) ; VT_INT|VT_BYREF + #case 0x4017 ( #(byref of UINT : $e.puintVal) ) ; VT_UINT|VT_BYREF + #case 0x4002 ( #(byref of I2 : $e.piVal) ) ; VT_I2|VT_BYREF + #case 0x4003 ( #(byref of I4 : $e.plVal) ) ; VT_I4|VT_BYREF + #case 0x4004 ( #(byref of R4 : $e.pfltVal) ) ; VT_R4|VT_BYREF + #case 0x4005 ( #(byref of R8 : $e.pdblVal) ) ; VT_R8|VT_BYREF + #case 0x4010 ( #(byref of I1 : $e.pcVal) ) ; VT_I1|VT_BYREF + #case 0x4011 ( #(byref of UI1 : $e.pbVal) ) ; VT_UI1|VT_BYREF + #case 0x4012 ( #(byref of UI2 : $e.puiVal) ) ; VT_UI2|VT_BYREF + #case 0x4013 ( #(byref of UI4 : $e.pulVal) ) ; VT_UI4|VT_BYREF + #case 0x4014 ( #(byref of I8 : (__int64*)$e.pdblVal) ) ; VT_I8|VT_BYREF + #case 0x4015 ( #(byref of UI8 : (unsigned __int64*)$e.pdblVal) ) ; VT_UI8|VT_BYREF + #case 0x400C ( #(byref of VARIANT : $e.pvarVal) ) ; VT_VARIANT|VT_BYREF + #case 0x400B ( #(byref of BOOL : $e.pboolVal) ) ; VT_BOOL|VT_BYREF + #case 0x400A ( #(byref of ERROR : $e.pscode) ) ; VT_ERROR|VT_BYREF + #case 0x4006 ( #(byref of CY : $e.pcyVal) ) ; VT_CY|VT_BYREF + #case 0x4007 ( #(byref of DATE : $e.pdate) ) ; VT_DATE|VT_BYREF + #case 0x4008 ( #(byref of BSTR : $e.pbstrVal) ) ; VT_BSTR|VT_BYREF + #case 0x400E ( #(byref of DECIMAL : $e.pdecVal) ) ; VT_DECIMAL|VT_BYREF + #case 0x400D ( #(byref of UNKNOWN : $e.ppunkVal) ) ; VT_UNKOWN|VT_BYREF + #case 0x4009 ( #(byref of DISPATCH : $e.ppdispVal) ) ; VT_DISPATCH|VT_BYREF + #case 0x6000 ( #(byref of ARRAY : $e.pparray) ) ; VT_ARRAY|VT_BYREF + + ; the following are either empty or invalid vt values for a variant + ; #case 0 ( #(Empty :) ) ; VT_EMPTY + ; #case 0x1 ( #(NULL :) ) ; VT_NULL + ; #case 0xC ( #(VARIANT :) ) ; VT_VARIANT + ; #case 0x18 ( #(VOID :) ) ; VT_VOID + ; #case 0x19 ( #(HRESULT :) ) ; VT_HRESULT + ; #case 0x1A ( #(PTR :) ) ; VT_PTR + ; #case 0x1B ( #(SAFEARRAY :) ) ; VT_SAFEARRAY + ; #case 0x1C ( #(CARRAY :) ) ; VT_CARRAY + ; #case 0x1D ( #(USERDEFINED :) ) ; VT_USERDEFINED + ; #case 0x24 ( #(RECORD :) ) ; VT_RECORD + ; #case 0x26 ( #(UINT_PTR :) ) ; VT_UINT_PTR + #default + ( + #if ($e.vt & 0x2000 ) + ( #(safearray: $e.parray)) + #else + ( + #( + [raw members]: [$e,!] ; unformatted data members + ) + ) + ) + #except + ( + #( + [raw members]: [$e,!] ; unformatted data members + ) + ) + ) + ) +} + +; Visualizers for data structures in namespace Concurrency +;------------------------------------------------------------------------------ +; Concurrency::message from +;------------------------------------------------------------------------------ +Concurrency::message<*>{ + preview ( + #( + $e.payload + ) + ) + + children ( + #( + #(payload: $e.payload), + #([msg_id]: $e._M_id) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::multi_link_registry from +;------------------------------------------------------------------------------ +Concurrency::multi_link_registry<*>{ + preview ( + #( + "[", + $e._M_vector._M_index, + "](", + #array( + expr: *($e._M_vector._M_array[$i]), + size: $e._M_vector._M_index + ), + ")" + ) + ) + + children ( + #( + #([size]: $e._M_vector._M_index), + #array( + expr: *($e._M_vector._M_array[$i]), + size: $e._M_vector._M_index + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::_Queue from +;------------------------------------------------------------------------------ +Concurrency::details::_Queue<*>{ + preview ( + #( + "[", + $e._M_count, + "](", + #list( + head: $e._M_pHead, + next: _M_pNext, + size: _M_count + ), + ")" + ) + ) + + children ( + #( + #([size]: $e._M_count), + #list( + head: $e._M_pHead, + next: _M_pNext, + size: _M_count + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::unbounded_buffer from +;------------------------------------------------------------------------------ +Concurrency::unbounded_buffer<*>{ + preview ( + #( + $e._M_messageBuffer + ) + ) + + children ( + #( + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(messages: $e._M_messageBuffer), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_targets: $e._M_connectedTargets), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::overwrite_buffer from +;------------------------------------------------------------------------------ +Concurrency::overwrite_buffer<*>{ + preview ( + #( + $e._M_pMessage + ) + ) + + children ( + #( + #(value: *($e._M_pMessage)), + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_targets: $e._M_connectedTargets), + #(reserving_target: *($e._M_pReservedFor)), + #(reserved_message: *($e._M_pReservedMessage)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::single_assignment from +;------------------------------------------------------------------------------ +Concurrency::single_assignment<*>{ + preview ( + #( + $e._M_pMessage + ) + ) + + children ( + #( + #(value: *($e._M_pMessage)), + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_targets: $e._M_connectedTargets), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::call from +;------------------------------------------------------------------------------ +Concurrency::call<*>{ + preview ( + #( + $e._M_pFunc + ) + ) + + children ( + #( + #(call_method: $e._M_pFunc), + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::transformer from +;------------------------------------------------------------------------------ +Concurrency::transformer<*>{ + preview ( + #( + $e._M_pFunc + ) + ) + + children ( + #( + #(transform_method: $e._M_pFunc), + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(messages: $e._M_messageBuffer), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_target: *($e._M_connectedTargets._M_connectedLink)), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::choice from +;------------------------------------------------------------------------------ +Concurrency::choice<*>{ + preview ( + #( + "[", + #if ($e._M_pSingleAssignment->_M_fIsInitialized) ("initialized") + #else ("not_initialized"), + "] ", + $e._M_sourceTuple + ) + ) + + children ( + #( + #([input_count]: $e._M_pSingleAssignment->_M_connectedSources._M_links._M_vector._M_index), + #(index: $e._M_pSingleAssignment->_M_pMessage->payload), + #(source_tuple: $e._M_sourceTuple), + #(linked_sources: $e._M_pSingleAssignment->_M_connectedSources._M_links), + #(linked_targets: $e._M_pSingleAssignment->_M_connectedTargets), + #(reserving_target: *($e._M_pSingleAssignment->_M_pReservedFor)), + #(Scheduler: *($e._M_pScheduler)), + #(ScheduleGroup: *($e._M_pScheduleGroup)), + #([raw _M_pSourceChoices] : $e._M_pSourceChoices) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::join<*,*>::_MessageArray from +;------------------------------------------------------------------------------ +Concurrency::join<*,*>::_MessageArray{ + preview ( + #( + "[", + $e._M_count, + "](", + #array( + expr: *(((Concurrency::message<$T1>**)$e._M_messages)[$i]), + size: $e._M_count + ), + ")" + ) + ) + + children ( + #( + #([size]: $e._M_count), + #array( + expr: *(((Concurrency::message<$T1>**)$e._M_messages)[$i]), + size: $e._M_count + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::join<*,*>::_SavedMessageIdArray from +;------------------------------------------------------------------------------ +Concurrency::join<*,*>::_SavedMessageIdArray{ + preview ( + #( + "[", + $e._M_count, + "](", + #array( + expr: ((int*)$e._M_savedIds)[$i], + size: $e._M_count + ), + ")" + ) + ) + + children ( + #( + #([size]: $e._M_count), + #array( + expr: ((int*)$e._M_savedIds)[$i], + size: $e._M_count + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::join from +;------------------------------------------------------------------------------ +Concurrency::join<*,*>{ + preview ( + #( + "[", + $e._M_messageArray._M_count - $e._M_messagesRemaining, + "/", + $e._M_messageArray._M_count, + "](", + #array( + expr: *($e._M_connectedSources._M_links._M_vector._M_array[$i]), + size: $e._M_connectedSources._M_links._M_vector._M_index + ), + ")" + ) + ) + + children ( + #( + #([join_type]: (Concurrency::join_type)$T2), + #([offer_count]: $e._M_messageArray._M_count - $e._M_messagesRemaining), + #(offer_IDs: $e._M_savedMessageIdArray), + #([input_count]: $e._M_messageArray._M_count), + #(input_values: $e._M_messageArray), + #(messages: $e._M_messageBuffer), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_target: $e._M_connectedTargets._M_connectedLink), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::multitype_join from +;------------------------------------------------------------------------------ +Concurrency::multitype_join<*,*>{ + preview ( + #( + "[", + $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index - $e._M_pJoinNode->_M_counter, + "/", + $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index, + "]", + $e._M_sourceTuple + ) + ) + + children ( + #( + #([join_type]: (Concurrency::join_type)$T2), + #([offer_count]: $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index - $e._M_pJoinNode->_M_counter), + #([input_count]: $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index), + #(source_tuple: $e._M_sourceTuple), + #(messages: $e._M_pJoinNode->_M_messageBuffer), + #(linked_sources: $e._M_pJoinNode->_M_connectedSources._M_links), + #(linked_target: $e._M_pJoinNode->_M_connectedTargets._M_connectedLink), + #(reserving_target: *($e._M_pJoinNode->_M_pReservedFor)), + #(Scheduler: *($e._M_pJoinNode->_M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_pJoinNode->_M_messageProcessor._M_pScheduleGroup)), + #([raw _M_pSourceJoins] : $e._M_pSourceJoins) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::timer from +;------------------------------------------------------------------------------ +Concurrency::timer<*>{ + preview ( + #( + $e._M_state + ) + ) + + children ( + #( + #(state: $e._M_state), + #(value: $e._M_value), + #(repeating: $e._M_fRepeating), + #(interval_ms: $e._M_ms), + #(linked_target: *($e._M_connectedTargets._M_connectedLink)), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::SchedulerBase from +; Concurrency::details::ThreadScheduler from +; Concurrency::details::UMSThreadScheduler from +;------------------------------------------------------------------------------ +Concurrency::details::SchedulerBase|Concurrency::details::ThreadScheduler|Concurrency::details::UMSThreadScheduler{ + preview ( + #( + "[", + $e.m_id, + "] ", + #if ($e.m_schedulerKind == 0) ("ThreadScheduler") + #else ("UmsScheduler"), + #if ($e.m_id == $e.s_pDefaultScheduler->m_id) (", default") + #else ("") + ) + ) + + children ( + #( + #(ID: $e.m_id), + #(SchedulerPolicy: $e.m_policy), + #(VirtualProcessorCount: $e.m_virtualProcessorCount), + #(ReferenceCount: $e.m_refCount), + #([isDefaultScheduler]: $e.m_id == $e.s_pDefaultScheduler->m_id) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::ScheduleGroupBase from +; Concurrency::details::CacheLocalScheduleGroup from +; Concurrency::details::FairScheduleGroup from +;------------------------------------------------------------------------------ +Concurrency::details::ScheduleGroupBase|Concurrency::details::CacheLocalScheduleGroup|Concurrency::details::FairScheduleGroup{ + preview ( + #( + "[", + $e.m_id, + "]", + #if ($e.m_kind & 4) (" AnonymousScheduleGroup") + #else ("") + ) + ) + + children ( + #( + #(ID: $e.m_id), + #(Scheduler: *($e.m_pScheduler)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::ContextBase from +; Concurrency::details::InternalContextBase from +; Concurrency::details::ThreadInternalContext from +; Concurrency::details::UMSThreadInternalContext from +;------------------------------------------------------------------------------ +Concurrency::details::ContextBase|Concurrency::details::InternalContextBase|Concurrency::details::ThreadInternalContext|Concurrency::details::UMSThreadInternalContext{ + preview ( + #( + "[", + $e.m_threadId, + "] ", + #if ($e.m_blockedState == 0) ("not_concrt_blocked") + #elif ($e.m_blockedState == 1) ("concrt_blocked") + #elif ($e.m_blockedState == 2) ("ums_sync_blocked") + #elif ($e.m_blockedState == 4) ("ums_async_blocked") + #else ("") + ) + ) + + children ( + #( + #(ID: $e.m_id), + #(ThreadID: $e.m_threadId), + #(Scheduler: *($e.m_pScheduler)), + #(ScheduleGroup: *($e.m_pGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::ExternalContextBase from +;------------------------------------------------------------------------------ +Concurrency::details::ExternalContextBase{ + preview ( + #( + "[", + $e.m_threadId, + "] ", + #if ($e.m_contextSwitchingFence == 1) ("concrt_blocked") + #else ("not_concrt_blocked") + ) + ) + + children ( + #( + #(ID: $e.m_id), + #(ThreadID: $e.m_threadId), + #(Scheduler: *($e.m_pScheduler)), + #(ScheduleGroup: *($e.m_pGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::SchedulerPolicy from +;------------------------------------------------------------------------------ +Concurrency::SchedulerPolicy{ + preview ( + #( + $e._M_pPolicyBag->_M_values._M_specificValues._M_schedulerKind, + ", Min=", + $e._M_pPolicyBag->_M_values._M_specificValues._M_minConcurrency, + ", Max=", + $e._M_pPolicyBag->_M_values._M_specificValues._M_maxConcurrency + ) + ) + + children ( + #( + #(SchedulerKind: $e._M_pPolicyBag->_M_values._M_specificValues._M_schedulerKind), + #(MinConcurrency: $e._M_pPolicyBag->_M_values._M_specificValues._M_minConcurrency), + #(MaxConcurrency: $e._M_pPolicyBag->_M_values._M_specificValues._M_maxConcurrency), + #(TargetOversubscriptionFactor: $e._M_pPolicyBag->_M_values._M_specificValues._M_targetOversubscriptionFactor), + #(LocalContextCacheSize: $e._M_pPolicyBag->_M_values._M_specificValues._M_localContextCacheSize), + #(ContextStackSize: $e._M_pPolicyBag->_M_values._M_specificValues._M_contextStackSize), + #(ContextPriority: $e._M_pPolicyBag->_M_values._M_specificValues._M_contextPriority), + #(SchedulingProtocol: $e._M_pPolicyBag->_M_values._M_specificValues._M_schedulingProtocol), + #(DynamicProgressFeedback: $e._M_pPolicyBag->_M_values._M_specificValues._M_dynamicProgressFeedback) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::event from +;------------------------------------------------------------------------------ +Concurrency::event{ + preview ( + #( + #if ($e._M_pWaitChain == 1) ("set") + #else ("not_set") + ) + ) + + children ( + #( + #([is_set]: ($e._M_pWaitChain == 1)), + #([has_waiters]: (($e._M_pWaitChain != 0) && ($e._M_pWaitChain != 1))) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::critical_section from +;------------------------------------------------------------------------------ +Concurrency::critical_section{ + preview ( + #( + #if ($e._M_pHead != 0) ("locked") + #else ("not_locked") + ) + ) + + children ( + #( + #([is_locked]: ($e._M_pHead != 0)), + #(OwningContext: *((Concurrency::Context*)($e._M_activeNode[0]))) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::critical_section::scoped_lock from +;------------------------------------------------------------------------------ +Concurrency::critical_section::scoped_lock{ + preview ( + #( + $e._M_critical_section + ) + ) + + children ( + #( + CriticalSection: $e._M_critical_section + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::reader_writer_lock from +;------------------------------------------------------------------------------ +Concurrency::reader_writer_lock{ + preview ( + #( + #if (($e._M_lockState < 8) && ($e._M_lockState & 2)) ("held_by_writer") + #elif ($e._M_lockState >= 8) ( + #( + "held_by_reader(s) [", + ($e._M_lockState / 8), + "]" + ) + ) + #else ("not_held") + ) + ) + + children ( + #( + #([is_reader_lock_held]: ($e._M_lockState >= 8)), + #([num_reader_lock_holders]: ($e._M_lockState / 8)), + #([is_writer_lock_held]: ($e._M_lockState < 8) && ($e._M_lockState & 2)), + #(OwningWriterContext: *((Concurrency::Context*)($e._M_activeWriter[0]))) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::reader_writer_lock::scoped_lock from +; Concurrency::reader_writer_lock::scoped_lock_read from +;------------------------------------------------------------------------------ +Concurrency::reader_writer_lock::scoped_lock|Concurrency::reader_writer_lock::scoped_lock_read{ + preview ( + #( + $e._M_reader_writer_lock + ) + ) + + children ( + #( + ReaderWriterLock: $e._M_reader_writer_lock + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::_TaskCollectionBase from +;------------------------------------------------------------------------------ +Concurrency::details::_TaskCollectionBase{ + preview ( + #( + #if ((((int)$e._M_pException & ~0x3) != 0) && (((int)$e._M_pException & ~0x3) != 0xC)) ("exception") + #else ("no_exception") + ) + ) + + children ( + #( + #([has_exception]: (((int)$e._M_pException & ~0x3) != 0) && (((int)$e._M_pException & ~0x3) != 0xC)), + #(CreatingContext: *((Concurrency::Context*)$e._M_pOwningContext)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::task_group from +; Concurrency::structured_task_group from +;------------------------------------------------------------------------------ +Concurrency::task_group|Concurrency::structured_task_group{ + preview ( + #( + #if ((((int)$e._M_task_collection._M_pException & ~0x3) != 0) && (((int)$e._M_task_collection._M_pException & ~0x3) != 0xC)) ("exception") + #else ("no_exception") + ) + ) + + children ( + #( + #([has_exception]: (((int)$e._M_task_collection._M_pException & ~0x3) != 0) && (((int)$e._M_task_collection._M_pException & ~0x3) != 0xC)), + #(CreatingContext: *((Concurrency::Context*)$e._M_task_collection._M_pOwningContext)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::task_handle from +;------------------------------------------------------------------------------ +Concurrency::task_handle<*>{ + preview ( + #( + $e._M_function + ) + ) + + children ( + #( + #(Function: $e._M_function), + #(RuntimeOwnsLifetime: $e._M_fRuntimeOwnsLifetime), + #(TaskCollection: *($e._M_pTaskCollection)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::combinable from +;------------------------------------------------------------------------------ +Concurrency::combinable<*>{ + preview( + #( + "(", + #array( + expr: *($e._M_buckets[$i]), + size: $e._M_size + ) : #list( + head: $e, + next: _M_chain + ) : $e._M_value, + ")" + ) + ) + children( + #( + #array( + expr: *($e._M_buckets[$i]), + size: $e._M_size + ) : #list( + head: $e, + next: _M_chain + ) : $e._M_value, + #(InitFunction : $e._M_fnInitialize) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::concurrent_vector from +;------------------------------------------------------------------------------ +Concurrency::concurrent_vector<*,*>{ + preview( + #( + "[", + $e._My_early_size._M_value, + "](", + #array ( + expr: #( + #if (($i >> 1) == 0) ((($T1*)$e._My_segment._M_value[0]._My_array)[$i]) + #else ((($T1*)$e._My_segment._M_value[__log2($i)]._My_array)[$i - (0x1 << __log2($i))]) + ), + size: $e._My_early_size._M_value + ), + ")" + ) + ) + children( + #( + [size] : $e._My_early_size._M_value, + #array ( + expr: #( + #if (($i >> 1) == 0) ((($T1*)$e._My_segment._M_value[0]._My_array)[$i]) + #else ((($T1*)$e._My_segment._M_value[__log2($i)]._My_array)[$i - (0x1 << __log2($i))]) + ), + size: $e._My_early_size._M_value + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::_Vector_iterator from +;------------------------------------------------------------------------------ +Concurrency::details::_Vector_iterator,*>{ + preview( + #( + #if (($e._My_index >> 1) == 0) ((($T1*)$e._My_vector->_My_segment._M_value[0]._My_array)[$e._My_index]) + #else ((($T1*)$e._My_vector->_My_segment._M_value[__log2($e._My_index)]._My_array)[$e._My_index - (0x1 << __log2($e._My_index))]) + ) + ) + children( + #( + [ptr]: #if (($e._My_index >> 1) == 0) (&((($T1*)$e._My_vector->_My_segment._M_value[0]._My_array)[$e._My_index])) + #else (&((($T1*)$e._My_vector->_My_segment._M_value[__log2($e._My_index)]._My_array)[$e._My_index - (0x1 << __log2($e._My_index))])) + + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::concurrent_queue from +;------------------------------------------------------------------------------ +Concurrency::concurrent_queue<*,*>{ + preview + ( + #( + "[", + $e._My_rep->_Tail_counter._M_value - $e._My_rep->_Head_counter._M_value, + "](", + #array + ( + expr : #if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 0) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 1) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 2) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 3) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 4) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 5) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 6) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 7) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 8) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 9) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 10) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 11) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 12) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 13) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 14) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 15) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 16) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 17) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 18) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 19) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1])))))))))))))))))))), + size : #if ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value < 20*8*$e._Items_per_page) ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value) + #else (20*8*$e._Items_per_page) + ), + ")" + ) + ) + children + ( + #( + #([unsafe_size]: $e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value), + #array + ( + expr : #if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 0) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 1) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 2) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 3) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 4) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 5) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 6) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 7) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 8) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 9) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 10) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 11) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 12) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 13) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 14) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 15) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 16) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 17) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 18) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 19) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1])))))))))))))))))))), + size : #if ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value < 20*8*$e._Items_per_page) ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value) + #else (20*8*$e._Items_per_page) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::_Concurrent_queue_iterator from +;------------------------------------------------------------------------------ +Concurrency::details::_Concurrent_queue_iterator,*>{ + preview( + #( + *(($T1*)$e._My_item) + ) + ) + children( + #( + [ptr]: (($T1*)$e._My_item) + + ) + ) +} + +; Qt visualizers +; Nokia Qt 4.x visualizers -----------------------------------------[ start ]-- +;------------------------------------------------------------------------------ +; Feel free to modify these visualizers to suit yours needs! But please let us +; know about the changes you make, so we continuously improve the visualizers. + +QString|*::QString{ + preview ([$e.d->data,su]) + stringview ([$e.d->data,sub]) + children + ( + #( + d: $c.d, + [size]: $c.d->size, + [referenced]: $c.d->ref._q_value + ) + ) +} + +QByteArray|*::QByteArray{ + preview ([$e.d->data,s]) + stringview ([$e.d->data,sb]) + children + ( + #( + d: $c.d, + [size]: $c.d->size, + [referenced]: $c.d->ref._q_value + ) + ) +} + +QFileInfo|*::QFileInfo{ + preview + ( + #( + "private=", $c.d_ptr + ) + ) +} + +QUrl|*::QUrl{ + preview + ( + #if ($e.d.stateFlags == 0) ( + $e.d + ) #else ( + #( $e.d->scheme, $e.d->host, $e.d->path ) + ) + ) + children + ( + #( + scheme: $c.d->scheme, + host: $c.d->host, + path: $c.d->path, + username: $c.d->userName, + password: $c.d->password, + encodedOriginal: $c.d->encodedOriginal, + query: $c.d->query, + fragment: $c.d->fragment + ) + ) +} + +QTime|*::QTime{ + preview + ( + #( + "hour=", [$e.mds / 3600000, d], + ", minute=", [($e.mds % 3600000) / 60000, d], + ", second=", [($e.mds / 1000) % 60, d], + ", millisecond=", [$e.mds % 1000, d] + ) + ) + children + ( + #( + [hour]: [$e.mds / 3600000, d], + [minute]: [($e.mds % 3600000) / 60000, d], + [second]: [($e.mds / 1000) % 60, d], + [millisecond]: [$e.mds % 1000, d] + ) + ) +} + +QVariant{ + preview + ( + #if ($e.d.type == 1) ( + #("bool = ", [$e.d.data.b]) + ) #elif ($e.d.type == 2) ( + #("int = ", [$e.d.data.i]) + ) #elif ($e.d.type == 3) ( + #("usigned int = ", [$e.d.data.u]) + ) #elif ($e.d.type == 4) ( + #("long long = ", [$e.d.data.ll]) + ) #elif ($e.d.type == 5) ( + #("unsigned long long = ", [$e.d.data.ull]) + ) #elif ($e.d.type == 6) ( + #("double = ", [$e.d.data.d]) + ) #elif ($e.d.type == 7) ( + #("char = ", [$e.d.data.c]) + ) #elif ($e.d.type == 8) ( + #("QMap = ", [(QMap) $e.d.data.ptr]) + ) #elif ($e.d.type == 10) ( + #("QString = ", [(QString) $e.d.data.ptr]) + ) #elif ($e.d.type == 11) ( + #("QStringList = ", [(QStringList) $e.d.data.ptr]) + ) #elif ($e.d.type == 17) ( + #("QUrl = ", [(QUrl) $e.d.data.ptr]) + ) #else ( + #("type = ", [$e.d.type]) + ) + ) + children + ( + #if ($e.d.type == 1) ( + $c.d.data.b + ) #elif ($e.d.type == 2) ( + $c.d.data.i + ) #elif ($e.d.type == 3) ( + $c.d.data.u + ) #elif ($e.d.type == 4) ( + $c.d.data.ll + ) #elif ($e.d.type == 5) ( + $c.d.data.ull + ) #elif ($e.d.type == 6) ( + $c.d.data.d + ) #elif ($e.d.type == 7) ( + $c.d.data.c + ) #elif ($e.d.type == 8) ( + ) #elif ($e.d.type == 10) ( + #( + [size]: ((QString) $c.d.data.ptr).d->size + ) + ) #elif ($e.d.type == 11) ( + #if ((((QStringList) $e.d.data.ptr).d->end - ((QStringList) $e.d.data.ptr).d->begin) <= 10) ( + #array + ( + expr: (QString)((((QStringList) $e.d.data.ptr).d->array + ((QStringList) $e.d.data.ptr).d->begin)[$i]), + size: ((QStringList) $e.d.data.ptr).d->end-((QStringList) $e.d.data.ptr).d->begin + ) + ) #else ( + #array + ( + expr: (QString)((((QStringList) $e.d.data.ptr).d->array + ((QStringList) $e.d.data.ptr).d->begin)[$i]), + size: 10 + ) + ) + ) #elif ($e.d.type == 17) ( + #( + scheme: ((QUrl) $e.d.data.ptr).d->scheme, + host: ((QUrl) $e.d.data.ptr).d->host, + path: ((QUrl) $e.d.data.ptr).d->path, + username: ((QUrl) $e.d.data.ptr).d->userName, + password: ((QUrl) $e.d.data.ptr).d->password, + encodedOriginal: ((QUrl) $e.d.data.ptr).d->encodedOriginal, + query: ((QUrl) $e.d.data.ptr).d->query, + fragment: ((QUrl) $e.d.data.ptr).d->fragment + ) + ) #else ( + #("type = ", [$e.d.type]) + ) + ) +} + +*::QVariant{ + preview + ( + #if ($e.d.type == 1) ( + #("bool = ", [$e.d.data.b]) + ) #elif ($e.d.type == 2) ( + #("int = ", [$e.d.data.i]) + ) #elif ($e.d.type == 3) ( + #("usigned int = ", [$e.d.data.u]) + ) #elif ($e.d.type == 4) ( + #("long long = ", [$e.d.data.ll]) + ) #elif ($e.d.type == 5) ( + #("unsigned long long = ", [$e.d.data.ull]) + ) #elif ($e.d.type == 6) ( + #("double = ", [$e.d.data.d]) + ) #elif ($e.d.type == 7) ( + #("char = ", [$e.d.data.c]) + ) #elif ($e.d.type == 8) ( + #("QMap = ", [($T1::QMap) $e.d.data.ptr]) + ) #elif ($e.d.type == 10) ( + #("QString = ", [($T1::QString) $e.d.data.ptr]) + ) #elif ($e.d.type == 11) ( + #("QStringList = ", [($T1::QStringList) $e.d.data.ptr]) + ) #elif ($e.d.type == 17) ( + #("QUrl = ", [($T1::QUrl) $e.d.data.ptr]) + ) #else ( + #("type = ", [$e.d.type]) + ) + ) + children + ( + #if ($e.d.type == 1) ( + $c.d.data.b + ) #elif ($e.d.type == 2) ( + $c.d.data.i + ) #elif ($e.d.type == 3) ( + $c.d.data.u + ) #elif ($e.d.type == 4) ( + $c.d.data.ll + ) #elif ($e.d.type == 5) ( + $c.d.data.ull + ) #elif ($e.d.type == 6) ( + $c.d.data.d + ) #elif ($e.d.type == 7) ( + $c.d.data.c + ) #elif ($e.d.type == 8) ( + ) #elif ($e.d.type == 10) ( + #( + [size]: (($T1::QString) $c.d.data.ptr).d->size + ) + ) #elif ($e.d.type == 11) ( + #if (((($T1::QStringList) $e.d.data.ptr).d->end - (($T1::QStringList) $e.d.data.ptr).d->begin) <= 10) ( + #array + ( + expr: ($T1::QString)(((($T1::QStringList) $e.d.data.ptr).d->array + (($T1::QStringList) $e.d.data.ptr).d->begin)[$i]), + size: (($T1::QStringList) $e.d.data.ptr).d->end-(($T1::QStringList) $e.d.data.ptr).d->begin + ) + ) #else ( + #array + ( + expr: ($T1::QString)(((($T1::QStringList) $e.d.data.ptr).d->array + (($T1::QStringList) $e.d.data.ptr).d->begin)[$i]), + size: 10 + ) + ) + ) #elif ($e.d.type == 17) ( + #( + scheme: (($T1::QUrl) $e.d.data.ptr).d->scheme, + host: (($T1::QUrl) $e.d.data.ptr).d->host, + path: (($T1::QUrl) $e.d.data.ptr).d->path, + username: (($T1::QUrl) $e.d.data.ptr).d->userName, + password: (($T1::QUrl) $e.d.data.ptr).d->password, + encodedOriginal: (($T1::QUrl) $e.d.data.ptr).d->encodedOriginal, + query: (($T1::QUrl) $e.d.data.ptr).d->query, + fragment: (($T1::QUrl) $e.d.data.ptr).d->fragment + ) + ) #else ( + #("type = ", [$e.d.type]) + ) + ) +} + +;------------------------------------------------------------------------------ +; QStringList +;------------------------------------------------------------------------------ +QStringList{ + preview + ( + #if (($c.d->end - $c.d->begin) <= 10) ( + #( + "[", $c.d->end - $c.d->begin, "](", + #array + ( + expr: (QString)(($c.d->array + $c.d->begin)[$i]), + size: $c.d->end-$c.d->begin + ), ")" + ) + ) #else ( + #( + "[", $c.d->end - $c.d->begin, "](", + #array + ( + expr: (QString)(($c.d->array + $c.d->begin)[$i]), + size: 10 + ), ", ...)" + ) + ) + ) +} + +*::QStringList{ + preview + ( + #if (($c.d->end - $c.d->begin) <= 10) ( + #( + "[", $c.d->end - $c.d->begin, "](", + #array + ( + expr: ($T1::QString)(($c.d->array + $c.d->begin)[$i]), + size: $c.d->end-$c.d->begin + ), ")" + ) + ) #else ( + #( + "[", $c.d->end - $c.d->begin, "](", + #array + ( + expr: ($T1::QString)(($c.d->array + $c.d->begin)[$i]), + size: 10 + ), ", ...)" + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; QList, QQueue +;------------------------------------------------------------------------------ +QList<*>|QQueue<*>{ + preview + ( + #if (int(sizeof($T1)) <= int(sizeof(void*))) ( + #if (($c.d->end - $c.d->begin) <= 10) ( + #( + "[", $c.d->end - $c.d->begin, "](", + #array + ( + expr: ($T1)(($c.d->array + $c.d->begin)[$i]), + size: $c.d->end-$c.d->begin + ), ")" + ) + ) #else ( + #( + "[", $c.d->end - $c.d->begin, "](", + #array + ( + expr: ($T1)(($c.d->array + $c.d->begin)[$i]), + size: 10 + ), ", ...)" + ) + ) + ) #else ( + #if (($c.d->end - $c.d->begin) <= 10) ( + #( + "[", $c.d->end - $c.d->begin, "](", + #array + ( + expr: *($T1*)(($c.d->array + $c.d->begin)[$i]), + size: $c.d->end-$c.d->begin + ), ")" + ) + ) #else ( + #( + "[", $c.d->end - $c.d->begin, "](", + #array + ( + expr: *($T1*)(($c.d->array + $c.d->begin)[$i]), + size: 10 + ), ", ...)" + ) + ) + ) + ) + children + ( + #if (int(sizeof($T1)) <= int(sizeof(void*))) ( + #array ( + expr: ($T1)(($c.d->array + $c.d->begin)[$i]), + size: $c.d->end - $c.d->begin + ) + ) #else ( + #array ( + expr: *($T1*)(($c.d->array + $c.d->begin)[$i]), + size: $c.d->end - $c.d->begin + ) + ) + ) +} + +*::QList<*>|*::QQueue<*>{ + preview + ( + #if (int(sizeof($T2)) <= int(sizeof(void*))) ( + #if (($c.d->end - $c.d->begin) <= 10) ( + #( + "[", $c.d->end - $c.d->begin, "](", + #array + ( + expr: ($T2)(($c.d->array + $c.d->begin)[$i]), + size: $c.d->end-$c.d->begin + ), ")" + ) + ) #else ( + #( + "[", $c.d->end - $c.d->begin, "](", + #array + ( + expr: ($T2)(($c.d->array + $c.d->begin)[$i]), + size: 10 + ), ", ...)" + ) + ) + ) #else ( + #if (($c.d->end - $c.d->begin) <= 10) ( + #( + "[", $c.d->end - $c.d->begin, "](", + #array + ( + expr: *($T2*)(($c.d->array + $c.d->begin)[$i]), + size: $c.d->end-$c.d->begin + ), ")" + ) + ) #else ( + #( + "[", $c.d->end - $c.d->begin, "](", + #array + ( + expr: *($T2*)(($c.d->array + $c.d->begin)[$i]), + size: 10 + ), ", ...)" + ) + ) + ) + ) + children + ( + #if (int(sizeof($T2)) <= int(sizeof(void*))) ( + #array ( + expr: ($T2)(($c.d->array + $c.d->begin)[$i]), + size: $c.d->end - $c.d->begin + ) + ) #else ( + #array ( + expr: *($T2*)(($c.d->array + $c.d->begin)[$i]), + size: $c.d->end - $c.d->begin + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; QList::iterator, QQueue::iterator +;------------------------------------------------------------------------------ +QList<*>::iterator|QList<*>::const_iterator|QQueue<*>::iterator|QQueue<*>::const_iterator{ + preview + ( + #( + ($T1*)$c.ptr + ) + ) + children + ( + #( + ptr: ($T1)$c.ptr + ) + ) +} + +*::QList<*>::iterator|*::QList<*>::const_iterator|*::QQueue<*>::iterator|*::QQueue<*>::const_iterator{ + preview + ( + #( + ($T2)$c.i->v + ) + ) + children + ( + #( + ptr: ($T2)$c.i->v + ) + ) +} + +;------------------------------------------------------------------------------ +; QListIterator +;------------------------------------------------------------------------------ +QListIterator<*>|QMutableListIterator<*>{ + preview + ( + #( + *($T1*)($c.i.i->v) + ) + ) + children + ( + #( + Value: *($T1*)($c.i.i->v) + ) + ) +} + +*::QListIterator<*>|*::QMutableListIterator<*>{ + preview + ( + #( + *($T2*)($c.i.i->v) + ) + ) + children + ( + #( + Value: *($T2*)($c.i.i->v) + ) + ) +} + +;------------------------------------------------------------------------------ +; QLinkedList +;------------------------------------------------------------------------------ +QLinkedList<*>{ + preview + ( + #if ($e.d->size >= 10) ( + #( + "[", $e.d->size, "](", + #list + ( + head: $c.d->n, + size: 10, + next: n + ) : ( (*(QLinkedListNode<$T1>*)&$e).t ), ", ...)" + ) + ) #else ( + #( + "[", $e.d->size, "](", + #list + ( + head: $c.d->n, + size: $c.d->size, + next: n + ) : ( (*(QLinkedListNode<$T1>*)&$e).t ), ")" + ) + ) + ) + children + ( + #( + #list + ( + head: $c.d->n, + size: $c.d->size, + next: n + ) : (*(QLinkedListNode<$T1>*)&$e).t + ) + ) +} + +*::QLinkedList<*>{ + preview + ( + #if ($e.d->size >= 10) ( + #( + "[", $e.d->size, "](", + #list + ( + head: $c.d->n, + size: 10, + next: n + ) : ( (*($T1::QLinkedListNode<$T2>*)&$e).t ), ", ...)" + ) + ) #else ( + #( + "[", $e.d->size, "](", + #list + ( + head: $c.d->n, + size: $c.d->size, + next: n + ) : ( (*($T1::QLinkedListNode<$T2>*)&$e).t ), ")" + ) + ) + ) + children + ( + #( + #list + ( + head: $c.d->n, + size: $c.d->size, + next: n + ) : (*($T1::QLinkedListNode<$T2>*)&$e).t + ) + ) +} + +;------------------------------------------------------------------------------ +; QLinkedList::iterator +;------------------------------------------------------------------------------ +QLinkedList<*>::iterator|*::QLinkedList<*>::iterator|QLinkedList<*>::const_iterator|*::QLinkedList<*>::const_iterator{ + preview + ( + #( + $e.i->t + ) + ) + children + ( + #( + ptr: $e.i->t + ) + ) +} + +QLinkedListIterator<*>|*::QLinkedListIterator<*>{ + preview + ( + #( + $c.i + ) + ) + children + ( + #( + value: $c.i + ) + ) +} + +;------------------------------------------------------------------------------ +; QVector, QStack +; +; By default, this visualizer supports only Qt 4.6.x. If you're going to use +; Qt 4.5.x code, then you may want to replace all expr lines with this: +; expr: (((size_t)($c.d) + (size_t)(sizeof(QVectorData)) ))[$i], +; +; This will allow this visualizer to display Qt 4.5.x and Qt 4.6.x QVector +; objects. But be aware of some limitations. For example enum types can't be +; displayed properly this way. +; +; Qt 4.5.x: +; QVector::d is QVectorTypedData +; QVector::p is QVectorData +; expr: $c.d->array[$i] +; +; Qt 4.6.x: +; QVector::d is QVectorData +; QVector::p is QVectorTypedData +; expr: $c.p->array[$i] +; +;------------------------------------------------------------------------------ +QVector<*>|*::QVector<*>|QStack<*>|*::QStack<*>{ + preview + ( + #if ($c.d->size <= 10) ( + #( + "[", $c.d->size, "](", + #array + ( + expr: $c.p->array[$i], + size: $c.d->size + ), ")" + ) + ) #else ( + #( + "[", $c.d->size, "](", + #array + ( + expr: $c.p->array[$i], + size: 10 + ), ", ...)" + ) + ) + ) + children + ( + #array + ( + expr: $c.p->array[$i], + size: $c.d->size + ) + ) +} + +;------------------------------------------------------------------------------ +; QMap +;------------------------------------------------------------------------------ +QMapNode<*,*>{ + preview + ( + #( + "(", + $e.key, + "; ", + $e.value, + ")" + ) + ) + + children + ( + #( + key: $e.key, + value: $e.value + ) + ) +} + +QMap<*>{ + children + ( + #( + raw data: [$c,!], + #tree + ( + head : $c.d->forward[0], + skip : $c.d, + size : $c.d->size, + left : backward, + right : forward + ) : ( (QMapNode<$T1>*)((char*)&$e - (sizeof(QMapPayloadNode<$T1>) - sizeof(QMapData::Node*))) ) + ) + ) + + preview + ( + #( + "[", + $e.d->size, + "](", + #tree + ( + head : $c.d->forward[0], + size : $c.d->size, + left : backward, + right : forward + ) : $e, + ")" + ) + ) +} + +;------------------------------------------------------------------------------ +; QHash +;------------------------------------------------------------------------------ +QHash<*>{ + preview + ( + #( + "[", $e.d->size, "] (...)" + ) + ) + children + ( + #( + #array ( + expr: (QHashNode<$T1>*)$c.d->buckets[$i], + size: $c.d->numBuckets + ) : #list ( + head: $e, + next: next + ) : #switch ($e.next != 0) #case 1 ( + $e + ) + ) + ) +} + +*::QHash<*>{ + preview + ( + #( + "[", $e.d->size, "] (...)" + ) + ) + children + ( + #( + #array ( + expr: ($T1::QHashNode<$T2> *)$c.d->buckets[$i], + size: $c.d->numBuckets + ) : #list ( + head: $e, + next: next + ) : #switch ($e.next != 0) #case 1 ( + $e + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; QMultiHash +;------------------------------------------------------------------------------ +QMultiHash<*>{ + preview + ( + (*(QHash<$T1>*)(&$c)) + ) +} + +*::QMultiHash<*>{ + preview + ( + (*($T1::QHash<$T2>*)(&$c)) + ) +} + +;------------------------------------------------------------------------------ +; QHash::iterator +;------------------------------------------------------------------------------ +QHash<*>::iterator{ + preview + ( + #( + "(", ((QHashNode<$T1>*)($c.i))->key, ", ", ((QHashNode<$T1>*)($c.i))->value, ")" + ) + ) + children + ( + #( + key: ((QHashNode<$T1>*)($c.i))->key, + value: ((QHashNode<$T1>*)($c.i))->value + ) + ) +} + +*::QHash<*>::iterator{ + preview + ( + #( + "(", (($T1::QHashNode<$T2>*)($c.i))->key, ", ", (($T1::QHashNode<$T2>*)($c.i))->key, ")" + ) + ) + children + ( + #( + key: (($T1::QHashNode<$T2>*)($c.i))->key, + value: (($T1::QHashNode<$T2>*)($c.i))->value + ) + ) +} + +;------------------------------------------------------------------------------ +; QHashIterator +;------------------------------------------------------------------------------ +QHashIterator<*>{ + preview + ( + #( + "(", ((QHashNode<$T1>*)((($c).i).i))->key, ", ", ((QHashNode<$T1>*)((($c).i).i))->key, ")" + ) + ) + children + ( + #( + key: ((QHashNode<$T1>*)((($c).i).i))->key, + value: ((QHashNode<$T1>*)((($c).i).i))->value + ) + ) +} + +*::QHashIterator<*>{ + preview + ( + #( + "(", (($T1::QHashNode<$T2>*)((($c).i).i))->key, ", ", (($T1::QHashNode<$T2>*)((($c).i).i))->key, ")" + ) + ) + children + ( + #( + key: (($T1::QHashNode<$T2>*)((($c).i).i))->key, + value: (($T1::QHashNode<$T2>*)((($c).i).i))->value + ) + ) +} + +;------------------------------------------------------------------------------ +; QHashNode +;------------------------------------------------------------------------------ +QHashNode<*>|*::QHashNode<*>{ + preview + ( + #( + "(key = ", $c.key,"; value = ", $c.value, ")" + ) + ) + children + ( + #( + key: $c.key, + value: $c.value + ) + ) +} + +;------------------------------------------------------------------------------ +; QSet +;------------------------------------------------------------------------------ +QSet<*>{ + preview + ( + #( + "[", $e.q_hash.d->size, "] (...)" + ) + ) + children + ( + #( + #array ( + expr: (QHashNode<$T1,QHashDummyValue> *)$c.q_hash.d->buckets[$i], + size: $c.q_hash.d->numBuckets + ) : #list ( + head: $e, + next: next + ) : #switch ($e.next != 0) #case 1 ( + $e.key + ) + ) + ) +} + +*::QSet<*>{ + preview + ( + #( + "[", $e.q_hash.d->size, "] (...)" + ) + ) + children + ( + #( + #array ( + expr: ($T1::QHashNode<$T2,QHashDummyValue> *)$c.q_hash.d->buckets[$i], + size: $c.q_hash.d->numBuckets + ) : #list ( + head: $e, + next: next + ) : #switch ($e.next != 0) #case 1 ( + $e.key + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; QPalette +;------------------------------------------------------------------------------ +QPalette{ + children + ( + #( + WindowText_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 0)->d, + Button_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 1)->d, + Light_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 2)->d, + Midlight_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 3)->d, + Dark_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 4)->d, + Mid_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 5)->d, + Text_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 6)->d, + BrightText_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 7)->d, + ButtonText_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 8)->d, + Base_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 9)->d, + Window_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+10)->d, + Shadow_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+11)->d, + Highlight_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+12)->d, + HighlightedText_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+13)->d, + Link_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+14)->d, + LinkVisited_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+15)->d, + AlternateBase_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+16)->d, + NoRole_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+17)->d, + ToolTipBase_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+18)->d, + ToolTipText_active: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+19)->d, + + WindowText_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 0)->d, + Button_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 1)->d, + Light_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 2)->d, + Midlight_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 3)->d, + Dark_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 4)->d, + Mid_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 5)->d, + Text_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 6)->d, + BrightText_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 7)->d, + ButtonText_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 8)->d, + Base_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 9)->d, + Window_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+10)->d, + Shadow_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+11)->d, + Highlight_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+12)->d, + HighlightedText_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+13)->d, + Link_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+14)->d, + LinkVisited_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+15)->d, + AlternateBase_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+16)->d, + NoRole_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+17)->d, + ToolTipBase_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+18)->d, + ToolTipText_disabled: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+19)->d, + + WindowText_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 0)->d, + Button_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 1)->d, + Light_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 2)->d, + Midlight_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 3)->d, + Dark_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 4)->d, + Mid_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 5)->d, + Text_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 6)->d, + BrightText_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 7)->d, + ButtonText_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 8)->d, + Base_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 9)->d, + Window_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+10)->d, + Shadow_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+11)->d, + Highlight_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+12)->d, + HighlightedText_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+13)->d, + Link_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+14)->d, + LinkVisited_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+15)->d, + AlternateBase_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+16)->d, + NoRole_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+17)->d, + ToolTipBase_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+18)->d, + ToolTipText_inactive: + ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+19)->d + ) + ) +} + +*::QPalette{ + children + ( + #( + WindowText_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 0)->d, + Button_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 1)->d, + Light_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 2)->d, + Midlight_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 3)->d, + Dark_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 4)->d, + Mid_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 5)->d, + Text_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 6)->d, + BrightText_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 7)->d, + ButtonText_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 8)->d, + Base_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 9)->d, + Window_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+10)->d, + Shadow_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+11)->d, + Highlight_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+12)->d, + HighlightedText_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+13)->d, + Link_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+14)->d, + LinkVisited_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+15)->d, + AlternateBase_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+16)->d, + NoRole_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+17)->d, + ToolTipBase_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+18)->d, + ToolTipText_active: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+19)->d, + + WindowText_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 0)->d, + Button_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 1)->d, + Light_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 2)->d, + Midlight_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 3)->d, + Dark_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 4)->d, + Mid_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 5)->d, + Text_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 6)->d, + BrightText_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 7)->d, + ButtonText_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 8)->d, + Base_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 9)->d, + Window_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+10)->d, + Shadow_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+11)->d, + Highlight_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+12)->d, + HighlightedText_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+13)->d, + Link_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+14)->d, + LinkVisited_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+15)->d, + AlternateBase_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+16)->d, + NoRole_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+17)->d, + ToolTipBase_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+18)->d, + ToolTipText_disabled: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+19)->d, + + WindowText_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 0)->d, + Button_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 1)->d, + Light_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 2)->d, + Midlight_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 3)->d, + Dark_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 4)->d, + Mid_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 5)->d, + Text_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 6)->d, + BrightText_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 7)->d, + ButtonText_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 8)->d, + Base_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 9)->d, + Window_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+10)->d, + Shadow_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+11)->d, + Highlight_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+12)->d, + HighlightedText_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+13)->d, + Link_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+14)->d, + LinkVisited_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+15)->d, + AlternateBase_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+16)->d, + NoRole_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+17)->d, + ToolTipBase_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+18)->d, + ToolTipText_inactive: + (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+19)->d + ) + ) +} + +;------------------------------------------------------------------------------ +; QBrush +;------------------------------------------------------------------------------ +QBrush|*::QBrush{ + preview + ( + #( + "[", $c.d->style, "] (...)" + ) + ) + children + ( + #( + style: $c.d->style, + color: $c.d->color, + transform: $c.d->transform + ) + ) +} + +QBrushData|*::QBrushData{ + preview + ( + #( + "[", $c.style, "] (...)" + ) + ) + children + ( + #( + style: $c.style, + color: $c.color, + transform: $c.transform + ) + ) +} + +;------------------------------------------------------------------------------ +; QColor +;------------------------------------------------------------------------------ +QColor|*::QColor{ + preview + ( + #( + #if ($c.cspec == 1) ( + #( + "[", $c.cspec, "] [", "r = ", [$c.ct.argb.red,x], + ", g = ", [$c.ct.argb.green,x], + ", b = ", [$c.ct.argb.blue,x], "] (...)" + ) + ) #elif ($c.cspec == 2) ( + #( + "[", $c.cspec, "] [", "h = ", [$c.ct.ahsv.hue,x], + ", s = ", [$c.ct.ahsv.saturation,x], + ", v = ", [$c.ct.ahsv.value,x], "] (...)" + ) + ) #elif ($c.cspec == 3) ( + #( + "[", $c.cspec, "] [", "c = ", [$c.ct.acmyk.cyan,x], + ", m = ", [$c.ct.acmyk.magenta,x], + ", y = ", [$c.ct.acmyk.yellow,x], + ", k = ", [$c.ct.acmyk.black,x], "] (...)" + ) + ) #else ( + #( + "[Invalid]" + ) + ) + ) + ) + children + ( + #( + #if ($c.cspec == 1) ( + #( + red: [$c.ct.argb.red,x], + green: [$c.ct.argb.green,x], + blue: [$c.ct.argb.blue,x], + alpha: [$c.ct.argb.alpha,x], + pad: [$c.ct.argb.pad,x] + ) + ) #elif ($c.cspec == 2) ( + #( + hue: [$c.ct.ahsv.hue,x], + saturation: [$c.ct.ahsv.saturation,x], + value: [$c.ct.ahsv.value,x], + alpha: [$c.ct.ahsv.alpha,x], + pad: [$c.ct.ahsv.pad,x] + ) + ) #elif ($c.cspec == 3) ( + #( + cyan: [$c.ct.acmyk.cyan,x], + magenta: [$c.ct.acmyk.magenta,x], + yellow: [$c.ct.acmyk.yellow,x], + black: [$c.ct.acmyk.black,x], + alpha: [$c.ct.acmyk.alpha,x] + ) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; QTransform +;------------------------------------------------------------------------------ +QTransform|*::QTransform{ + preview + ( + #( + "[",[$c.affine._m11,g]," ",[$c.affine._m12,g]," ",[$c.m_13,g],"]", + "[",[$c.affine._m21,g]," ",[$c.affine._m22,g]," ",[$c.m_23,g],"]", + "[",[$c.affine._dx,g]," ",[$c.affine._dy,g]," ",[$c.m_33,g],"]" + ) + ) + children + ( + #( + translation_horizontal_m31_dx: [$c.affine._dx,g], + translation_vertical_m32_dy: [$c.affine._dy,g], + scaling_horizontal_m11: [$c.affine._m11,g], + scaling_vertical_m22: [$c.affine._m22,g], + projection_factor_m33: [$c.m_33,g], + projection_horizontal_m13: [$c.m_13,g], + projection_vertical_m23: [$c.m_23,g], + shearing_horizontal_m21: [$c.affine._m21,g], + shearing_vertical_m12: [$c.affine._m12,g], + type: $c.m_type, + dirty: (bool)$c.m_dirty + ) + ) +} + +;------------------------------------------------------------------------------ +; QMatrix +;------------------------------------------------------------------------------ +QMatrix|*::QMatrix{ + preview + ( + #( + "[",[$c._m11,g]," ",[$c._m12,g],"]", + "[",[$c._m21,g]," ",[$c._m22,g],"]", + "[",[$c._dx,g]," ",[$c._dy,g],"]" + ) + ) + children + ( + #( + translation_horizontal_dx: [$c._dx,g], + translation_vertical_dy: [$c._dy,g], + scaling_horizontal_m11: [$c._m11,g], + scaling_vertical_m22: [$c._m22,g], + shearing_horizontal_m21: [$c._m21,g], + shearing_vertical_m12: [$c._m12,g] + ) + ) +} + +;------------------------------------------------------------------------------ +; QPolygon +;------------------------------------------------------------------------------ +QPolygon{ + preview + ( + #( + "[", ((QVector*)(&$c))->d->size, "] (...)" + ) + ) + children + ( + #( + #array + ( + expr: ((QVector*)(&$c))->d->array[$i], + size: ((QVector*)(&$c))->d->size + ) + ) + ) +} + +*::QPolygon{ + preview + ( + #( + "[", (($T1::QVector<$T1::QPoint>*)(&$c))->d->size, "] (...)" + ) + ) + children + ( + #( + #array + ( + expr: (($T1::QVector<$T1::QPoint>*)(&$c))->d->array[$i], + size: (($T1::QVector<$T1::QPoint>*)(&$c))->d->size + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; QPolygonF +;------------------------------------------------------------------------------ +QPolygonF{ + preview + ( + #( + "[", ((QVector*)(&$c))->d->size, "] (...)" + ) + ) + children + ( + #( + #array + ( + expr: ((QVector*)(&$c))->d->array[$i], + size: ((QVector*)(&$c))->d->size + ) + ) + ) +} + +*::QPolygonF{ + preview + ( + #( + "[", (($T1::QVector<$T1::QPointF>*)(&$c))->d->size, "] (...)" + ) + ) + children + ( + #( + #array + ( + expr: (($T1::QVector<$T1::QPointF>*)(&$c))->d->array[$i], + size: (($T1::QVector<$T1::QPointF>*)(&$c))->d->size + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Nokia Qt 4.x visualizers -------------------------------------------[ end ]-- + +; STLport visualizers +;------------------------------------------------------------------------------ +; stlport::basic_string +;------------------------------------------------------------------------------ +stlp_std::basic_string|stlpx_std::basic_string|stlpmtx_std::basic_string|stlpxmtx_std::basic_string|stlpd_std::priv::_NonDbg_str|stlpdx_std::priv::_NonDbg_str|stlpdmtx_std::priv::_NonDbg_str|stlpdxmtx_std::priv::_NonDbg_str{ + preview + ( + [$c._M_start_of_storage._M_data, s] + ) + + stringview + ( + [$c._M_start_of_storage._M_data, s] + ) + + children + ( + #( + [raw view]: [$c,!], + buffer: [(unsigned int)$c._M_start_of_storage._M_data, x], + length: $c._M_finish - $c._M_start_of_storage._M_data, + capacity: #if($c._M_start_of_storage._M_data == $c._M_buffers._M_static_buf) + ( + $c._DEFAULT_SIZE + ) + #else + ( + $c._M_buffers._M_end_of_storage - $c._M_start_of_storage._M_data + ), + #array + ( + expr: $c._M_start_of_storage._M_data[$i], + size: $c._M_finish - $c._M_start_of_storage._M_data + ) + ) + ) +} + +stlp_std::basic_string|stlp_std::basic_string|stlpx_std::basic_string|stlpx_std::basic_string|stlpmtx_std::basic_string|stlpmtx_std::basic_string|stlpxmtx_std::basic_string|stlpxmtx_std::basic_string|stlpd_std::priv::_NonDbg_str|stlpd_std::priv::_NonDbg_str|stlpdx_std::priv::_NonDbg_str|stlpdx_std::priv::_NonDbg_str|stlpdmtx_std::priv::_NonDbg_str|stlpdmtx_std::priv::_NonDbg_str|stlpdxmtx_std::priv::_NonDbg_str|stlpdxmtx_std::priv::_NonDbg_str{ + preview + ( + [$c._M_start_of_storage._M_data, su] + ) + + stringview + ( + [$c._M_start_of_storage._M_data, su] + ) + + children + ( + #( + [raw view]: [$c,!], + buffer: [(unsigned int)$c._M_start_of_storage._M_data, x], + length: $c._M_finish - $c._M_start_of_storage._M_data, + capacity: #if($c._M_start_of_storage._M_data == $c._M_buffers._M_static_buf) + ( + $c._DEFAULT_SIZE + ) + #else + ( + $c._M_buffers._M_end_of_storage - $c._M_start_of_storage._M_data + ), + #array + ( + expr: $c._M_start_of_storage._M_data[$i], + size: $c._M_finish - $c._M_start_of_storage._M_data + ) + ) + ) +} + +stlpd_std::basic_string<*>|stlpdx_std::basic_string<*>|stlpdmtx_std::basic_string<*>|stlpdxmtx_std::basic_string<*>{ + preview + ( + $c._M_non_dbg_impl + ) + + stringview + ( + $c._M_non_dbg_impl + ) + + children + ( + #( + [raw view]: [$c,!], + string: $c._M_non_dbg_impl + ) + ) +} + +;------------------------------------------------------------------------------ +; stlport::vector +;------------------------------------------------------------------------------ +stlp_std::vector|stlpx_std::vector|stlpmtx_std::vector|stlpxmtx_std::vector|stlpd_std::priv::_NonDbg_vector|stlpdx_std::priv::_NonDbg_vector|stlpdmtx_std::priv::_NonDbg_vector|stlpdxmtx_std::priv::_NonDbg_vector{ + preview + ( + #( + "[", + ($c._M_finish._M_p - $c._M_start._M_p) * sizeof(unsigned int) * 8 + $c._M_finish._M_offset, + "](", + #array + ( + expr : ($c._M_start._M_p[$i / (sizeof(unsigned int) * 8)] >> ($i % (sizeof(unsigned int) * 8))), + size : (($c._M_finish._M_p - $c._M_start._M_p) * sizeof(unsigned int) * 8 + $c._M_finish._M_offset) + ) : (bool)($e & 1), + ")" + ) + ) + children + ( + #( + [raw view]: [$c,!], + buffer : [(unsigned int)$c._M_start._M_p, x], + size : (($c._M_finish._M_p - $c._M_start._M_p) * sizeof(unsigned int) * 8 + $c._M_finish._M_offset), + #array + ( + expr : ($c._M_start._M_p[$i / (sizeof(unsigned int) * 8)] >> ($i % (sizeof(unsigned int) * 8))), + size : (($c._M_finish._M_p - $c._M_start._M_p) * sizeof(unsigned int) * 8 + $c._M_finish._M_offset) + ) : (bool)($e & 1) + ) + ) +} + +stlp_std::priv::_Bit_iter<*>|stlpx_std::priv::_Bit_iter<*>|stlpmtx_std::priv::_Bit_iter<*>|stlpxmtx_std::priv::_Bit_iter<*>|stlpd_std::priv::_Bit_iter<*>|stlpdx_std::priv::_Bit_iter<*>|stlpdmtx_std::priv::::_Bit_iter<*>|stlpdxmtx_std::priv::_Bit_iter<*>{ + preview + ( + #( + (bool) (((*$c._M_p) >> $c._M_offset) & 1) + ) + ) + children + ( + #( + [raw view]: [$c,!], + value : (bool) (((*$c._M_p) >> $c._M_offset) & 1) + ) + ) +} + +stlp_std::vector<*>|stlpx_std::vector<*>|stlpmtx_std::vector<*>|stlpxmtx_std::vector<*>|stlpd_std::priv::_NonDbg_vector<*>|stlpdx_std::priv::_NonDbg_vector<*>|stlpdmtx_std::priv::_NonDbg_vector<*>|stlpdxmtx_std::priv::_NonDbg_vector<*>{ + preview + ( + #( + "[", + $c._M_finish - $c._M_start, + "/", + $c._M_end_of_storage._M_data - $c._M_start, + "](", + #array + ( + expr : ($c._M_start)[$i], + size : $c._M_finish - $c._M_start + ), + ")" + ) + ) + children + ( + #( + [raw view]: [$c,!], + size : $c._M_finish - $c._M_start, + capacity : $c._M_end_of_storage._M_data - $c._M_start, + #array + ( + expr : ($c._M_start)[$i], + size : $c._M_finish - $c._M_start + ) + ) + ) +} + +stlpd_std::vector<*>|stlpdx_std::vector<*>|stlpdmtx_std::vector<*>|stlpdxmtx_std::vector<*>{ + preview + ( + $c._M_non_dbg_impl + ) + children + ( + #( + [raw view] : [$c,!], + vector : $c._M_non_dbg_impl + ) + ) +} + +;------------------------------------------------------------------------------ +; stlport::deque +;------------------------------------------------------------------------------ +stlp_std::deque<*,*>|stlpx_std::deque<*,*>|stlpmtx_std::deque<*,*>|stlpxmtx_std::deque<*,*>|stlpd_std::priv::_NonDbg_deque<*,*>|stlpdx_std::priv::_NonDbg_deque<*,*>|stlpdmtx_std::priv::_NonDbg_deque<*,*>|stlpdxmtx_std::priv::_NonDbg_deque<*,*>{ + preview + ( + #if (((unsigned int)($c._M_start._M_cur + 1) - ((unsigned int)$c._M_start._M_cur)) < _MAX_BYTES) + ( + #( + "[", + (($c._M_finish._M_node - $c._M_start._M_node + 1) * (_MAX_BYTES / sizeof($T1))) - ($c._M_start._M_cur - $c._M_start._M_first) - ($c._M_finish._M_last - $c._M_finish._M_cur), + "/", + ($c._M_finish._M_node - $c._M_start._M_node + 1) * (_MAX_BYTES / sizeof($T1)) - 1, + "](", + #array + ( + expr : *(*($c._M_start._M_node + (($i + ($c._M_start._M_cur - $c._M_start._M_first)) / (_MAX_BYTES / sizeof($T1)))) + (($i + ($c._M_start._M_cur - $c._M_start._M_first)) % (_MAX_BYTES / sizeof($T1)))), + size : (($c._M_finish._M_node - $c._M_start._M_node + 1) * (_MAX_BYTES / sizeof($T1))) - ($c._M_start._M_cur - $c._M_start._M_first) - ($c._M_finish._M_last - $c._M_finish._M_cur) + ), + ")" + ) + ) + #else + ( + #( + "[", + $c._M_finish._M_node - $c._M_start._M_node, + "/", + $c._M_finish._M_node - $c._M_start._M_node, + "](", + #array + ( + expr : **($c._M_start._M_node + $i), + size : $c._M_finish._M_node - $c._M_start._M_node + ), + ")" + ) + ) + ) + children + ( + #if (((unsigned int)($c._M_start._M_cur + 1) - ((unsigned int)$c._M_start._M_cur)) < _MAX_BYTES) + ( + #( + [raw view]: [$c,!], + size : (($c._M_finish._M_node - $c._M_start._M_node + 1) * (_MAX_BYTES / sizeof($T1))) - ($c._M_start._M_cur - $c._M_start._M_first) - ($c._M_finish._M_last - $c._M_finish._M_cur), + capacity : ($c._M_finish._M_node - $c._M_start._M_node + 1) * (_MAX_BYTES / sizeof($T1)) - 1, + front free space : $c._M_start._M_cur - $c._M_start._M_first, + back free space : $c._M_finish._M_last - $c._M_finish._M_cur - 1, + #array + ( + expr : *(*($c._M_start._M_node + (($i + ($c._M_start._M_cur - $c._M_start._M_first)) / (_MAX_BYTES / sizeof($T1)))) + (($i + ($c._M_start._M_cur - $c._M_start._M_first)) % (_MAX_BYTES / sizeof($T1)))), + size : (($c._M_finish._M_node - $c._M_start._M_node + 1) * (_MAX_BYTES / sizeof($T1))) - ($c._M_start._M_cur - $c._M_start._M_first) - ($c._M_finish._M_last - $c._M_finish._M_cur) + ) + ) + ) + #else + ( + #( + [raw view] : [$c,!], + size : $c._M_finish._M_node - $c._M_start._M_node, + capacity : $c._M_finish._M_node - $c._M_start._M_node, + front free space : $c._M_start._M_cur - $c._M_start._M_first, + back free space : $c._M_finish._M_last - $c._M_finish._M_cur - 1, + #array + ( + expr : **($c._M_start._M_node + $i), + size : $c._M_finish._M_node - $c._M_start._M_node + ) + ) + ) + ) +} + +stlp_std::priv::_Deque_iterator<*>|stlpx_std::priv::_Deque_iterator<*>|stlpmtx_std::priv::_Deque_iterator<*>|stlpxmtx_std::priv::_Deque_iterator<*>|stlpd_std::priv::_Deque_iterator<*>|stlpdx_std::priv::_Deque_iterator<*>|stlpdmtx_std::priv::_Deque_iterator<*>|stlpdxmtx_std::priv::_Deque_iterator<*>{ + preview + ( + *($c._M_cur) + ) + children + ( + #( + [raw view] : [$c, !], + ptr : [(unsigned int)($c._M_cur), x], + value : *($c._M_cur) + ) + ) +} + +stlpd_std::deque<*>|stlpdx_std::deque<*>|stlpdmtx_std::deque<*>|stlpdxmtx_std::deque<*>{ + preview + ( + $c._M_non_dbg_impl + ) + children + ( + #( + [raw view] : [$c,!], + deque : $c._M_non_dbg_impl + ) + ) +} + +;------------------------------------------------------------------------------ +; stlport::list +;------------------------------------------------------------------------------ +stlp_std::list<*,*>|stlpx_std::list<*,*>|stlpmtx_std::list<*,*>|stlpxmtx_std::list<*,*>|stlpd_std::priv::_NonDbg_list<*,*>|stlpdx_std::priv::_NonDbg_list<*,*>|stlpdmtx_std::priv::_NonDbg_list<*,*>|stlpdxmtx_std::priv::_NonDbg_list<*,*>{ + preview + ( + #( + "(", + #list + ( + head : $c._M_node._M_data._M_next, + skip : &($c._M_node._M_data), + next : _M_next, + ): #( *($T1*)(&($e) + 1)), + ")" + ) + ) + children + ( + #( + [raw view]: [$c,!], + #list + ( + head : $c._M_node._M_data._M_next, + skip : &($c._M_node._M_data), + next : _M_next, + ): #( *($T1*)(&($e) + 1)) + ) + ) +} + +stlp_std::priv::_List_iterator<*,*>|stlpx_std::priv::_List_iterator<*,*>|stlpmtx_std::priv::_List_iterator<*,*>|stlpxmtx_std::priv::_List_iterator<*,*>|stlpd_std::priv::_List_iterator<*,*>|stlpdx_std::priv::_List_iterator<*,*>|stlpdmtx_std::priv::_List_iterator<*,*>|stlpdxmtx_std::priv::_List_iterator<*,*>{ + preview + ( + #(*($T1 *)($c._M_node + 1)) + ) + children + ( + #( + [raw view] : [$c, !], + ptr : [(unsigned int)($c._M_node + 1), x], + value : *($T1 *)($c._M_node + 1) + ) + ) +} + +stlpd_std::list<*,*>|stlpdx_std::list<*,*>|stlpdmtx_std::list<*,*>|stlpdxmtx_std::list<*,*>{ + preview + ( + $c._M_non_dbg_impl + ) + children + ( + #( + [raw view] : [$c,!], + list : $c._M_non_dbg_impl + ) + ) +} + +;------------------------------------------------------------------------------ +; stlport::slist +;------------------------------------------------------------------------------ +stlp_std::slist<*,*>|stlpx_std::slist<*,*>|stlpmtx_std::slist<*,*>|stlpxmtx_std::slist<*,*>|stlpd_std::priv::_NonDbg_slist<*,*>|stlpdx_std::priv::_NonDbg_slist<*,*>|stlpdmtx_std::priv::_NonDbg_slist<*,*>|stlpdxmtx_std::priv::_NonDbg_slist<*,*>{ + preview + ( + #( + "(", + #list + ( + head : $c._M_head._M_data._M_next, + skip : &($c._M_head._M_data), + next : _M_next, + ): #( *($T1*)(&($e) + 1)), + ")" + ) + ) + children + ( + #( + [raw view]: [$c,!], + #list + ( + head : $c._M_head._M_data._M_next, + skip : &($c._M_head._M_data), + next : _M_next, + ): #( *($T1*)(&($e) + 1)) + ) + ) +} + +stlp_std::priv::_Slist_iterator<*,*>|stlpx_std::priv::_Slist_iterator<*,*>|stlpmtx_std::priv::_Slist_iterator<*,*>|stlpxmtx_std::priv::_Slist_iterator<*,*>|stlpd_std::priv::_Slist_iterator<*,*>|stlpdx_std::priv::_Slist_iterator<*,*>|stlpdmtx_std::priv::_Slist_iterator<*,*>|stlpdxmtx_std::priv::_Slist_iterator<*,*>{ + preview + ( + #(*($T1 *)($c._M_node + 1)) + ) + children + ( + #( + [raw view] : [$c,!], + ptr : [(unsigned int)($c._M_node + 1), x], + value : *($T1 *)($c._M_node + 1) + ) + ) +} + +stlpd_std::slist<*,*>|stlpdx_std::slist<*,*>|stlpdmtx_std::slist<*,*>|stlpdxmtx_std::slist<*,*>{ + preview + ( + $c._M_non_dbg_impl + ) + children + ( + #( + [raw view] : [$c,!], + [slist] : $c._M_non_dbg_impl + ) + ) +} + +;------------------------------------------------------------------------------ +; stlport::pair +;------------------------------------------------------------------------------ +stlp_std::pair<*,*>|stlpx_std::pair<*,*>|stlpmtx_std::pair<*,*>|stlpxmtx_std::pair<*,*>|stlpd_std::pair<*,*>|stlpdx_std::pair<*,*>|stlpdmtx_std::pair<*,*>|stlpdxmtx_std::pair<*,*>{ + preview + ( + #( + "(", + $c.first, + ", ", + $c.second, + ")" + ) + ) +} + +;------------------------------------------------------------------------------ +; stlport::map, stlport::multimap, stlport::set, stlport::multiset +;------------------------------------------------------------------------------ +stlp_std::map<*>|stlpx_std::map<*>|stlpmtx_std::map<*>|stlpxmtx_std::map<*>|stlp_std::multimap<*>|stlpx_std::multimap<*>|stlpmtx_std::multimap<*>|stlpxmtx_std::multimap<*>|stlp_std::set<*>|stlpx_std::set<*>|stlpmtx_std::set<*>|stlpxmtx_std::set<*>|stlp_std::multiset<*>|stlpx_std::multiset<*>|stlpmtx_std::multiset<*>|stlpxmtx_std::multiset<*>{ + preview + ( + #( + "[", + $c._M_t._M_node_count, + "](", + $c._M_t, + ")" + ) + ) + children + ( + #( + [raw view]: [$c,!], + size: [$c._M_t._M_node_count], + tree: $c._M_t + ) + ) +} + +stlpd_std::map<*>|stlpdx_std::map<*>|stlpdmtx_std::map<*>|stlpdxmtx_std::map<*>|stlpd_std::multimap<*>|stlpdx_std::multimap<*>|stlpdmtx_std::multimap<*>|stlpdxmtx_std::multimap<*>|stlpd_std::set<*>|stlpdx_std::set<*>|stlpdmtx_std::set<*>|stlpdxmtx_std::set<*>|stlpd_std::multiset<*>|stlpdx_std::multiset<*>|stlpdmtx_std::multiset<*>|stlpdxmtx_std::multiset<*>{ + preview + ( + #( + "[", + $c._M_t._M_non_dbg_impl._M_node_count, + "](", + $c._M_t._M_non_dbg_impl, + ")" + ) + ) + children + ( + #( + [raw view]: [$c,!], + size: $c._M_t._M_non_dbg_impl._M_node_count, + tree: $c._M_t._M_non_dbg_impl + ) + ) +} + +stlp_std::priv::_Rb_tree<*,*,*,*,*>|stlpx_std::priv::_Rb_tree<*,*,*,*,*>|stlpmtx_std::priv::_Rb_tree<*,*,*,*,*>|stlpxmtx_std::priv::_Rb_tree<*,*,*,*,*>|stlpd_std::priv::_NonDbg_Rb_tree<*,*,*,*,*>|stlpdx_std::priv::_NonDbg_Rb_tree<*,*,*,*,*>|stlpdmtx_std::priv::_NonDbg_Rb_tree<*,*,*,*,*>|stlpdxmtx_std::priv::_NonDbg_Rb_tree<*,*,*,*,*>{ + preview + ( + #tree + ( + head : $c._M_header._M_data._M_parent, + skip : &($c._M_header._M_data), + size : $c._M_node_count, + left : _M_left, + right : _M_right + ): #(*($T3 *)(&($e) + 1)) + ) + children + ( + #( + [raw view]: [$c,!], + #tree + ( + head : $c._M_header._M_data._M_parent, + skip : &($c._M_header._M_data), + size : $c._M_node_count, + left : _M_left, + right : _M_right + ) : #(*($T3 *)(&($e) + 1)) + ) + ) +} + +stlp_std::priv::_Rb_tree_iterator<*,*>|stlpx_std::priv::_Rb_tree_iterator<*,*>|stlpmtx_std::priv::_Rb_tree_iterator<*,*>|stlpxmtx_std::priv::_Rb_tree_iterator<*,*>|stlpd_std::priv::_Rb_tree_iterator<*,*>|stlpdx_std::priv::_Rb_tree_iterator<*,*>|stlpdmtx_std::priv::_Rb_tree_iterator<*,*>|stlpdxmtx_std::priv::_Rb_tree_iterator<*,*>{ + preview + ( + [*($T1*)($c._M_node + 1)] + ) + children + ( + #( + [raw view]: [$c,!], + value: [*($T1*)($c._M_node + 1)], + ptr: [(unsigned int)($c._M_node + 1), x] + ) + ) +} + +;------------------------------------------------------------------------------ +; stlport::hash_map, stlport::hash_multimap, stlport::hash_set, stlport::hash_multiset +; stlport::unordered_map, stlport::unordered_multimap, stlport::unordered_set, stlport::unordered_multiset +;------------------------------------------------------------------------------ +stlp_std::hash_map<*>|stlpx_std::hash_map<*>|stlpmtx_std::hash_map<*>|stlpxmtx_std::hash_map<*>|stlp_std::hash_multimap<*>|stlpx_std::hash_multimap<*>|stlpmtx_std::hash_multimap<*>|stlpxmtx_std::hash_multimap<*>|stlp_std::hash_set<*>|stlpx_std::hash_set<*>|stlpmtx_std::hash_set<*>|stlpxmtx_std::hash_set<*>|stlp_std::hash_multiset<*>|stlpx_std::hash_multiset<*>|stlpmtx_std::hash_multiset<*>|stlpxmtx_std::hash_multiset<*>|stlp_std::tr1::unordered_map<*>|stlpx_std::tr1::unordered_map<*>|stlpmtx_std::tr1::unordered_map<*>|stlpxmtx_std::tr1::unordered_map<*>|stlp_std::tr1::unordered_multimap<*>|stlpx_std::tr1::unordered_multimap<*>|stlpmtx_std::tr1::unordered_multimap<*>|stlpxmtx_std::tr1::unordered_multimap<*>|stlp_std::tr1::unordered_set<*>|stlpx_std::tr1::unordered_set<*>|stlpmtx_std::tr1::unordered_set<*>|stlpxmtx_std::tr1::unordered_set<*>|stlp_std::tr1::unordered_multiset<*>|stlpx_std::tr1::unordered_multiset<*>|stlpmtx_std::tr1::unordered_multiset<*>|stlpxmtx_std::tr1::unordered_multiset<*>{ + preview + ( + #( + "[", + $c._M_ht._M_num_elements, + "]", + $c._M_ht + ) + ) + children + ( + #( + [raw view]: [$c,!], + hashtable: $c._M_ht + ) + ) +} + +stlpd_std::hash_map<*>|stlpdx_std::hash_map<*>|stlpdmtx_std::hash_map<*>|stlpdxmtx_std::hash_map<*>|stlpd_std::hash_multimap<*>|stlpdx_std::hash_multimap<*>|stlpdmtx_std::hash_multimap<*>|stlpdxmtx_std::hash_multimap<*>|stlpd_std::hash_set<*>|stlpdx_std::hash_set<*>|stlpdmtx_std::hash_set<*>|stlpdxmtx_std::hash_set<*>|stlpd_std::hash_multiset<*>|stlpdx_std::hash_multiset<*>|stlpdmtx_std::hash_multiset<*>|stlpdxmtx_std::hash_multiset<*>|stlpd_std::tr1::unordered_map<*>|stlpdx_std::tr1::unordered_map<*>|stlpdmtx_std::tr1::unordered_map<*>|stlpdxmtx_std::tr1::unordered_map<*>|stlpd_std::tr1::unordered_multimap<*>|stlpdx_std::tr1::unordered_multimap<*>|stlpdmtx_std::tr1::unordered_multimap<*>|stlpdxmtx_std::tr1::unordered_multimap<*>|stlpd_std::tr1::unordered_set<*>|stlpdx_std::tr1::unordered_set<*>|stlpdmtx_std::tr1::unordered_set<*>|stlpdxmtx_std::tr1::unordered_set<*>|stlpd_std::tr1::unordered_multiset<*>|stlpdx_std::tr1::unordered_multiset<*>|stlpdmtx_std::tr1::unordered_multiset<*>|stlpdxmtx_std::tr1::unordered_multiset<*>{ + preview + ( + #( + "[", + $c._M_ht._M_non_dbg_impl._M_num_elements, + "]", + $c._M_ht._M_non_dbg_impl + ) + ) + children + ( + #( + [raw view]: [$c,!], + hashtable: $c._M_ht._M_non_dbg_impl + ) + ) +} + +stlp_std::hashtable<*,*>|stlpx_std::hashtable<*,*>|stlpmtx_std::hashtable<*,*>|stlpxmtx_std::hashtable<*,*>|stlpd_std::priv::_NonDbg_hashtable<*,*>|stlpdx_std::priv::_NonDbg_hashtable<*,*>|stlpdmtx_std::priv::_NonDbg_hashtable<*,*>|stlpdxmtx_std::priv::_NonDbg_hashtable<*,*>{ + preview + ( + $c._M_elems + ) + children + ( + #( + [raw view]: [$c,!], + size : $c._M_num_elements, + load factor : (float)$c._M_num_elements / ($c._M_buckets._M_finish - $c._M_buckets._M_start), + max load factor: $c._M_max_load_factor, + buckets : $c._M_buckets, + elements : $c._M_elems + ) + ) +} + +;------------------------------------------------------------------------------ +; stlport::queue, stlport::priority_queue, stlport::stack +;------------------------------------------------------------------------------ +stlp_std::queue<*>|stlpx_std::queue<*>|stlpmtx_std::queue<*>|stlpxmtx_std::queue<*>|stlpd_std::queue<*>|stlpdx_std::queue<*>|stlpdmtx_std::queue<*>|stlpdxmtx_std::queue<*>|stlp_std::priority_queue<*>|stlpx_std::priority_queue<*>|stlpmtx_std::priority_queue<*>|stlpxmtx_std::priority_queue<*>|stlpd_std::priority_queue<*>|stlpdx_std::priority_queue<*>|stlpdmtx_std::priority_queue<*>|stlpdxmtx_std::priority_queue<*>|stlp_std::stack<*>|stlpx_std::stack<*>|stlpmtx_std::stack<*>|stlpxmtx_std::stack<*>|stlpd_std::stack<*>|stlpdx_std::stack<*>|stlpdmtx_std::stack<*>|stlpdxmtx_std::stack<*>{ + preview + ( + $c.c + ) + children + ( + #( + [raw view] : [$c,!], + container : $c.c + ) + ) +} + +;------------------------------------------------------------------------------ +; stlport debug iterator +;------------------------------------------------------------------------------ +stlp_std::priv::_DBG_iter<*>|stlpx_std::priv::_DBG_iter<*>|stlpmtx_std::priv::_DBG_iter<*>|stlpxmtx_std::priv::_DBG_iter<*>|stlpd_std::priv::_DBG_iter<*>|stlpdx_std::priv::_DBG_iter<*>|stlpdmtx_std::priv::_DBG_iter<*>|stlpdxmtx_std::priv::_DBG_iter<*>{ + preview + ( + #if($c._M_owner != 0) + ( + $c._M_iterator + ) + #else + ( + "undefined" + ) + ) + children + ( + #( + #if($c._M_owner != 0) + ( + #( + [raw view] : [$c,!], + [iterator] : $c._M_iterator, + [valid] : [true] + ) + ) + #else + ( + #( + [raw view] : [$c,!], + [valid] : [false] + ) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; stlport::bitset +; TODO: Fix it, it doesn't work as expected even when adding an enum to the bitset +; class to get access to the bitset static size rather than using $T1. +;------------------------------------------------------------------------------ +stdp_std::bitset<*,*>|stdpx_std::bitset<*,*>|stdpmtx_std::bitset<*,*>|stdpxmtx_std::bitset<*,*>|stdpd_std::bitset<*>|stdpdx_std::bitset<*>|stdpdmtx_std::bitset<*>|stdpdxmtx_std::bitset<*>{ + preview + ( + #( + "[", + $T1, + "](", + #array + ( + expr : ($c._M_w[$i / (sizeof(unsigned long) * 8)] >> ($i % (sizeof(unsigned long) * 8))), + size : $T1 + ) : [($e & 1),d], + ")" + ) + ) + children + ( + #array + ( + expr : ($c._M_w[$i / (sizeof(unsigned long) * 8)] >> ($i % (sizeof(unsigned long) * 8))), + size : $T1 + ) : (bool)($e & 1) + ) +} + +stdp_std::bitset<*>::reference|stdpx_std::bitset<*>::reference|stdpmtx_std::bitset<*>::reference|stdpxmtx_std::bitset<*>::reference|stdpd_std::bitset<*>::reference|stdpdx_std::bitset<*>::reference|stdpdmtx_std::bitset<*>::reference|stdpdxmtx_std::bitset<*>{ + preview + ( + #( + "bitset[", $c._M_bpos, "] = ", + (bool)(*($c._M_wp) >> $c._M_bpos) & 1) + ) + ) +} + +;------------------------------------------------------------------------------ +; stlport::auto_ptr +;------------------------------------------------------------------------------ +stlp_std::auto_ptr<*>|stlpx_std::auto_ptr<*>|stlpmtx_std::auto_ptr<*>|stlpxmtx_std::auto_ptr<*>|stlpd_std::auto_ptr<*>|stlpdx_std::auto_ptr<*>|stlpdmtx_std::auto_ptr<*>|stlpdxmtx_std::auto_ptr<*>{ + preview + ( + #if(($c._M_p) != 0) + ( + [*($T1 *)$c._M_p] + ) + #else + ( + "null" + ) + ) + children + ( + #if(($c._M_p) != 0) + ( + #( + [raw view]: [$c,!], + ptr: [(unsigned int)$c._M_p, x], + value: [*($T1 *)$c._M_p] + ) + ) + #else + ( + #( + [raw view]: [$c,!] + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; stlport::complex +;------------------------------------------------------------------------------ +stlp_std::complex<*>|stlpx_std::complex<*>|stlpmtx_std::complex<*>|stlpxmtx_std::complex<*>|stlpd_std::complex<*>|stlpdx_std::complex<*>|stlpdmtx_std::complex<*>|stlpdxmtx_std::complex<*>{ + children + ( + #( + real: $e._M_re, + imaginary: $e._M_im + ) + ) + preview + ( + #if($e._M_im != 0) + ( + #if ($e._M_re != 0) + ( ; Real and Imaginary components + #if ($e._M_im >= 0) + ( + #($e._M_re,"+i*", $e._M_im) + ) + #else + ( + #($e._M_re,"-i*", -$e._M_im) + ) + ) + #else + ( ; Purely imaginary + #if ($e._M_im >= 0.0) + ( + #("i*", $e._M_im) + ) + #else + ( + #("-i*", -$e._M_im) + ) + ) + ) + #else + ( ; Purely real + $e._M_re + ) + ) +} + +;------------------------------------------------------------------------------ +; stlport::valarray +;------------------------------------------------------------------------------ + +stlp_std::valarray<*>|stlpx_std::valarray<*>|stlpmtx_std::valarray<*>|stlpxmtx_std::valarray<*>|stlpd_std::valarray<*>|stlpdx_std::valarray<*>|stlpdmtx_std::valarray<*>|stlpdxmtx_std::valarray<*>{ + preview + ( + #( + "[", + $c._M_size , + "](", + #array + ( + expr : ($c._M_first)[$i], + size : $c._M_size + ), + ")" + ) + ) + + children + ( + #array + ( + expr : ($c._M_first)[$i], + size : $c._M_size + ) + ) +} + +stlp_std::slice|stlpx_std::slice|stlpmtx_std::slice|stlpxmtx_std::slice|stlpd_std::slice|stlpdx_std::slice|stlpdmtx_std::slice|stlpdxmtx_std::slice{ + preview + ( + #( + "start = ", + $c._M_start, + ", size = ", + $c._M_length, + ", stride = ", + $c._M_stride + ) + ) + children + ( + #( + [raw view] : [$c,!], + start : $c._M_start, + size : $c._M_length, + stride : $c._M_stride + ) + ) +} + +stlp_std::gslice|stlpx_std::gslice|stlpmtx_std::gslice|stlpxmtx_std::gslice|stlpd_std::gslice|stlpdx_std::gslice|stlpdmtx_std::gslice|stlpdxmtx_std::gslice{ + preview + ( + #( + "start = ", + $c._M_start, + ", sizes = ", + $c._M_lengths, + ", strides = ", + $c._M_strides + ) + ) + children + ( + #( + [raw view] : [$c,!], + start : $c._M_start, + sizes : $c._M_lengths, + strides : $c._M_strides + ) + ) +} + +; This section lets you define your own errors for the HRESULT display. +; You need to list the error code in unsigned decimal, followed by the message. +; Changes will take effect the next time you redisplay the variable. + +[hresult] +;1234=my custom error code +