diff --git a/CMakeLists.txt b/CMakeLists.txt index a12126c2a..338a5e7e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,7 +177,6 @@ include_directories(${UUID_INCLUDE_DIR}) endif (WIN32) if (MSVC10) set(PLATFORM_INCLUDE_DIR "") - add_definitions(-DMYGUI_DONT_REPLACE_NULLPTR) endif() if (APPLE) @@ -187,6 +186,7 @@ endif (APPLE) # Dependencies find_package(OGRE REQUIRED) +find_package(MyGUI REQUIRED) find_package(Boost REQUIRED COMPONENTS system filesystem program_options thread) find_package(OIS REQUIRED) find_package(OpenAL REQUIRED) @@ -203,14 +203,14 @@ include_directories("." ${OGRE_INCLUDE_DIR} ${OGRE_INCLUDE_DIR}/Ogre ${OGRE_INCLUDE_DIR}/OGRE ${OGRE_PLUGIN_INCLUDE_DIRS} ${OIS_INCLUDE_DIRS} ${Boost_INCLUDE_DIR} ${PLATFORM_INCLUDE_DIR} - ${CMAKE_HOME_DIRECTORY}/extern/mygui_3.0.1/MyGUIEngine/include - ${CMAKE_HOME_DIRECTORY}/extern/mygui_3.0.1/OgrePlatform/include + ${MYGUI_INCLUDE_DIRS} + ${MYGUI_PLATFORM_INCLUDE_DIRS} ${OPENAL_INCLUDE_DIR} ${UUID_INCLUDE_DIR} ${LIBDIR} ) -link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR}) +link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR} ${MYGUI_LIB_DIR}) if(APPLE) # List used Ogre plugins @@ -222,13 +222,6 @@ endif(APPLE) add_subdirectory( extern/mygui_3.0.1 ) -# Make sure that certain libraries are used as static libraries -# This is in effect turns off __declspec (dllexport) for windows -# Each library will also need to be configured to build as a static lib - -# MyGUI: extern/mygui_3.0.0/ -add_definitions(-DMYGUI_STATIC) - # Specify build paths if (APPLE) diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 6d33298df..d6101c919 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -87,9 +87,9 @@ target_link_libraries(openmw ${OPENAL_LIBRARY} ${SOUND_INPUT_LIBRARY} ${BULLET_LIBRARIES} + ${MYGUI_LIBRARIES} + MyGUI.OgrePlatform #TODO MyGUI ogre platform is not added by the find script components - MyGUIEngine - MyGUIOgrePlatform ) if(APPLE) diff --git a/cmake/FindMyGUI.cmake b/cmake/FindMyGUI.cmake new file mode 100644 index 000000000..339f494dd --- /dev/null +++ b/cmake/FindMyGUI.cmake @@ -0,0 +1,125 @@ +# - Find MyGUI includes and library +# +# This module defines +# MYGUI_INCLUDE_DIRS +# MYGUI_LIBRARIES, the libraries to link against to use MYGUI. +# MYGUI_LIB_DIR, the location of the libraries +# MYGUI_FOUND, If false, do not try to use MYGUI +# +# Copyright © 2007, Matt Williams +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +CMAKE_POLICY(PUSH) +include(FindPkgMacros) + +# IF (MYGUI_LIBRARIES AND MYGUI_INCLUDE_DIRS) + # SET(MYGUI_FIND_QUIETLY TRUE) +# ENDIF (MYGUI_LIBRARIES AND MYGUI_INCLUDE_DIRS) + +IF (WIN32) #Windows + MESSAGE(STATUS "Looking for MyGUI") + SET(MYGUISDK $ENV{MYGUI_HOME}) + IF (MYGUISDK) + findpkg_begin ( "MYGUI" ) + MESSAGE(STATUS "Using MyGUI in OGRE SDK") + STRING(REGEX REPLACE "[\\]" "/" MYGUISDK "${MYGUISDK}" ) + + find_path ( MYGUI_INCLUDE_DIRS + MyGUI.h + "${MYGUISDK}/MyGUIEngine/include" + NO_DEFAULT_PATH ) + + find_path ( MYGUI_PLATFORM_INCLUDE_DIRS + MyGUI_OgrePlatform.h + "${MYGUISDK}/Platforms/Ogre/OgrePlatform/include" + NO_DEFAULT_PATH ) + + SET ( MYGUI_LIB_DIR ${MYGUISDK}/*/lib ) + + find_library ( MYGUI_LIBRARIES_REL NAMES + MyGUIEngine.lib + MyGUI.OgrePlatform.lib + HINTS + ${MYGUI_LIB_DIR} + PATH_SUFFIXES "" release relwithdebinfo minsizerel ) + + find_library ( MYGUI_LIBRARIES_DBG NAMES + MyGUIEngine_d.lib + MyGUI.OgrePlatform_d.lib + HINTS + ${MYGUI_LIB_DIR} + PATH_SUFFIXES "" debug ) + + find_library ( MYGUI_PLATFORM_LIBRARIES_REL NAMES + MyGUI.OgrePlatform.lib + HINTS + ${MYGUI_LIB_DIR} + PATH_SUFFIXES "" release relwithdebinfo minsizerel ) + + find_library ( MYGUI_PLATFORM_LIBRARIES_DBG NAMES + MyGUI.OgrePlatform_d.lib + HINTS + ${MYGUI_LIB_DIR} + PATH_SUFFIXES "" debug ) + + make_library_set ( MYGUI_LIBRARIES ) + make_library_set ( MYGUI_PLATFORM_LIBRARIES ) + + MESSAGE ("${MYGUI_LIBRARIES}") + MESSAGE ("${MYGUI_PLATFORM_LIBRARIES}") + + findpkg_finish ( "MYGUI" ) + + ENDIF (MYGUISDK) + IF (OGRESOURCE) + MESSAGE(STATUS "Using MyGUI in OGRE dependencies") + STRING(REGEX REPLACE "[\\]" "/" OGRESDK "${OGRESOURCE}" ) + SET(MYGUI_INCLUDE_DIRS ${OGRESOURCE}/OgreMain/include/MYGUI) + SET(MYGUI_LIB_DIR ${OGRESOURCE}/lib) + SET(MYGUI_LIBRARIES debug Debug/MyGUIEngine_d optimized Release/MyGUIEngine) + ENDIF (OGRESOURCE) +ELSE (WIN32) #Unix + CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR) + FIND_PACKAGE(PkgConfig) + PKG_SEARCH_MODULE(MYGUI MYGUI MyGUI) + IF (MYGUI_INCLUDE_DIRS) + SET(MYGUI_INCLUDE_DIRS ${MYGUI_INCLUDE_DIRS}) + SET(MYGUI_LIB_DIR ${MYGUI_LIBDIR}) + SET(MYGUI_LIBRARIES ${MYGUI_LIBRARIES} CACHE STRING "") + ELSE (MYGUI_INCLUDE_DIRS) + FIND_PATH(MYGUI_INCLUDE_DIRS MyGUI.h PATHS /usr/local/include /usr/include PATH_SUFFIXES MyGUI MYGUI) + FIND_LIBRARY(MYGUI_LIBRARIES mygui PATHS /usr/lib /usr/local/lib) + SET(MYGUI_LIB_DIR ${MYGUI_LIBRARIES}) + STRING(REGEX REPLACE "(.*)/.*" "\\1" MYGUI_LIB_DIR "${MYGUI_LIB_DIR}") + STRING(REGEX REPLACE ".*/" "" MYGUI_LIBRARIES "${MYGUI_LIBRARIES}") + ENDIF (MYGUI_INCLUDE_DIRS) +ENDIF (WIN32) + +#Do some preparation +SEPARATE_ARGUMENTS(MYGUI_INCLUDE_DIRS) +SEPARATE_ARGUMENTS(MYGUI_LIBRARIES) +SEPARATE_ARGUMENTS(MYGUI_PLATFORM_LIBRARIES) + +SET(MYGUI_INCLUDE_DIRS ${MYGUI_INCLUDE_DIRS} CACHE PATH "") +SET(MYGUI_LIBRARIES ${MYGUI_LIBRARIES} CACHE STRING "") +SET(MYGUI_LIBRARIES ${MYGUI_PLATFORM_LIBRARIES} CACHE STRING "") +SET(MYGUI_LIB_DIR ${MYGUI_LIB_DIR} CACHE PATH "") + +IF (MYGUI_INCLUDE_DIRS AND MYGUI_LIBRARIES) + SET(MYGUI_FOUND TRUE) +ENDIF (MYGUI_INCLUDE_DIRS AND MYGUI_LIBRARIES) + +IF (MYGUI_FOUND) + MARK_AS_ADVANCED(MYGUI_LIB_DIR) + IF (NOT MYGUI_FIND_QUIETLY) + MESSAGE(STATUS " libraries : ${MYGUI_LIBRARIES} from ${MYGUI_LIB_DIR}") + MESSAGE(STATUS " includes : ${MYGUI_INCLUDE_DIRS}") + ENDIF (NOT MYGUI_FIND_QUIETLY) +ELSE (MYGUI_FOUND) + IF (MYGUI_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find MYGUI") + ENDIF (MYGUI_FIND_REQUIRED) +ENDIF (MYGUI_FOUND) + +CMAKE_POLICY(POP) \ No newline at end of file diff --git a/extern/mygui_3.0.1/CMakeLists.txt b/extern/mygui_3.0.1/CMakeLists.txt index 2cbe8aabe..38f8abbba 100644 --- a/extern/mygui_3.0.1/CMakeLists.txt +++ b/extern/mygui_3.0.1/CMakeLists.txt @@ -1,25 +1,5 @@ # Minimal MyGUI build system for OpenMW -cmake_minimum_required(VERSION 2.6) -project(MYGUI) - -# Use Freetype -find_package(Freetype REQUIRED) -set(MYGUI_USE_FREETYPE TRUE) - -# Use Ogre -add_definitions("-DMYGUI_OGRE_PLATFORM") - -# Static linking -set(MYGUI_LIB_TYPE STATIC) -add_definitions(-DMYGUI_STATIC) - -# Setup MyGUIEngine project -add_subdirectory(MyGUIEngine) - -# Setup OgrePlatform -add_subdirectory(OgrePlatform) - # Copy resource files into the build directory set(SDIR ${CMAKE_CURRENT_SOURCE_DIR}/openmw_resources) set(DDIR ${OpenMW_BINARY_DIR}/resources/mygui) diff --git a/extern/mygui_3.0.1/MyGUIEngine/CMakeLists.txt b/extern/mygui_3.0.1/MyGUIEngine/CMakeLists.txt deleted file mode 100644 index 27362e027..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -set (PROJECT_NAME MyGUIEngine) - -project( ${PROJECT_NAME} ) - -include(${PROJECT_NAME}.list) - -include_directories(include) -if (MYGUI_USE_FREETYPE) - include_directories( - ${FREETYPE_INCLUDE_DIRS} - ) - add_definitions(-DMYGUI_USE_FREETYPE) -endif () - -add_definitions(-DMYGUI_BUILD) - -if (WIN32) - add_definitions(-DNOMINMAX) -endif () - -add_library(${PROJECT_NAME} ${MYGUI_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES}) -if (MYGUI_USE_FREETYPE) - target_link_libraries(${PROJECT_NAME} - ${FREETYPE_LIBRARIES} - ) -endif() - -# We don't need this lib in OS X. uuid functions is in libc here. -if (NOT APPLE) - target_link_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS} uuid) -endif(NOT APPLE) - -if (MINGW) - target_link_libraries(${PROJECT_NAME} libwinmm.a) -endif (MINGW) diff --git a/extern/mygui_3.0.1/MyGUIEngine/MyGUIEngine.list b/extern/mygui_3.0.1/MyGUIEngine/MyGUIEngine.list deleted file mode 100644 index 42fa44718..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/MyGUIEngine.list +++ /dev/null @@ -1,561 +0,0 @@ -set (HEADER_FILES - include/MyGUI_Allocator.h - include/MyGUI_CustomAllocator.h - include/MyGUI_DDItemInfo.h - include/MyGUI_IBItemInfo.h - include/MyGUI_MenuItemType.h - include/MyGUI_MessageStyle.h - include/MyGUI_WidgetToolTip.h - include/MyGUI_Button.h - include/MyGUI_Canvas.h - include/MyGUI_ComboBox.h - include/MyGUI_DDContainer.h - include/MyGUI_Edit.h - include/MyGUI_HScroll.h - include/MyGUI_ItemBox.h - include/MyGUI_List.h - include/MyGUI_ListBox.h - include/MyGUI_ListCtrl.h - include/MyGUI_MenuBar.h - include/MyGUI_MenuCtrl.h - include/MyGUI_MenuItem.h - include/MyGUI_Message.h - include/MyGUI_MultiList.h - include/MyGUI_PopupMenu.h - include/MyGUI_Progress.h - include/MyGUI_ScrollView.h - include/MyGUI_StaticImage.h - include/MyGUI_StaticText.h - include/MyGUI_Tab.h - include/MyGUI_TabItem.h - include/MyGUI_VScroll.h - include/MyGUI_Widget.h - include/MyGUI_Window.h - include/MyGUI_IWidgetFactory.h - include/MyGUI_Bitwise.h - include/MyGUI_CoordConverter.h - include/MyGUI_DataFileStream.h - include/MyGUI_DataStream.h - include/MyGUI_Delegate.h - include/MyGUI_DelegateImplement.h - include/MyGUI_DynLib.h - include/MyGUI_Enumerator.h - include/MyGUI_EventPair.h - include/MyGUI_Guid.h - include/MyGUI_RenderOut.h - include/MyGUI_TextChangeHistory.h - include/MyGUI_TextIterator.h - include/MyGUI_TextureUtility.h - include/MyGUI_TextView.h - include/MyGUI_Timer.h - include/MyGUI_UString.h - include/MyGUI_Utility.h - include/MyGUI_WidgetTranslate.h - include/MyGUI_XmlDocument.h - include/MyGUI_LogManager.h - include/MyGUI_LogStream.h - include/MyGUI.h - include/MyGUI_CastWidget.h - include/MyGUI_Common.h - include/MyGUI_Diagnostic.h - include/MyGUI_Exception.h - include/MyGUI_GenericFactory.h - include/MyGUI_Macros.h - include/MyGUI_Platform.h - include/MyGUI_Precompiled.h - include/MyGUI_Prerequest.h - include/MyGUI_RenderFormat.h - include/MyGUI_ResourceHolder.h - include/MyGUI_WidgetDefines.h - include/MyGUI_ICroppedRectangle.h - include/MyGUI_IDataStream.h - include/MyGUI_Instance.h - include/MyGUI_IObject.h - include/MyGUI_ISerializable.h - include/MyGUI_ITexture.h - include/MyGUI_IUnlinkWidget.h - include/MyGUI_IVertexBuffer.h - include/MyGUI_IWidgetCreator.h - include/MyGUI_Plugin.h - include/MyGUI_RTTI.h - include/MyGUI_BiIndexBase.h - include/MyGUI_ScrollViewBase.h - include/MyGUI_WidgetEvent.h - include/MyGUI_WidgetUserData.h - include/MyGUI_EditText.h - include/MyGUI_MainSkin.h - include/MyGUI_RawRect.h - include/MyGUI_RotatingSkin.h - include/MyGUI_SimpleText.h - include/MyGUI_SubSkin.h - include/MyGUI_TileRect.h - include/MyGUI_IStateInfo.h - include/MyGUI_ISubWidget.h - include/MyGUI_ISubWidgetRect.h - include/MyGUI_ISubWidgetText.h - include/MyGUI_LayerItem.h - include/MyGUI_LayerNode.h - include/MyGUI_OverlappedLayer.h - include/MyGUI_RenderItem.h - include/MyGUI_SharedLayer.h - include/MyGUI_SharedLayerNode.h - include/MyGUI_ILayer.h - include/MyGUI_ILayerItem.h - include/MyGUI_ILayerNode.h - include/MyGUI_IRenderTarget.h - include/MyGUI_ActionController.h - include/MyGUI_ControllerEdgeHide.h - include/MyGUI_ControllerFadeAlpha.h - include/MyGUI_ControllerItem.h - include/MyGUI_ControllerPosition.h - include/MyGUI_ResourceImageSet.h - include/MyGUI_ResourceImageSetPointer.h - include/MyGUI_ResourceManualFont.h - include/MyGUI_ResourceManualPointer.h - include/MyGUI_ResourceSkin.h - include/MyGUI_ResourceTrueTypeFont.h - include/MyGUI_IFont.h - include/MyGUI_IPointer.h - include/MyGUI_IResource.h - include/MyGUI_ChildSkinInfo.h - include/MyGUI_FontData.h - include/MyGUI_MaskPickInfo.h - include/MyGUI_SubWidgetBinding.h - include/MyGUI_SubWidgetInfo.h - include/MyGUI_Align.h - include/MyGUI_Any.h - include/MyGUI_Colour.h - include/MyGUI_CommonStateInfo.h - include/MyGUI_ImageInfo.h - include/MyGUI_InputDefine.h - include/MyGUI_RenderTargetInfo.h - include/MyGUI_TCoord.h - include/MyGUI_TPoint.h - include/MyGUI_TRect.h - include/MyGUI_TSize.h - include/MyGUI_Types.h - include/MyGUI_Version.h - include/MyGUI_VertexData.h - include/MyGUI_WidgetStyle.h - include/MyGUI_ClipboardManager.h - include/MyGUI_ControllerManager.h - include/MyGUI_DataManager.h - include/MyGUI_DynLibManager.h - include/MyGUI_FactoryManager.h - include/MyGUI_FontManager.h - include/MyGUI_Gui.h - include/MyGUI_InputManager.h - include/MyGUI_LanguageManager.h - include/MyGUI_LayerManager.h - include/MyGUI_LayoutManager.h - include/MyGUI_PluginManager.h - include/MyGUI_PointerManager.h - include/MyGUI_RenderManager.h - include/MyGUI_ResourceManager.h - include/MyGUI_SkinManager.h - include/MyGUI_SubWidgetManager.h - include/MyGUI_WidgetManager.h -) -set (SOURCE_FILES - src/MyGUI_Button.cpp - src/MyGUI_Canvas.cpp - src/MyGUI_ComboBox.cpp - src/MyGUI_DDContainer.cpp - src/MyGUI_Edit.cpp - src/MyGUI_HScroll.cpp - src/MyGUI_ItemBox.cpp - src/MyGUI_List.cpp - src/MyGUI_ListBox.cpp - src/MyGUI_ListCtrl.cpp - src/MyGUI_MenuBar.cpp - src/MyGUI_MenuCtrl.cpp - src/MyGUI_MenuItem.cpp - src/MyGUI_Message.cpp - src/MyGUI_MultiList.cpp - src/MyGUI_PopupMenu.cpp - src/MyGUI_Progress.cpp - src/MyGUI_ScrollView.cpp - src/MyGUI_StaticImage.cpp - src/MyGUI_StaticText.cpp - src/MyGUI_Tab.cpp - src/MyGUI_TabItem.cpp - src/MyGUI_VScroll.cpp - src/MyGUI_Widget.cpp - src/MyGUI_Window.cpp - src/MyGUI_EditText.cpp - src/MyGUI_MainSkin.cpp - src/MyGUI_RawRect.cpp - src/MyGUI_RotatingSkin.cpp - src/MyGUI_SimpleText.cpp - src/MyGUI_SubSkin.cpp - src/MyGUI_TileRect.cpp - src/MyGUI_LayerItem.cpp - src/MyGUI_LayerNode.cpp - src/MyGUI_OverlappedLayer.cpp - src/MyGUI_RenderItem.cpp - src/MyGUI_SharedLayer.cpp - src/MyGUI_SharedLayerNode.cpp - src/MyGUI_ActionController.cpp - src/MyGUI_ControllerEdgeHide.cpp - src/MyGUI_ControllerFadeAlpha.cpp - src/MyGUI_ControllerPosition.cpp - src/MyGUI_Exception.cpp - src/MyGUI_Precompiled.cpp - src/MyGUI_IWidgetCreator.cpp - src/MyGUI_ScrollViewBase.cpp - src/MyGUI_ResourceImageSet.cpp - src/MyGUI_ResourceImageSetPointer.cpp - src/MyGUI_ResourceManualFont.cpp - src/MyGUI_ResourceManualPointer.cpp - src/MyGUI_ResourceSkin.cpp - src/MyGUI_ResourceTrueTypeFont.cpp - src/MyGUI_MaskPickInfo.cpp - src/MyGUI_Any.cpp - src/MyGUI_Colour.cpp - src/MyGUI_ClipboardManager.cpp - src/MyGUI_ControllerManager.cpp - src/MyGUI_DataManager.cpp - src/MyGUI_DynLibManager.cpp - src/MyGUI_FactoryManager.cpp - src/MyGUI_FontManager.cpp - src/MyGUI_Gui.cpp - src/MyGUI_InputManager.cpp - src/MyGUI_LanguageManager.cpp - src/MyGUI_LayerManager.cpp - src/MyGUI_LayoutManager.cpp - src/MyGUI_PluginManager.cpp - src/MyGUI_PointerManager.cpp - src/MyGUI_RenderManager.cpp - src/MyGUI_ResourceManager.cpp - src/MyGUI_SkinManager.cpp - src/MyGUI_SubWidgetManager.cpp - src/MyGUI_WidgetManager.cpp - src/MyGUI_DataFileStream.cpp - src/MyGUI_DataStream.cpp - src/MyGUI_DynLib.cpp - src/MyGUI_Guid.cpp - src/MyGUI_RenderOut.cpp - src/MyGUI_TextIterator.cpp - src/MyGUI_TextureUtility.cpp - src/MyGUI_Timer.cpp - src/MyGUI_XmlDocument.cpp - src/MyGUI_LogManager.cpp - src/MyGUI_LogStream.cpp -) -SOURCE_GROUP("Source Files\\Widget\\Widget" FILES - src/MyGUI_Button.cpp - src/MyGUI_Canvas.cpp - src/MyGUI_ComboBox.cpp - src/MyGUI_DDContainer.cpp - src/MyGUI_Edit.cpp - src/MyGUI_HScroll.cpp - src/MyGUI_ItemBox.cpp - src/MyGUI_List.cpp - src/MyGUI_ListBox.cpp - src/MyGUI_ListCtrl.cpp - src/MyGUI_MenuBar.cpp - src/MyGUI_MenuCtrl.cpp - src/MyGUI_MenuItem.cpp - src/MyGUI_Message.cpp - src/MyGUI_MultiList.cpp - src/MyGUI_PopupMenu.cpp - src/MyGUI_Progress.cpp - src/MyGUI_ScrollView.cpp - src/MyGUI_StaticImage.cpp - src/MyGUI_StaticText.cpp - src/MyGUI_Tab.cpp - src/MyGUI_TabItem.cpp - src/MyGUI_VScroll.cpp - src/MyGUI_Widget.cpp - src/MyGUI_Window.cpp -) -SOURCE_GROUP("Source Files\\Widget" FILES -) -SOURCE_GROUP("Source Files\\Core\\SubWidget" FILES - src/MyGUI_EditText.cpp - src/MyGUI_MainSkin.cpp - src/MyGUI_RawRect.cpp - src/MyGUI_RotatingSkin.cpp - src/MyGUI_SimpleText.cpp - src/MyGUI_SubSkin.cpp - src/MyGUI_TileRect.cpp -) -SOURCE_GROUP("Source Files\\Core\\LayerItem" FILES - src/MyGUI_LayerItem.cpp - src/MyGUI_LayerNode.cpp - src/MyGUI_OverlappedLayer.cpp - src/MyGUI_RenderItem.cpp - src/MyGUI_SharedLayer.cpp - src/MyGUI_SharedLayerNode.cpp -) -SOURCE_GROUP("Source Files\\Core\\Controller" FILES - src/MyGUI_ActionController.cpp - src/MyGUI_ControllerEdgeHide.cpp - src/MyGUI_ControllerFadeAlpha.cpp - src/MyGUI_ControllerPosition.cpp -) -SOURCE_GROUP("Source Files\\Core\\Common\\Interfaces" FILES - src/MyGUI_IWidgetCreator.cpp -) -SOURCE_GROUP("Source Files\\Core\\Common\\Base" FILES - src/MyGUI_ScrollViewBase.cpp -) -SOURCE_GROUP("Source Files\\Core\\Common" FILES - src/MyGUI_Exception.cpp - src/MyGUI_Precompiled.cpp -) -SOURCE_GROUP("Source Files\\Core\\Resource\\Data" FILES - src/MyGUI_MaskPickInfo.cpp -) -SOURCE_GROUP("Source Files\\Core\\Resource" FILES - src/MyGUI_ResourceImageSet.cpp - src/MyGUI_ResourceImageSetPointer.cpp - src/MyGUI_ResourceManualFont.cpp - src/MyGUI_ResourceManualPointer.cpp - src/MyGUI_ResourceSkin.cpp - src/MyGUI_ResourceTrueTypeFont.cpp -) -SOURCE_GROUP("Source Files\\Core\\Types" FILES - src/MyGUI_Any.cpp - src/MyGUI_Colour.cpp -) -SOURCE_GROUP("Source Files\\Core\\Manager" FILES - src/MyGUI_ClipboardManager.cpp - src/MyGUI_ControllerManager.cpp - src/MyGUI_DataManager.cpp - src/MyGUI_DynLibManager.cpp - src/MyGUI_FactoryManager.cpp - src/MyGUI_FontManager.cpp - src/MyGUI_Gui.cpp - src/MyGUI_InputManager.cpp - src/MyGUI_LanguageManager.cpp - src/MyGUI_LayerManager.cpp - src/MyGUI_LayoutManager.cpp - src/MyGUI_PluginManager.cpp - src/MyGUI_PointerManager.cpp - src/MyGUI_RenderManager.cpp - src/MyGUI_ResourceManager.cpp - src/MyGUI_SkinManager.cpp - src/MyGUI_SubWidgetManager.cpp - src/MyGUI_WidgetManager.cpp -) -SOURCE_GROUP("Source Files\\Core" FILES -) -SOURCE_GROUP("Source Files\\Utility\\Logging" FILES - src/MyGUI_LogManager.cpp - src/MyGUI_LogStream.cpp -) -SOURCE_GROUP("Source Files\\Utility" FILES - src/MyGUI_DataFileStream.cpp - src/MyGUI_DataStream.cpp - src/MyGUI_DynLib.cpp - src/MyGUI_Guid.cpp - src/MyGUI_RenderOut.cpp - src/MyGUI_TextIterator.cpp - src/MyGUI_TextureUtility.cpp - src/MyGUI_Timer.cpp - src/MyGUI_XmlDocument.cpp -) -SOURCE_GROUP("Source Files" FILES -) -SOURCE_GROUP("Header Files\\Widget\\Types" FILES - include/MyGUI_DDItemInfo.h - include/MyGUI_IBItemInfo.h - include/MyGUI_MenuItemType.h - include/MyGUI_MessageStyle.h - include/MyGUI_WidgetToolTip.h -) -SOURCE_GROUP("Header Files\\Widget\\Widget" FILES - include/MyGUI_Button.h - include/MyGUI_Canvas.h - include/MyGUI_ComboBox.h - include/MyGUI_DDContainer.h - include/MyGUI_Edit.h - include/MyGUI_HScroll.h - include/MyGUI_ItemBox.h - include/MyGUI_List.h - include/MyGUI_ListBox.h - include/MyGUI_ListCtrl.h - include/MyGUI_MenuBar.h - include/MyGUI_MenuCtrl.h - include/MyGUI_MenuItem.h - include/MyGUI_Message.h - include/MyGUI_MultiList.h - include/MyGUI_PopupMenu.h - include/MyGUI_Progress.h - include/MyGUI_ScrollView.h - include/MyGUI_StaticImage.h - include/MyGUI_StaticText.h - include/MyGUI_Tab.h - include/MyGUI_TabItem.h - include/MyGUI_VScroll.h - include/MyGUI_Widget.h - include/MyGUI_Window.h -) -SOURCE_GROUP("Header Files\\Widget\\Interfaces" FILES - include/MyGUI_IWidgetFactory.h -) -SOURCE_GROUP("Header Files\\Widget" FILES -) -SOURCE_GROUP("Header Files\\Utility\\Logging" FILES - include/MyGUI_LogManager.h - include/MyGUI_LogStream.h -) -SOURCE_GROUP("Header Files\\Utility" FILES - include/MyGUI_Bitwise.h - include/MyGUI_CoordConverter.h - include/MyGUI_DataFileStream.h - include/MyGUI_DataStream.h - include/MyGUI_Delegate.h - include/MyGUI_DelegateImplement.h - include/MyGUI_DynLib.h - include/MyGUI_Enumerator.h - include/MyGUI_EventPair.h - include/MyGUI_Guid.h - include/MyGUI_RenderOut.h - include/MyGUI_TextChangeHistory.h - include/MyGUI_TextIterator.h - include/MyGUI_TextureUtility.h - include/MyGUI_TextView.h - include/MyGUI_Timer.h - include/MyGUI_UString.h - include/MyGUI_Utility.h - include/MyGUI_WidgetTranslate.h - include/MyGUI_XmlDocument.h -) -SOURCE_GROUP("Header Files\\Core\\Common\\Interfaces" FILES - include/MyGUI_ICroppedRectangle.h - include/MyGUI_IDataStream.h - include/MyGUI_Instance.h - include/MyGUI_IObject.h - include/MyGUI_ISerializable.h - include/MyGUI_ITexture.h - include/MyGUI_IUnlinkWidget.h - include/MyGUI_IVertexBuffer.h - include/MyGUI_IWidgetCreator.h - include/MyGUI_Plugin.h - include/MyGUI_RTTI.h -) -SOURCE_GROUP("Header Files\\Core\\Common\\Base" FILES - include/MyGUI_BiIndexBase.h - include/MyGUI_ScrollViewBase.h - include/MyGUI_WidgetEvent.h - include/MyGUI_WidgetUserData.h -) -SOURCE_GROUP("Header Files\\Core\\Common" FILES - include/MyGUI.h - include/MyGUI_CastWidget.h - include/MyGUI_Common.h - include/MyGUI_Diagnostic.h - include/MyGUI_Exception.h - include/MyGUI_GenericFactory.h - include/MyGUI_Macros.h - include/MyGUI_Platform.h - include/MyGUI_Precompiled.h - include/MyGUI_Prerequest.h - include/MyGUI_RenderFormat.h - include/MyGUI_ResourceHolder.h - include/MyGUI_WidgetDefines.h -) -SOURCE_GROUP("Header Files\\Core\\SubWidget\\Interfaces" FILES - include/MyGUI_IStateInfo.h - include/MyGUI_ISubWidget.h - include/MyGUI_ISubWidgetRect.h - include/MyGUI_ISubWidgetText.h -) -SOURCE_GROUP("Header Files\\Core\\SubWidget" FILES - include/MyGUI_EditText.h - include/MyGUI_MainSkin.h - include/MyGUI_RawRect.h - include/MyGUI_RotatingSkin.h - include/MyGUI_SimpleText.h - include/MyGUI_SubSkin.h - include/MyGUI_TileRect.h -) -SOURCE_GROUP("Header Files\\Core\\LayerItem\\Interfaces" FILES - include/MyGUI_ILayer.h - include/MyGUI_ILayerItem.h - include/MyGUI_ILayerNode.h - include/MyGUI_IRenderTarget.h -) -SOURCE_GROUP("Header Files\\Core\\LayerItem" FILES - include/MyGUI_LayerItem.h - include/MyGUI_LayerNode.h - include/MyGUI_OverlappedLayer.h - include/MyGUI_RenderItem.h - include/MyGUI_SharedLayer.h - include/MyGUI_SharedLayerNode.h -) -SOURCE_GROUP("Header Files\\Core\\Controller" FILES - include/MyGUI_ActionController.h - include/MyGUI_ControllerEdgeHide.h - include/MyGUI_ControllerFadeAlpha.h - include/MyGUI_ControllerItem.h - include/MyGUI_ControllerPosition.h -) -SOURCE_GROUP("Header Files\\Core\\Resource\\Interface" FILES - include/MyGUI_IFont.h - include/MyGUI_IPointer.h - include/MyGUI_IResource.h -) -SOURCE_GROUP("Header Files\\Core\\Resource\\Data" FILES - include/MyGUI_ChildSkinInfo.h - include/MyGUI_FontData.h - include/MyGUI_MaskPickInfo.h - include/MyGUI_SubWidgetBinding.h - include/MyGUI_SubWidgetInfo.h -) -SOURCE_GROUP("Header Files\\Core\\Resource" FILES - include/MyGUI_ResourceImageSet.h - include/MyGUI_ResourceImageSetPointer.h - include/MyGUI_ResourceManualFont.h - include/MyGUI_ResourceManualPointer.h - include/MyGUI_ResourceSkin.h - include/MyGUI_ResourceTrueTypeFont.h -) -SOURCE_GROUP("Header Files\\Core\\Types" FILES - include/MyGUI_Align.h - include/MyGUI_Any.h - include/MyGUI_Colour.h - include/MyGUI_CommonStateInfo.h - include/MyGUI_ImageInfo.h - include/MyGUI_InputDefine.h - include/MyGUI_RenderTargetInfo.h - include/MyGUI_TCoord.h - include/MyGUI_TPoint.h - include/MyGUI_TRect.h - include/MyGUI_TSize.h - include/MyGUI_Types.h - include/MyGUI_Version.h - include/MyGUI_VertexData.h - include/MyGUI_WidgetStyle.h -) -SOURCE_GROUP("Header Files\\Core\\Manager" FILES - include/MyGUI_ClipboardManager.h - include/MyGUI_ControllerManager.h - include/MyGUI_DataManager.h - include/MyGUI_DynLibManager.h - include/MyGUI_FactoryManager.h - include/MyGUI_FontManager.h - include/MyGUI_Gui.h - include/MyGUI_InputManager.h - include/MyGUI_LanguageManager.h - include/MyGUI_LayerManager.h - include/MyGUI_LayoutManager.h - include/MyGUI_PluginManager.h - include/MyGUI_PointerManager.h - include/MyGUI_RenderManager.h - include/MyGUI_ResourceManager.h - include/MyGUI_SkinManager.h - include/MyGUI_SubWidgetManager.h - include/MyGUI_WidgetManager.h -) -SOURCE_GROUP("Header Files\\Core" FILES -) -SOURCE_GROUP("Header Files" FILES - include/MyGUI_Allocator.h - include/MyGUI_CustomAllocator.h -) -SOURCE_GROUP("" FILES - CMakeLists.txt -) diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI.h deleted file mode 100644 index db960fc8b..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI.h +++ /dev/null @@ -1,92 +0,0 @@ -/*! - @file - @author Georgiy Evmenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_H__ -#define __MYGUI_H__ - -#include "MyGUI_Gui.h" - -#include "MyGUI_Button.h" -#include "MyGUI_ComboBox.h" -#include "MyGUI_Edit.h" -#include "MyGUI_HScroll.h" -#include "MyGUI_List.h" -#include "MyGUI_StaticText.h" -#include "MyGUI_StaticImage.h" -#include "MyGUI_Tab.h" -#include "MyGUI_TabItem.h" -#include "MyGUI_VScroll.h" -#include "MyGUI_Window.h" -#include "MyGUI_Progress.h" -#include "MyGUI_Message.h" -#include "MyGUI_ItemBox.h" -#include "MyGUI_MultiList.h" -#include "MyGUI_MenuCtrl.h" -#include "MyGUI_MenuItem.h" -#include "MyGUI_PopupMenu.h" -#include "MyGUI_MenuBar.h" -#include "MyGUI_ScrollView.h" -#include "MyGUI_DDContainer.h" -#include "MyGUI_Canvas.h" -#include "MyGUI_ListCtrl.h" -#include "MyGUI_ListBox.h" - -#include "MyGUI_InputManager.h" -#include "MyGUI_SubWidgetManager.h" -#include "MyGUI_ClipboardManager.h" -#include "MyGUI_LayerManager.h" -#include "MyGUI_LogManager.h" -#include "MyGUI_SkinManager.h" -#include "MyGUI_WidgetManager.h" -#include "MyGUI_LayoutManager.h" -#include "MyGUI_FontManager.h" -#include "MyGUI_PointerManager.h" -#include "MyGUI_PluginManager.h" -#include "MyGUI_DynLibManager.h" -#include "MyGUI_ControllerManager.h" -#include "MyGUI_LanguageManager.h" -#include "MyGUI_ResourceManager.h" -#include "MyGUI_RenderManager.h" -#include "MyGUI_DataManager.h" -#include "MyGUI_FactoryManager.h" - -#include "MyGUI_ActionController.h" -#include "MyGUI_ControllerEdgeHide.h" -#include "MyGUI_ControllerFadeAlpha.h" -#include "MyGUI_ControllerPosition.h" -#include "MyGUI_CoordConverter.h" -#include "MyGUI_IResource.h" -#include "MyGUI_CastWidget.h" -#include "MyGUI_Any.h" -#include "MyGUI_MenuItemType.h" -#include "MyGUI_Version.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_WidgetStyle.h" -#include "MyGUI_IObject.h" -#include "MyGUI_ISerializable.h" -#include "MyGUI_RenderOut.h" - -#include "MyGUI_RawRect.h" -#include "MyGUI_RotatingSkin.h" -#include "MyGUI_TextureUtility.h" - -#endif // __MYGUI_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ActionController.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ActionController.h deleted file mode 100644 index 7f89b4fd3..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ActionController.h +++ /dev/null @@ -1,75 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_ACTION_CONTROLLER_H__ -#define __MYGUI_ACTION_CONTROLLER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include - -namespace MyGUI -{ - - namespace action - { - - /** Function used for hiding widget with one of controller event */ - void MYGUI_EXPORT actionWidgetHide(Widget* _widget); - - /** Function used for showing widget with one of controller event */ - void MYGUI_EXPORT actionWidgetShow(Widget* _widget); - - /** Function used for destroying widget with one of controller event */ - void MYGUI_EXPORT actionWidgetDestroy(Widget* _widget); - - /** Function for ControllerPosition per frame action : Move with constant speed */ - void MYGUI_EXPORT linearMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _k); - - /** Function for ControllerPosition per frame action : Move with accelerated speed - if N == 10 then this function is same as linearMoveFunction - if N > 10 speed will be increasing - if N < 10 speed will be decreasing - */ - template - inline void acceleratedMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time) - { - float k = (float)pow (_current_time, N/10.f /*3 by default as Accelerated and 0.4 by default as Slowed*/); - linearMoveFunction(_startRect, _destRect, _result, k); - } - - /** Function for ControllerPosition per frame action : Move with accelerated speed a bit farther than necessary and then return it back */ - template - inline void jumpMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time) - { - float k = pow (_current_time, 2) * (-2 - N/10.f) + _current_time * (3 + N/10.f); - linearMoveFunction(_startRect, _destRect, _result, k); - } - - /** Function for ControllerPosition per frame action : Start with zero speed increasing half time and then decreasing to zero */ - void MYGUI_EXPORT inertionalMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time); - - } // namespace action - -} // namespace MyGUI - -#endif // __MYGUI_ACTION_CONTROLLER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Align.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Align.h deleted file mode 100644 index ca1e6c64a..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Align.h +++ /dev/null @@ -1,202 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 08/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_ALIGN_H__ -#define __MYGUI_ALIGN_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Macros.h" -#include "MyGUI_Diagnostic.h" -#include - -namespace MyGUI -{ - - struct MYGUI_EXPORT Align - { - enum Enum - { - HCenter = MYGUI_FLAG_NONE, /**< center horizontally */ - VCenter = MYGUI_FLAG_NONE, /**< center vertically */ - Center = HCenter | VCenter, /**< center in the dead center */ - - Left = MYGUI_FLAG(1), /**< value from the left (and center vertically) */ - Right = MYGUI_FLAG(2), /**< value from the right (and center vertically) */ - HStretch = Left | Right, /**< stretch horizontally proportionate to parent window (and center vertically) */ - - Top = MYGUI_FLAG(3), /**< value from the top (and center horizontally) */ - Bottom = MYGUI_FLAG(4), /**< value from the bottom (and center horizontally) */ - VStretch = Top | Bottom, /**< stretch vertically proportionate to parent window (and center horizontally) */ - - Stretch = HStretch | VStretch, /**< stretch proportionate to parent window */ - Default = Left | Top, /**< default value (value from left and top) */ - - HRelative = MYGUI_FLAG(5), - VRelative = MYGUI_FLAG(6), - Relative = HRelative | VRelative - }; - - Align(Enum _value = Default) : value(_value) { } - - bool isHCenter() const { return HCenter == (value & ((int)HStretch | (int)HRelative)); } - bool isVCenter() const { return VCenter == (value & ((int)VStretch | (int)VRelative)); } - bool isCenter() const { return Center == (value & ((int)Stretch | (int)Relative)); } - - bool isLeft() const { return Left == (value & ((int)HStretch | (int)HRelative)); } - bool isRight() const { return Right == (value & ((int)HStretch | (int)HRelative)); } - bool isHStretch() const { return HStretch == (value & ((int)HStretch | (int)HRelative)); } - - bool isTop() const { return Top == (value & ((int)VStretch | (int)VRelative)); } - bool isBottom() const { return (Bottom == (value & ((int)VStretch | (int)VRelative))); } - bool isVStretch() const { return (VStretch == (value & ((int)VStretch | (int)VRelative))); } - - bool isStretch() const { return (Stretch == (value & ((int)Stretch | (int)Relative))); } - bool isDefault() const { return (Default == (value & ((int)Stretch | (int)Relative))); } - - bool isHRelative() const { return HRelative == (value & (int)HRelative); } - bool isVRelative() const { return VRelative == (value & (int)VRelative); } - bool isRelative() const { return Relative == (value & (int)Relative); } - - Align& operator |= (Align const& _other) { value = Enum(int(value) | int(_other.value)); return *this; } - friend Align operator | (Enum const& a, Enum const& b) { return Align(Enum(int(a) | int(b))); } - friend Align operator | (Align const& a, Align const& b) { return Align(Enum(int(a.value) | int(b.value))); } - - friend bool operator == (Align const& a, Align const& b) { return a.value == b.value; } - friend bool operator != (Align const& a, Align const& b) { return a.value != b.value; } - - typedef std::map MapAlign; - - static Align parse(const std::string& _value) - { - Align result(Enum(0)); - const MapAlign& map_names = result.getValueNames(); - const std::vector& vec = utility::split(_value); - for (size_t pos=0; possecond)); - } - } - return result; - } - - std::string print() const - { - std::string result; - - if (value & Left) - { - if (value & Right) result = "HStretch"; - else result = "Left"; - } - else if (value & Right) result = "Right"; - else result = "HCenter"; - - if (value & Top) - { - if (value & Bottom) result += " VStretch"; - else result += " Top"; - } - else if (value & Bottom) result += " Bottom"; - else result += " VCenter"; - - return result; - } - - friend std::ostream& operator << ( std::ostream& _stream, const Align& _value ) - { - _stream << _value.print(); - return _stream; - } - - friend std::istream& operator >> ( std::istream& _stream, Align& _value ) - { - _value.value = Enum(0); - std::string value; - _stream >> value; - - const MapAlign& map_names = _value.getValueNames(); - MapAlign::const_iterator iter = map_names.find(value); - if (iter != map_names.end()) - _value.value = Enum(int(_value.value) | int(iter->second)); - - - if (!_stream.eof()) - { - std::string value2; - _stream >> value2; - iter = map_names.find(value2); - if (iter != map_names.end()) - _value.value = Enum(int(_value.value) | int(iter->second)); - } - - return _stream; - } - - private: - const MapAlign& getValueNames() const - { - static MapAlign map_names; - - if (map_names.empty()) - { - // OBSOLETE - map_names["ALIGN_HCENTER"] = HCenter; - map_names["ALIGN_VCENTER"] = VCenter; - map_names["ALIGN_CENTER"] = Center; - map_names["ALIGN_LEFT"] = Left; - map_names["ALIGN_RIGHT"] = Right; - map_names["ALIGN_HSTRETCH"] = HStretch; - map_names["ALIGN_TOP"] = Top; - map_names["ALIGN_BOTTOM"] = Bottom; - map_names["ALIGN_VSTRETCH"] = VStretch; - map_names["ALIGN_STRETCH"] = Stretch; - map_names["ALIGN_DEFAULT"] = Default; - - MYGUI_REGISTER_VALUE(map_names, HCenter); - MYGUI_REGISTER_VALUE(map_names, VCenter); - MYGUI_REGISTER_VALUE(map_names, Center); - MYGUI_REGISTER_VALUE(map_names, Left); - MYGUI_REGISTER_VALUE(map_names, Right); - MYGUI_REGISTER_VALUE(map_names, HStretch); - MYGUI_REGISTER_VALUE(map_names, Top); - MYGUI_REGISTER_VALUE(map_names, Bottom); - MYGUI_REGISTER_VALUE(map_names, VStretch); - MYGUI_REGISTER_VALUE(map_names, Stretch); - MYGUI_REGISTER_VALUE(map_names, Default); - MYGUI_REGISTER_VALUE(map_names, HRelative); - MYGUI_REGISTER_VALUE(map_names, VRelative); - MYGUI_REGISTER_VALUE(map_names, Relative); - } - - return map_names; - } - - private: - Enum value; - }; - -} // namespace MyGUI - -#endif // __MYGUI_ALIGN_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Allocator.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Allocator.h deleted file mode 100644 index ca107dcbd..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Allocator.h +++ /dev/null @@ -1,89 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 05/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_ALLOCATOR_H__ -#define __MYGUI_ALLOCATOR_H__ - -#include -#include - -namespace MyGUI -{ - - template - class Allocator - { - public: - // typedefs - 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 std::size_t size_type; - typedef std::ptrdiff_t difference_type; - - public: - // convert an allocator to allocator - template - struct rebind - { - typedef Allocator other; - }; - - public: - inline explicit Allocator() { } - inline ~Allocator() { } - template - inline explicit Allocator(Allocator const&) { } - - // address - inline pointer address(reference r) { return &r; } - inline const_pointer address(const_reference r) { return &r; } - - // memory allocation - inline pointer allocate(size_type cnt, typename std::allocator::const_pointer = 0) - { - return reinterpret_cast(::operator new (cnt * sizeof (T))); - } - inline void deallocate(pointer p, size_type) - { - ::operator delete (p); - } - - // size - inline size_type max_size() const - { - return std::numeric_limits::max() / sizeof(T); - } - - // construction/destruction - inline void construct(pointer p, const T& t) { new (p) T(t); } - inline void destroy(pointer p) { p->~T(); } - - inline bool operator==(Allocator const&) { return true; } - inline bool operator!=(Allocator const& a) { return !operator==(a); } - }; - -} // namespace MyGUI - -#endif // __MYGUI_ALLOCATOR_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Any.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Any.h deleted file mode 100644 index bf5ae0fbe..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Any.h +++ /dev/null @@ -1,213 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 10/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ - -// -- Based on boost::any, original copyright information follows -- -// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved. -// -// Distributed under the Boost Software License, Version 1.0. -// (See at http://www.boost.org/LICENSE_1_0.txt) -// -- End original copyright -- - -#ifndef __MYGUI_ANY_H__ -#define __MYGUI_ANY_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Diagnostic.h" -#include -#include - -namespace MyGUI -{ - - /** @example "Class Any usage" - @code - void f() - { - // RU: тестовый класс, с простыми типами все аналогично - // EN: test class, with simple types all is similar - struct Data { int value; }; - - // RU: экземпляр и инициализация - // EN: instance and initialization - Data data; - data.value = 0xDEAD; - - // RU: создастся копия класса Data - // EN: copy of class Data will be created - MyGUI::Any any = data; - // RU: копия класса Data - // EN: copy of class Data - Data copy_data = *any.castType(); - // RU: теперь value == 0xDEAD - // EN: now value == 0xDEAD - int value = copy_data.value; - - - // RU: создастся копия указателя на класс Data - // EN: copy of pointer on class Data will be created - any = &data; - // RU: копия указателя на класс Data и конкретно на объект data - // EN: copy of pointer on class Data and on object data - Data * copy_ptr = *any.castType(); - // RU: теперь data.value == 0 - // EN: now value == 0 - copy_ptr->value = 0; - - } - @endcode - */ - - class MYGUI_EXPORT Any - { - - private: - struct AnyEmpty { }; - - public: - static AnyEmpty Null; - - public: - Any() : - mContent(nullptr) - { - } - - template Any(const ValueType& value) : - mContent(new Holder(value)) - { - } - - Any(const Any::AnyEmpty& value) : - mContent(nullptr) - { - } - - Any(const Any& other) : - mContent(other.mContent ? other.mContent->clone() : nullptr) - { - } - - ~Any() - { - delete mContent; - } - - Any& swap(Any& rhs) - { - std::swap(mContent, rhs.mContent); - return *this; - } - - template Any& operator = (const ValueType& rhs) - { - Any(rhs).swap(*this); - return *this; - } - - Any& operator = (const Any::AnyEmpty& rhs) - { - delete mContent; - mContent = nullptr; - return *this; - } - - Any& operator = (const Any& rhs) - { - Any(rhs).swap(*this); - return *this; - } - - bool empty() const - { - return !mContent; - } - - const std::type_info& getType() const - { - return mContent ? mContent->getType() : typeid(void); - } - - template - ValueType * castType(bool _throw = true) const - { - if (this->getType() == typeid(ValueType)) - { - return &static_cast *>(this->mContent)->held; - } - MYGUI_ASSERT(!_throw, "Bad cast from type '" << getType().name() << "' to '" << typeid(ValueType).name() << "'"); - return nullptr; - } - - void * castUnsafe() const - { - return mContent ? static_cast *>(this->mContent)->held : nullptr; - } - - private: - class Placeholder - { - public: - virtual ~Placeholder() { } - - public: - virtual const std::type_info& getType() const = 0; - virtual Placeholder * clone() const = 0; - - }; - - template class Holder : public Placeholder - { - public: - Holder(const ValueType& value) : - held(value) - { - } - - public: - virtual const std::type_info& getType() const - { - return typeid(ValueType); - } - - virtual Placeholder * clone() const - { - return new Holder(held); - } - - public: - ValueType held; - - private: - Holder& operator=(const Holder &); - - }; - - - private: // representation - Placeholder * mContent; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_ANY_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_BiIndexBase.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_BiIndexBase.h deleted file mode 100644 index f9f38a76d..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_BiIndexBase.h +++ /dev/null @@ -1,216 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 10/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_BIINDEX_BASE_H__ -#define __MYGUI_BIINDEX_BASE_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - class BiIndexBase - { - public: - virtual ~BiIndexBase() { } - protected: - - size_t getIndexCount() { return mIndexFace.size(); } - - size_t insertItemAt(size_t _index) - { - #if MYGUI_DEBUG_MODE == 1 - MYGUI_ASSERT_RANGE_INSERT(_index, mIndexFace.size(), "BiIndexBase::insertItemAt"); - checkIndexes(); - #endif - - if (_index == MyGUI::ITEM_NONE) _index = mIndexFace.size(); - - size_t index; - - if (_index == mIndexFace.size()) - { - // для вставки айтема - index = mIndexFace.size(); - - mIndexFace.push_back(_index); - mIndexBack.push_back(_index); - } - else - { - // для вставки айтема - index = mIndexFace[_index]; - - size_t count = mIndexFace.size(); - for (size_t pos=0; pos= index) mIndexFace[pos]++; - } - mIndexFace.insert(mIndexFace.begin() + _index, index); - - count ++; - mIndexBack.push_back(0); - for (size_t pos=0; pos index) mIndexFace[pos]--; - mIndexBack[mIndexFace[pos]] = pos; - } - - #if MYGUI_DEBUG_MODE == 1 - checkIndexes(); - #endif - - return index; - } - - void removeAllItems() - { - mIndexFace.clear(); - mIndexBack.clear(); - } - - // на входе индексы пользователя, на выходе реальные индексы - size_t convertToBack(size_t _index) const - { - #if MYGUI_DEBUG_MODE == 1 - MYGUI_ASSERT_RANGE_AND_NONE(_index, mIndexFace.size(), "BiIndexBase::convertToBack"); - #endif - return _index == ITEM_NONE ? ITEM_NONE : mIndexFace[_index]; - } - - // на входе индексы реальные, на выходе, то что видит пользователь - size_t convertToFace(size_t _index) const - { - #if MYGUI_DEBUG_MODE == 1 - MYGUI_ASSERT_RANGE_AND_NONE(_index, mIndexFace.size(), "BiIndexBase::convertToFace"); - #endif - return _index == ITEM_NONE ? ITEM_NONE : mIndexBack[_index]; - } - - // меняет местами два индекса, индексы со стороны пользователя - void swapItemsFaceAt(size_t _index1, size_t _index2) - { - #if MYGUI_DEBUG_MODE == 1 - MYGUI_ASSERT_RANGE(_index1, mIndexFace.size(), "BiIndexBase::swapItemsFaceAt"); - MYGUI_ASSERT_RANGE(_index2, mIndexFace.size(), "BiIndexBase::swapItemsFaceAt"); - #endif - - std::swap(mIndexFace[_index1], mIndexFace[_index2]); - std::swap(mIndexBack[mIndexFace[_index1]], mIndexBack[mIndexFace[_index2]]); - } - - // меняет местами два индекса, индексы со сторонны данных - void swapItemsBackAt(size_t _index1, size_t _index2) - { - #if MYGUI_DEBUG_MODE == 1 - MYGUI_ASSERT_RANGE(_index1, mIndexFace.size(), "BiIndexBase::swapItemsBackAt"); - MYGUI_ASSERT_RANGE(_index2, mIndexFace.size(), "BiIndexBase::swapItemsBackAt"); - #endif - - std::swap(mIndexBack[_index1], mIndexBack[_index2]); - std::swap(mIndexFace[mIndexBack[_index1]], mIndexFace[mIndexBack[_index2]]); - } - - #if MYGUI_DEBUG_MODE == 1 - - void checkIndexes() - { - assert(mIndexFace.size() == mIndexBack.size()); - - // проверяем на уникальность каждого индекса в маппинге - std::vector vec; - size_t count = mIndexFace.size(); - - vec.reserve(count); - for (size_t pos=0; pos= count) throw new std::exception(); - - // максимум - index = mIndexFace[pos]; - if (index >= count) throw new std::exception(); - - if (vec[index]) throw new std::exception(); - vec[index] = true; - } - - for (size_t pos=0; pos VectorSizeT; - - // маппинг с индексов, которые видны наружу - // на индексы которые реально используются данными - VectorSizeT mIndexFace; - - // маппинг с индексов, которые используют данные - // на индексы которые виндны наружу - VectorSizeT mIndexBack; - }; - -} // namespace MyGUI - -#endif // __MYGUI_BIINDEX_BASE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Bitwise.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Bitwise.h deleted file mode 100644 index 9ba9cc298..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Bitwise.h +++ /dev/null @@ -1,78 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_BITWISE_H__ -#define __MYGUI_BITWISE_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - class Bitwise - { - public: - /** Returns the closest power-of-two number greater or equal to value. - */ - template - static MYGUI_FORCEINLINE Type firstPO2From(Type _value) - { - --_value; - _value |= _value >> 16; - _value |= _value >> 8; - _value |= _value >> 4; - _value |= _value >> 2; - _value |= _value >> 1; - ++_value; - return _value; - } - - /** Determines whether the number is power-of-two or not. */ - template - static MYGUI_FORCEINLINE bool isPO2(Type _value) - { - return (_value & (_value-1)) == 0; - } - - /** Returns the number of bits a pattern must be shifted right by to - remove right-hand zeros. - */ - template - static MYGUI_FORCEINLINE size_t getBitShift(Type _mask) - { - if (_mask == 0) - return 0; - - size_t result = 0; - while ((_mask & 1) == 0) - { - ++result; - _mask >>= 1; - } - return result; - } - - }; - -} // namespace MyGUI - -#endif // __MYGUI_BITWISE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Button.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Button.h deleted file mode 100644 index 0766de105..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Button.h +++ /dev/null @@ -1,111 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_BUTTON_H__ -#define __MYGUI_BUTTON_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_StaticText.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT Button : - public StaticText - { - MYGUI_RTTI_DERIVED( Button ) - - public: - Button(); - - //! OLD Set button check state - void setButtonPressed(bool _value) { setStateCheck(_value); } - //! OLD Get buton check - bool getButtonPressed() { return getStateCheck(); } - - //! Set button check state - void setStateCheck(bool _value); - - //! Get buton check - bool getStateCheck() { return mIsStateCheck; } - - //! Set image index (image should be defined in skin) - void setImageIndex(size_t _value); - //! Get image index - size_t getImageIndex(); - - /** Enable or disable Image mode\n - Image mode: when button state changed Image on button also change it's picture.\n - Disabled (false) by default. - */ - void setModeImage(bool _value); - /** Get Image mode flag */ - bool getModeImage() { return mModeImage; } - - /** Get pointer to glyph image for this button (if it exist in button skin) */ - StaticImage* getStaticImage() { return mImage; } - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - void _setMouseFocus(bool _focus); - - protected: - virtual ~Button(); - - virtual void baseChangeWidgetSkin(ResourceSkin* _info); - - virtual void onMouseLostFocus(Widget* _new); - virtual void onMouseSetFocus(Widget* _old); - virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id); - virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id); - - virtual void baseUpdateEnable(); - - bool _setState(const std::string& _value); - void setImageResource(const std::string& _name); - - private: - void updateButtonState(); - - void shutdownWidgetSkin(); - void initialiseWidgetSkin(ResourceSkin* _info); - - private: - // нажата ли кнопка - bool mIsMousePressed; - // в фокусе ли кнопка - bool mIsMouseFocus; - // статус кнопки нажата или нет - bool mIsStateCheck; - - StaticImage* mImage; - bool mModeImage; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_BUTTON_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Canvas.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Canvas.h deleted file mode 100644 index da1c77fe2..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Canvas.h +++ /dev/null @@ -1,246 +0,0 @@ -/*! - @file - @author Alexander Ptakhin - @date 01/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_CANVAS_H__ -#define __MYGUI_CANVAS_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Widget.h" -#include "MyGUI_ITexture.h" - -namespace MyGUI -{ - - /** - * Widget wrapper over Texture - shows the texture. - * Implemented: resizing of texture (see TextureResizeMode); recovery after lossing device; - */ - class MYGUI_EXPORT Canvas : - public Widget, - public ITextureInvalidateListener - { - MYGUI_RTTI_DERIVED( Canvas ) - - public: - Canvas(); - - struct Event - { - Event( bool _textureChanged, bool _widgetResized, bool _requested ) : - textureChanged( _textureChanged ), - widgetResized( _widgetResized ), - requested( _requested ) - { - } - - bool textureChanged; - bool widgetResized; - - /// This update was caused by calling updateTexture(); - bool requested; - }; - - typedef delegates::CDelegate1 EventInfo_Canvas; - typedef delegates::CDelegate2 EventInfo_CanvasEvent; - - //FIXME - /** - Available resize and view modes of texture - @remarks PT - Power of Two (size) - */ - enum TextureResizeMode - { - // - TRM_PT_CONST_SIZE, /// Texture doesn't resizes and fills all widget space - TRM_PT_VIEW_REQUESTED, /// You can view all pixels of texture, texture cropped by sizes of widget - TRM_PT_VIEW_ALL /// Texture resizes and fills all widget space - }; - - public: - - /// Creates texture - void createTexture( TextureResizeMode _resizeMode, TextureUsage _usage = getDefaultTextureUsage(), PixelFormat _format = getDefaultTextureFormat() ); - - /// Creates texture - void createTexture( int _width, int _height, TextureResizeMode _resizeMode, TextureUsage _usage = getDefaultTextureUsage(), PixelFormat _format = getDefaultTextureFormat() ); - - /// Creates texture - void createTexture( const IntSize& _size, TextureResizeMode _resizeMode, TextureUsage _usage = getDefaultTextureUsage(), PixelFormat _format = getDefaultTextureFormat() ); - - /// Destroys texture - void destroyTexture(); - - /// Call user delegate update and removes old texture if it isn't original. - void updateTexture(); - - /// Locks hardware pixel buffer. - void* lock(TextureUsage _usage = TextureUsage::Write); - - /// Unlocks hardware pixel buffer. - void unlock(); - - /// Checks lockness of hardware _pixel buffer. - bool isLocked() const { return mTexture->isLocked(); } - - /// Returns real width of texture. - int getTextureRealWidth() const { return (int) mTexture->getWidth(); } - - /// Returns real height of texture. - int getTextureRealHeight() const { return (int) mTexture->getHeight(); } - - /// Returns real _size of texture. - IntSize getTextureRealSize() const { return IntSize( getTextureRealWidth(), getTextureRealHeight() ); } - - /// Returns needed width while creating texture. - int getTextureSrcWidth() const { return mReqTexSize.width; } - - /// Returns needed height while creating texture. - int getTextureSrcHeight() const { return mReqTexSize.height; } - - /// Returns needed sizes while creating texture. - IntSize getTextureSrcSize() const { return mReqTexSize; } - - /// Returns needed sizes while creating texture. - PixelFormat getTextureFormat() const { return mTexture->getFormat(); } - - /// Returns name of the current texture. - const std::string& getTextureName() const { return mTexture->getName(); } - - //! @copydoc Widget::setSize(const IntSize& _value) - virtual void setSize(const IntSize& _value); - //! @copydoc Widget::setCoord(const IntCoord& _value) - virtual void setCoord(const IntCoord& _value); - - /** @copydoc Widget::setSize(int _width, int _height) */ - void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); } - /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ - void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); } - - /// Returns resize mode - TextureResizeMode getResizeMode() const { return mTexResizeMode; } - - /// Sets resize mode of texture \sa TextureResizeMode - void setResizeMode( TextureResizeMode _set ) { mTexResizeMode = _set; } - - /// Checks if the texture has the source (required by user) size, otherwise real texture size are bigger. - bool isTextureSrcSize() const; - - /// Returns true if the texture was created (and exists), otherwise false - bool isTextureCreated() const { return mTexture != nullptr; } - - /// Returns true if we own the texture, otherwise false. \sa mManaged - bool isTextureManaged() const { return mTexManaged; } - - /// Reurns interface texture. - ITexture* getTexture() { return mTexture; } - - /// Sets the texture managed @remarks Be careful with assigning managed status to texture, which wasn't created in Canvas! \sa mManaged - void setTextureManaged( bool _value ) { mTexManaged = _value; } - - /// Returns default GUI texture usage - static TextureUsage getDefaultTextureUsage() { return TextureUsage::Stream | TextureUsage::Write; } - - /// Returns default GUI texture format - static PixelFormat getDefaultTextureFormat() { return PixelFormat::R8G8B8A8; } - - /*event:*/ - /** Event : Notify user texture instance will be changed \sa requestUpdateCanvas\n - signature : void method(MyGUI::Canvas* _canvas)\n - @param _canvas, which will be updated - */ - EventInfo_Canvas eventPreTextureChanges; - - /** Event : Texture instance was changed (May be caused by resizing texture or lossing device). User have to update all references to new instance of texture.\n - signature : void method(MyGUI::Canvas* _canvas, MyGUI::Canvas::Event _event)\n - @param _canvas, which needs to update - @param _event - */ - EventInfo_CanvasEvent requestUpdateCanvas; - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - protected: - virtual ~Canvas(); - - /// Destroys texture - void _destroyTexture( bool _sendEvent ); - - /// Update entered parameters according to current texture resize mode(size) and restore (if can) parameters of usage and format from texture - void validate( int& _width, int& _height, TextureUsage& _usage, PixelFormat& _format ) const; - - /// Creates the texture itself - void createExactTexture( int _width, int _height, TextureUsage _usage, PixelFormat _format ); - - /// Checks if we need to create a texture with such sizes. - bool checkCreate( int _width, int _height ) const; - - /// Calls when resize widget - void resize( const IntSize& _size ); - - /// Correct texture uv-coordinates - void correctUV(); - - //! @copydoc Widget::baseChangeWidgetSkin(ResourceSkin* _info) - void baseChangeWidgetSkin( ResourceSkin* _info ); - - //! @copydoc Widget::initialiseWidgetSkin(ResourceSkin* _info) - void initialiseWidgetSkin( ResourceSkin* _info ); - - //! @copydoc Widget::shutdownWidgetSkin() - void shutdownWidgetSkin(); - - /// For updating once per frame. - void frameAdvise( bool _advise ); - - /// For updating once per frame. - void frameEntered( float _time ); - - virtual void textureInvalidate(ITexture* _texture); - - protected: - /// Current texture - ITexture* mTexture; - - /// Requested bu user sizes - IntSize mReqTexSize; - - /// Generated texture name - std::string mGenTexName; - - /// Texture resize mode \sa TextureResizeMode - TextureResizeMode mTexResizeMode; - - /// Saved pointer from last calling lock. \sa lock - uint8* mTexData; - - /// true if we own the texture (can delete it or replace by another instance), otherwise false - bool mTexManaged; - - /// For updating once per frame. True state means updating before next frame starts. - bool mFrameAdvise; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_CANVAS_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_CastWidget.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_CastWidget.h deleted file mode 100644 index 28ac57789..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_CastWidget.h +++ /dev/null @@ -1,47 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_CAST_WIDGET_H__ -#define __MYGUI_CAST_WIDGET_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Widget.h" - -namespace MyGUI -{ - -#ifndef MYGUI_DONT_USE_OBSOLETE - - // шаблонный класс для проверки типа виджета - template - MYGUI_OBSOLETE("use : template Type* Widget::castType(bool _throw)") - T* castWidget(Widget * _widget) - { - MYGUI_DEBUG_ASSERT(nullptr != _widget, "Error static cast, widget == nullptr"); - return _widget->castType(); - } - -#endif // MYGUI_DONT_USE_OBSOLETE - -} // namespace MyGUI - -#endif // __MYGUI_CAST_WIDGET_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ChildSkinInfo.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ChildSkinInfo.h deleted file mode 100644 index 4a129252d..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ChildSkinInfo.h +++ /dev/null @@ -1,73 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_CHILD_SKIN_INFO_H__ -#define __MYGUI_CHILD_SKIN_INFO_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_WidgetStyle.h" - -namespace MyGUI -{ - - struct MYGUI_EXPORT ChildSkinInfo - { - ChildSkinInfo() : style(WidgetStyle::Child), align(Align::Default) { } - - ChildSkinInfo(const std::string& _type, const WidgetStyle& _style, const std::string& _skin, const IntCoord& _coord, const Align& _align, const std::string& _layer, const std::string& _name) : - type(_type), - skin(_skin), - name(_name), - layer(_layer), - style(_style), - coord(_coord), - align(_align) - { - // set Child style by default - if (style == WidgetStyle::MAX) style = WidgetStyle::Child; - } - - void addParam(const std::string& _key, const std::string& _value) - { - params[_key] = _value; - } - - std::string findValue(const std::string& _key) const - { - MapString::const_iterator iter = params.find(_key); - if (iter != params.end()) return iter->second; - return ""; - } - - std::string type, skin, name, layer; - WidgetStyle style; - IntCoord coord; - Align align; - MapString params; - }; - - typedef std::vector VectorChildSkinInfo; - -} // namespace MyGUI - - -#endif // __MYGUI_CHILD_SKIN_INFO_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ClipboardManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ClipboardManager.h deleted file mode 100644 index 857ce012a..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ClipboardManager.h +++ /dev/null @@ -1,70 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_CLIPBOARD_MANAGER_H__ -#define __MYGUI_CLIPBOARD_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Instance.h" -#include "MyGUI_Types.h" -#include "MyGUI_UString.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT ClipboardManager - { - MYGUI_INSTANCE_HEADER( ClipboardManager ) - - public: - void initialise(); - void shutdown(); - - /** Set current data in clipboard - @param _type of data (for example "Text") - @param _data - */ - void setClipboardData(const std::string& _type, const std::string& _data); - /** Clear specific type data - @param _type of data to delete (for example "Text") - */ - void clearClipboardData(const std::string& _type); - /** Get specific type data - @param _type of data to get (for example "Text") - */ - std::string getClipboardData(const std::string& _type); - - private: - MapString mClipboardData; - -#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32 - // дискриптор нашего главного окна - size_t mHwnd; - // строка, которую мы положили в буфер обмена винды - UString mPutTextInClipboard; -#endif - - }; - -} - -#endif // __MYGUI_CLIPBOARD_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Colour.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Colour.h deleted file mode 100644 index bb51b3239..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Colour.h +++ /dev/null @@ -1,163 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_COLOUR_H__ -#define __MYGUI_COLOUR_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" - -namespace MyGUI -{ - - struct MYGUI_EXPORT Colour - { - float red, green, blue, alpha; - - static const Colour Zero; - static const Colour Black; - static const Colour White; - static const Colour Red; - static const Colour Green; - static const Colour Blue; - - Colour() : red( 1 ), green( 1 ), blue( 1 ), alpha( 1 ) { } - Colour( float _red, float _green, float _blue, float _alpha = 1 ) : red( _red ), green( _green ), blue( _blue ), alpha( _alpha ) { } - explicit Colour(const std::string& _value) { *this = parse(_value); } - - - Colour& operator=( Colour const& _value ) - { - red = _value.red; - green = _value.green; - blue = _value.blue; - alpha = _value.alpha; - return *this; - } - - bool operator==( Colour const& _value ) const - { - return ((red == _value.red) && (green == _value.green) && (blue == _value.blue) && (alpha == _value.alpha)); - } - - bool operator!=( Colour const& _value ) const - { - return ! (*this == _value); - } - - void set( float _red, float _green, float _blue, float _alpha = 1 ) - { - red = _red; - green = _green; - blue = _blue; - alpha = _alpha; - } - - void clear() - { - red = green = blue = alpha = 0; - } - - std::string print() const - { - std::ostringstream stream; - stream << *this; - return stream.str(); - } - - static Colour parse(const std::string& _value) - { - if (!_value.empty()) - { - if (_value[0] == '#') - { - std::istringstream stream(_value.substr(1)); - int result = 0; - stream >> std::hex >> result; - if (!stream.fail()) - { - return Colour( (unsigned char)( result >> 16 ) / 256.0f, (unsigned char)( result >> 8 ) / 256.0f, (unsigned char)( result ) / 256.0f ); - } - } - else - { - float red, green, blue, alpha = 1; - std::istringstream stream(_value); - stream >> red >> green >> blue; - if (!stream.fail()) - { - if (!stream.eof()) - stream >> alpha; - return Colour(red, green, blue, alpha); - } - } - } - return Colour::Zero; - } - - friend std::ostream& operator << ( std::ostream& _stream, const Colour& _value ) - { - _stream << _value.red << " " << _value.green << " " << _value.blue << " " << _value.alpha; - return _stream; - } - - friend std::istream& operator >> ( std::istream& _stream, Colour& _value ) - { - _value.clear(); - - std::string value; - _stream >> value; - - if (value.empty()) - return _stream; - - if (value[0] == '#') - { - _value = Colour::parse(value); - } - else - { - std::istringstream stream(value); - stream >> _value.red; - if (stream.fail()) - _value.clear(); - else - { - _stream >> _value.green >> _value.blue; - if (!_stream.eof()) - _stream >> _value.alpha; - else - _value.alpha = 1; - - if (_stream.fail()) - _value.clear(); - } - } - - return _stream; - } - - }; - -} // namespace MyGUI - -#endif // __MYGUI_COLOUR_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ComboBox.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ComboBox.h deleted file mode 100644 index ffdd1b158..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ComboBox.h +++ /dev/null @@ -1,237 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_COMBO_BOX_H__ -#define __MYGUI_COMBO_BOX_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Edit.h" -#include "MyGUI_List.h" -#include "MyGUI_Any.h" -#include "MyGUI_EventPair.h" -#include "MyGUI_ControllerFadeAlpha.h" - -namespace MyGUI -{ - - typedef delegates::CDelegate2 EventHandle_ComboBoxPtrSizeT; - - class MYGUI_EXPORT ComboBox : - public Edit - { - MYGUI_RTTI_DERIVED( ComboBox ) - - public: - ComboBox(); - - //------------------------------------------------------------------------------// - // манипуляции айтемами - - //! Get number of items - size_t getItemCount() const { return mList->getItemCount(); } - - //! Insert an item into a array at a specified position - void insertItemAt(size_t _index, const UString& _name, Any _data = Any::Null); - - //! Add an item to the end of a array - void addItem(const UString& _name, Any _data = Any::Null) { return insertItemAt(ITEM_NONE, _name, _data); } - - //! Remove item at a specified position - void removeItemAt(size_t _index); - - //! Remove all items - void removeAllItems(); - - - //! Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found - size_t findItemIndexWith(const UString& _name); - - - //------------------------------------------------------------------------------// - // манипуляции выделениями - - //! Get index of selected item (ITEM_NONE if none selected) - size_t getIndexSelected() { return mItemIndex; } - - //! Select specified _index - void setIndexSelected(size_t _index); - - //! Clear item selection - void clearIndexSelected() { setIndexSelected(ITEM_NONE); } - - - //------------------------------------------------------------------------------// - // манипуляции данными - - //! Replace an item data at a specified position - void setItemDataAt(size_t _index, Any _data); - - //! Clear an item data at a specified position - void clearItemDataAt(size_t _index) { setItemDataAt(_index, Any::Null); } - - //! Get item data from specified position - template - ValueType * getItemDataAt(size_t _index, bool _throw = true) - { - return mList->getItemDataAt(_index, _throw); - } - - - //------------------------------------------------------------------------------// - // манипуляции отображением - - //! Replace an item name at a specified position - void setItemNameAt(size_t _index, const UString& _name); - - //! Get item name from specified position - const UString& getItemNameAt(size_t _index) { return mList->getItemNameAt(_index); } - - - //------------------------------------------------------------------------------// - // манипуляции выдимостью - - //! Move all elements so specified becomes visible - void beginToItemAt(size_t _index) { mList->beginToItemAt(_index); } - - //! Move all elements so first becomes visible - void beginToItemFirst() { if (getItemCount()) beginToItemAt(0); } - - //! Move all elements so last becomes visible - void beginToItemLast() { if (getItemCount()) beginToItemAt(getItemCount() - 1); } - - //! Move all elements so selected becomes visible - void beginToItemSelected() { if (getIndexSelected() != ITEM_NONE) beginToItemAt(getIndexSelected()); } - - - //------------------------------------------------------------------------------------// - // методы для управления отображением - - //! Set drop list mode (text can not be edited) - void setComboModeDrop(bool _value); - //! Get drop list mode flag - bool getComboModeDrop() { return mModeDrop; } - - //! Set smooth show of list - void setSmoothShow(bool _value) { mShowSmooth = _value; } - //! Get smooth show of list flag - bool getSmoothShow() { return mShowSmooth; } - - //! Get max list height - void setMaxListHeight(int _value) { mMaxHeight = _value; } - //! Set max list height - int getMaxListHeight() { return mMaxHeight; } - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*event:*/ - /** Event : Enter pressed in combo mode or item selected in drop.\n - signature : void method(MyGUI::ComboBox* _sender, size_t _index) - @param _sender widget that called this event - @param _index item - */ - EventPair eventComboAccept; - - /** Event : Position changed.\n - signature : void method(MyGUI::ComboBox* _sender, size_t _index) - @param _sender widget that called this event - @param _index of new position - */ - EventPair eventComboChangePosition; - - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : size_t ComboBox::getIndexSelected()") - size_t getItemIndexSelected() { return getIndexSelected(); } - MYGUI_OBSOLETE("use : void ComboBox::setIndexSelected(size_t _index)") - void setItemSelectedAt(size_t _index) { setIndexSelected(_index); } - MYGUI_OBSOLETE("use : void ComboBox::clearIndexSelected()") - void clearItemSelected() { clearIndexSelected(); } - - MYGUI_OBSOLETE("use : void ComboBox::insertItemAt(size_t _index, const UString& _name)") - void insertItem(size_t _index, const UString& _name) { insertItemAt(_index, _name); } - MYGUI_OBSOLETE("use : void ComboBox::setItemNameAt(size_t _index, const UString& _name)") - void setItem(size_t _index, const UString& _item) { setItemNameAt(_index, _item); } - MYGUI_OBSOLETE("use : const UString& ComboBox::getItemNameAt(size_t _index)") - const UString& getItem(size_t _index) { return getItemNameAt(_index); } - MYGUI_OBSOLETE("use : void ComboBox::removeItemAt(size_t _index)") - void deleteItem(size_t _index) { removeItemAt(_index); } - MYGUI_OBSOLETE("use : void ComboBox::removeAllItems()") - void deleteAllItems() { removeAllItems(); } - MYGUI_OBSOLETE("use : size_t ComboBox::getIndexSelected()") - size_t getItemSelect() { return getIndexSelected(); } - MYGUI_OBSOLETE("use : void void ComboBox::clearIndexSelected()") - void resetItemSelect() { clearIndexSelected(); } - MYGUI_OBSOLETE("use : void ComboBox::setIndexSelected(size_t _index)") - void setItemSelect(size_t _index) { setIndexSelected(_index); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - protected: - virtual ~ComboBox(); - - virtual void onKeyButtonPressed(KeyCode _key, Char _char); - - virtual void baseChangeWidgetSkin(ResourceSkin* _info); - - private: - void notifyButtonPressed(Widget* _sender, int _left, int _top, MouseButton _id); - void notifyListLostFocus(Widget* _sender, MyGUI::Widget* _new); - void notifyListSelectAccept(List* _widget, size_t _position); - void notifyListMouseItemActivate(List* _widget, size_t _position); - void notifyListChangePosition(List* _widget, size_t _position); - void notifyMouseWheel(Widget* _sender, int _rel); - void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id); - void notifyEditTextChange(Edit* _sender); - - void showList(); - void hideList(); - - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - void actionWidgetHide(Widget* _widget); - - ControllerFadeAlpha* createControllerFadeAlpha(float _alpha, float _coef, bool _enable); - - private: - Button* mButton; - List* mList; - - bool mListShow; - int mMaxHeight; - size_t mItemIndex; - bool mModeDrop; - bool mDropMouse; - bool mShowSmooth; - bool mManualList; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_COMBO_BOX_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Common.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Common.h deleted file mode 100644 index 079a92ee2..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Common.h +++ /dev/null @@ -1,57 +0,0 @@ -/*! - @file - @author Albert Semenov - @author baho_is - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_COMMON_H__ -#define __MYGUI_COMMON_H__ - -#include "MyGUI_Prerequest.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef MYGUI_CUSTOM_ALLOCATOR -# include "MyGUI_CustomAllocator.h" -#else // MYGUI_CUSTOM_ALLOCATOR -# include "MyGUI_Allocator.h" -#endif // MYGUI_CUSTOM_ALLOCATOR - -#include "MyGUI_Macros.h" -#include "MyGUI_Diagnostic.h" -#include "MyGUI_LogManager.h" -#include "MyGUI_Instance.h" -#include "MyGUI_Types.h" -#include "MyGUI_RenderOut.h" -#include "MyGUI_Utility.h" -#include "MyGUI_InputDefine.h" -#include "MyGUI_Version.h" -#include "MyGUI_WidgetStyle.h" -#include "MyGUI_UString.h" -#include "MyGUI_Delegate.h" - -#endif // __MYGUI_COMMON_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_CommonStateInfo.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_CommonStateInfo.h deleted file mode 100644 index 1788c558e..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_CommonStateInfo.h +++ /dev/null @@ -1,145 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_COMMON_STATE_INFO_H__ -#define __MYGUI_COMMON_STATE_INFO_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_IStateInfo.h" -#include "MyGUI_CoordConverter.h" -#include "MyGUI_LanguageManager.h" -#include "MyGUI_TextureUtility.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT SubSkinStateInfo : - public IStateInfo - { - MYGUI_RTTI_DERIVED( SubSkinStateInfo ) - - public: - virtual ~SubSkinStateInfo() { } - - const FloatRect& getRect() { return mRect; } - - private: - virtual void deserialization(xml::ElementPtr _node, Version _version) - { - std::string texture = _node->getParent()->getParent()->findAttribute("texture"); - - // - if (_version >= Version(1, 1)) - { - texture = LanguageManager::getInstance().replaceTags(texture); - } - - const IntSize& size = texture_utility::getTextureSize(texture); - const IntCoord& coord = IntCoord::parse(_node->findAttribute("offset")); - mRect = CoordConverter::convertTextureCoord(coord, size); - } - - private: - FloatRect mRect; - }; - - class MYGUI_EXPORT TileRectStateInfo : - public IStateInfo - { - MYGUI_RTTI_DERIVED( TileRectStateInfo ) - - public: - TileRectStateInfo() : mTileH(true), mTileV(true) { } - virtual ~TileRectStateInfo() { } - - const FloatRect& getRect() { return mRect; } - const IntSize& getTileSize() { return mTileSize; } - bool getTileH() { return mTileH; } - bool getTileV() { return mTileV; } - - private: - virtual void deserialization(xml::ElementPtr _node, Version _version) - { - std::string texture = _node->getParent()->getParent()->findAttribute("texture"); - - // - if (_version >= Version(1, 1)) - { - texture = LanguageManager::getInstance().replaceTags(texture); - } - - const IntSize& size = texture_utility::getTextureSize(texture); - const IntCoord& coord = IntCoord::parse(_node->findAttribute("offset")); - mRect = CoordConverter::convertTextureCoord(coord, size); - - xml::ElementEnumerator prop = _node->getElementEnumerator(); - while (prop.next("Property")) - { - const std::string& key = prop->findAttribute("key"); - const std::string& value = prop->findAttribute("value"); - if (key == "TileH") mTileH = utility::parseBool(value); - else if (key == "TileV") mTileV = utility::parseBool(value); - else if (key == "TileSize") mTileSize = IntSize::parse(value); - } - } - - private: - FloatRect mRect; - IntSize mTileSize; - bool mTileH; - bool mTileV; - }; - - class MYGUI_EXPORT EditTextStateInfo : - public IStateInfo - { - MYGUI_RTTI_DERIVED( EditTextStateInfo ) - - public: - EditTextStateInfo() : mColour(Colour::White), mShift(false) { } - virtual ~EditTextStateInfo() { } - - const Colour& getColour() { return mColour; } - bool getShift() { return mShift; } - - private: - virtual void deserialization(xml::ElementPtr _node, Version _version) - { - mShift = utility::parseBool(_node->findAttribute("shift")); - - std::string colour = _node->findAttribute("colour"); - if (_version >= Version(1, 1)) - { - colour = LanguageManager::getInstance().replaceTags(colour); - } - - mColour = Colour::parse(colour); - } - - private: - Colour mColour; - bool mShift; - }; - -} // namespace MyGUI - -#endif // __MYGUI_COMMON_STATE_INFO_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerEdgeHide.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerEdgeHide.h deleted file mode 100644 index 5a050e778..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerEdgeHide.h +++ /dev/null @@ -1,84 +0,0 @@ -/*! - @file - @author Evmenov Georgiy - @date 04/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_CONTROLLER_EDGE_HIDE_H__ -#define __MYGUI_CONTROLLER_EDGE_HIDE_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_WidgetDefines.h" -#include "MyGUI_ControllerItem.h" -#include "MyGUI_Types.h" - -namespace MyGUI -{ - - /** This controller used for hiding widgets near screen edges. - Widget will start hiding(move out of screen) if it's near - border and it and it's childrens don't have any focus. Hiding - till only small part of widget be visible. Widget will move - inside screen if it have any focus. - */ - class MYGUI_EXPORT ControllerEdgeHide : - public ControllerItem - { - MYGUI_RTTI_DERIVED( ControllerEdgeHide ) - - public: - ControllerEdgeHide(); - virtual ~ControllerEdgeHide() { } - - /** - @param _value in which widget will be hidden or shown - */ - void setTime(float _value) { mTime = _value; } - - /** - @param _remainPixels how many pixels you will see afterr full hide - */ - void setRemainPixels(int _value) { mRemainPixels = _value; } - - /** - @param _shadowSize adds to _remainPixels when hiding left or top (for example used for windows with shadows) - */ - void setShadowSize(int _value) { mShadowSize = _value; } - - virtual void setProperty(const std::string& _key, const std::string& _value); - - private: - bool addTime(Widget* _widget, float _time); - void prepareItem(Widget* _widget); - - void recalculateTime(Widget* _widget); - - delegates::CDelegate1 eventPostAction; - - float mTime; - int mRemainPixels; - int mShadowSize; - float mElapsedTime; - // for checking if widget was moved - MyGUI::IntCoord mLastCoord; - }; - -} - -#endif // __MYGUI_CONTROLLER_EDGE_HIDE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerFadeAlpha.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerFadeAlpha.h deleted file mode 100644 index 2bbe58ccc..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerFadeAlpha.h +++ /dev/null @@ -1,78 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_CONTROLLER_FADE_ALPHA_H__ -#define __MYGUI_CONTROLLER_FADE_ALPHA_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_WidgetDefines.h" -#include "MyGUI_ControllerItem.h" - -namespace MyGUI -{ - - /** This controller used for smooth changing alpha of widget in time */ - class MYGUI_EXPORT ControllerFadeAlpha : - public ControllerItem - { - MYGUI_RTTI_DERIVED( ControllerFadeAlpha ) - - public: - ControllerFadeAlpha(); - virtual ~ControllerFadeAlpha() { } - - /** - @param _alpha that will be as result of changing - */ - void setAlpha(float _value) { mAlpha = _value; } - - /** - @param _coef of alpha changing speed (1. mean that alpha will change from 0 to 1 at 1 second) - */ - void setCoef(float _value) { mCoef = _value; } - - /** - @param _enabled if true then widget will be inactive after start of alpha changing - */ - void setEnabled(bool _value) { mEnabled = _value; } - - - virtual void setProperty(const std::string& _key, const std::string& _value); - - private: - bool addTime(Widget* _widget, float _time); - void prepareItem(Widget* _widget); - - bool getEnabled() { return mEnabled; } - float getAlpha() { return mAlpha; } - float getCoef() { return mCoef; } - - private: - float mAlpha; - float mCoef; - bool mEnabled; - - }; - -} - -#endif // __MYGUI_CONTROLLER_FADE_ALPHA_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerItem.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerItem.h deleted file mode 100644 index 74d162ff8..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerItem.h +++ /dev/null @@ -1,73 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_CONTROLLER_ITEM_H__ -#define __MYGUI_CONTROLLER_ITEM_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_WidgetDefines.h" -#include "MyGUI_IObject.h" -#include "MyGUI_Delegate.h" - -namespace MyGUI -{ - - /** Base interface for controllers */ - class MYGUI_EXPORT ControllerItem : - public IObject - { - MYGUI_RTTI_DERIVED( ControllerItem ) - - public: - virtual ~ControllerItem() { } - - virtual void prepareItem(Widget* _widget) = 0; - virtual bool addTime(Widget* _widget, float _time) = 0; - - virtual void setProperty(const std::string& _key, const std::string& _value) { } - - /** Event : Before controller started working.\n - signature : void method(MyGUI::Widget* _sender)\n - @param _sender widget under control - */ - delegates::CDelegate1 - eventPreAction; - - /** Event : Controller updated (called every frame).\n - signature : void method(MyGUI::Widget* _sender)\n - @param _sender widget under control - */ - delegates::CDelegate1 - eventUpdateAction; - - /** Event : After controller finished working.\n - signature : void method(MyGUI::Widget* _sender)\n - @param _sender widget under control - */ - delegates::CDelegate1 - eventPostAction; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_CONTROLLER_ITEM_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerManager.h deleted file mode 100644 index 4910313e0..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerManager.h +++ /dev/null @@ -1,74 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_CONTROLLER_MANAGER_H__ -#define __MYGUI_CONTROLLER_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Instance.h" -#include "MyGUI_ControllerItem.h" -#include "MyGUI_IUnlinkWidget.h" -#include "MyGUI_WidgetDefines.h" -#include "MyGUI_ActionController.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT ControllerManager : public IUnlinkWidget - { - MYGUI_INSTANCE_HEADER( ControllerManager ) - - public: - void initialise(); - void shutdown(); - - // - ControllerItem* createItem(const std::string& _type); - - /** Add controlled widget - @param _widget to be controlled - @param _item controller with some actions (for example ControllerFadeAlpha or your own) - @note _item will be deleted automatically at end of controller lifetime - (if not removed by removeItem(Widget* _widget) before) - */ - void addItem(Widget* _widget, ControllerItem * _item); - - /** Stop the control over a widget - @param _widget to be removed - */ - void removeItem(Widget* _widget); - - private: - void _unlinkWidget(Widget* _widget); - void frameEntered(float _time); - void clear(); - - private: - typedef std::pair PairControllerItem; - typedef std::list ListControllerItem; - ListControllerItem mListItem; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_CONTROLLER_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerPosition.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerPosition.h deleted file mode 100644 index 147770915..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ControllerPosition.h +++ /dev/null @@ -1,95 +0,0 @@ -/*! - @file - @author Evmenov Georgiy - @date 03/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_CONTROLLER_POSITION_H__ -#define __MYGUI_CONTROLLER_POSITION_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Delegate.h" -#include "MyGUI_Types.h" -#include "MyGUI_WidgetDefines.h" -#include "MyGUI_ControllerItem.h" - -namespace MyGUI -{ - - /** This controller used for smooth changing position of widget in time */ - class MYGUI_EXPORT ControllerPosition : - public ControllerItem - { - MYGUI_RTTI_DERIVED( ControllerPosition ) - - public: - typedef delegates::CDelegate4 FrameAction; - - ControllerPosition(); - virtual ~ControllerPosition() { } - - void setCoord(const IntCoord& _value); - - void setSize(const IntSize& _value); - - void setPosition(const IntPoint& _value); - - void setFunction(const std::string& _value); - - /** - @param _value seconds in which widget planned to reach destination coordinate - */ - void setTime(float _value) { mTime = _value; } - - /** - @param _action applied to widget every frame (see ControllerPosition::eventFrameAction) - */ - void setAction(FrameAction::IDelegate* _value) { eventFrameAction = _value; } - - virtual void setProperty(const std::string& _key, const std::string& _value); - - private: - bool addTime(Widget* _widget, float _time); - void prepareItem(Widget* _widget); - - float getElapsedTime() { return mElapsedTime; } - - IntCoord mStartCoord; - IntCoord mDestCoord; - float mTime; - float mElapsedTime; - - // controller changing position - bool mCalcPosition; - // controller changing size - bool mCalcSize; - - /** Event : Every frame action while controller exist.\n - signature : void method(const IntRect& _startRect, const IntRect& _destRect, IntRect& _result, float _current_time)\n - @param _startRect start coordinate of widget - @param _destRect destination coordinate - @param _result resultRect - @param _current_time elapsed time (_current_time is real elapsed time divided by _time(see constructor) so _current_time == 1 mean that _time seconds elapsed) - */ - FrameAction eventFrameAction; - }; - -} - -#endif // __MYGUI_CONTROLLER_POSITION_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_CoordConverter.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_CoordConverter.h deleted file mode 100644 index 82a0f7e3d..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_CoordConverter.h +++ /dev/null @@ -1,92 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_COORD_CONVERTER_H__ -#define __MYGUI_COORD_CONVERTER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT CoordConverter - { - public: - /** Convert pixel coordinates to texture UV coordinates */ - static FloatRect convertTextureCoord(const IntCoord& _coord, const IntSize& _textureSize) - { - if (!_textureSize.width || !_textureSize.height) return FloatRect(); - return FloatRect( - (float)_coord.left / (float)_textureSize.width, - (float)_coord.top / (float)_textureSize.height, - (float)_coord.right() / (float)_textureSize.width, - (float)_coord.bottom() / (float)_textureSize.height); - } - - /* Convert from relative to pixel coordinates. - @param _coord relative coordinates. - */ - static IntCoord convertFromRelative(const FloatCoord& _coord, const IntSize& _view) - { - return IntCoord(int(_coord.left * _view.width), int(_coord.top * _view.height), int(_coord.width * _view.width), int(_coord.height * _view.height)); - } - - /* Convert from relative to pixel coordinates. - @param _coord relative coordinates. - */ - static IntSize convertFromRelative(const FloatSize& _size, const IntSize& _view) - { - return IntSize(int(_size.width * _view.width), int(_size.height * _view.height)); - } - - /* Convert from relative to pixel coordinates. - @param _coord relative coordinates. - */ - static IntPoint convertFromRelative(const FloatPoint& _point, const IntSize& _view) - { - return IntPoint(int(_point.left * _view.width), int(_point.top * _view.height)); - } - - /* Convert from pixel to relative coordinates. - @param _coord pixel coordinates. - */ - static FloatCoord convertToRelative(const IntCoord& _coord, const IntSize& _view) - { - return FloatCoord(_coord.left / (float)_view.width, _coord.top / (float)_view.height, _coord.width / (float)_view.width, _coord.height / (float)_view.height); - } - - static FloatSize convertToRelative(const IntSize& _size, const IntSize& _view) - { - return FloatSize(_size.width / (float)_view.width, _size.height / (float)_view.height); - } - - static FloatPoint convertToRelative(const IntPoint& _point, const IntSize& _view) - { - return FloatPoint(_point.left / (float)_view.width, _point.top / (float)_view.height); - } - - }; - -} // namespace MyGUI - -#endif // __MYGUI_COORD_CONVERTER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_CustomAllocator.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_CustomAllocator.h deleted file mode 100644 index 870092a64..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_CustomAllocator.h +++ /dev/null @@ -1,101 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 05/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_CUSTOM_ALLOCATOR_H__ -#define __MYGUI_CUSTOM_ALLOCATOR_H__ - -#include -#include - -// for Ogre version -#include - -#if OGRE_VERSION < MYGUI_DEFINE_VERSION(1, 6, 0) -#include -#include -#endif - -namespace MyGUI -{ - - template - class Allocator - { - public: - // typedefs - 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 std::size_t size_type; - typedef std::ptrdiff_t difference_type; - - public: - // convert an allocator to allocator - template - struct rebind - { - typedef Allocator other; - }; - - public: - inline explicit Allocator() { } - inline ~Allocator() { } - template - inline explicit Allocator(Allocator const&) { } - - // address - inline pointer address(reference r) { return &r; } - inline const_pointer address(const_reference r) { return &r; } - - // memory allocation - inline pointer allocate(size_type cnt, typename std::allocator::const_pointer = 0) - { - return reinterpret_cast(::operator new (cnt * sizeof (T))); - } - inline void deallocate(pointer p, size_type) - { - ::operator delete (p); - } - - // size - inline size_type max_size() const - { - return std::numeric_limits::max() / sizeof(T); - } - - // construction/destruction - inline void construct(pointer p, const T& t) { new (p) T(t); } - inline void destroy(pointer p) { p->~T(); } - - inline bool operator==(Allocator const&) { return true; } - inline bool operator!=(Allocator const& a) { return !operator==(a); } - }; - -} // namespace MyGUI - -#if OGRE_VERSION < MYGUI_DEFINE_VERSION(1, 6, 0) -#include -#endif - -#endif // __MYGUI_CUSTOM_ALLOCATOR_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DDContainer.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DDContainer.h deleted file mode 100644 index 560cb9018..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DDContainer.h +++ /dev/null @@ -1,175 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 10/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_DDCONTAINER_H__ -#define __MYGUI_DDCONTAINER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Widget.h" -#include "MyGUI_DDItemInfo.h" -#include "MyGUI_EventPair.h" - -namespace MyGUI -{ - - typedef delegates::CDelegate3 EventHandle_DDContainerPtrCDDItemInfoRefBoolRef; - typedef delegates::CDelegate3 EventHandle_DDContainerPtrCDDItemInfoRefBool; - typedef delegates::CDelegate2 EventHandle_EventHandle_DDContainerPtrDDItemState; - typedef delegates::CDelegate3 EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef; - - - class MYGUI_EXPORT DDContainer : - public Widget - { - MYGUI_RTTI_DERIVED( DDContainer ) - - public: - DDContainer(); - - /** Set drag'n'drop mode flag. - Disabled (false) by default. - */ - void setNeedDragDrop(bool _value) { mNeedDragDrop = _value; } - /** Get drag'n'drop mode flag */ - bool getNeedDragDrop() { return mNeedDragDrop; } - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*event:*/ - /** Event : request for start drag - signature : void method(MyGUI::DDContainer* _sender, const MyGUI::DDItemInfo& _info, bool& _result) - @param _sender widget that called this event - @param _info information about DDContainers - @param _result write here true if container can be draggedor false if it can't - */ - EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventStartDrag; - - /** Event : request for start drag (moving mouse over container, but not dropped yet) - signature : void method(MyGUI::DDContainer* _sender, const MyGUI::DDItemInfo& _info, bool& _result) - @param _sender widget that called this event - @param _info information about DDContainers - @param _result write here true if container accept dragged widget or false if it isn't - */ - EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventRequestDrop; - - /** Event : end drag (drop) - signature : void method(MyGUI::DDContainer* _sender, const MyGUI::DDItemInfo& _info, bool _result) - @param _sender widget that called this event - @param _info information about DDContainers - @param _result if true then drop was successfull - */ - EventHandle_DDContainerPtrCDDItemInfoRefBool eventDropResult; - - /** Event : drag'n'drop state changed - signature : void method(MyGUI::DDContainer* _sender, MyGUI::DDItemState _state) - @param _sender widget that called this event - @param _state new state - */ - EventHandle_EventHandle_DDContainerPtrDDItemState eventChangeDDState; - - /** Event : [not used] request widget for dragging - signature : void method(MyGUI::DDContainer* _sender, MyGUI::Widget*& _item, MyGUI::IntCoord& _dimension) - @param _sender widget that called this event - @param _item write widget pointer here - @param _dimension write widget coordinate here - */ - EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef requestDragWidgetInfo; - - - /*internal:*/ - // метод для установления стейта айтема - virtual void _setContainerItemInfo(size_t _index, bool _set, bool _accept) { } - - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - /** Event : внутреннее событие, невалидна информация для контейнера - signature : void method(MyGUI::DDContainer* _sender) - @param _sender widget that called this event - */ - EventPair > - _eventInvalideContainer; - - /** Event : !!обновить виджеты дропа DD_FIXME наверное internal - signature : void method(MyGUI::DDContainer* _sender, MyGUI::Widget* _item, const MyGUI::DDWidgetState& _state) - @param _sender widget that called this event - @param _items - @param _state - */ - delegates::CDelegate3 - eventUpdateDropState; - - protected: - virtual ~DDContainer(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id); - virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id); - virtual void onMouseDrag(int _left, int _top); - - virtual void notifyInvalideDrop(DDContainer* _sender); - - virtual void _getContainer(Widget*& _container, size_t& _index); - - virtual void removeDropItems(); - virtual void updateDropItems(); - virtual void updateDropItemsState(const DDWidgetState& _state); - - void mouseDrag(); - void mouseButtonReleased(MouseButton _id); - void mouseButtonPressed(MouseButton _id); - - void endDrop(bool _reset); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - - protected: - bool mDropResult; - bool mNeedDrop; - bool mStartDrop; - - Widget* mOldDrop; - Widget* mCurrentSender; - - DDItemInfo mDropInfo; - - size_t mDropSenderIndex; - - // список виджетов для дропа - Widget* mDropItem; - IntCoord mDropDimension; - - IntPoint mClickInWidget; - - // нужно и виджету поддержка драг энд дропа - bool mNeedDragDrop; - - DDContainer* mReseiverContainer; - }; - -} // namespace MyGUI - -#endif // __MYGUI_DDCONTAINER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DDItemInfo.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DDItemInfo.h deleted file mode 100644 index 288598073..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DDItemInfo.h +++ /dev/null @@ -1,120 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_ITEM_DROP_INFO_H__ -#define __MYGUI_ITEM_DROP_INFO_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - struct MYGUI_EXPORT DDItemState - { - enum Enum - { - None, - Start, /**< start drag */ - End, /**< end drag (drop) */ - Miss, /**< drag DDContainer over empty space or widgets that don't have drag'n'drop */ - Accept, /**< drag DDContainer over another DDContainer that accept dropping on it */ - Refuse /**< drag DDContainer over another DDContainer that refuse dropping on it */ - }; - - DDItemState(Enum _value = None) : value(_value) { } - - friend bool operator == (DDItemState const& a, DDItemState const& b) { return a.value == b.value; } - friend bool operator != (DDItemState const& a, DDItemState const& b) { return a.value != b.value; } - - private: - Enum value; - }; - - // структура информации об индексах дропа - /** Inormation about drag'n'drop indexes */ - struct MYGUI_EXPORT DDItemInfo - { - DDItemInfo() : - sender(nullptr), - sender_index(ITEM_NONE), - receiver(nullptr), - receiver_index(ITEM_NONE) - { - } - - DDItemInfo(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index) : - sender(_sender), - sender_index(_sender_index), - receiver(_receiver), - receiver_index(_receiver_index) - { - } - - void set(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index) - { - sender = _sender; - sender_index = _sender_index; - receiver = _receiver; - receiver_index = _receiver_index; - } - - void reset() - { - sender = nullptr; - sender_index = ITEM_NONE; - receiver = nullptr; - receiver_index = ITEM_NONE; - } - - /** DDContainer that send this event (container from which we started drag) */ - DDContainer* sender; - /** Index of sender container */ - size_t sender_index; - - /** DDContainer that receive dragged widget (container to which we want to drop) */ - DDContainer* receiver; - /** Index of receiver container */ - size_t receiver_index; - }; - - struct MYGUI_EXPORT DDWidgetState - { - DDWidgetState(size_t _index) : - index(_index), - update(true), - accept(false), - refuse(false) - { } - - /** Index of element */ - size_t index; - /** State and internal data changed */ - bool update; - /** Is widget accept drop */ - bool accept; - /** Is widget refuse drop */ - bool refuse; - }; - -} // namespace MyGUI - -#endif // __MYGUI_ITEM_DROP_INFO_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DataFileStream.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DataFileStream.h deleted file mode 100644 index 0907f21b6..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DataFileStream.h +++ /dev/null @@ -1,45 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 05/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_DATA_FILE_STREAM_H__ -#define __MYGUI_DATA_FILE_STREAM_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_DataStream.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT DataFileStream : public DataStream - { - public: - DataFileStream(); - DataFileStream(std::ifstream* _stream); - ~DataFileStream(); - - private: - std::ifstream* mFileStream; - }; - -} // namespace MyGUI - -#endif // __MYGUI_DATA_STREAM_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DataManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DataManager.h deleted file mode 100644 index be7649e8f..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DataManager.h +++ /dev/null @@ -1,56 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 05/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_DATA_MANAGER_H__ -#define __MYGUI_DATA_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_IDataStream.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT DataManager - { - public: - DataManager(); - virtual ~DataManager() = 0; - - static DataManager& getInstance(); - static DataManager* getInstancePtr(); - - virtual IDataStream* getData(const std::string& _name) = 0; - - virtual bool isDataExist(const std::string& _name) = 0; - - virtual const VectorString& getDataListNames(const std::string& _pattern) = 0; - - virtual const std::string& getDataPath(const std::string& _name) = 0; - - private: - static DataManager* msInstance; - bool mIsInitialise; - }; - -} // namespace MyGUI - -#endif // __MYGUI_DATA_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DataStream.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DataStream.h deleted file mode 100644 index a532eebee..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DataStream.h +++ /dev/null @@ -1,51 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 05/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_DATA_STREAM_H__ -#define __MYGUI_DATA_STREAM_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_IDataStream.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT DataStream : public IDataStream - { - public: - DataStream(); - DataStream(std::istream* _stream); - virtual ~DataStream(); - - virtual bool eof(); - virtual size_t size(); - virtual void readline(std::string& _source, Char _delim); - virtual size_t read(void* _buf, size_t _count); - - protected: - std::istream* mStream; - size_t mSize; - }; - -} // namespace MyGUI - -#endif // __MYGUI_DATA_STREAM_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Delegate.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Delegate.h deleted file mode 100644 index 5dd843c85..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Delegate.h +++ /dev/null @@ -1,137 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_DELEGATE_H__ -#define __MYGUI_DELEGATE_H__ - -#include "MyGUI_Diagnostic.h" -#include -#include - -// source -// http://rsdn.ru/article/cpp/delegates.xml - -// генерация делегатов для различного колличества параметров -namespace MyGUI -{ - - namespace delegates - { - // базовый класс для тех классов, что хотят себя отвязывать от мульти делегатов - class MYGUI_EXPORT IDelegateUnlink - { - public: - virtual ~IDelegateUnlink() { } - - IDelegateUnlink() { m_baseDelegateUnlink = this; } - bool compare(IDelegateUnlink * _unlink) const { return m_baseDelegateUnlink == _unlink->m_baseDelegateUnlink; } - - private: - IDelegateUnlink * m_baseDelegateUnlink; - }; - - inline IDelegateUnlink * GetDelegateUnlink(void * _base) { return 0; } - inline IDelegateUnlink * GetDelegateUnlink(IDelegateUnlink * _base) { return _base; } - } - - // без параметров - #define MYGUI_SUFFIX 0 - #define MYGUI_TEMPLATE - #define MYGUI_TEMPLATE_PARAMS - #define MYGUI_TEMPLATE_ARGS - #define MYGUI_T_TEMPLATE_PARAMS - #define MYGUI_T_TEMPLATE_ARGS - #define MYGUI_PARAMS - #define MYGUI_ARGS - #define MYGUI_TYPENAME - - #include "MyGUI_DelegateImplement.h" - - // один параметр - #define MYGUI_SUFFIX 1 - #define MYGUI_TEMPLATE template - #define MYGUI_TEMPLATE_PARAMS - #define MYGUI_TEMPLATE_ARGS - #define MYGUI_T_TEMPLATE_PARAMS - #define MYGUI_T_TEMPLATE_ARGS - #define MYGUI_PARAMS TP1 p1 - #define MYGUI_ARGS p1 - #define MYGUI_TYPENAME typename - - #include "MyGUI_DelegateImplement.h" - - // два параметра - #define MYGUI_SUFFIX 2 - #define MYGUI_TEMPLATE template - #define MYGUI_TEMPLATE_PARAMS - #define MYGUI_TEMPLATE_ARGS - #define MYGUI_T_TEMPLATE_PARAMS - #define MYGUI_T_TEMPLATE_ARGS - #define MYGUI_PARAMS TP1 p1, TP2 p2 - #define MYGUI_ARGS p1, p2 - #define MYGUI_TYPENAME typename - - #include "MyGUI_DelegateImplement.h" - - // три параметра - #define MYGUI_SUFFIX 3 - #define MYGUI_TEMPLATE template - #define MYGUI_TEMPLATE_PARAMS - #define MYGUI_TEMPLATE_ARGS - #define MYGUI_T_TEMPLATE_PARAMS - #define MYGUI_T_TEMPLATE_ARGS - #define MYGUI_PARAMS TP1 p1, TP2 p2, TP3 p3 - #define MYGUI_ARGS p1, p2, p3 - #define MYGUI_TYPENAME typename - - #include "MyGUI_DelegateImplement.h" - - // четыре параметра - #define MYGUI_SUFFIX 4 - #define MYGUI_TEMPLATE template - #define MYGUI_TEMPLATE_PARAMS - #define MYGUI_TEMPLATE_ARGS - #define MYGUI_T_TEMPLATE_PARAMS - #define MYGUI_T_TEMPLATE_ARGS - #define MYGUI_PARAMS TP1 p1, TP2 p2, TP3 p3, TP4 p4 - #define MYGUI_ARGS p1, p2, p3, p4 - #define MYGUI_TYPENAME typename - - #include "MyGUI_DelegateImplement.h" - - // пять параметров - #define MYGUI_SUFFIX 5 - #define MYGUI_TEMPLATE template - #define MYGUI_TEMPLATE_PARAMS - #define MYGUI_TEMPLATE_ARGS - #define MYGUI_T_TEMPLATE_PARAMS - #define MYGUI_T_TEMPLATE_ARGS - #define MYGUI_PARAMS TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5 - #define MYGUI_ARGS p1, p2, p3, p4, p5 - #define MYGUI_TYPENAME typename - - #include "MyGUI_DelegateImplement.h" - - -} // namespace MyGUI - -#endif // __MYGUI_DELEGATE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DelegateImplement.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DelegateImplement.h deleted file mode 100644 index f07e48675..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DelegateImplement.h +++ /dev/null @@ -1,319 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ - -namespace delegates -{ - - #define MYGUI_COMBINE(a, b) MYGUI_COMBINE1(a, b) - #define MYGUI_COMBINE1(a, b) a##b - - #define MYGUI_I_DELEGATE MYGUI_COMBINE(IDelegate, MYGUI_SUFFIX) - - #define MYGUI_C_STATIC_DELEGATE MYGUI_COMBINE(CStaticDelegate, MYGUI_SUFFIX) - #define MYGUI_C_METHOD_DELEGATE MYGUI_COMBINE(CMethodDelegate, MYGUI_SUFFIX) - - #define MYGUI_C_DELEGATE MYGUI_COMBINE(CDelegate, MYGUI_SUFFIX) - #define MYGUI_C_MULTI_DELEGATE MYGUI_COMBINE(CMultiDelegate, MYGUI_SUFFIX) - - - // базовый класс всех делегатов - MYGUI_TEMPLATE MYGUI_TEMPLATE_PARAMS - class MYGUI_I_DELEGATE - { - public: - virtual ~MYGUI_I_DELEGATE() { } - virtual bool isType( const std::type_info& _type) = 0; - virtual void invoke( MYGUI_PARAMS ) = 0; - virtual bool compare( MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS * _delegate) const = 0; - virtual bool compare(IDelegateUnlink * _unlink) const { return false; } - }; - - - // делегат для статической функции - MYGUI_TEMPLATE MYGUI_TEMPLATE_PARAMS - class MYGUI_C_STATIC_DELEGATE : public MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS - { - public: - typedef void (*Func)( MYGUI_PARAMS ); - - MYGUI_C_STATIC_DELEGATE (Func _func) : mFunc(_func) { } - - virtual bool isType( const std::type_info& _type) { return typeid( MYGUI_C_STATIC_DELEGATE MYGUI_TEMPLATE_ARGS ) == _type; } - - virtual void invoke( MYGUI_PARAMS ) - { - mFunc( MYGUI_ARGS ); - } - - virtual bool compare( MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS * _delegate) const - { - if (nullptr == _delegate || !_delegate->isType(typeid(MYGUI_C_STATIC_DELEGATE MYGUI_TEMPLATE_ARGS)) ) return false; - MYGUI_C_STATIC_DELEGATE MYGUI_TEMPLATE_ARGS * cast = static_cast(_delegate); - return cast->mFunc == mFunc; - } - virtual bool compare(IDelegateUnlink * _unlink) const { return false; } - - private: - Func mFunc; - }; - - - // делегат для метода класса - template MYGUI_T_TEMPLATE_PARAMS - class MYGUI_C_METHOD_DELEGATE : public MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS - { - public: - typedef void (T::*Method)( MYGUI_PARAMS ); - - MYGUI_C_METHOD_DELEGATE(IDelegateUnlink * _unlink, T * _object, Method _method) : mUnlink(_unlink), mObject(_object), mMethod(_method) { } - - virtual bool isType( const std::type_info& _type) { return typeid( MYGUI_C_METHOD_DELEGATE MYGUI_T_TEMPLATE_ARGS ) == _type; } - - virtual void invoke( MYGUI_PARAMS ) - { - (mObject->*mMethod)( MYGUI_ARGS ); - } - - virtual bool compare( MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS * _delegate) const - { - if (nullptr == _delegate || !_delegate->isType(typeid(MYGUI_C_METHOD_DELEGATE MYGUI_T_TEMPLATE_ARGS)) ) return false; - MYGUI_C_METHOD_DELEGATE MYGUI_T_TEMPLATE_ARGS * cast = static_cast< MYGUI_C_METHOD_DELEGATE MYGUI_T_TEMPLATE_ARGS * >(_delegate); - return cast->mObject == mObject && cast->mMethod == mMethod; - } - - virtual bool compare(IDelegateUnlink * _unlink) const - { - return mUnlink == _unlink; - } - - private: - IDelegateUnlink *mUnlink; - T * mObject; - Method mMethod; - }; - -} // namespace delegates - -// шаблон для создания делегата статической функции -// параметры : указатель на функцию -// пример : newDelegate(funk_name); -// пример : newDelegate(class_name::static_method_name); -MYGUI_TEMPLATE MYGUI_TEMPLATE_PARAMS -inline delegates::MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS * newDelegate( void (*_func)( MYGUI_PARAMS ) ) -{ - return new delegates::MYGUI_C_STATIC_DELEGATE MYGUI_TEMPLATE_ARGS (_func); -} - - -// шаблон для создания делегата метода класса -// параметры : указатель на объект класса и указатель на метод класса -// пример : newDelegate(&object_name, &class_name::method_name); -template MYGUI_T_TEMPLATE_PARAMS -inline delegates::MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS * newDelegate( T * _object, void (T::*_method)( MYGUI_PARAMS ) ) -{ - return new delegates::MYGUI_C_METHOD_DELEGATE MYGUI_T_TEMPLATE_ARGS (delegates::GetDelegateUnlink(_object), _object, _method); -} - -namespace delegates -{ - // шаблон класса делегата - MYGUI_TEMPLATE MYGUI_TEMPLATE_PARAMS - class MYGUI_C_DELEGATE - { - public: - typedef MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS IDelegate; - - MYGUI_C_DELEGATE () : mDelegate(nullptr) { } - MYGUI_C_DELEGATE (const MYGUI_C_DELEGATE MYGUI_TEMPLATE_ARGS& _event) - { - // забираем себе владение - mDelegate = _event.mDelegate; - const_cast< MYGUI_C_DELEGATE MYGUI_TEMPLATE_ARGS& >(_event).mDelegate = nullptr; - } - ~MYGUI_C_DELEGATE () { clear(); } - - bool empty() const { return mDelegate == nullptr; } - - void clear() - { - if (mDelegate) - { - delete mDelegate; - mDelegate = nullptr; - } - } - - MYGUI_C_DELEGATE MYGUI_TEMPLATE_ARGS & operator=(IDelegate* _delegate) - { - delete mDelegate; - mDelegate = _delegate; - return *this; - } - - MYGUI_C_DELEGATE MYGUI_TEMPLATE_ARGS & operator=(const MYGUI_C_DELEGATE MYGUI_TEMPLATE_ARGS& _event) - { - // забираем себе владение - delete mDelegate; - mDelegate = _event.mDelegate; - const_cast< MYGUI_C_DELEGATE MYGUI_TEMPLATE_ARGS& >(_event).mDelegate = nullptr; - - return *this; - } - - void operator()( MYGUI_PARAMS ) - { - if (mDelegate == nullptr) return; - mDelegate->invoke( MYGUI_ARGS ); - } - - private: - IDelegate * mDelegate; - }; - - - // шаблон класса мульти делегата - MYGUI_TEMPLATE MYGUI_TEMPLATE_PARAMS - class MYGUI_C_MULTI_DELEGATE - { - public: - typedef MYGUI_I_DELEGATE MYGUI_TEMPLATE_ARGS IDelegate; - typedef MYGUI_TYPENAME std::list*/ > ListDelegate; - typedef MYGUI_TYPENAME ListDelegate::iterator ListDelegateIterator; - typedef MYGUI_TYPENAME ListDelegate::const_iterator ConstListDelegateIterator; - - MYGUI_C_MULTI_DELEGATE () { } - ~MYGUI_C_MULTI_DELEGATE () { clear(); } - - bool empty() const - { - for (ConstListDelegateIterator iter = mListDelegates.begin(); iter!=mListDelegates.end(); ++iter) - { - if (*iter) return false; - } - return true; - } - - void clear() - { - for (ListDelegateIterator iter=mListDelegates.begin(); iter!=mListDelegates.end(); ++iter) - { - if (*iter) - { - delete (*iter); - (*iter) = nullptr; - } - } - } - - void clear(IDelegateUnlink * _unlink) - { - for (ListDelegateIterator iter=mListDelegates.begin(); iter!=mListDelegates.end(); ++iter) - { - if ((*iter) && (*iter)->compare(_unlink)) - { - delete (*iter); - (*iter) = nullptr; - } - } - } - - MYGUI_C_MULTI_DELEGATE MYGUI_TEMPLATE_ARGS & operator+=(IDelegate* _delegate) - { - for (ListDelegateIterator iter=mListDelegates.begin(); iter!=mListDelegates.end(); ++iter) - { - if ((*iter) && (*iter)->compare(_delegate)) - { - MYGUI_ASSERT(false, "dublicate delegate"); - } - } - mListDelegates.push_back(_delegate); - return *this; - } - - MYGUI_C_MULTI_DELEGATE MYGUI_TEMPLATE_ARGS & operator-=(IDelegate* _delegate) - { - for (ListDelegateIterator iter=mListDelegates.begin(); iter!=mListDelegates.end(); ++iter) - { - if ((*iter) && (*iter)->compare(_delegate)) - { - // проверяем на идентичность делегатов - if ((*iter) != _delegate) delete (*iter); - (*iter) = nullptr; - break; - } - } - delete _delegate; - return *this; - } - - void operator()( MYGUI_PARAMS ) - { - ListDelegateIterator iter = mListDelegates.begin(); - while (iter != mListDelegates.end()) - { - if (nullptr == (*iter)) - { - iter = mListDelegates.erase(iter); - } - else - { - (*iter)->invoke( MYGUI_ARGS ); - ++iter; - } - } - } - - private: - // constructor and operator =, without implementation, just for private - MYGUI_C_MULTI_DELEGATE (const MYGUI_C_MULTI_DELEGATE MYGUI_TEMPLATE_ARGS & _event); - MYGUI_C_MULTI_DELEGATE MYGUI_TEMPLATE_ARGS & operator=(const MYGUI_C_MULTI_DELEGATE MYGUI_TEMPLATE_ARGS & _event); - - - private: - ListDelegate mListDelegates; - - }; - - - #undef MYGUI_COMBINE - #undef MYGUI_COMBINE1 - - #undef MYGUI_I_DELEGATE - - #undef MYGUI_C_STATIC_DELEGATE - #undef MYGUI_C_METHOD_DELEGATE - - #undef MYGUI_C_DELEGATE - #undef MYGUI_C_MULTI_DELEGATE - - #undef MYGUI_SUFFIX - #undef MYGUI_TEMPLATE - #undef MYGUI_TEMPLATE_PARAMS - #undef MYGUI_TEMPLATE_ARGS - #undef MYGUI_T_TEMPLATE_PARAMS - #undef MYGUI_T_TEMPLATE_ARGS - #undef MYGUI_PARAMS - #undef MYGUI_ARGS - #undef MYGUI_TYPENAME - -} // namespace delegates diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Diagnostic.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Diagnostic.h deleted file mode 100644 index 5eee622cb..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Diagnostic.h +++ /dev/null @@ -1,115 +0,0 @@ -/*! - @file - @author Albert Semenov - @author baho_is - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_DIAGNOSTIC_H__ -#define __MYGUI_DIAGNOSTIC_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Exception.h" -#include "MyGUI_LogManager.h" -#include - -// for debugging -#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC - #include -#endif - -#define MYGUI_LOG_SECTION "Core" -#define MYGUI_LOG_FILENAME "MyGUI.log" -#define MYGUI_LOG(level, text) MYGUI_LOGGING(MYGUI_LOG_SECTION, level, text) - -#define MYGUI_BASE_EXCEPT(desc, src) throw MyGUI::Exception(desc, src, __FILE__, __LINE__); - -// MSVC specific: sets the breakpoint -#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC - #define MYGUI_DBG_BREAK _CrtDbgBreak(); -#else - #define MYGUI_DBG_BREAK -#endif - -#define MYGUI_EXCEPT(dest) \ -{ \ - MYGUI_LOG(Critical, dest); \ - MYGUI_DBG_BREAK;\ - std::ostringstream stream; \ - stream << dest << "\n"; \ - MYGUI_BASE_EXCEPT(stream.str().c_str(), "MyGUI"); \ -} - -#define MYGUI_ASSERT(exp, dest) \ -{ \ - if ( ! (exp) ) \ - { \ - MYGUI_LOG(Critical, dest); \ - MYGUI_DBG_BREAK;\ - std::ostringstream stream; \ - stream << dest << "\n"; \ - MYGUI_BASE_EXCEPT(stream.str().c_str(), "MyGUI"); \ - } \ -} - -#define MYGUI_ASSERT_RANGE(index, size, owner) MYGUI_ASSERT(index < size, owner << " : index number " << index << " out of range [" << size << "]"); -#define MYGUI_ASSERT_RANGE_AND_NONE(index, size, owner) MYGUI_ASSERT(index < size || index == ITEM_NONE, owner << " : index number " << index << " out of range [" << size << "]"); -#define MYGUI_ASSERT_RANGE_INSERT(index, size, owner) MYGUI_ASSERT((index <= size) || (index == MyGUI::ITEM_NONE), owner << " : insert index number " << index << " out of range [" << size << "] or not ITEM_NONE"); - -#if MYGUI_DEBUG_MODE == 1 - #define MYGUI_REGISTER_VALUE(map, value) \ - { \ - MYGUI_LOG(Info, "Register value : '" << #value << "' = " << (int)value); \ - map[#value] = value; \ - } - #define MYGUI_DEBUG_ASSERT(exp, dest) MYGUI_ASSERT(exp, dest) -#else - #define MYGUI_REGISTER_VALUE(map, value) map[#value] = value; - #define MYGUI_DEBUG_ASSERT(exp, dest) ((void)0) -#endif - - -// for more info see: http://mdf-i.blogspot.com/2008/09/deprecated-gcc-vs-vs-vs-vs.html -#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC - #if MYGUI_COMP_VER == 1310 // VC++ 7.1 - #define MYGUI_OBSOLETE_START(text) - #define MYGUI_OBSOLETE_END - #else - #define MYGUI_OBSOLETE_START(text) __declspec(deprecated(text)) - #define MYGUI_OBSOLETE_END - #endif - -#elif MYGUI_COMPILER == MYGUI_COMPILER_GNUC - #if MYGUI_PLATFORM == MYGUI_PLATFORM_LINUX && MYGUI_COMP_VER == 412 - #define MYGUI_OBSOLETE_START(text) - #define MYGUI_OBSOLETE_END - #else - #define MYGUI_OBSOLETE_START(text) - #define MYGUI_OBSOLETE_END __attribute__((deprecated)) - #endif - -#else - #define MYGUI_OBSOLETE_START(text) - #define MYGUI_OBSOLETE_END - -#endif - -#define MYGUI_OBSOLETE(text) /*! \deprecated text */ MYGUI_OBSOLETE_START(text)MYGUI_OBSOLETE_END - -#endif // __MYGUI_DIAGNOSTIC_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DynLib.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DynLib.h deleted file mode 100644 index 1eb23e884..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DynLib.h +++ /dev/null @@ -1,111 +0,0 @@ -/*! - @file - @author Denis Koronchik - @author Georgiy Evmenov - @date 09/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ - -#ifndef __MYGUI_DYNLIB_H__ -#define __MYGUI_DYNLIB_H__ - -#include "MyGUI_Prerequest.h" -#include - - -#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32 -# define MYGUI_DYNLIB_HANDLE hInstance -# define MYGUI_DYNLIB_LOAD( a ) LoadLibrary( a ) -# define MYGUI_DYNLIB_GETSYM( a, b ) GetProcAddress( a, b ) -# define MYGUI_DYNLIB_UNLOAD( a ) !FreeLibrary( a ) - -struct HINSTANCE__; -typedef struct HINSTANCE__* hInstance; - -#elif MYGUI_PLATFORM == MYGUI_PLATFORM_LINUX -# define MYGUI_DYNLIB_HANDLE void* -# define MYGUI_DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY | RTLD_GLOBAL) -# define MYGUI_DYNLIB_GETSYM( a, b ) dlsym( a, b ) -# define MYGUI_DYNLIB_UNLOAD( a ) dlclose( a ) - -#elif MYGUI_PLATFORM == MYGUI_PLATFORM_APPLE -# include -# define MYGUI_DYNLIB_HANDLE CFBundleRef -# define MYGUI_DYNLIB_LOAD( a ) mac_loadExeBundle( a ) -# define MYGUI_DYNLIB_GETSYM( a, b ) mac_getBundleSym( a, b ) -# define MYGUI_DYNLIB_UNLOAD( a ) mac_unloadExeBundle( a ) -#endif - -namespace MyGUI -{ - - /*! @brief Resource holding data about a dynamic library. - - @remarks - This class holds the data required to get symbols from - libraries loaded at run-time (i.e. from DLL's for so's) - */ - class MYGUI_EXPORT DynLib - { - friend class DynLibManager; - - protected: - DynLib(const std::string &name); - - ~DynLib(); - - public: - - /*! Load the library - */ - bool load(); - - /*! Unload the library - */ - void unload(); - - //! Get the name of the library - std::string getName(void) const { return mName; } - - /** - Returns the address of the given symbol from the loaded library. - @param - strName The name of the symbol to search for - @returns - If the function succeeds, the returned value is a handle to the symbol. - If the function fails, the returned value is nullptr. - */ - void* getSymbol( const std::string& strName ) const throw(); - - protected: - //! Gets the last loading error - std::string dynlibError(void); - - - protected: - //! Name of library - std::string mName; - - //! Handle to the loaded library. - MYGUI_DYNLIB_HANDLE mInstance; - }; - -} - -#endif // __MYGUI_DYNLIB_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DynLibManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DynLibManager.h deleted file mode 100644 index 4b6b99f62..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_DynLibManager.h +++ /dev/null @@ -1,58 +0,0 @@ -/*! - @file - @author Denis Koronchik - @date 08/2007 - @module libEngine -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_DYN_LIB_MANAGER_H__ -#define __MYGUI_DYN_LIB_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Instance.h" -#include "MyGUI_DynLib.h" -#include - -namespace MyGUI -{ - - /*! \brief Manager of dynamic libraries - */ - class MYGUI_EXPORT DynLibManager - { - MYGUI_INSTANCE_HEADER( DynLibManager ) - - public: - void initialise(); - void shutdown(); - - //! Load library - DynLib* load(const std::string &fileName); - //! Unload library - void unload(DynLib *library); - - private: - //! Dynamic libraries map - typedef std::map StringDynLibMap; - //! Loaded libraries - StringDynLibMap mLibsMap; - }; - -} - -#endif // __MYGUI_DYN_LIB_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Edit.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Edit.h deleted file mode 100644 index 01277cdca..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Edit.h +++ /dev/null @@ -1,443 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_EDIT_H__ -#define __MYGUI_EDIT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_StaticText.h" -#include "MyGUI_TextChangeHistory.h" -#include "MyGUI_TextIterator.h" -#include "MyGUI_EventPair.h" -#include "MyGUI_ScrollViewBase.h" - -namespace MyGUI -{ - - typedef delegates::CDelegate1 EventHandle_EditPtr; - - class MYGUI_EXPORT Edit : - public StaticText, - public ScrollViewBase - { - MYGUI_RTTI_DERIVED( Edit ) - - public: - Edit(); - - /** Colour interval */ - void setTextIntervalColour(size_t _start, size_t _count, const Colour& _colour); - - /** Get index of first selected character or ITEM_NONE if nothing selected */ - size_t getTextSelectionStart(); - - /** Get index of last selected character or ITEM_NONE if nothing selected */ - size_t getTextSelectionEnd(); - - /** Get length of selected text */ - size_t getTextSelectionLength(); - - // возвращает текст с тегами - /** Get _count characters with tags from _start position */ - UString getTextInterval(size_t _start, size_t _count); - - /** Set selected text interval - @param _start of interval - @param _end of interval - */ - void setTextSelection(size_t _start, size_t _end); - - /** Delete selected text */ - void deleteTextSelection(); - - /** Get selected text */ - UString getTextSelection(); - - /** Is any text selected */ - bool isTextSelection(); - - /** Colour selected text */ - void setTextSelectionColour(const Colour& _value); - - /** Set text cursor position */ - void setTextCursor(size_t _index); - /** Get text cursor position */ - size_t getTextCursor() { return mCursorPosition; } - - - /** Set edit text applying tags */ - virtual void setCaption(const UString& _value); - /** Get edit text with tags */ - virtual const UString& getCaption(); - - /** Set edit text without tags */ - void setOnlyText(const UString& _value); - /** Get edit text without tags */ - UString getOnlyText(); - - /** Get text length excluding tags - For example "#00FF00Hello" length is 5 - */ - size_t getTextLength() const { return mTextLength; } - - //! Sets if surplus characters should push characters off the left side rather than ignored - void setOverflowToTheLeft(bool _value) { mOverflowToTheLeft = _value; } - //! Returns true if surplus characters will be pushed off the left rather than ignored - bool getOverflowToTheLeft() { return mOverflowToTheLeft; } - - //! Sets the max amount of text allowed in the edit field. - void setMaxTextLength(size_t _value) { mMaxTextLength = _value; } - //! Gets the max amount of text allowed in the edit field. - size_t getMaxTextLength() { return mMaxTextLength; } - - /** Inser text at _index position (text end by default) */ - void insertText(const UString& _text, size_t _index = ITEM_NONE); - /** Add text */ - void addText(const UString& _text); - /** Erase _count characters from _start position */ - void eraseText(size_t _start, size_t _count = 1); - - /** Enable or disable edit read only mode\n - Read only mode: you can't edit text, but can select it.\n - Disabled (false) by default. - */ - void setEditReadOnly(bool _value); - /** Get edit read only mode flag */ - bool getEditReadOnly() { return mModeReadOnly; } - - /** Enable or disable edit password mode\n - Password mode: you see password chars (*** by default) instead text.\n - Disabled (false) by default. - */ - void setEditPassword(bool _value); - /** Get edit password mode flag */ - bool getEditPassword() { return mModePassword; } - - /** Enable or disable edit multiline mode\n - Multile mode: new line character moves text to new line.\n - Otherwise new lines replaced with space and all text is in single line.\n - Disabled (false) by default. - */ - void setEditMultiLine(bool _value); - /** Get edit multiline mode flag */ - bool getEditMultiLine() { return mModeMultiline; } - - /** Enable or disable edit static mode\n - Static mode is same as read only, but you also can't select text.\n - Disabled (false) by default. - */ - void setEditStatic(bool _value); - /** Get edit static mode flag */ - bool getEditStatic() { return mModeStatic; } - - /** Set edit password character ('*' by default) */ - void setPasswordChar(Char _value); - /** Set edit password character ('*' by default). First character of string used. */ - void setPasswordChar(const UString& _char); - /** Get edit password character */ - Char getPasswordChar() { return mCharPassword; } - - /** Enable or disable edit word wrap mode\n - Word Wrap mode: move words to new line if they goes out of width. - Also in this mode you can't edit or select text.\n - Disabled (false) by default. - */ - void setEditWordWrap(bool _value); - /** Get edit word wrap mode flag */ - bool getEditWordWrap() { return mModeWordWrap; } - - /** Enable or disable tab printing mode\n - Tab printing mode: when editing text and pressing Tab key it displayed. - If this mode disabled Tab key ignored.\n - Disabled (false) by default. - */ - void setTabPrinting(bool _value) { mTabPrinting = _value; } - /** Get edit tab printing wrap mode flag */ - bool getTabPrinting() { return mTabPrinting; } - - /** Get invert selected text color property */ - bool getInvertSelected(); - /** Enable or disable inverting color of selected text\n - Enabled (true) by default - */ - void setInvertSelected(bool _value); - - //! @copydoc Widget::setPosition(const IntPoint& _value) - virtual void setPosition(const IntPoint& _value); - //! @copydoc Widget::setSize(const IntSize& _value) - virtual void setSize(const IntSize& _value); - //! @copydoc Widget::setCoord(const IntCoord& _value) - virtual void setCoord(const IntCoord& _value); - - /** @copydoc Widget::setPosition(int _left, int _top) */ - void setPosition(int _left, int _top) { setPosition(IntPoint(_left, _top)); } - /** @copydoc Widget::setSize(int _width, int _height) */ - void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); } - /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ - void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); } - - /** Show VScroll when text size larger than Edit */ - void setVisibleVScroll(bool _value); - /** Get Show VScroll flag */ - bool isVisibleVScroll() { return mVisibleVScroll; } - /** Get range of vertical scroll (or 0 if no scroll). - Range measured in pixels (full text heiht minus Edit height). - For example if Edit is 200 pixels height and 40 lines of text - 30 pixels height each (i.e. 600 pixels total), then return - value is 400 ( = 600 - 200 ). - */ - size_t getVScrollRange(); - /** Get current position of vertical scroll (or 0 if no scroll) */ - size_t getVScrollPosition(); - /** Set current position of vertical scroll */ - void setVScrollPosition(size_t _index); - - /** Show HScroll when text size larger than Edit */ - void setVisibleHScroll(bool _value); - /** Get Show HScroll flag */ - bool isVisibleHScroll() { return mVisibleHScroll; } - /** Get range of horizontal scroll (or 0 if no scroll). - Range measured in pixels (full text width minus Edit width). - For example if Edit is 200 pixels width and the longest line - is 600 pixels width, then return value is 400 ( = 600 - 200 ). - */ - size_t getHScrollRange(); - /** Get current position of horizontal scroll (or 0 if no scroll) */ - size_t getHScrollPosition(); - /** Set current position of horizontal scroll */ - void setHScrollPosition(size_t _index); - - - //! @copydoc StaticText::setFontName - virtual void setFontName(const std::string& _value); - //! @copydoc StaticText::setFontHeight - virtual void setFontHeight(int _value); - - //! @copydoc StaticText::setTextAlign - virtual void setTextAlign(Align _value); - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*event:*/ - /** Event : Enter pressed (Ctrl+enter in multiline mode).\n - signature : void method(MyGUI::Edit* _sender) - @param _sender widget that called this event - */ - EventPair eventEditSelectAccept; - - /** Event : Text changed.\n - signature : void method(MyGUI::Edit* _sender) - @param _sender widget that called this event - */ - EventPair eventEditTextChange; - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void Edit::setVisibleVScroll(bool _visible)") - void showVScroll(bool _visible) { setVisibleVScroll(_visible); } - MYGUI_OBSOLETE("use : bool Edit::isVisibleVScroll()") - bool isShowVScroll() { return isVisibleVScroll(); } - MYGUI_OBSOLETE("use : void Edit::setVisibleHScroll(bool _visible)") - void showHScroll(bool _visible) { setVisibleHScroll(_visible); } - MYGUI_OBSOLETE("use : bool Edit::isVisibleHScroll()") - bool isShowHScroll() { return isVisibleHScroll(); } - - MYGUI_OBSOLETE("use : void Widget::setCoord(const IntCoord& _coord)") - void setPosition(const IntCoord& _coord) { setCoord(_coord); } - MYGUI_OBSOLETE("use : void Widget::setCoord(int _left, int _top, int _width, int _height)") - void setPosition(int _left, int _top, int _width, int _height) { setCoord(_left, _top, _width, _height); } - - // to avoid hiding base virtual function - virtual void setTextColour(const Colour& _colour) { Base::setTextColour(_colour); } - - MYGUI_OBSOLETE("use : void Edit::setTextIntervalColour(size_t _start, size_t _count, const Colour& _colour)") - void setTextColour(size_t _start, size_t _count, const Colour& _colour) { setTextIntervalColour(_start, _count, _colour); } - - MYGUI_OBSOLETE("use : size_t Edit::getTextSelectionStart() , size_t getTextSelectionEnd()") - void getTextSelect(size_t& _start, size_t& _end); - - MYGUI_OBSOLETE("use : UString Edit::getTextInterval(size_t _start, size_t _count)") - UString getText(size_t _start, size_t _count) { return getTextInterval(_start, _count); } - - MYGUI_OBSOLETE("use : void Edit::setTextSelection(size_t _start, size_t _end)") - void setTextSelect(size_t _start, size_t _end) { setTextSelection(_start, _end); } - - MYGUI_OBSOLETE("use : void Edit::deleteTextSelection()") - void deleteTextSelect() { deleteTextSelection(); } - - MYGUI_OBSOLETE("use : UString Edit::getTextSelection()") - UString getSelectedText() { return getTextSelection(); } - - MYGUI_OBSOLETE("use : bool Edit::isTextSelection()") - bool isTextSelect() { return isTextSelection(); } - - MYGUI_OBSOLETE("use : void Edit::setTextSelectionColour(const Colour& _colour)") - void setTextSelectColour(const Colour& _colour) { setTextSelectionColour(_colour); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - - protected: - virtual ~Edit(); - - virtual void onMouseDrag(int _left, int _top); - virtual void onKeyLostFocus(Widget* _new); - virtual void onKeySetFocus(Widget* _old); - virtual void onKeyButtonPressed(KeyCode _key, Char _char); - - // потом убрать все нотифи в сраку - void notifyMouseSetFocus(Widget* _sender, Widget* _old); - void notifyMouseLostFocus(Widget* _sender, Widget* _new); - void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id); - void notifyMouseReleased(Widget* _sender, int _left, int _top, MouseButton _id); - void notifyMouseDrag(Widget* _sender, int _left, int _top); - void notifyMouseButtonDoubleClick(Widget* _sender); - - void notifyScrollChangePosition(VScroll* _sender, size_t _position); - void notifyMouseWheel(Widget* _sender, int _rel); - - // обновление представления - void updateView(); - void updateViewWithCursor(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - void eraseView(); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - private: - // устанавливает текст - void setText(const UString& _text, bool _history); - // удаляет все что выделенно - bool deleteTextSelect(bool _history); - // вставляет текст в указанную позицию - void insertText(const UString& _text, size_t _index, bool _history); - // удаляет текст - void eraseText(size_t _start, size_t _count, bool _history); - // выделяет цветом выделение - void setTextSelectColour(const Colour& _colour, bool _history); - // выделяет цветом диапазон - void _setTextColour(size_t _start, size_t _count, const Colour& _colour, bool _history); - - void frameEntered(float _frame); - - void updateEditState(); - - // обновляет курсор по координате - void updateSelectText(); - - void resetSelect(); - - // запись в историю данных о позиции - void commandPosition(size_t _undo, size_t _redo, size_t _length, VectorChangeInfo * _info = nullptr); - - // команнды отмена и повтор - bool commandRedo(); - bool commandUndo(); - // объединяет последние две комманды - void commandMerge(); - // очистка - void commandResetRedo() { mVectorRedoChangeInfo.clear(); } - void commandResetHistory() { mVectorRedoChangeInfo.clear();mVectorUndoChangeInfo.clear(); } - void saveInHistory(VectorChangeInfo * _info = nullptr); - - // работа с буфером обмена - void commandCut(); - void commandCopy(); - void commandPast(); - - const UString& getRealString(); - - void setRealString(const UString& _caption); - - void updateCursorPosition(); - - // размер данных - virtual IntSize getContentSize(); - // смещение данных - virtual IntPoint getContentPosition(); - virtual void setContentPosition(const IntPoint& _point); - // размер окна, через которые видно данные - virtual IntSize getViewSize() const; - // размер на который прокручиваются данные при щелчке по скролу - virtual size_t getVScrollPage(); - virtual size_t getHScrollPage(); - - virtual Align getContentAlign(); - - protected: - // нажата ли кнопка - bool mIsPressed; - // в фокусе ли кнопка - bool mIsFocus; - - bool mCursorActive; - float mCursorTimer; - float mActionMouseTimer; - - // позиция курсора - size_t mCursorPosition; - // максимальное колличество - size_t mTextLength; - - // выделение - size_t mStartSelect; - size_t mEndSelect; - - // списоки изменений для отмены и повтора - DequeUndoRedoInfo mVectorUndoChangeInfo; - DequeUndoRedoInfo mVectorRedoChangeInfo; - - bool mMouseLeftPressed; - - bool mModeReadOnly; - bool mModePassword; - bool mModeMultiline; - bool mModeStatic; - bool mModeWordWrap; - - bool mTabPrinting; - - // настоящий текст, закрытый за звездочками - UString mPasswordText; - - // для поддержки режима статик, где курсор не нужен - std::string mOriginalPointer; - - Char mCharPassword; - - bool mOverflowToTheLeft; - size_t mMaxTextLength; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_EDIT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_EditText.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_EditText.h deleted file mode 100644 index ad897061f..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_EditText.h +++ /dev/null @@ -1,164 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 09/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_EDIT_TEXT_H__ -#define __MYGUI_EDIT_TEXT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_Types.h" -#include "MyGUI_ISubWidgetText.h" -#include "MyGUI_IFont.h" -#include "MyGUI_ResourceSkin.h" -#include "MyGUI_RenderFormat.h" -#include "MyGUI_TextView.h" - -namespace MyGUI -{ - - class RenderItem; - - class MYGUI_EXPORT EditText : public ISubWidgetText - { - MYGUI_RTTI_DERIVED( EditText ) - - public: - EditText(); - virtual ~EditText(); - - virtual void setVisible(bool _value); - - // обновляет все данные связанные с тектом - virtual void updateRawData(); - - // метод для отрисовки себя - virtual void doRender(); - - void setCaption(const UString& _value); - const UString& getCaption(); - - void setTextColour(const Colour& _value); - const Colour& getTextColour(); - - void setAlpha(float _value); - float getAlpha(); - - virtual void setFontName(const std::string& _value); - virtual const std::string& getFontName(); - - virtual void setFontHeight(int _value); - virtual int getFontHeight(); - - virtual void createDrawItem(ITexture* _texture, ILayerNode * _node); - virtual void destroyDrawItem(); - - virtual void setTextAlign(Align _value); - virtual Align getTextAlign(); - - virtual size_t getTextSelectionStart(); - virtual size_t getTextSelectionEnd(); - virtual void setTextSelection(size_t _start, size_t _end); - - virtual bool getSelectBackground(); - virtual void setSelectBackground(bool _normal); - - virtual bool isVisibleCursor(); - virtual void setVisibleCursor(bool _value); - - /** Get invert selected text color property */ - virtual bool getInvertSelected() { return mInvertSelect; } - /** Enable or disable inverting color of selected text\n - Enabled (true) by default - */ - virtual void setInvertSelected(bool _value); - - virtual size_t getCursorPosition(); - virtual void setCursorPosition(size_t _index); - - virtual IntSize getTextSize(); - - // устанавливает смещение текста в пикселях - virtual void setViewOffset(const IntPoint& _point); - virtual IntPoint getViewOffset(); - - // возвращает положение курсора по произвольному положению - virtual size_t getCursorPosition(const IntPoint& _point); - - // возвращает положение курсора в обсолютных координатах - virtual IntCoord getCursorCoord(size_t _position); - - void setShiftText(bool _shift); - - void setWordWrap(bool _value); - - virtual void setStateData(IStateInfo * _data); - - void _updateView(); - void _correctView(); - - /*internal:*/ - void _setAlign(const IntSize& _oldsize, bool _update); - void _setAlign(const IntCoord& _oldcoord, bool _update); - - protected: - bool mEmptyView; - uint32 mCurrentColour; - uint32 mInverseColour; - uint32 mCurrentAlpha; - IntCoord mCurrentCoord; - - UString mCaption; - bool mTextOutDate; - Align mTextAlign; - - Colour mColour; - float mAlpha; - VertexColourType mVertexFormat; - - IFont* mFont; - ITexture* mTexture; - int mFontHeight; - - bool mBackgroundNormal; - size_t mStartSelect; - size_t mEndSelect; - size_t mCursorPosition; - bool mVisibleCursor; - bool mInvertSelect; - - IntPoint mViewOffset; // смещение текста - - ILayerNode* mNode; - RenderItem* mRenderItem; - size_t mCountVertex; - bool mIsAddCursorWidth; - - bool mShiftText; - bool mWordWrap; - int mOldWidth; - - TextView mTextView; - }; - -} // namespace MyGUI - -#endif // __MYGUI_EDIT_TEXT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Enumerator.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Enumerator.h deleted file mode 100644 index c7c8811dd..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Enumerator.h +++ /dev/null @@ -1,108 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 08/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_ENUMERATOR_H__ -#define __MYGUI_ENUMERATOR_H__ - -#include - -namespace MyGUI -{ - - /** Class for comfortable using of vectors with small while loop - instead iterators. Performance is same as with iterators. - Enumerator usage - @example Enumerator - @code - typedef std::vector VectorString; - typedef Enumerator EnumeratorVectorString; - - VectorString vec; - vec.push_back("value"); - //EnumeratorVectorString enum_vec(vec.begin(), vec.end()); - EnumeratorVectorString enum_vec(vec); - while (enum_vec.next()) - { - std::string value = enum_vec.current(); - } - - typedef std::pair PairString; - typedef std::map MapString; - - MapString map; - map["key"] = "value"; - //EnumeratorMapString enum_map(map.begin(), map.end()); - EnumeratorMapString enum_map(map); - while (enum_map.next()) - { - std::string key = enum_map.current().first; - std::string value = enum_map.current().second; - } - @endcode - */ - - template - class Enumerator - { - private: - Enumerator() { } - - public: - explicit Enumerator(const T& _container) : - m_first(true), - m_current(_container.begin()), - m_end(_container.end()) - { - } - - Enumerator(typename T::const_iterator _first, typename T::const_iterator _end) : - m_first(true), - m_current(_first), - m_end(_end) - { - } - - bool next() - { - if (m_current == m_end) return false; - else if (m_first) - { - m_first = false; - return true; - } - ++ m_current; - if (m_current == m_end) return false; - return true; - } - - typename T::const_reference operator->() const { assert(m_current != m_end); return (*m_current); } - typename T::const_reference current() { assert(m_current != m_end); return (*m_current); } - - private: - bool m_first; - typename T::const_iterator m_current; - typename T::const_iterator m_end; - }; - -} // namespace MyGUI - -#endif // __MYGUI_ENUMERATOR_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_EventPair.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_EventPair.h deleted file mode 100644 index 8039d83e1..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_EventPair.h +++ /dev/null @@ -1,118 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 10/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_EVENT_PAIR_H__ -#define __MYGUI_EVENT_PAIR_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - template - class EventPair - { - public: - - template - MYGUI_OBSOLETE("use : signature : Event::IDelegate * _delegate") - void operator = (T * _delegate) - { - m_eventObsolete = _delegate; - m_event = nullptr; - } - - void operator = (typename Event::IDelegate * _delegate) - { - m_eventObsolete = nullptr; - m_event = _delegate; - } - - template - void operator()( TP1 p1 ) - { - m_eventObsolete(p1); - m_event(p1); - } - - template - void operator()( TP1 p1, TP2 p2 ) - { - m_eventObsolete(p1, p2); - m_event(p1, p2); - } - - template - void operator()( TP1 p1, TP2 p2, TP3 p3 ) - { - m_eventObsolete(p1, p2, p3); - m_event(p1, p2, p3); - } - - template - void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4 ) - { - m_eventObsolete(p1, p2, p3, p4); - m_event(p1, p2, p3, p4); - } - - template - void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5 ) - { - m_eventObsolete(p1, p2, p3, p4, p5); - m_event(p1, p2, p3, p4, p5); - } - - template - void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5, TP6 p6 ) - { - m_eventObsolete(p1, p2, p3, p4, p5, p6); - m_event(p1, p2, p3, p4, p5, p6); - } - - template - void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5, TP6 p6, TP7 p7 ) - { - m_eventObsolete(p1, p2, p3, p4, p5, p6, p7); - m_event(p1, p2, p3, p4, p5, p6, p7); - } - - template - void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5, TP6 p6, TP7 p7, TP8 p8 ) - { - m_eventObsolete(p1, p2, p3, p4, p5, p6, p7, p8); - m_event(p1, p2, p3, p4, p5, p6, p7, p8); - } - - bool empty() const - { - return m_eventObsolete.empty() && m_event.empty(); - } - - public: - EventObsolete m_eventObsolete; - Event m_event; - }; - -} // namespace MyGUI - -#endif // __MYGUI_EVENT_PAIR_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Exception.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Exception.h deleted file mode 100644 index 07f720175..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Exception.h +++ /dev/null @@ -1,69 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 05/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_EXCEPTION_H__ -#define __MYGUI_EXCEPTION_H__ - -#include "MyGUI_Prerequest.h" -#include -#include - -namespace MyGUI -{ - - class MYGUI_EXPORT Exception : public std::exception - { - protected: - std::string mDescription; - std::string mSource; - std::string mFile; - long mLine; - mutable std::string mFullDesc; - - public: - Exception(const std::string& _description, const std::string& _source, const char* _file, long _line ); - - Exception(const Exception& _rhs); - - // Needed for compatibility with std::exception - ~Exception() throw() { } - - Exception& operator = (const Exception& _rhs); - - virtual const std::string& getFullDescription() const; - - virtual const std::string &getSource() const { return mSource; } - - virtual const std::string &getFile() const { return mFile; } - - virtual long getLine() const { return mLine; } - - virtual const std::string& getDescription() const { return mDescription; } - - // Override std::exception::what - const char* what() const throw() { return getFullDescription().c_str(); } - - }; - -} // namespace MyGUI - -#endif // __MYGUI_EXCEPTION_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_FactoryManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_FactoryManager.h deleted file mode 100644 index 172eb4733..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_FactoryManager.h +++ /dev/null @@ -1,79 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_FACTORY_MANAGER_H__ -#define __MYGUI_FACTORY_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Instance.h" -#include "MyGUI_IObject.h" -#include "MyGUI_GenericFactory.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT FactoryManager - { - MYGUI_INSTANCE_HEADER( FactoryManager ) - - public: - typedef delegates::CDelegate1 Delegate; - - void initialise(); - void shutdown(); - - void registerFactory(const std::string& _category, const std::string& _type, Delegate::IDelegate* _delegate); - void unregisterFactory(const std::string& _category, const std::string& _type); - void unregisterFactory(const std::string& _category); - - bool isFactoryExist(const std::string& _category, const std::string& _type); - - template - void registerFactory(const std::string& _category) - { - registerFactory(_category, Type::getClassTypeName(), GenericFactory::getFactory()); - } - - template - void registerFactory(const std::string& _category, const std::string& _type) - { - registerFactory(_category, _type, GenericFactory::getFactory()); - } - - template - void unregisterFactory(const std::string& _category) - { - unregisterFactory(_category, Type::getClassTypeName()); - } - - IObject* createObject(const std::string& _category, const std::string& _type); - void destroyObject(IObject* _object); - - private: - typedef std::map MapFactoryItem; - typedef std::map MapRegisterFactoryItem; - MapRegisterFactoryItem mRegisterFactoryItems; - }; - -} // namespace MyGUI - -#endif // __MYGUI_FACTORY_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_FontData.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_FontData.h deleted file mode 100644 index 95b5b7558..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_FontData.h +++ /dev/null @@ -1,129 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_FONT_DATA_H__ -#define __MYGUI_FONT_DATA_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - struct MYGUI_EXPORT FontCodeType - { - enum Enum - { - Selected = 6, - SelectedBack = 7, - Cursor = 8, - Tab = 9, - LF = 0x000A, - CR = 0x000D, - Space = 0x0020, - LatinStart = 0x0021, - NEL = 0x0085, - LatinEnd = 0x00A6, - MAX - }; - - FontCodeType(Enum _value = MAX) : value(_value) { } - - friend bool operator == (FontCodeType const& a, FontCodeType const& b) { return a.value == b.value; } - friend bool operator != (FontCodeType const& a, FontCodeType const& b) { return a.value != b.value; } - - private: - Enum value; - }; - - // - struct GlyphInfo - { - FloatRect uvRect; - Char codePoint; - int width; - - GlyphInfo() : codePoint(0), width(0) { } - }; - - typedef std::vector VectorGlyphInfo; - - // - //FIXME move to std::pair - class PairCodePoint - { - public: - PairCodePoint() : first(0), last(0) { } - PairCodePoint(Char _first, Char _last) : first(_first), last(_last) { } - - // - bool isExist(Char _code) const { return _code >= first && _code <= last; } - - public: - Char first; - Char last; - }; - - // - class RangeInfo - { - public: - RangeInfo() : first(0), last(0) { } - RangeInfo(Char _first, Char _last) : - first(_first), - last(_last) - { - range.resize(last - first + 1); - } - - // - bool isExist(Char _code) const { return _code >= first && _code <= last; } - - // , 0, - GlyphInfo* getInfo(Char _code) { return isExist(_code) ? &range[_code - first] : nullptr; } - void setInfo(Char _code, GlyphInfo* _value) { if (isExist(_code)) range[_code - first] = *_value; } - - public: - Char first; - Char last; - VectorGlyphInfo range; - }; - - // FIXME move to resource font - class PairCodeCoord - { - public: - PairCodeCoord() : code(0) { } - PairCodeCoord(Char _code, const IntCoord& _coord) : - code(_code), - coord(_coord) - { - } - - bool operator < (const PairCodeCoord& _value) const { return code < _value.code; } - - Char code; - IntCoord coord; - }; - -} // namespace MyGUI - -#endif // __MYGUI_FONT_DATA_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_FontManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_FontManager.h deleted file mode 100644 index baaad1292..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_FontManager.h +++ /dev/null @@ -1,60 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_FONT_MANAGER_H__ -#define __MYGUI_FONT_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Enumerator.h" -#include "MyGUI_IFont.h" -#include "MyGUI_Instance.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_ResourceManager.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT FontManager - { - MYGUI_INSTANCE_HEADER( FontManager ) - - public: - void initialise(); - void shutdown(); - - /** Load additional MyGUI *_font.xml file */ - bool load(const std::string& _file); - void _load(xml::ElementPtr _node, const std::string& _file, Version _version); - - const std::string& getDefaultFont() const { return mDefaultName; } - void setDefaultFont(const std::string& _value); - - /** Get font resource */ - IFont* getByName(const std::string& _name) const; - - private: - std::string mDefaultName; - }; - -} // namespace MyGUI - -#endif // __MYGUI_FONT_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_GenericFactory.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_GenericFactory.h deleted file mode 100644 index 503c61a25..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_GenericFactory.h +++ /dev/null @@ -1,36 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -#ifndef __MYGUI_GENERIC_FACTORY_H__ -#define __MYGUI_GENERIC_FACTORY_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include "MyGUI_Delegate.h" - -namespace MyGUI -{ - - template - class GenericFactory - { - public: - typedef delegates::CDelegate1 Delegate; - static typename Delegate::IDelegate* getFactory() - { - return newDelegate(createFromFactory); - } - - private: - static void createFromFactory(IObject*& _instance) - { - _instance = new Type(); - } - }; - -} - -#endif // __MYGUI_GENERIC_FACTORY_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Gui.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Gui.h deleted file mode 100644 index 006d28301..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Gui.h +++ /dev/null @@ -1,287 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_GUI_H__ -#define __MYGUI_GUI_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include "MyGUI_Instance.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_IWidgetCreator.h" -#include "MyGUI_IUnlinkWidget.h" -#include "MyGUI_Widget.h" - -namespace MyGUI -{ - - typedef delegates::CMultiDelegate1 FrameEventDelegate; - - class MYGUI_EXPORT Gui : public IWidgetCreator, public IUnlinkWidget - { - friend class WidgetManager; - MYGUI_INSTANCE_HEADER( Gui ) - - public: - /** Initialise GUI and all GUI Managers - @param - _core name of core config file for MyGUI (contain main config files with skins, layers, fonts, etc.) - @param - _logFileName Log file name - */ - void initialise(const std::string& _core = "core.xml", const std::string& _logFileName = MYGUI_LOG_FILENAME); - - /** Shutdown GUI and all GUI Managers*/ - void shutdown(); - - // methods for creating widgets - /** Create widget - @param _type widget type - @param _skin widget skin - @param _coord int coordinates of widget (_left, _top, _width, _height) - @param _align widget align (possible values can be found in enum Align) - @param _layer layer where widget will be created (all layers usually defined in core.layer file). - If your widget will overlap with any other you shoud select _layer with "overlapped" property enabled. - @param _name if needed (you can use it for finding widget by name later) - */ - Widget* createWidgetT(const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name = "") - { - return baseCreateWidget(WidgetStyle::Overlapped, _type, _skin, _coord, _align, _layer, _name); - } - /** See Gui::createWidgetT */ - Widget* createWidgetT(const std::string& _type, const std::string& _skin, int _left, int _top, int _width, int _height, Align _align, const std::string& _layer, const std::string& _name = "") - { - return createWidgetT(_type, _skin, IntCoord(_left, _top, _width, _height), _align, _layer, _name); - } - /** Create widget using coordinates relative to parent. see Gui::createWidgetT */ - Widget* createWidgetRealT(const std::string& _type, const std::string& _skin, const FloatCoord& _coord, Align _align, const std::string& _layer, const std::string& _name = "") - { - return createWidgetT(_type, _skin, IntCoord((int)(_coord.left*mViewSize.width), (int)(_coord.top*mViewSize.height), (int)(_coord.width*mViewSize.width), (int)(_coord.height*mViewSize.height)), _align, _layer, _name); - } - /** Create widget using coordinates relative to parent. see Gui::createWidgetT */ - Widget* createWidgetRealT(const std::string& _type, const std::string& _skin, float _left, float _top, float _width, float _height, Align _align, const std::string& _layer, const std::string& _name = "") - { - return createWidgetT(_type, _skin, IntCoord((int)(_left*mViewSize.width), (int)(_top*mViewSize.height), (int)(_width*mViewSize.width), (int)(_height*mViewSize.height)), _align, _layer, _name); - } - - // templates for creating widgets by type - /** Same as Gui::createWidgetT but return T* instead of Widget* */ - template - T* createWidget(const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name = "") - { - return static_cast(createWidgetT(T::getClassTypeName(), _skin, _coord, _align, _layer, _name)); - } - /** Same as Gui::createWidgetT but return T* instead of Widget* */ - template - T* createWidget(const std::string& _skin, int _left, int _top, int _width, int _height, Align _align, const std::string& _layer, const std::string& _name = "") - { - return static_cast(createWidgetT(T::getClassTypeName(), _skin, IntCoord(_left, _top, _width, _height), _align, _layer, _name)); - } - /** Same as Gui::createWidgetRealT but return T* instead of Widget* */ - template - T* createWidgetReal(const std::string& _skin, const FloatCoord& _coord, Align _align, const std::string& _layer, const std::string& _name = "") - { - return static_cast(createWidgetRealT(T::getClassTypeName(), _skin, _coord, _align, _layer, _name)); - } - /** Same as Gui::createWidgetRealT but return T* instead of Widget* */ - template - T* createWidgetReal(const std::string& _skin, float _left, float _top, float _width, float _height, Align _align, const std::string& _layer, const std::string& _name = "") - { - return static_cast(createWidgetRealT(T::getClassTypeName(), _skin, _left, _top, _width, _height, _align, _layer, _name)); - } - - /** Get view size of GUI area */ - const IntSize& getViewSize() const { return mViewSize; } - - int getViewWidth() { return mViewSize.width; } - int getViewHeight() { return mViewSize.height; } - - // mirror of InputManager methods - /** Inject MouseMove event - @return true if event has been processed by GUI - */ - bool injectMouseMove(int _absx, int _absy, int _absz); - /** Inject MousePress event - @return true if event has been processed by GUI - */ - bool injectMousePress(int _absx, int _absy, MouseButton _id); - /** Inject MouseRelease event - @return true if event has been processed by GUI - */ - bool injectMouseRelease(int _absx, int _absy, MouseButton _id); - - /** Inject KeyPress event - @return true if event has been processed by GUI - */ - bool injectKeyPress(KeyCode _key, Char _text = 0); - /** Inject KeyReleas event - @return true if event has been processed by GUI - */ - bool injectKeyRelease(KeyCode _key); - - /** Destroy any created widget */ - void destroyWidget(Widget* _widget); - - /** Destroy vector of widgets */ - void destroyWidgets(VectorWidgetPtr& _widgets); - - /** Destroy Enumerator of widgets */ - void destroyWidgets(EnumeratorWidgetPtr& _widgets); - - /** Find widget by name - If widget is not found the exception will be thrown, or if the second parameter is false the nullptr pointer will be returned - */ - Widget* findWidgetT(const std::string& _name, bool _throw = true); - - /** Find widget by name and prefix - If widget is not found the exception will be thrown, or if the second parameter is false the nullptr pointer will be returned - */ - Widget* findWidgetT(const std::string& _name, const std::string& _prefix, bool _throw = true) - { - return findWidgetT(_prefix + _name, _throw); - } - - // mirror WidgetManager - /** Find widget by name and cast it to T type. - If widget not found or T and found widget have different types cause exception, or if the second parameter is false the nullptr pointer will be returned - */ - template - T* findWidget(const std::string& _name, bool _throw = true) - { - Widget* widget = findWidgetT(_name, _throw); - if (nullptr == widget) return nullptr; - return widget->castType(_throw); - } - - /** Find widget by name and prefix and cast it to T type - If widget not found or T and found widget have different types cause exception, or if the second parameter is false the nullptr pointer will be returned - */ - template - T* findWidget(const std::string& _name, const std::string& _prefix, bool _throw = true) - { - return findWidget(_prefix + _name, _throw); - } - - - /** Show or hide mouse pointer */ - void setVisiblePointer(bool _visible); - /** Is mouse pointer visible */ - bool isVisiblePointer(); - - - // mirror ResourceManager - /** Load config with any info (file can have different data such other config files that will be loaded, skins, layers, pointers, etc) */ - bool load(const std::string& _file); - - void resizeWindow(const IntSize& _size); - - /** Destroy child widget or throw exception if this child widget not found */ - void destroyChildWidget(Widget* _widget) { _destroyChildWidget(_widget); } - - /** Destroy all child widgets */ - void destroyAllChildWidget() { _destroyAllChildWidget(); } - - /** Get name of Gui ResourceGroup*/ - //static const std::string& getResourceGroup(); - - /** Get root widgets Enumerator */ - EnumeratorWidgetPtr getEnumerator() { return EnumeratorWidgetPtr(mWidgetChild); } - - /*internal:*/ - - /** Inject frame entered event (called be renderer, do not call it manually). - This function is called every frame by renderer. - */ - void _injectFrameEntered(float _time); - - /*event:*/ - /** Multidelegate for GUI per frame call.\n - signature : void method(float _time)\n - @param _time Time elapsed since last frame - */ - FrameEventDelegate eventFrameStart; - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void Gui::destroyWidgets(VectorWidgetPtr &_widgets)") - void destroyWidgetsVector(VectorWidgetPtr& _widgets) { destroyWidgets(_widgets); } - - MYGUI_OBSOLETE("use : void Gui::setVisiblePointer(bool _value)") - void hidePointer() { setVisiblePointer(false); } - MYGUI_OBSOLETE("use : void Gui::setVisiblePointer(bool _value)") - void showPointer() { setVisiblePointer(true); } - MYGUI_OBSOLETE("use : bool Gui::isVisiblePointer()") - bool isShowPointer() { return isVisiblePointer(); } - MYGUI_OBSOLETE("called be renderer, do not call it manually") - void injectFrameEntered(float _time) { } - -#endif // MYGUI_DONT_USE_OBSOLETE - - private: - // создает виджет - virtual Widget* baseCreateWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name); - - // удяляет неудачника - void _destroyChildWidget(Widget* _widget); - - // удаляет всех детей - void _destroyAllChildWidget(); - - virtual void _unlinkWidget(Widget* _widget); - - // добавляет в список виджет - virtual void _linkChildWidget(Widget* _widget); - - // удаляет из списка - virtual void _unlinkChildWidget(Widget* _widget); - - - private: - // вектор всех детей виджетов - VectorWidgetPtr mWidgetChild; - - // размеры экрана - IntSize mViewSize; - - // синглтоны гуя - InputManager * mInputManager; - SubWidgetManager * mSubWidgetManager; - LayerManager* mLayerManager; - SkinManager* mSkinManager; - WidgetManager* mWidgetManager; - FontManager* mFontManager; - ControllerManager* mControllerManager; - PointerManager* mPointerManager; - ClipboardManager* mClipboardManager; - LayoutManager* mLayoutManager; - DynLibManager* mDynLibManager; - PluginManager* mPluginManager; - LanguageManager* mLanguageManager; - ResourceManager* mResourceManager; - FactoryManager* mFactoryManager; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_GUI_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Guid.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Guid.h deleted file mode 100644 index 72d253434..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Guid.h +++ /dev/null @@ -1,137 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 09/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_GUID_H__ -#define __MYGUI_GUID_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include - -namespace MyGUI -{ - - class MYGUI_EXPORT Guid - { - public: - Guid() { fast._data1 = fast._data2 = fast._data3 = fast._data4 = 0; } - Guid( Guid const& _value ) { *this = _value; } - explicit Guid(const std::string& _value) { *this = parse(_value); } - explicit Guid(unsigned char(&_id)[16]) { ::memcpy((void*)&vec._data1[0], (void*)&_id[0], 16); } - - bool operator == (Guid const& _comp) const - { - return _comp.fast._data1 == fast._data1 - && _comp.fast._data2 == fast._data2 - && _comp.fast._data3 == fast._data3 - && _comp.fast._data4 == fast._data4; - } - - bool operator != ( Guid const& _comp ) const - { - return ! (*this == _comp); - } - - bool operator < ( Guid const& _comp ) const - { - if (_comp.fast._data1 < fast._data1) return true; - else if (_comp.fast._data1 > fast._data1) return false; - if (_comp.fast._data2 < fast._data2) return true; - else if (_comp.fast._data2 > fast._data2) return false; - if (_comp.fast._data3 < fast._data3) return true; - else if (_comp.fast._data3 > fast._data3) return false; - if (_comp.fast._data4 < fast._data4) return true; - return false; - } - - Guid& operator = (Guid const& _rvalue) - { - fast._data1 = _rvalue.fast._data1; - fast._data2 = _rvalue.fast._data2; - fast._data3 = _rvalue.fast._data3; - fast._data4 = _rvalue.fast._data4; - return *this; - } - - bool empty() const - { - return fast._data1 == 0 - && fast._data2 == 0 - && fast._data3 == 0 - && fast._data4 == 0; - } - - void clear() - { - fast._data1 = fast._data2 = fast._data3 = fast._data4 = 0; - } - - std::string print() const; - static Guid parse(const std::string& _value); - static Guid generate(); - - friend std::ostream& operator << ( std::ostream& _stream, const Guid& _value ) - { - _stream << _value.print(); - return _stream; - } - - friend std::istream& operator >> ( std::istream& _stream, Guid& _value ) - { - std::string value; - _stream >> value; - if (_stream.fail()) _value.clear(); - else _value = Guid::parse(value); - return _stream; - } - - private: - // массив для быстрой конвертации - static const char convert_hex[64]; - - struct _original - { - uint32 data1; - uint16 data2, data3; - uint8 data4[8]; - }; - struct _fast - { - uint32 _data1, _data2, _data3, _data4; - }; - struct _vec - { - unsigned char _data1[16]; - }; - - union - { - _original original; - _fast fast; - _vec vec; - }; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_GUID_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_HScroll.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_HScroll.h deleted file mode 100644 index 1f7e47e4e..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_HScroll.h +++ /dev/null @@ -1,67 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_HSCROLL_H__ -#define __MYGUI_HSCROLL_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_VScroll.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT HScroll : - public VScroll - { - MYGUI_RTTI_DERIVED( HScroll ) - - public: - HScroll(); - - //! @copydoc VScroll::getLineSize() - virtual int getLineSize(); - - //! @copydoc VScroll::setTrackSize(int _value) - virtual void setTrackSize(int _value); - //! @copydoc VScroll::getTrackSize() - virtual int getTrackSize(); - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - protected: - virtual ~HScroll(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - void TrackMove(int _left, int _top); - void updateTrack(); - - }; - -} // namespace MyGUI - -#endif // __MYGUI_HSCROLL_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IBItemInfo.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IBItemInfo.h deleted file mode 100644 index 1bbda09f4..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IBItemInfo.h +++ /dev/null @@ -1,111 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_ITEM_INFO_H__ -#define __MYGUI_ITEM_INFO_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - // структура информации об отображении элемента - /** Info about ItemBox item*/ - struct MYGUI_EXPORT IBDrawItemInfo - { - - IBDrawItemInfo() : - index(ITEM_NONE), - update(false), - select(false), - active(false), - drag(false), - drop_accept(false), - drop_refuse(false) - { - } - - IBDrawItemInfo(size_t _index, size_t _select, size_t _active, size_t _accept, size_t _refuse, bool _update, bool _drag) : - index(_index), - update(_update), - select(_index == _select), - active(_index == _active), - drag(_drag), - drop_accept(_index == _accept), - drop_refuse(_index == _refuse) - { - } - - /** Index of element */ - size_t index; - /** State and interdan data changed */ - bool update; - /** Is widget selected */ - bool select; - /** Is widget active */ - bool active; - /** Is widget able to be dragged */ - bool drag; - /** Is widget accepting drop */ - bool drop_accept; - /** Is widget refuseing drop */ - bool drop_refuse; - }; - - struct MYGUI_EXPORT IBNotifyItemData - { - enum NotifyItem - { - MousePressed, - MouseReleased, - KeyPressed, - KeyReleased - }; - - IBNotifyItemData(size_t _index, NotifyItem _notify, int _x, int _y, MouseButton _id) : - index(_index), notify(_notify), x(_x), y(_y), id(_id), code(KeyCode::None), key(0) { } - - IBNotifyItemData(size_t _index, NotifyItem _notify, KeyCode _code, Char _key) : - index(_index), notify(_notify), x(0), y(0), id(MouseButton::None), code(_code), key(_key) { } - - IBNotifyItemData(size_t _index, NotifyItem _notify, KeyCode _code) : - index(_index), notify(_notify), x(0), y(0), id(MouseButton::None), code(_code), key(KeyCode::None) { } - - /** Item index */ - size_t index; - /** Notify type */ - NotifyItem notify; - /** If Mouse* notify type - mouse x position, else 0 */ - int x; - /** If Mouse* notify type - mouse y position, else 0 */ - int y; - /** If Mouse* notify type - mouse button id position, else 0 */ - MouseButton id; - /** If Key* notify type - key code, else 0 */ - KeyCode code; - /** If Key* notify type - mouse button id position, else 0 */ - Char key; - }; - -} // namespace MyGUI - -#endif // __MYGUI_ITEM_INFO_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ICroppedRectangle.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ICroppedRectangle.h deleted file mode 100644 index 06229d056..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ICroppedRectangle.h +++ /dev/null @@ -1,213 +0,0 @@ -/*! - @file - @author Georgiy Evmenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_CROPPED_RECTANGLE_H__ -#define __MYGUI_I_CROPPED_RECTANGLE_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT ICroppedRectangle - { - public: - ICroppedRectangle() : - mIsMargin(false), - mCroppedParent(nullptr), - mVisible(true), - mAlign(Align::Default) - { } - - virtual ~ICroppedRectangle() { } - - /** Get parent ICroppedRectangle */ - ICroppedRectangle * getCroppedParent() { return mCroppedParent; } - - /** Set coordinates (position and size) */ - virtual void setCoord(const IntCoord& _value) { mCoord = _value; } - /** Get coordinates (position and size) */ - const IntCoord& getCoord() const { return mCoord; } - - /** Set position */ - virtual void setPosition(const IntPoint& _value) { mCoord.left = _value.left; mCoord.top = _value.top; } - /** Get position */ - IntPoint getPosition() const { return mCoord.point(); } - - /** Set size */ - virtual void setSize(const IntSize& _value) { mCoord.width = _value.width; mCoord.height = _value.height; } - /** Get size */ - IntSize getSize() const { return mCoord.size(); } - - /** Hide or show */ - virtual void setVisible(bool _value) { mVisible = _value; } - /** Return true if visible */ - bool isVisible() const { return mVisible; } - - /** Get position in screen coordinates */ - const IntPoint& getAbsolutePosition() const { return mAbsolutePosition; } - /** Get rectangle in screen coordinates */ - IntRect getAbsoluteRect() const { return IntRect(mAbsolutePosition.left, mAbsolutePosition.top, mAbsolutePosition.left+mCoord.width, mAbsolutePosition.top+mCoord.height); } - /** Get coordinate in screen coordinates */ - IntCoord getAbsoluteCoord() const { return IntCoord(mAbsolutePosition.left, mAbsolutePosition.top, mCoord.width, mCoord.height); } - - /** Get X in screen coordinates */ - int getAbsoluteLeft() const { return mAbsolutePosition.left; } - /** Get Y in screen coordinates */ - int getAbsoluteTop() const { return mAbsolutePosition.top; } - - /** Set align */ - virtual void setAlign(Align _value) { mAlign = _value; } - /** Get align */ - Align getAlign() const { return mAlign; } - - /** Get left x-coordinate */ - int getLeft() const { return mCoord.left; } - /** Get right x-coordinate */ - int getRight() const { return mCoord.right(); } - /** Get top y-coordinate */ - int getTop() const { return mCoord.top; } - /** Get bottom y-coordinate */ - int getBottom() const { return mCoord.bottom(); } - /** Get width */ - int getWidth() const { return mCoord.width; } - /** Get height */ - int getHeight() const { return mCoord.height; } - - - /*internal:*/ - /** True if rectangle is cropped by parent rectangle */ - bool _isMargin() const { return mIsMargin; } - - // Get cropped by parent rectangle coordinates - int _getViewLeft() const { return mCoord.left + mMargin.left; } - int _getViewRight() const { return mCoord.right() - mMargin.right; } - int _getViewTop() const { return mCoord.top + mMargin.top; } - int _getViewBottom() const { return mCoord.bottom() - mMargin.bottom; } - int _getViewWidth() const { return mCoord.width - mMargin.left - mMargin.right; } - int _getViewHeight() const { return mCoord.height - mMargin.top - mMargin.bottom; } - - virtual void _updateView() { } - virtual void _correctView() { } - virtual void _setAlign(const IntSize& _oldsize, bool _update) { } - virtual void _setAlign(const IntCoord& _oldcoord, bool _update) { } - - void _setCroppedParent(ICroppedRectangle* _parent) { mCroppedParent = _parent; } - - const IntRect& _getMargin() const { return mMargin; } - int _getMarginLeft() const { return mMargin.left; } - int _getMarginRight() const { return mMargin.right; } - int _getMarginTop() const { return mMargin.top; } - int _getMarginBottom() const { return mMargin.bottom; } - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void ICroppedRectangle::setVisible(bool _visible)") - void show() { setVisible(true); } - MYGUI_OBSOLETE("use : void ICroppedRectangle::setVisible(bool _visible)") - void hide() { setVisible(false); } - MYGUI_OBSOLETE("use : bool ICroppedRectangle::isVisible()") - bool isShow() { return isVisible(); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - protected: - bool _checkPoint(int _left, int _top) - { - return ! ((_getViewLeft() > _left) || (_getViewTop() > _top) || (_getViewRight() < _left) || (_getViewBottom() < _top)); - } - - bool _checkMargin() - { - bool margin = false; - //вылезли ли налево - if (getLeft() < mCroppedParent->mMargin.left) - { - mMargin.left = mCroppedParent->mMargin.left - getLeft(); - margin = true; - } - else - { - mMargin.left = 0; - } - - //вылезли ли направо - if (getRight() > mCroppedParent->getWidth() - mCroppedParent->mMargin.right) - { - mMargin.right = getRight() - (mCroppedParent->getWidth() - mCroppedParent->mMargin.right); - margin = true; - } - else - { - mMargin.right = 0; - } - - //вылезли ли вверх - if (getTop() < mCroppedParent->mMargin.top) - { - mMargin.top = mCroppedParent->mMargin.top - getTop(); - margin = true; - } - else - { - mMargin.top = 0; - } - - //вылезли ли вниз - if (getBottom() > mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom) - { - mMargin.bottom = getBottom() - (mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom); - margin = true; - } - else - { - mMargin.bottom = 0; - } - - return margin; - } - - bool _checkOutside() // проверка на полный выход за границу - { - return ( (getRight() < mCroppedParent->mMargin.left ) || // совсем уехали налево - (getLeft() > mCroppedParent->getWidth() - mCroppedParent->mMargin.right ) || // совсем уехали направо - (getBottom() < mCroppedParent->mMargin.top ) || // совсем уехали вверх - (getTop() > mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom ) ); // совсем уехали вниз - } - - protected: - bool mIsMargin; - IntRect mMargin; // перекрытие - IntCoord mCoord; // координаты - IntPoint mAbsolutePosition; // обсолютные координаты - - ICroppedRectangle * mCroppedParent; - bool mVisible; - Align mAlign; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_CROPPED_RECTANGLE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IDataStream.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IDataStream.h deleted file mode 100644 index b40480850..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IDataStream.h +++ /dev/null @@ -1,46 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 08/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_DATA_STREAM_H__ -#define __MYGUI_I_DATA_STREAM_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT IDataStream - { - public: - virtual ~IDataStream() { } - - virtual bool eof() = 0; - virtual size_t size() = 0; - virtual void readline(std::string& _source, Char _delim = '\n') = 0; - virtual size_t read(void* _buf, size_t _count) = 0; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_DATA_STREAM_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IFont.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IFont.h deleted file mode 100644 index 14357714e..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IFont.h +++ /dev/null @@ -1,54 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_FONT_H__ -#define __MYGUI_I_FONT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_ISerializable.h" -#include "MyGUI_IResource.h" -#include "MyGUI_FontData.h" - -namespace MyGUI -{ - - class ITexture; - - class MYGUI_EXPORT IFont : public IResource - { - MYGUI_RTTI_DERIVED( IFont ) - - public: - IFont() { } - virtual ~IFont() { } - - virtual GlyphInfo* getGlyphInfo(Char _id) = 0; - - virtual ITexture* getTextureFont() = 0; - - virtual int getDefaultHeight() = 0; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_FONT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ILayer.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ILayer.h deleted file mode 100644 index 2f45bccac..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ILayer.h +++ /dev/null @@ -1,79 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_LAYER_H__ -#define __MYGUI_I_LAYER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include "MyGUI_IRenderTarget.h" -#include "MyGUI_ILayerNode.h" -#include "MyGUI_ISerializable.h" - -namespace MyGUI -{ - - class ILayerItem; - - class MYGUI_EXPORT ILayer : public ISerializable - { - MYGUI_RTTI_DERIVED( ILayer ) - - public: - ILayer() { } - virtual ~ILayer() { } - - // - const std::string& getName() const { return mName; } - - // - virtual ILayerNode* createChildItemNode() = 0; - // - virtual void destroyChildItemNode(ILayerNode* _node) = 0; - - // - virtual void upChildItemNode(ILayerNode* _node) = 0; - - // - virtual EnumeratorILayerNode getEnumerator() = 0; - - // - virtual ILayerItem* getLayerItemByPoint(int _left, int _top) = 0; - - // - virtual IntPoint getPosition(int _left, int _top) const = 0; - - // - virtual const IntSize& getSize() const = 0; - - // - virtual void renderToTarget(IRenderTarget* _target, bool _update) = 0; - - virtual void dumpStatisticToLog() { } - - protected: - std::string mName; - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_LAYER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ILayerItem.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ILayerItem.h deleted file mode 100644 index b7705b163..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ILayerItem.h +++ /dev/null @@ -1,50 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_LAYER_ITEM_H__ -#define __MYGUI_I_LAYER_ITEM_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - class ILayer; - class ILayerNode; - - class MYGUI_EXPORT ILayerItem - { - public: - virtual ~ILayerItem() { } - - virtual ILayerItem * getLayerItemByPoint(int _left, int _top) = 0; - virtual const IntCoord& getLayerItemCoord() = 0; - - virtual void attachItemToNode(ILayer* _layer, ILayerNode* _node) = 0; - virtual void detachFromLayer() = 0; - virtual void upLayerItem() = 0; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_LAYER_ITEM_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ILayerNode.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ILayerNode.h deleted file mode 100644 index 7a4e67748..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ILayerNode.h +++ /dev/null @@ -1,91 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_LAYER_NODE_H__ -#define __MYGUI_I_LAYER_NODE_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Enumerator.h" -#include "MyGUI_IObject.h" -#include "MyGUI_IRenderTarget.h" - -namespace MyGUI -{ - - class ILayer; - class ILayerItem; - class ILayerNode; - - class RenderItem; - class ISubWidget; - - typedef std::vector VectorILayerNode; - typedef Enumerator EnumeratorILayerNode; - - class MYGUI_EXPORT ILayerNode : public IObject - { - MYGUI_RTTI_DERIVED( ILayerNode ) - - public: - virtual ~ILayerNode() { } - - // , - virtual ILayer* getLayer() = 0; - - // nullptr - virtual ILayerNode* getParent() = 0; - - // - virtual ILayerNode* createChildItemNode() = 0; - // - virtual void destroyChildItemNode(ILayerNode* _node) = 0; - - // - virtual void upChildItemNode(ILayerNode* _node) = 0; - - // - virtual EnumeratorILayerNode getEnumerator() = 0; - - - // - virtual void attachLayerItem(ILayerItem* _item) = 0; - // - virtual void detachLayerItem(ILayerItem* _root) = 0; - - // - virtual RenderItem* addToRenderItem(ITexture* _texture, ISubWidget* _item) = 0; - // - virtual void outOfDate(RenderItem* _item) = 0; - - // - virtual ILayerItem* getLayerItemByPoint(int _left, int _top) = 0; - - // - virtual void renderToTarget(IRenderTarget* _target, bool _update) = 0; - - virtual void dumpStatisticToLog(size_t _level) { } - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_LAYER_NODE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IObject.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IObject.h deleted file mode 100644 index 6364afae7..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IObject.h +++ /dev/null @@ -1,43 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_OBJECT_H__ -#define __MYGUI_I_OBJECT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_RTTI.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT IObject - { - MYGUI_RTTI_BASE( IObject ) - - public: - virtual ~IObject() { } - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_OBJECT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IPointer.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IPointer.h deleted file mode 100644 index 709247818..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IPointer.h +++ /dev/null @@ -1,47 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_POINTER_H__ -#define __MYGUI_I_POINTER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_IResource.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT IPointer : public IResource - { - MYGUI_RTTI_DERIVED( IPointer ) - - public: - IPointer() { } - virtual ~IPointer() { } - - virtual void setImage(StaticImage* _image) = 0; - virtual void setPosition(StaticImage* _image, const IntPoint& _point) = 0; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_POINTER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IRenderTarget.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IRenderTarget.h deleted file mode 100644 index 38094fac5..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IRenderTarget.h +++ /dev/null @@ -1,52 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_RENDER_TARGET_H__ -#define __MYGUI_I_RENDER_TARGET_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_RenderTargetInfo.h" - -namespace MyGUI -{ - - class ITexture; - class IVertexBuffer; - - class MYGUI_EXPORT IRenderTarget - { - public: - IRenderTarget() { } - virtual ~IRenderTarget() { } - - virtual void begin() = 0; - virtual void end() = 0; - - virtual void doRender(IVertexBuffer* _buffer, ITexture* _texture, size_t _count) = 0; - - virtual const RenderTargetInfo& getInfo() = 0; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_RENDER_TARGET_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IResource.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IResource.h deleted file mode 100644 index b296b684c..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IResource.h +++ /dev/null @@ -1,77 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 09/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_RESOURCE_H__ -#define __MYGUI_I_RESOURCE_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_Guid.h" -#include "MyGUI_Version.h" -#include "MyGUI_ISerializable.h" -#include "MyGUI_ResourceHolder.h" - -namespace MyGUI -{ - - class IResource; - typedef IResource * IResourcePtr; - - class ResourceManager; - - class MYGUI_EXPORT IResource : public ISerializable - { - // для серелизации - friend class ResourceManager; - // для удаления - friend class ResourceHolder; - - MYGUI_RTTI_DERIVED( IResource ) - - public: - const std::string& getResourceName() { return mResourceName; } - const Guid& getResourceID() { return mResourceID; } - - protected: - IResource() { } - private: - // constructors and operator =, without implementation, just for private - IResource(IResource const &); - IResource& operator = (IResource const &); - - protected: - virtual void deserialization(xml::ElementPtr _node, Version _version) - { - mResourceID = Guid::parse(_node->findAttribute("id")); - mResourceName = _node->findAttribute("name"); - } - - virtual ~IResource() { } - - private: - std::string mResourceName; - Guid mResourceID; - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_RESOURCE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ISerializable.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ISerializable.h deleted file mode 100644 index 69b5cfa02..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ISerializable.h +++ /dev/null @@ -1,49 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_SERIALIZABLE_H__ -#define __MYGUI_I_SERIALIZABLE_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_IObject.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_Version.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT ISerializable : public IObject - { - MYGUI_RTTI_DERIVED( ISerializable ) - - public: - ISerializable() { } - virtual ~ISerializable() { } - - virtual void serialization(xml::ElementPtr _node, Version _version) { } - virtual void deserialization(xml::ElementPtr _node, Version _version) { } - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_SERIALIZABLE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IStateInfo.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IStateInfo.h deleted file mode 100644 index 478522144..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IStateInfo.h +++ /dev/null @@ -1,47 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_STATE_INFO_H__ -#define __MYGUI_I_STATE_INFO_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_ISerializable.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT IStateInfo : public ISerializable - { - MYGUI_RTTI_DERIVED( IStateInfo ) - - public: - virtual ~IStateInfo() { } - - }; - - typedef std::vector VectorStateInfo; - typedef std::map MapStateInfo; - typedef std::map MapWidgetStateInfo; - -} // namespace MyGUI - -#endif // __MYGUI_I_STATE_INFO_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ISubWidget.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ISubWidget.h deleted file mode 100644 index c213eb700..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ISubWidget.h +++ /dev/null @@ -1,62 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 09/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_SUB_WIDGET_H__ -#define __MYGUI_I_SUB_WIDGET_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_ICroppedRectangle.h" -#include "MyGUI_ILayerNode.h" -#include "MyGUI_Types.h" -#include "MyGUI_IRenderTarget.h" -#include "MyGUI_IStateInfo.h" -#include "MyGUI_IObject.h" - -namespace MyGUI -{ - - class ISubWidget; - typedef std::vector VectorSubWidget; - - class MYGUI_EXPORT ISubWidget : - public ICroppedRectangle, - public IObject - { - MYGUI_RTTI_DERIVED( ISubWidget ) - - public: - virtual ~ISubWidget() { } - - virtual void createDrawItem(ITexture* _texture, ILayerNode* _node) = 0; - virtual void destroyDrawItem() = 0; - - virtual void setAlpha(float _alpha) { } - - virtual void setStateData(IStateInfo* _data) { } - - virtual void doRender() = 0; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_SUB_WIDGET_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ISubWidgetRect.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ISubWidgetRect.h deleted file mode 100644 index 57fe40ac0..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ISubWidgetRect.h +++ /dev/null @@ -1,47 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 09/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_SUB_WIDGET_RECT_H__ -#define __MYGUI_I_SUB_WIDGET_RECT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_ISubWidget.h" -#include "MyGUI_Colour.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT ISubWidgetRect : public ISubWidget - { - MYGUI_RTTI_DERIVED( ISubWidgetRect ) - - public: - virtual ~ISubWidgetRect() { } - - virtual void _setUVSet(const FloatRect& _rect) { } - virtual void _setColour(const Colour& _value) { } - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_SUB_WIDGET_RECT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ISubWidgetText.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ISubWidgetText.h deleted file mode 100644 index a90783401..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ISubWidgetText.h +++ /dev/null @@ -1,114 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_SUB_WIDGET_TEXT_H__ -#define __MYGUI_I_SUB_WIDGET_TEXT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_ISubWidget.h" -#include "MyGUI_Colour.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT ISubWidgetText : public ISubWidget - { - MYGUI_RTTI_DERIVED( ISubWidgetText ) - - public: - virtual ~ISubWidgetText() { } - - /** Get index of start of selection */ - virtual size_t getTextSelectionStart() { return 0; } - /** Get index of end of selection */ - virtual size_t getTextSelectionEnd() { return 0; } - /** Set text selection */ - virtual void setTextSelection(size_t _start, size_t _end) { } - - // интенсивность выделенного текста - virtual bool getSelectBackground() { return true; } - virtual void setSelectBackground(bool _normal) { } - - // нужно ли инвертировать выделение - virtual bool getInvertSelected() { return true; } - virtual void setInvertSelected(bool _value) { } - - // управление видимостью курсора - virtual bool isVisibleCursor() { return false; } - virtual void setVisibleCursor(bool _value) { } - - // управление положением курсора - virtual size_t getCursorPosition() { return 0; } - virtual void setCursorPosition(size_t _index) { } - - virtual void setWordWrap(bool _value) { } - - // возвращает положение курсора по произвольному положению - // позиция абсолютная, без учета смещений - virtual size_t getCursorPosition(const IntPoint& _point) { return 0; } - - // возвращает положение курсора в обсолютных координатах - virtual IntCoord getCursorCoord(size_t _position) { return IntCoord(); } - - // возвращает положение курсора в обсолютных координатах - IntPoint getCursorPoint(size_t _position) - { - const IntCoord& coord = getCursorCoord(_position); - return IntPoint(coord.left + coord.width / 2, coord.top + coord.height / 2); - } - - // возвращает положение курсора в обсолютных координатах - IntRect getCursorRect(size_t _position) - { - const IntCoord& coord = getCursorCoord(_position); - return IntRect(coord.left, coord.top, coord.left + coord.width, coord.top + coord.height); - } - - // возвращает размер текста в пикселях - virtual IntSize getTextSize() { return IntSize(); } - - // устанавливает смещение текста в пикселях - virtual void setViewOffset(const IntPoint& _point) { } - virtual IntPoint getViewOffset() { return IntPoint(); } - - virtual void setCaption(const UString& _value) { } - virtual const UString& getCaption() { static UString caption; return caption; } - - virtual void setTextColour(const Colour& _value) { } - virtual const Colour& getTextColour() { return Colour::Zero; } - - virtual void setFontName(const std::string& _value) { } - virtual const std::string& getFontName() { static std::string name; return name; } - - virtual void setFontHeight(int _value) { } - virtual int getFontHeight() { return 0; } - - virtual void setTextAlign(Align _value) { } - virtual Align getTextAlign() { return Align::Default; } - - virtual void setShiftText(bool _value) { } - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_SUB_WIDGET_TEXT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ITexture.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ITexture.h deleted file mode 100644 index fdf093f2f..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ITexture.h +++ /dev/null @@ -1,73 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 04/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_TEXTURE_H__ -#define __MYGUI_I_TEXTURE_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_IRenderTarget.h" -#include "MyGUI_RenderFormat.h" -#include - -namespace MyGUI -{ - class ITexture; - - class MYGUI_EXPORT ITextureInvalidateListener - { - public: - virtual void textureInvalidate(ITexture* _texture) = 0; - }; - - class MYGUI_EXPORT ITexture - { - public: - virtual ~ITexture() { } - - virtual const std::string& getName() const = 0; - - virtual void createManual(int _width, int _height, TextureUsage _usage, PixelFormat _format) = 0; - virtual void loadFromFile(const std::string& _filename) = 0; - virtual void saveToFile(const std::string& _filename) = 0; - - virtual void setInvalidateListener(ITextureInvalidateListener* _listener) { } - - virtual void destroy() = 0; - - virtual void* lock(TextureUsage _access) = 0; - virtual void unlock() = 0; - virtual bool isLocked() = 0; - - virtual int getWidth() = 0; - virtual int getHeight() = 0; - - virtual PixelFormat getFormat() = 0; - virtual TextureUsage getUsage() = 0; - virtual size_t getNumElemBytes() = 0; - - virtual IRenderTarget* getRenderTarget() { return nullptr; } - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_TEXTURE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IUnlinkWidget.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IUnlinkWidget.h deleted file mode 100644 index f890e435a..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IUnlinkWidget.h +++ /dev/null @@ -1,43 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_UNLINK_WIDGET_H__ -#define __MYGUI_UNLINK_WIDGET_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_WidgetDefines.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT IUnlinkWidget - { - public: - virtual ~IUnlinkWidget() { } - virtual void _unlinkWidget(Widget* _widget) = 0; - }; - - typedef std::vector VectorIUnlinkWidget; - -} // namespace MyGUI - -#endif // __MYGUI_UNLINK_WIDGET_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IVertexBuffer.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IVertexBuffer.h deleted file mode 100644 index 7533e9fcd..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IVertexBuffer.h +++ /dev/null @@ -1,47 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 04/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_VERTEX_BUFFER_H__ -#define __MYGUI_I_VERTEX_BUFFER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_VertexData.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT IVertexBuffer - { - public: - virtual ~IVertexBuffer() { } - - virtual void setVertextCount(size_t _value) = 0; - virtual size_t getVertextCount() = 0; - - virtual Vertex* lock() = 0; - virtual void unlock() = 0; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_I_VERTEX_BUFFER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IWidgetCreator.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IWidgetCreator.h deleted file mode 100644 index d82e4ac36..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IWidgetCreator.h +++ /dev/null @@ -1,64 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 03/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_WIDGET_CREATOR_H__ -#define __MYGUI_WIDGET_CREATOR_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include "MyGUI_WidgetStyle.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT IWidgetCreator - { - friend class WidgetManager; - - public: - virtual ~IWidgetCreator() { } - - protected: - virtual Widget* baseCreateWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name) = 0; - - // удяляет неудачника - virtual void _destroyChildWidget(Widget* _widget) = 0; - - // удаляет всех детей - virtual void _destroyAllChildWidget() = 0; - - // удаляет виджет с закрытым конструктором - void _deleteWidget(Widget* _widget); - - public: - // добавляет в список виджет - // имплементировать только для рутовых креаторов - virtual void _linkChildWidget(Widget* _widget) { } - // удаляет из списка - // имплементировать только для рутовых креаторов - virtual void _unlinkChildWidget(Widget* _widget) { } - - }; - -} // namespace MyGUI - -#endif // __MYGUI_WIDGET_CREATOR_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IWidgetFactory.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IWidgetFactory.h deleted file mode 100644 index d3929375f..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_IWidgetFactory.h +++ /dev/null @@ -1,95 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_I_WIDGET_FACTORY_H__ -#define __MYGUI_I_WIDGET_FACTORY_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include "MyGUI_WidgetStyle.h" -#include "MyGUI_WidgetDefines.h" -#include "MyGUI_ICroppedRectangle.h" - -#include "MyGUI_WidgetManager.h" -#include "MyGUI_SkinManager.h" - -namespace MyGUI -{ - - //OBSOLETE - class MYGUI_EXPORT IWidgetFactory - { - public: - virtual ~IWidgetFactory() { } - - virtual const std::string& getTypeName() = 0; - virtual Widget* createWidget(WidgetStyle _style, const std::string& _skin, const IntCoord& _coord, Align _align, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name) = 0; - }; - - namespace factory - { - - //OBSOLETE - template - class MYGUI_EXPORT BaseWidgetFactory : public IWidgetFactory - { - public: - BaseWidgetFactory() - { - // регестрируем себя - MyGUI::WidgetManager& manager = MyGUI::WidgetManager::getInstance(); - manager.registerFactory(this); - } - - ~BaseWidgetFactory() - { - // удаляем себя - MyGUI::WidgetManager& manager = MyGUI::WidgetManager::getInstance(); - manager.unregisterFactory(this); - } - - const std::string& getTypeName() - { - return T::getClassTypeName(); - } - - Widget* createWidget(WidgetStyle _style, const std::string& _skin, const IntCoord& _coord, Align _align, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name) - { - T* instance = new T(_style, _coord, _align, SkinManager::getInstance().getByName(_skin), _parent, _croppedParent, _creator, _name); - return instance; - } - - bool isFalseType(Widget* _ptr, const std::string &_key) - { - if (!_ptr->isType()) - { - MYGUI_LOG(Error, "Property '" << _key << "' is not supported by '" << _ptr->getTypeName() << "' widget"); - return true; - } - return false; - } - }; - - } // namespace factory -} // namespace MyGUI - -#endif // __MYGUI_I_WIDGET_FACTORY_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ImageInfo.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ImageInfo.h deleted file mode 100644 index 9f6e5a090..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ImageInfo.h +++ /dev/null @@ -1,64 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 09/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_IMAGE_INFO_H__ -#define __MYGUI_IMAGE_INFO_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - struct ImageItem - { - ImageItem() : frame_rate(0) { } - - float frame_rate; - std::vector images; - }; - - typedef std::vector VectorImages; - - struct ImageIndexInfo - { - ImageIndexInfo( - const std::string& _texture, - const IntSize& _size, - const float _rate, - const std::vector& _frames - ) : - texture(_texture), - size(_size), - rate(_rate), - frames(_frames) - { - } - - const std::string& texture; - const IntSize& size; - const float rate; - const std::vector& frames; - }; - -} // namespace MyGUI - -#endif // __MYGUI_IMAGE_INFO_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_InputDefine.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_InputDefine.h deleted file mode 100644 index 7ecd43d88..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_InputDefine.h +++ /dev/null @@ -1,227 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 03/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_INPUT_DEFINE_H__ -#define __MYGUI_INPUT_DEFINE_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - struct MYGUI_EXPORT MouseButton - { - enum Enum - { - Left = 0, - Right, - Middle, - - Button0 = 0, - Button1, - Button2, - Button3, - Button4, - Button5, - Button6, - Button7, - - None = -1 - }; - - MouseButton(Enum _value = None) : value(_value) { } - - friend bool operator == (MouseButton const& a, MouseButton const& b) { return a.value == b.value; } - friend bool operator != (MouseButton const& a, MouseButton const& b) { return a.value != b.value; } - - int toValue() const { return (int)value; } - - private: - Enum value; - }; - - struct MYGUI_EXPORT KeyCode - { - enum Enum - { - None = 0x00, - Escape = 0x01, - One = 0x02, - Two = 0x03, - Three = 0x04, - Four = 0x05, - Five = 0x06, - Six = 0x07, - Seven = 0x08, - Eight = 0x09, - Nine = 0x0A, - Zero = 0x0B, - Minus = 0x0C, /* - on main keyboard */ - Equals = 0x0D, - Backspace = 0x0E, /* Backspace */ - Tab = 0x0F, - Q = 0x10, - W = 0x11, - E = 0x12, - R = 0x13, - T = 0x14, - Y = 0x15, - U = 0x16, - I = 0x17, - O = 0x18, - P = 0x19, - LeftBracket = 0x1A, - RightBracket = 0x1B, - Return = 0x1C, /* Enter on main keyboard */ - LeftControl = 0x1D, - A = 0x1E, - S = 0x1F, - D = 0x20, - F = 0x21, - G = 0x22, - H = 0x23, - J = 0x24, - K = 0x25, - L = 0x26, - Semicolon = 0x27, - Apostrophe = 0x28, - Grave = 0x29, /* Accent grave ( ~ ) */ - LeftShift = 0x2A, - Backslash = 0x2B, - Z = 0x2C, - X = 0x2D, - C = 0x2E, - V = 0x2F, - B = 0x30, - N = 0x31, - M = 0x32, - Comma = 0x33, - Period = 0x34, /* . on main keyboard */ - Slash = 0x35, /* '/' on main keyboard */ - RightShift = 0x36, - Multiply = 0x37, /* * on numeric keypad */ - LeftAlt = 0x38, /* Left Alt */ - Space = 0x39, - Capital = 0x3A, - F1 = 0x3B, - F2 = 0x3C, - F3 = 0x3D, - F4 = 0x3E, - F5 = 0x3F, - F6 = 0x40, - F7 = 0x41, - F8 = 0x42, - F9 = 0x43, - F10 = 0x44, - NumLock = 0x45, - ScrollLock = 0x46, /* Scroll Lock */ - Numpad7 = 0x47, - Numpad8 = 0x48, - Numpad9 = 0x49, - Subtract = 0x4A, /* - on numeric keypad */ - Numpad4 = 0x4B, - Numpad5 = 0x4C, - Numpad6 = 0x4D, - Add = 0x4E, /* + on numeric keypad */ - Numpad1 = 0x4F, - Numpad2 = 0x50, - Numpad3 = 0x51, - Numpad0 = 0x52, - Decimal = 0x53, /* . on numeric keypad */ - OEM_102 = 0x56, /* < > | on UK/Germany keyboards */ - F11 = 0x57, - F12 = 0x58, - F13 = 0x64, /* (NEC PC98) */ - F14 = 0x65, /* (NEC PC98) */ - F15 = 0x66, /* (NEC PC98) */ - Kana = 0x70, /* (Japanese keyboard) */ - ABNT_C1 = 0x73, /* / ? on Portugese (Brazilian) keyboards */ - Convert = 0x79, /* (Japanese keyboard) */ - NoConvert = 0x7B, /* (Japanese keyboard) */ - Yen = 0x7D, /* (Japanese keyboard) */ - ABNT_C2 = 0x7E, /* Numpad . on Portugese (Brazilian) keyboards */ - NumpadEquals = 0x8D, /* = on numeric keypad (NEC PC98) */ - PrevTrack = 0x90, /* Previous Track (KC_CIRCUMFLEX on Japanese keyboard) */ - At = 0x91, /* (NEC PC98) */ - Colon = 0x92, /* (NEC PC98) */ - Underline = 0x93, /* (NEC PC98) */ - Kanji = 0x94, /* (Japanese keyboard) */ - Stop = 0x95, /* (NEC PC98) */ - AX = 0x96, /* (Japan AX) */ - Unlabeled = 0x97, /* (J3100) */ - NextTrack = 0x99, /* Next Track */ - NumpadEnter = 0x9C, /* Enter on numeric keypad */ - RightControl = 0x9D, - Mute = 0xA0, - Calculator = 0xA1, - PlayPause = 0xA2, /* Play / Pause */ - MediaStop = 0xA4, /* Media Stop */ - VolumeDown = 0xAE, /* Volume - */ - VolumeUp = 0xB0, /* Volume + */ - WebHome = 0xB2, /* Web home */ - NumpadComma = 0xB3, /* , on numeric keypad (NEC PC98) */ - Divide = 0xB5, /* / on numeric keypad */ - SysRq = 0xB7, - RightAlt = 0xB8, /* Right Alt */ - Pause = 0xC5, - Home = 0xC7, /* Home on arrow keypad */ - ArrowUp = 0xC8, /* UpArrow on arrow keypad */ - PageUp = 0xC9, /* PgUp on arrow keypad */ - ArrowLeft = 0xCB, /* LeftArrow on arrow keypad */ - ArrowRight = 0xCD, /* RightArrow on arrow keypad */ - End = 0xCF, /* End on arrow keypad */ - ArrowDown = 0xD0, /* DownArrow on arrow keypad */ - PageDown = 0xD1, /* PgDn on arrow keypad */ - Insert = 0xD2, /* Insert on arrow keypad */ - Delete = 0xD3, /* Delete on arrow keypad */ - LeftWindows = 0xDB, /* Left Windows key */ - RightWindow = 0xDC, /* Right Windows key */ - RightWindows = 0xDC, /* Right Windows key - Correct spelling :) */ - AppMenu = 0xDD, /* AppMenu key */ - Power = 0xDE, /* System Power */ - Sleep = 0xDF, /* System Sleep */ - Wake = 0xE3, /* System Wake */ - WebSearch = 0xE5, - WebFavorites = 0xE6, - WebRefresh = 0xE7, - WebStop = 0xE8, - WebForward = 0xE9, - WebBack = 0xEA, - MyComputer = 0xEB, - Mail = 0xEC, - MediaSelect = 0xED - }; - - KeyCode(Enum _value = None) : value(_value) { } - - friend bool operator == (KeyCode const& a, KeyCode const& b) { return a.value == b.value; } - friend bool operator != (KeyCode const& a, KeyCode const& b) { return a.value != b.value; } - - int toValue() const { return (int)value; } - - private: - Enum value; - }; - -} // namespace MyGUI - -#endif // __MYGUI_INPUT_DEFINE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_InputManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_InputManager.h deleted file mode 100644 index bb7a6bc78..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_InputManager.h +++ /dev/null @@ -1,180 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_INPUT_MANAGER_H__ -#define __MYGUI_INPUT_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Macros.h" -#include "MyGUI_Instance.h" -#include "MyGUI_WidgetDefines.h" -#include "MyGUI_IUnlinkWidget.h" -#include "MyGUI_WidgetDefines.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_InputDefine.h" -#include "MyGUI_Timer.h" -#include "MyGUI_ILayer.h" -#include "MyGUI_Delegate.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT InputManager : public IUnlinkWidget - { - MYGUI_INSTANCE_HEADER( InputManager ) - - public: - void initialise(); - void shutdown(); - - /** Inject MouseMove event - @return true if event has been processed by GUI - */ - bool injectMouseMove(int _absx, int _absy, int _absz); - /** Inject MousePress event - @return true if event has been processed by GUI - */ - bool injectMousePress(int _absx, int _absy, MouseButton _id); - /** Inject MouseRelease event - @return true if event has been processed by GUI - */ - bool injectMouseRelease(int _absx, int _absy, MouseButton _id); - - /** Inject KeyPress event - @return true if event has been processed by GUI - */ - bool injectKeyPress(KeyCode _key, Char _text = 0); - /** Inject KeyRelease event - @return true if event has been processed by GUI - */ - bool injectKeyRelease(KeyCode _key); - - /** Is any widget have mouse focus */ - bool isFocusMouse() { return mWidgetMouseFocus != nullptr; } - /** Is any widget have key focus */ - bool isFocusKey() { return mWidgetKeyFocus != nullptr; } - /** Is any widget captured mouse */ - bool isCaptureMouse() { return mIsWidgetMouseCapture; } - - /** Set key focus for _widget */ - void setKeyFocusWidget(Widget* _widget); - /** Drop key focus for _widget */ - void resetKeyFocusWidget(Widget* _widget); - /** Drop any key focus */ - void resetKeyFocusWidget() { setKeyFocusWidget(nullptr); } - - /** Get mouse focused widget */ - Widget* getMouseFocusWidget() { return mWidgetMouseFocus; } - /** Get key focused widget */ - Widget* getKeyFocusWidget() { return mWidgetKeyFocus; } - /** Get position of last left mouse button press */ - const IntPoint& getLastLeftPressed() { return mLastLeftPressed; } - /** Get current mouse position */ - const IntPoint& getMousePosition() { return mMousePosition; } - - IntPoint getMousePositionByLayer(); - - // тестовый вариант, очистка фокуса мыши - /** Drop any mouse focus */ - void resetMouseFocusWidget(); - - // работа с модальными окнами - /** Add modal widget - all other widgets inaccessible while modal widget exist */ - void addWidgetModal(Widget* _widget); - /** Remove modal widget */ - void removeWidgetModal(Widget* _widget); - - /** Return true if any modal widget exist */ - bool isModalAny() { return !mVectorModalRootWidget.empty(); } - - /** Is control button pressed */ - bool isControlPressed() { return mIsControlPressed; } - /** Is shift button pressed */ - bool isShiftPressed() { return mIsShiftPressed; } - - /** Reset mouse capture (for example when we dragging and application - lost focus you should call this) - */ - void resetMouseCaptureWidget() { mIsWidgetMouseCapture = false; } - - void unlinkWidget(Widget* _widget) { _unlinkWidget(_widget); } - - /** Event :\n - signature : void method(MyGUI::Widget* _widget)\n - @param _widget - */ - delegates::CMultiDelegate1 - eventChangeMouseFocus; - - /** Event :\n - signature : void method(MyGUI::Widget* _widget)\n - @param _widget - */ - delegates::CMultiDelegate1 - eventChangeKeyFocus; - - private: - // удаляем данный виджет из всех возможных мест - void _unlinkWidget(Widget* _widget); - - void frameEntered(float _frame); - - void firstEncoding(KeyCode _key, bool bIsKeyPressed); - - // запоминает клавишу для поддержки повторения - void storeKey(KeyCode _key, Char _text); - - // сбрасывает клавишу повторения - void resetKey(); - - private: - // виджеты которым принадлежит фокус - Widget* mWidgetMouseFocus; - Widget* mWidgetKeyFocus; - ILayer* mLayerMouseFocus; - // захватил ли мышь активный виджет - bool mIsWidgetMouseCapture; - // таймер для двойного клика - Timer mTimer; //used for double click timing - - // нажат ли шифт - bool mIsShiftPressed; - // нажат ли контрол - bool mIsControlPressed; - // там где была последний раз нажата левая кнопка - IntPoint mLastLeftPressed; - IntPoint mMousePosition; - // клавиша для повтора - KeyCode mHoldKey; - Char mHoldChar; - bool mFirstPressKey; - float mTimerKey; - int mOldAbsZ; - - // список виджетов с модальным режимом - VectorWidgetPtr mVectorModalRootWidget; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_INPUT_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Instance.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Instance.h deleted file mode 100644 index 8f6d79cde..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Instance.h +++ /dev/null @@ -1,45 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_INSTANCE_H__ -#define __MYGUI_INSTANCE_H__ - -#define MYGUI_INSTANCE_HEADER(type) \ - private: \ - static type* msInstance; \ - bool mIsInitialise; \ - public: \ - type();\ - ~type();\ - static type& getInstance(); \ - static type* getInstancePtr(); - - -#define MYGUI_INSTANCE_IMPLEMENT(type) \ - const std::string INSTANCE_TYPE_NAME(#type); \ - type* type::msInstance = nullptr; \ - type* type::getInstancePtr() { return msInstance; } \ - type& type::getInstance() { MYGUI_ASSERT(0 != msInstance, "instance " << INSTANCE_TYPE_NAME << " was not created"); return (*msInstance); } \ - type::type() : mIsInitialise(false) { MYGUI_ASSERT(0 == msInstance, "instance " << INSTANCE_TYPE_NAME << " is exsist"); msInstance = this; } \ - type::~type() { msInstance = nullptr; } - -#endif // __MYGUI_INSTANCE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ItemBox.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ItemBox.h deleted file mode 100644 index f3ad3f8c7..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ItemBox.h +++ /dev/null @@ -1,368 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_ITEM_BOX_H__ -#define __MYGUI_ITEM_BOX_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_DDContainer.h" -#include "MyGUI_IBItemInfo.h" -#include "MyGUI_Any.h" -#include "MyGUI_EventPair.h" -#include "MyGUI_ScrollViewBase.h" - -namespace MyGUI -{ - - typedef delegates::CDelegate2 EventHandle_ItemBoxPtrWidgetPtr; - typedef delegates::CDelegate3 EventHandle_ItemBoxPtrIntCoordRefBool; - typedef delegates::CDelegate3 EventHandle_ItemBoxPtrWidgetPtrCIBCellDrawInfoRef; - typedef delegates::CDelegate2 EventHandle_ItemBoxPtrSizeT; - typedef delegates::CDelegate2 EventHandle_ItemBoxPtrCIBNotifyCellDataRef; - - class MYGUI_EXPORT ItemBox : - public DDContainer, - protected ScrollViewBase - { - MYGUI_RTTI_DERIVED( ItemBox ) - - public: - ItemBox(); - - //------------------------------------------------------------------------------// - // манипуляции айтемами - - //! Get number of items - size_t getItemCount() const { return mItemsInfo.size(); } - - //! Insert an item into a array at a specified position - void insertItemAt(size_t _index, Any _data = Any::Null); - - //! Add an item to the end of a array - void addItem(Any _data = Any::Null) { insertItemAt(ITEM_NONE, _data); } - - //! Remove item at a specified position - void removeItemAt(size_t _index); - - //! Remove all items - void removeAllItems(); - - //! Redraw at a specified position - void redrawItemAt(size_t _index); - - //! Redraw all items - void redrawAllItems(); - - - //------------------------------------------------------------------------------// - // манипуляции выделениями - - //! Get index of selected item (ITEM_NONE if none selected) - size_t getIndexSelected() { return mIndexSelect; } - - //! Select specified _index - void setIndexSelected(size_t _index); - - //! Clear item selection - void clearIndexSelected() { setIndexSelected(ITEM_NONE); } - - - //------------------------------------------------------------------------------// - // манипуляции данными - - //! Replace an item data at a specified position - void setItemDataAt(size_t _index, Any _data); - - //! Clear an item data at a specified position - void clearItemDataAt(size_t _index) { setItemDataAt(_index, Any::Null); } - - //! Get item data from specified position - template - ValueType * getItemDataAt(size_t _index, bool _throw = true) - { - MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "ItemBox::getItemDataAt"); - return mItemsInfo[_index].data.castType(_throw); - } - - - /** Set vertical alignment grid mode */ - void setItemBoxAlignVert(bool _value); - /** Get vertical alignment grid mode flag */ - bool getItemBoxAlignVert() { return mAlignVert; } - - /** Get item index by item Widget pointer */ - size_t getIndexByWidget(Widget* _widget); - - /** Get widget created for drop */ - Widget* getWidgetDrag() { return mItemDrag; } - - /** Get item Widget pointer by item index if it is visible - @note returned widget can be deleted, so this pointer - is valid only at time when you got it and can be invalid - next frame - */ - Widget* getWidgetByIndex(size_t _index); - - /** Interrupt drag as if widget was dropped into empty space */ - void resetDrag(); - - //! @copydoc Widget::setPosition(const IntPoint& _value) - virtual void setPosition(const IntPoint& _value); - //! @copydoc Widget::setSize(const IntSize& _value) - virtual void setSize(const IntSize& _value); - //! @copydoc Widget::setCoord(const IntCoord& _value) - virtual void setCoord(const IntCoord& _value); - - /** @copydoc Widget::setPosition(int _left, int _top) */ - void setPosition(int _left, int _top) { setPosition(IntPoint(_left, _top)); } - /** @copydoc Widget::setSize(int _width, int _height) */ - void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); } - /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ - void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); } - - /*event:*/ - /** Event : request for creating new item - signature : void method(MyGUI::ItemBox* _sender, MyGUI::Widget* _item) - @param _sender widget that called this event - @param _item widget item pointer - */ - EventHandle_ItemBoxPtrWidgetPtr requestCreateWidgetItem; - - /** Event : request for item coordinate - signature : void method(MyGUI::ItemBox* _sender, MyGUI::IntCoord& _coord, bool _drag) - @param _sender widget that called this event - @param _coord write heer item coordinate - @param _drag is this item dragging - */ - EventHandle_ItemBoxPtrIntCoordRefBool requestCoordItem; - - /** Event : request for item redraw - signature : void method(MyGUI::ItemBox* _sender, MyGUI::Widget* _item, const MyGUI::IBDrawItemInfo& _info) - @param _sender widget that called this event - @param _item widget item pointer - @param _info item info - */ - EventHandle_ItemBoxPtrWidgetPtrCIBCellDrawInfoRef requestDrawItem; - - /** Event : doubleclick or enter pressed on item - signature : void method(MyGUI::ItemBox* _sender, size_t _index) - @param _sender widget that called this event - @param _index item index - */ - EventHandle_ItemBoxPtrSizeT eventSelectItemAccept; - - /** Event : position of selected item was changed - signature : void method(MyGUI::ItemBox* _sender, size_t _index) - @param _sender widget that called this event - @param _index item index - */ - EventHandle_ItemBoxPtrSizeT eventChangeItemPosition; - - /** Event : click on item - signature : void method(MyGUI::ItemBox* _sender, size_t _index) - @param _sender widget that called this event - @param _index item index - */ - EventHandle_ItemBoxPtrSizeT eventMouseItemActivate; - - /** Event : notify about event in item widget - signature : void method(MyGUI::ItemBox* _sender, const MyGUI::IBNotifyItemData& _info) - @param _sender widget that called this event - @param _info info about item notify - */ - EventHandle_ItemBoxPtrCIBNotifyCellDataRef eventNotifyItem; - - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void Widget::setCoord(const IntCoord& _coord)") - void setPosition(const IntCoord& _coord) { setCoord(_coord); } - MYGUI_OBSOLETE("use : void Widget::setCoord(int _left, int _top, int _width, int _height)") - void setPosition(int _left, int _top, int _width, int _height) { setCoord(_left, _top, _width, _height); } - - MYGUI_OBSOLETE("use : size_t ItemBox::getItemIndexSelected()") - size_t getItemIndexSelected() { return getIndexSelected(); } - MYGUI_OBSOLETE("use : void ItemBox::setIndexSelected(size_t _index)") - void setItemSelectedAt(size_t _index) { setIndexSelected(_index); } - MYGUI_OBSOLETE("use : void ItemBox::clearIndexSelected()") - void clearItemSelected() { clearIndexSelected(); } - - MYGUI_OBSOLETE("use : void ItemBox::insertItemAt(size_t _index, Any _data)") - void insertItem(size_t _index, Any _data = Any::Null) { insertItemAt(_index, _data); } - MYGUI_OBSOLETE("use : void ItemBox::setItemDataAt(size_t _index, Any _data)") - void setItemData(size_t _index, Any _data) { setItemDataAt(_index, _data); } - MYGUI_OBSOLETE("use : void ItemBox::removeItemAt(size_t _index)") - void deleteItem(size_t _index) { removeItemAt(_index); } - MYGUI_OBSOLETE("use : void ItemBox::removeAllItems()") - void deleteAllItems() { removeAllItems(); } - MYGUI_OBSOLETE("use : size_t ItemBox::getIndexSelected()") - size_t getItemSelect() { return getIndexSelected(); } - MYGUI_OBSOLETE("use : void ItemBox::clearIndexSelected()") - void resetItemSelect() { clearIndexSelected(); } - MYGUI_OBSOLETE("use : void ItemBox::setIndexSelected(size_t _index)") - void setItemSelect(size_t _index) { setIndexSelected(_index); } - - MYGUI_OBSOLETE("use : Widget* ItemBox::getWidgetDrag()") - Widget* getWidgetDrop() { return getWidgetDrag(); } - MYGUI_OBSOLETE("use : void ItemBox::resetDrag()") - void resetDrop() { resetDrag(); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - - protected: - virtual ~ItemBox(); - - struct ItemDataInfo - { - ItemDataInfo(Any _data) : - data(_data) { } - Any data; - }; - typedef std::vector VectorItemInfo; - - void baseChangeWidgetSkin(ResourceSkin* _info); - - virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id); - virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id); - virtual void onMouseDrag(int _left, int _top); - - virtual void onMouseWheel(int _rel); - virtual void onKeyLostFocus(Widget* _new); - virtual void onKeySetFocus(Widget* _old); - - void notifyKeyButtonPressed(Widget* _sender, KeyCode _key, Char _char); - void notifyKeyButtonReleased(Widget* _sender, KeyCode _key); - void notifyScrollChangePosition(VScroll* _sender, size_t _index); - void notifyMouseWheel(Widget* _sender, int _rel); - void notifyRootMouseChangeFocus(Widget* _sender, bool _focus); - void notifyMouseButtonDoubleClick(Widget* _sender); - void _requestGetContainer(Widget* _sender, Widget*& _container, size_t& _index); - void notifyMouseDrag(Widget* _sender, int _left, int _top); - void notifyMouseButtonPressed(Widget* _sender, int _left, int _top, MouseButton _id); - void notifyMouseButtonReleased(Widget* _sender, int _left, int _top, MouseButton _id); - - - virtual void removeDropItems(); - virtual void updateDropItems(); - virtual void updateDropItemsState(const DDWidgetState& _state); - - // Обновляет данные о айтемах, при изменении размеров - void updateMetrics(); - - // просто обновляет все виджеты что видны - void _updateAllVisible(bool _redraw); - - void updateFromResize(); - - // возвращает следующий айтем, если нет его, то создается - // запросы только последовательно - Widget* getItemWidget(size_t _index); - - void _setContainerItemInfo(size_t _index, bool _set, bool _accept); - - // сбрасываем старую подсветку - void resetCurrentActiveItem(); - // ищет и устанавливает подсвеченный айтем - void findCurrentActiveItem(); - - // запрашиваем у конейтера айтем по позиции мыши - virtual size_t _getContainerIndex(const IntPoint& _point); - - // сбрасывает зависимости, при любом колличественном изменении - virtual void _resetContainer(bool _update); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - size_t calcIndexByWidget(Widget* _widget); - - void requestItemSize(); - - virtual IntSize getContentSize(); - virtual IntPoint getContentPosition(); - virtual IntSize getViewSize() const; - virtual void eraseContent(); - virtual size_t getHScrollPage(); - virtual size_t getVScrollPage(); - virtual Align getContentAlign(); - virtual void setContentPosition(const IntPoint& _point); - - IntRect _getClientAbsoluteRect(); - Widget* _getClientWidget(); - const Widget* _getClientWidget() const; - - private: - // наши дети в строках - VectorWidgetPtr mVectorItems; - - // размер одного айтема - IntSize mSizeItem; - - // размерность скролла в пикселях - IntSize mContentSize; - // позиция скролла п пикселях - IntPoint mContentPosition; - - // колличество айтемов в одной строке - int mCountItemInLine; - // колличество линий - int mCountLines; - - // самая верхняя строка - int mFirstVisibleIndex; - // текущее смещение верхнего элемента в пикселях - // сколько его пикселей не видно сверху - int mFirstOffsetIndex; - - // текущий выделенный элемент или ITEM_NONE - size_t mIndexSelect; - // подсвеченный элемент или ITEM_NONE - size_t mIndexActive; - // индекс со свойством приема или ITEM_NONE - size_t mIndexAccept; - // индекс со свойством отказа или ITEM_NONE - size_t mIndexRefuse; - - // имеем ли мы фокус ввода - bool mIsFocus; - - // структура данных об айтеме - VectorItemInfo mItemsInfo; - - Widget* mItemDrag; - IntPoint mPointDragOffset; - - bool mAlignVert; - - std::string mDragLayer; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_ITEM_BOX_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LanguageManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LanguageManager.h deleted file mode 100644 index 3ad168022..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LanguageManager.h +++ /dev/null @@ -1,96 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 09/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_LANGUAGE_MANAGER_H__ -#define __MYGUI_LANGUAGE_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Instance.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_Delegate.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT LanguageManager - { - MYGUI_INSTANCE_HEADER( LanguageManager ) - - public: - void initialise(); - void shutdown(); - - /** Load additional MyGUI *_language.xml file */ - bool load(const std::string& _file); - - void _load(xml::ElementPtr _node, const std::string& _file, Version _version); - - /** Set current language for replacing #{} tags */ - void setCurrentLanguage(const std::string& _name); - /** Get current language */ - const std::string& getCurrentLanguage(); - - /** Replace all tags #{tagname} in _line with appropriate string dependent - on current language or keep #{tagname} if 'tagname' not found found */ - UString replaceTags(const UString& _line); - - /** Get tag value */ - UString getTag(const UString& _tag); - - /** Add user tag */ - void addUserTag(const UString& _tag, const UString& _replace); - - /** Delete all user tags */ - void clearUserTags(); - - bool loadUserTags(const std::string& _file); - - /** Event : Change current language.\n - signature : void method(const std::string& _language); - @param _language Current language. - */ - delegates::CMultiDelegate1 eventChangeLanguage; - - private: - //bool loadResourceLanguage(const std::string& _name); - bool loadLanguage(const std::string& _file, bool _user = false); - void _loadLanguage(IDataStream* _stream, bool _user); - void _loadLanguageXML(IDataStream* _stream, bool _user); - //void _loadSource(xml::ElementPtr _node, const std::string& _file, Version _version); - - private: - typedef std::map MapLanguageString; - - MapLanguageString mMapLanguage; - MapLanguageString mUserMapLanguage; - - std::string mCurrentLanguageName; - - typedef std::vector VectorString; - typedef std::map MapListString; - MapListString mMapFile; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_LANGUAGE_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LayerItem.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LayerItem.h deleted file mode 100644 index 59098f7d3..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LayerItem.h +++ /dev/null @@ -1,88 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_LAYER_ITEM_H__ -#define __MYGUI_LAYER_ITEM_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_LayerManager.h" -#include "MyGUI_ILayer.h" -#include "MyGUI_ILayerNode.h" -#include "MyGUI_ILayerItem.h" -#include "MyGUI_ISubWidget.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT LayerItem : public ILayerItem - { - public: - LayerItem(); - virtual ~LayerItem() { } - - public: - ILayer* getLayer() { return mLayer; } - - virtual void attachItemToNode(ILayer* _layer, ILayerNode* _node); - virtual void detachFromLayer(); - virtual void upLayerItem(); - - void setRenderItemTexture(ITexture* _texture); - - void addChildItem(LayerItem* _item); - void removeChildItem(LayerItem* _item); - - void addChildNode(LayerItem* _item); - void removeChildNode(LayerItem* _item); - - void addRenderItem(ISubWidget* _item); - void removeAllRenderItems(); - - void saveLayerItem(); - void restoreLayerItem(); - - protected: - void attachToLayerItemNode(ILayerNode* _node, bool _deep); - void detachFromLayerItemNode(bool _deep); - - private: - // актуально для рутового виджета - ILayer* mLayer; - // конкретный айтем находящийся в слое - ILayerNode * mLayerNode; - ILayerNode * mSaveLayerNode; - - typedef std::vector VectorLayerItem; - // список наших детей айтемов - VectorLayerItem mLayerItems; - // список наших узлов - VectorLayerItem mLayerNodes; - - // вектор всех детей сабскинов - VectorSubWidget mDrawItems; - - ITexture* mTexture; - }; - -} // namespace MyGUI - -#endif // __MYGUI_LAYER_ITEM_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LayerManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LayerManager.h deleted file mode 100644 index b5413c3ff..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LayerManager.h +++ /dev/null @@ -1,99 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_LAYER_MANAGER_H__ -#define __MYGUI_LAYER_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Instance.h" -#include "MyGUI_Enumerator.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_IUnlinkWidget.h" -#include "MyGUI_ResourceManager.h" -#include "MyGUI_ILayer.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT LayerManager : - public IUnlinkWidget - { - MYGUI_INSTANCE_HEADER( LayerManager ) - - public: - typedef std::vector VectorLayer; - typedef Enumerator EnumeratorLayer; - - public: - void initialise(); - void shutdown(); - - /** Attach widget to specific layer - @param _name Layer name - @param _item Widget pointer - */ - void attachToLayerNode(const std::string& _name, Widget* _item); - /** Detach widget from layer - @param _item Widget pointer - */ - void detachFromLayer(Widget* _item); - - /** Up widget to be on top of its layer - @param _item Widget pointer - */ - void upLayerItem(Widget* _item); - - /** Load additional MyGUI *_layer.xml file */ - bool load(const std::string& _file); - void _load(xml::ElementPtr _node, const std::string& _file, Version _version); - - /** Check is layer exist */ - bool isExist(const std::string& _name) const; - /** Get layer nodes Enumerator */ - EnumeratorLayer getEnumerator() { return EnumeratorLayer(mLayerNodes); } - - ILayer* getByName(const std::string& _name, bool _throw = true) const; - - /** Get top visible and enabled widget at specified position */ - Widget* getWidgetFromPoint(int _left, int _top); - - void renderToTarget(IRenderTarget* _target, bool _update); - - virtual void dumpStatisticToLog(); - - private: - // удаляем данный виджет из всех возможных мест - void _unlinkWidget(Widget* _widget); - - void clear(); - - void merge(VectorLayer& _layers); - void destroy(ILayer* _layer); - - private: - VectorLayer mLayerNodes; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_LAYER_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LayerNode.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LayerNode.h deleted file mode 100644 index 36ad2b8d1..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LayerNode.h +++ /dev/null @@ -1,105 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_LAYER_NODE_H__ -#define __MYGUI_LAYER_NODE_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_ILayer.h" -#include "MyGUI_ILayerNode.h" -#include "MyGUI_RenderItem.h" - -namespace MyGUI -{ - - class LayerItem; - typedef std::vector VectorRenderItem; - typedef std::vector VectorLayerItem; - - class MYGUI_EXPORT LayerNode : public ILayerNode - { - MYGUI_RTTI_DERIVED( LayerNode ) - - public: - explicit LayerNode(ILayer* _layer, ILayerNode * _parent = nullptr); - virtual ~LayerNode(); - - // леер, которому мы принадлежим - virtual ILayer* getLayer() { return mLayer; } - - // возвращает отца или nullptr - virtual ILayerNode* getParent() { return mParent; } - - // создаем дочерний нод - virtual ILayerNode* createChildItemNode(); - // удаляем дочерний нод - virtual void destroyChildItemNode(ILayerNode* _node); - - // поднимаем дочерний нод - virtual void upChildItemNode(ILayerNode* _node); - - // список детей - virtual EnumeratorILayerNode getEnumerator(); - - // добавляем айтем к ноду - virtual void attachLayerItem(ILayerItem* _item); - // удаляем айтем из нода - virtual void detachLayerItem(ILayerItem* _item); - - // добавляет саб айтем и возвращает рендер айтем - virtual RenderItem* addToRenderItem(ITexture* _texture, ISubWidget* _item); - // необходимо обновление нода - virtual void outOfDate(RenderItem* _item); - - // возвращает виджет по позиции - virtual ILayerItem* getLayerItemByPoint(int _left, int _top); - - // рисует леер - virtual void renderToTarget(IRenderTarget* _target, bool _update); - - virtual void dumpStatisticToLog(size_t _level); - - bool isOutOfDate() { return mOutOfDate; } - - protected: - void updateCompression(); - - protected: - // список двух очередей отрисовки, для сабскинов и текста - VectorRenderItem mFirstRenderItems; - VectorRenderItem mSecondRenderItems; - - // список всех рутовых виджетов - // у перекрывающегося слоя здесь только один - VectorLayerItem mLayerItems; - - // список такиж как мы, для построения дерева - VectorILayerNode mChildItems; - - ILayerNode * mParent; - ILayer* mLayer; - bool mOutOfDate; - }; - -} // namespace MyGUI - -#endif // __MYGUI_LAYER_NODE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LayoutManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LayoutManager.h deleted file mode 100644 index ff57a917b..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LayoutManager.h +++ /dev/null @@ -1,78 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_LAYOUT_MANAGER_H__ -#define __MYGUI_LAYOUT_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Instance.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_WidgetDefines.h" -#include "MyGUI_Gui.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT LayoutManager - { - MYGUI_INSTANCE_HEADER( LayoutManager ) - - public: - void initialise(); - void shutdown(); - - /** Load layout file - @param _file name of layout - @return Return vector of pointers of loaded root widgets (root == without parents) - */ - VectorWidgetPtr& load(const std::string& _file); - void _load(xml::ElementPtr _node, const std::string& _file, Version _version); - - /** Load layout file - @param _file name of layout - @param _prefix will be added to all loaded widgets names - @param _parent widget to load on - @return Return vector of pointers of loaded root widgets (root == without parents) - */ - VectorWidgetPtr& loadLayout(const std::string& _file, const std::string& _prefix = "", Widget* _parent = nullptr); - - /** Unload layout file */ - void unloadLayout(VectorWidgetPtr& _widgets); - - private: - void parseLayout(VectorWidgetPtr& _widgets, xml::ElementPtr _root); - void parseWidget(VectorWidgetPtr& _widgets, xml::ElementEnumerator& _widget, Widget* _parent); - - private: - // для возврата последней загрузки - VectorWidgetPtr mVectorWidgetPtr; - - // префикс при загрузке лейаута - std::string layoutPrefix; - // префикс при загрузке лейаута - Widget* layoutParent; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_LAYOUT_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_List.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_List.h deleted file mode 100644 index 6a6cbeb1a..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_List.h +++ /dev/null @@ -1,333 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_LIST_H__ -#define __MYGUI_LIST_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Widget.h" -#include "MyGUI_Any.h" -#include "MyGUI_EventPair.h" - -namespace MyGUI -{ - - typedef delegates::CDelegate2 EventHandle_ListPtrSizeT; - - class MYGUI_EXPORT List : - public Widget - { - MYGUI_RTTI_DERIVED( List ) - - public: - List(); - - //------------------------------------------------------------------------------// - // манипуляции айтемами - - //! Get number of items - size_t getItemCount() const { return mItemsInfo.size(); } - - //! Insert an item into a array at a specified position - void insertItemAt(size_t _index, const UString& _name, Any _data = Any::Null); - - //! Add an item to the end of a array - void addItem(const UString& _name, Any _data = Any::Null) { insertItemAt(ITEM_NONE, _name, _data); } - - //! Remove item at a specified position - void removeItemAt(size_t _index); - - //! Remove all items - void removeAllItems(); - - //! Swap items at a specified positions - void swapItemsAt(size_t _index1, size_t _index2); - - - //! Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found - size_t findItemIndexWith(const UString& _name); - - - //------------------------------------------------------------------------------// - // манипуляции выделениями - - /** Get index of selected item (ITEM_NONE if none selected) */ - size_t getIndexSelected() { return mIndexSelect; } - - /** Select specified _index */ - void setIndexSelected(size_t _index); - - /** Clear item selection */ - void clearIndexSelected() { setIndexSelected(ITEM_NONE); } - - - //------------------------------------------------------------------------------// - // манипуляции данными - - //! Replace an item data at a specified position - void setItemDataAt(size_t _index, Any _data); - - //! Clear an item data at a specified position - void clearItemDataAt(size_t _index) { setItemDataAt(_index, Any::Null); } - - //! Get item data from specified position - template - ValueType * getItemDataAt(size_t _index, bool _throw = true) - { - MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "List::getItemDataAt"); - return mItemsInfo[_index].second.castType(_throw); - } - - - //------------------------------------------------------------------------------// - // манипуляции отображением - - //! Replace an item name at a specified position - void setItemNameAt(size_t _index, const UString& _name); - - //! Get item name from specified position - const UString& getItemNameAt(size_t _index); - - - //------------------------------------------------------------------------------// - // манипуляции выдимостью - - //! Move all elements so specified becomes visible - void beginToItemAt(size_t _index); - - //! Move all elements so first becomes visible - void beginToItemFirst() { if (getItemCount()) beginToItemAt(0); } - - //! Move all elements so last becomes visible - void beginToItemLast() { if (getItemCount()) beginToItemAt(getItemCount() - 1); } - - //! Move all elements so selected becomes visible - void beginToItemSelected() { if (getIndexSelected() != ITEM_NONE) beginToItemAt(getIndexSelected()); } - - //------------------------------------------------------------------------------// - - // видим ли мы элемент, полностью или нет - /** Return true if item visible - @param - _index of item - @param - _fill false: function return true when whole item is visible - true: function return true when at least part of item is visible - */ - bool isItemVisibleAt(size_t _index, bool _fill = true); - //! Same as List::isItemVisible for selected item - bool isItemSelectedVisible(bool _fill = true) { return isItemVisibleAt(mIndexSelect, _fill); } - - - //! Set scroll visible when it needed - void setScrollVisible(bool _visible); - //! Set scroll position - void setScrollPosition(size_t _position); - - //------------------------------------------------------------------------------------// - - //! @copydoc Widget::setPosition(const IntPoint& _value) - virtual void setPosition(const IntPoint& _value); - //! @copydoc Widget::setSize(const IntSize& _value) - virtual void setSize(const IntSize& _value); - //! @copydoc Widget::setCoord(const IntCoord& _value) - virtual void setCoord(const IntCoord& _value); - - /** @copydoc Widget::setPosition(int _left, int _top) */ - void setPosition(int _left, int _top) { setPosition(IntPoint(_left, _top)); } - /** @copydoc Widget::setSize(int _width, int _height) */ - void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); } - /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ - void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); } - - // возвращает максимальную высоту вмещающую все строки и родительский бордюр - //! Return optimal height to fit all items in List - int getOptimalHeight(); - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*event:*/ - /** Event : Enter pressed or double click.\n - signature : void method(MyGUI::List* _sender, size_t _index)\n - @param _sender widget that called this event - @param _index of selected item - */ - EventPair eventListSelectAccept; - - /** Event : Selected item position changed.\n - signature : void method(MyGUI::List* _sender, size_t _index)\n - @param _sender widget that called this event - @param _index of new item - */ - EventPair eventListChangePosition; - - /** Event : Item was selected by mouse.\n - signature : void method(MyGUI::List* _sender, size_t _index)\n - @param _sender widget that called this event - @param _index of selected item - */ - EventPair eventListMouseItemActivate; - - /** Event : Mouse is over item.\n - signature : void method(MyGUI::List* _sender, size_t _index)\n - @param _sender widget that called this event - @param _index of focused item - */ - EventPair eventListMouseItemFocus; - - /** Event : Position of scroll changed.\n - signature : void method(MyGUI::List* _sender, size_t _position)\n - @param _sender widget that called this event - @param _position of scroll - */ - EventPair eventListChangeScroll; - - /*internal:*/ - // дебажная проверка на правильность выравнивания списка - void _checkAlign(); - - // вспомогательные методы для составных списков - void _setItemFocus(size_t _position, bool _focus); - void _sendEventChangeScroll(size_t _position); - - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void Widget::setCoord(const IntCoord& _coord)") - void setPosition(const IntCoord& _coord) { setCoord(_coord); } - MYGUI_OBSOLETE("use : void Widget::setCoord(int _left, int _top, int _width, int _height)") - void setPosition(int _left, int _top, int _width, int _height) { setCoord(_left, _top, _width, _height); } - - MYGUI_OBSOLETE("use : size_t List::getIndexSelected()") - size_t getItemIndexSelected() { return getIndexSelected(); } - MYGUI_OBSOLETE("use : void List::setIndexSelected(size_t _index)") - void setItemSelectedAt(size_t _index) { setIndexSelected(_index); } - MYGUI_OBSOLETE("use : void List::clearIndexSelected()") - void clearItemSelected() { clearIndexSelected(); } - - MYGUI_OBSOLETE("use : void List::insertItemAt(size_t _index, const UString& _name)") - void insertItem(size_t _index, const UString& _item) { insertItemAt(_index, _item); } - MYGUI_OBSOLETE("use : void List::setItemNameAt(size_t _index, const UString& _name)") - void setItem(size_t _index, const UString& _item) { setItemNameAt(_index, _item); } - MYGUI_OBSOLETE("use : const UString& List::getItemNameAt(size_t _index)") - const UString& getItem(size_t _index) { return getItemNameAt(_index); } - MYGUI_OBSOLETE("use : void List::removeItemAt(size_t _index)") - void deleteItem(size_t _index) { removeItemAt(_index); } - MYGUI_OBSOLETE("use : void List::removeAllItems()") - void deleteAllItems() { removeAllItems(); } - MYGUI_OBSOLETE("use : size_t List::findItemIndexWith(const UString& _name)") - size_t findItem(const UString& _item) { return findItemIndexWith(_item); } - MYGUI_OBSOLETE("use : size_t List::getIndexSelected()") - size_t getItemSelect() { return getIndexSelected(); } - MYGUI_OBSOLETE("use : void List::clearIndexSelected()") - void resetItemSelect() { clearIndexSelected(); } - MYGUI_OBSOLETE("use : void List::setIndexSelected(size_t _index)") - void setItemSelect(size_t _index) { setIndexSelected(_index); } - MYGUI_OBSOLETE("use : void List::beginToItemAt(size_t _index)") - void beginToIndex(size_t _index) { beginToItemAt(_index); } - MYGUI_OBSOLETE("use : void List::beginToItemFirst()") - void beginToStart() { beginToItemFirst(); } - MYGUI_OBSOLETE("use : void List::beginToItemLast()") - void beginToEnd() { beginToItemLast(); } - MYGUI_OBSOLETE("use : void List::beginToItemSelected()") - void beginToSelect() { beginToItemSelected(); } - MYGUI_OBSOLETE("use : bool List::isItemVisibleAt(size_t _index, bool _fill)") - bool isItemVisible(size_t _index, bool _fill = true) { return isItemVisibleAt(_index, _fill); } - MYGUI_OBSOLETE("use : bool List::isItemSelectedVisible(bool _fill)") - bool isItemSelectVisible(bool _fill = true) { return isItemSelectedVisible(_fill); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - protected: - virtual ~List(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - void onMouseWheel(int _rel); - void onKeyLostFocus(Widget* _new); - void onKeySetFocus(Widget* _old); - void onKeyButtonPressed(KeyCode _key, Char _char); - - void notifyScrollChangePosition(VScroll* _sender, size_t _rel); - void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id); - void notifyMouseDoubleClick(Widget* _sender); - void notifyMouseWheel(Widget* _sender, int _rel); - void notifyMouseSetFocus(Widget* _sender, Widget* _old); - void notifyMouseLostFocus(Widget* _sender, Widget* _new); - - void updateScroll(); - void updateLine(bool _reset = false); - void _setScrollView(size_t _position); - - // перерисовывает от индекса до низа - void _redrawItemRange(size_t _start = 0); - - // перерисовывает индекс - void _redrawItem(size_t _index); - - // ищет и выделяет елемент - void _selectIndex(size_t _index, bool _select); - - void _updateState() { setState(mIsFocus ? "pushed" : "normal"); } - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - void _checkMapping(const std::string& _owner); - - Widget* _getClientWidget(); - const Widget* _getClientWidget() const; - - private: - std::string mSkinLine; - VScroll* mWidgetScroll; - - // наши дети в строках - VectorWidgetPtr mWidgetLines; - - int mHeightLine; // высота одной строки - int mTopIndex; // индекс самого верхнего элемента - int mOffsetTop; // текущее смещение - int mRangeIndex; // размерность скрола - size_t mLastRedrawLine; // последняя перерисованная линия - - size_t mIndexSelect; // текущий выделенный элемент или ITEM_NONE - size_t mLineActive; // текущий виджет над которым мыша - - typedef std::pair PairItem; - typedef std::vector VectorItemInfo; - VectorItemInfo mItemsInfo; - - // имеем ли мы фокус ввода - bool mIsFocus; - bool mNeedVisibleScroll; - - IntSize mOldSize; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_LIST_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ListBox.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ListBox.h deleted file mode 100644 index a090eb498..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ListBox.h +++ /dev/null @@ -1,147 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 04/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_LIST_BOX_H__ -#define __MYGUI_LIST_BOX_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_ListCtrl.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT ListBox : - public ListCtrl - { - MYGUI_RTTI_DERIVED( ListBox ) - - public: - ListBox(); - - //------------------------------------------------------------------------------// - // - - //! Get number of items - size_t getItemCount() const { return mItemsInfo.size(); } - - //! Insert an item into a array at a specified position - void insertItemAt(size_t _index, const UString& _name, Any _data = Any::Null); - - //! Add an item to the end of a array - void addItem(const UString& _name, Any _data = Any::Null) { insertItemAt(ITEM_NONE, _name, _data); } - - //! Remove item at a specified position - void removeItemAt(size_t _index); - - //! Remove all items - void removeAllItems(); - - //! Swap items at a specified positions - void swapItemsAt(size_t _index1, size_t _index2); - - //! Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found - size_t findItemIndexWith(const UString& _name); - - - //------------------------------------------------------------------------------// - // - - /** Get index of selected item (ITEM_NONE if none selected) */ - size_t getIndexSelected() { return Base::getIndexSelected(); } - - /** Select specified _index */ - void setIndexSelected(size_t _index) { Base::setIndexSelected(_index); } - - /** Clear item selection */ - void clearIndexSelected() { Base::clearIndexSelected(); } - - - //------------------------------------------------------------------------------// - // - - //! Replace an item data at a specified position - void setItemDataAt(size_t _index, Any _data) { Base::setItemDataAt(_index, _data); } - - //! Clear an item data at a specified position - void clearItemDataAt(size_t _index) { Base::clearItemDataAt(_index); } - - //! Get item data from specified position - template - ValueType * getItemDataAt(size_t _index, bool _throw = true) - { - return Base::getItemDataAt(_index, _throw); - } - - - //------------------------------------------------------------------------------// - // - - //! Replace an item name at a specified position - void setItemNameAt(size_t _index, const UString& _name); - - //! Get item name from specified position - const UString& getItemNameAt(size_t _index); - - - //------------------------------------------------------------------------------// - // - - //! Move all elements so specified becomes visible - void beginToItemAt(size_t _index); - - //! Move all elements so first becomes visible - void beginToItemFirst() { if (getItemCount()) beginToItemAt(0); } - - //! Move all elements so last becomes visible - void beginToItemLast() { if (getItemCount()) beginToItemAt(getItemCount() - 1); } - - //! Move all elements so selected becomes visible - void beginToItemSelected() { if (getIndexSelected() != ITEM_NONE) beginToItemAt(getIndexSelected()); } - - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - protected: - virtual ~ListBox(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - void notifyCreateWidgetItem(MyGUI::ListCtrl* _sender, MyGUI::Widget* _item); - void notifyDrawItem(MyGUI::ListCtrl* _sender, MyGUI::Widget* _item, const MyGUI::IBDrawItemInfo& _info, MyGUI::IntCoord& _coord); - - private: - std::string mSkinLine; - int mHeightLine; - - typedef std::vector VectorUTFString; - VectorUTFString mItemsInfo; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_LIST_BOX_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ListCtrl.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ListCtrl.h deleted file mode 100644 index ad235966c..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ListCtrl.h +++ /dev/null @@ -1,301 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 04/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_LIST_CTRL_H__ -#define __MYGUI_LIST_CTRL_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_DDContainer.h" -#include "MyGUI_IBItemInfo.h" -#include "MyGUI_Any.h" -#include "MyGUI_EventPair.h" -#include "MyGUI_ScrollViewBase.h" - -namespace MyGUI -{ - - typedef delegates::CDelegate2 EventHandle_ListCtrlPtrWidgetPtr; - typedef delegates::CDelegate4 EventHandle_ListCtrlPtrWidgetPtrCIBCellDrawInfoRef; - typedef delegates::CDelegate2 EventHandle_ListCtrlPtrSizeT; - typedef delegates::CDelegate2 EventHandle_ListCtrlPtrCIBNotifyCellDataRef; - - class MYGUI_EXPORT ListCtrl : - public DDContainer, - protected ScrollViewBase - { - MYGUI_RTTI_DERIVED( ListCtrl ) - - public: - ListCtrl(); - - //------------------------------------------------------------------------------// - // манипуляции айтемами - - //! Get number of items - size_t getItemCount() const { return mItemsInfo.size(); } - - //! Insert an item into a array at a specified position - void insertItemAt(size_t _index, Any _data = Any::Null); - - //! Add an item to the end of a array - void addItem(Any _data = Any::Null) { insertItemAt(ITEM_NONE, _data); } - - //! Remove item at a specified position - void removeItemAt(size_t _index); - - //! Remove all items - void removeAllItems(); - - //! Redraw at a specified position - void redrawItemAt(size_t _index); - - //! Redraw all items - void redrawAllItems() { _updateAllVisible(ITEM_NONE, true, true); } - - - //------------------------------------------------------------------------------// - // манипуляции выделениями - - //! Get index of selected item (ITEM_NONE if none selected) - size_t getIndexSelected() { return mIndexSelect; } - - //! Select specified _index - void setIndexSelected(size_t _index); - - //! Clear item selection - void clearIndexSelected() { setIndexSelected(ITEM_NONE); } - - - //------------------------------------------------------------------------------// - // манипуляции данными - - //! Replace an item data at a specified position - void setItemDataAt(size_t _index, Any _data); - - //! Clear an item data at a specified position - void clearItemDataAt(size_t _index) { setItemDataAt(_index, Any::Null); } - - //! Get item data from specified position - template - ValueType * getItemDataAt(size_t _index, bool _throw = true) - { - MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "ListCtrl::getItemDataAt"); - return mItemsInfo[_index].data.castType(_throw); - } - - - /** Get item index by item Widget pointer */ - size_t getIndexByWidget(Widget* _widget); - - /** Get widget created for drop */ - Widget* getWidgetDrag() { return mItemDrag; } - - /** Get item Widget pointer by item index if it is visible - @note returned widget can be deleted, so this pointer - is valid only at time when you got it and can be invalid - next frame - */ - Widget* getWidgetByIndex(size_t _index); - - /** Interrupt drag as if widget was dropped into empty space */ - void resetDrag(); - - //! @copydoc Widget::setPosition(const IntPoint& _value) - virtual void setPosition(const IntPoint& _value); - //! @copydoc Widget::setSize(const IntSize& _value) - virtual void setSize(const IntSize& _value); - //! @copydoc Widget::setCoord(const IntCoord& _value) - virtual void setCoord(const IntCoord& _value); - - /** @copydoc Widget::setPosition(int _left, int _top) */ - void setPosition(int _left, int _top) { setPosition(IntPoint(_left, _top)); } - /** @copydoc Widget::setSize(int _width, int _height) */ - void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); } - /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ - void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); } - - - /*event:*/ - /** Event : request for creating new item - signature : void method(MyGUI::ListCtrl* _sender, MyGUI::Widget* _item) - @param _sender widget that called this event - @param _item widget item pointer - */ - EventHandle_ListCtrlPtrWidgetPtr requestCreateWidgetItem; - - /** Event : request for item redraw - signature : void method(MyGUI::ListCtrl* _sender, MyGUI::Widget* _item, const MyGUI::IBDrawItemInfo& _info) - @param _sender widget that called this event - @param _item widget item pointer - @param _info item info - */ - EventHandle_ListCtrlPtrWidgetPtrCIBCellDrawInfoRef requestDrawItem; - - /** Event : doubleclick or enter pressed on item - signature : void method(MyGUI::ListCtrl* _sender, size_t _index) - @param _sender widget that called this event - @param _index item index - */ - EventHandle_ListCtrlPtrSizeT eventSelectItemAccept; - - /** Event : position of selected item was changed - signature : void method(MyGUI::ListCtrl* _sender, size_t _index) - @param _sender widget that called this event - @param _index item index - */ - EventHandle_ListCtrlPtrSizeT eventChangeItemPosition; - - /** Event : click on item - signature : void method(MyGUI::ListCtrl* _sender, size_t _index) - @param _sender widget that called this event - @param _index item index - */ - EventHandle_ListCtrlPtrSizeT eventMouseItemActivate; - - /** Event : notify about event in item widget - signature : void method(MyGUI::ListCtrl* _sender, const MyGUI::IBNotifyItemData& _info) - @param _sender widget that called this event - @param _info info about item notify - */ - EventHandle_ListCtrlPtrCIBNotifyCellDataRef eventNotifyItem; - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - protected: - virtual ~ListCtrl(); - - struct ItemDataInfo - { - ItemDataInfo(Any _data) : - data(_data) { } - Any data; - IntSize size; - }; - typedef std::vector VectorItemInfo; - - void baseChangeWidgetSkin(ResourceSkin* _info); - - virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id); - virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id); - virtual void onMouseDrag(int _left, int _top); - - virtual void onMouseWheel(int _rel); - virtual void onKeyLostFocus(Widget* _new); - virtual void onKeySetFocus(Widget* _old); - - void notifyKeyButtonPressed(Widget* _sender, KeyCode _key, Char _char); - void notifyKeyButtonReleased(Widget* _sender, KeyCode _key); - void notifyScrollChangePosition(VScroll* _sender, size_t _index); - void notifyMouseWheel(Widget* _sender, int _rel); - void notifyRootMouseChangeFocus(Widget* _sender, bool _focus); - void notifyMouseButtonDoubleClick(Widget* _sender); - void _requestGetContainer(Widget* _sender, Widget*& _container, size_t& _index); - void notifyMouseDrag(Widget* _sender, int _left, int _top); - void notifyMouseButtonPressed(Widget* _sender, int _left, int _top, MouseButton _id); - void notifyMouseButtonReleased(Widget* _sender, int _left, int _top, MouseButton _id); - - - virtual void removeDropItems(); - virtual void updateDropItems(); - virtual void updateDropItemsState(const DDWidgetState& _state); - - // Обновляет данные о айтемах, при изменении размеров - void updateMetrics(); - - // просто обновляет все виджеты что видны - void _updateAllVisible(size_t _index, bool _needUpdateContetntSize, bool _update); - - void updateFromResize(); - - // возвращает следующий айтем, если нет его, то создается - // запросы только последовательно - Widget* getItemWidget(size_t _index); - - void _setContainerItemInfo(size_t _index, bool _set, bool _accept); - - // сбрасываем старую подсветку - void resetCurrentActiveItem(); - // ищет и устанавливает подсвеченный айтем - void findCurrentActiveItem(); - - // запрашиваем у конейтера айтем по позиции мыши - virtual size_t _getContainerIndex(const IntPoint& _point); - - // сбрасывает зависимости, при любом колличественном изменении - virtual void _resetContainer(bool _update); - - void _setScrollViewPage(size_t _size) { mScrollViewPage = _size; } - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - size_t calcIndexByWidget(Widget* _widget) { return *_widget->_getInternalData(); } - - virtual IntSize getContentSize(); - virtual IntPoint getContentPosition(); - virtual IntSize getViewSize() const; - virtual void eraseContent(); - virtual size_t getHScrollPage(); - virtual size_t getVScrollPage(); - virtual Align getContentAlign(); - virtual void setContentPosition(const IntPoint& _point); - - Widget* _getClientWidget(); - const Widget* _getClientWidget() const; - - private: - // наши дети в строках - VectorWidgetPtr mVectorItems; - - // размерность скролла в пикселях - IntSize mContentSize; - // позиция скролла п пикселях - IntPoint mContentPosition; - - // текущий выделенный элемент или ITEM_NONE - size_t mIndexSelect; - // подсвеченный элемент или ITEM_NONE - size_t mIndexActive; - // индекс со свойством приема или ITEM_NONE - size_t mIndexAccept; - // индекс со свойством отказа или ITEM_NONE - size_t mIndexRefuse; - - // имеем ли мы фокус ввода - bool mIsFocus; - - // структура данных об айтеме - VectorItemInfo mItemsInfo; - - Widget* mItemDrag; - IntPoint mPointDragOffset; - - std::string mDragLayer; - - size_t mScrollViewPage; - }; - -} // namespace MyGUI - -#endif // __MYGUI_LIST_CTRL_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LogManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LogManager.h deleted file mode 100644 index 83edeffe0..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LogManager.h +++ /dev/null @@ -1,88 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_LOG_MANAGER_H__ -#define __MYGUI_LOG_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_LogStream.h" -#include - -namespace MyGUI -{ - - #define MYGUI_LOGGING(section, level, text) \ - MyGUI::LogManager::out(section, MyGUI::LogManager::level) \ - << text \ - << MyGUI::LogManager::info(__FILE__, __LINE__) \ - << MyGUI::LogManager::end() - - class MYGUI_EXPORT LogManager - { - - public: - enum LogLevel - { - Info, - Warning, - Error, - Critical, - EndLogLevel - }; - - public: - static void shutdown(); - static void initialise(); - - static void registerSection(const std::string& _section, const std::string& _file); - static void unregisterSection(const std::string& _section); - - static LogStream& out(const std::string& _section, LogLevel _level); - static const std::string& info(const char * _file /* = __FILE__*/, int _line /* = __LINE__*/); - - static const LogStream::LogStreamEnd& end(); - - // set logging enabled on std output device - static void setSTDOutputEnabled(bool _enable); - static bool getSTDOutputEnabled(); - - private: - LogManager(); - ~LogManager(); - - public: - static const std::string General; - static const std::string separator; - - static LogStream::LogStreamEnd endl; - static const std::string LevelsName[EndLogLevel]; - - private: - static LogManager * msInstance; - typedef std::map MapLogStream; - MapLogStream mMapSectionFileName; - bool mSTDOut; - }; - -} // namespace MyGUI - -#endif // __MYGUI_LOG_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LogStream.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LogStream.h deleted file mode 100644 index de168caed..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_LogStream.h +++ /dev/null @@ -1,74 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_LOG_STREAM_H__ -#define __MYGUI_LOG_STREAM_H__ - -#include "MyGUI_Prerequest.h" -#include -#include -#include - -namespace MyGUI -{ - - class MYGUI_EXPORT LogStream - { - friend class LogManager; - - public: - struct LogStreamEnd { }; - - public: - LogStream& operator<<(const LogStreamEnd& _endl); - - template - inline LogStream& operator<<(T _value) - { - if (getSTDOutputEnabled()) std::cout << _value; - if (mStream.is_open()) mStream << _value; - return *this; - } - - const std::string& getFileName() const { return mFileName; } - - private: - LogStream(); - ~LogStream(); - - LogStream(const std::string& _file); - - void start(const std::string& _section, const std::string& _level); - - bool getSTDOutputEnabled(); - - void lock() const { } - void release() const { } - - private: - std::ofstream mStream; - std::string mFileName; - }; - -} // namespace MyGUI - -#endif // __MYGUI_LOG_STREAM_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Macros.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Macros.h deleted file mode 100644 index 23f3573a2..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Macros.h +++ /dev/null @@ -1,41 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_MACROS_H__ -#define __MYGUI_MACROS_H__ - -namespace MyGUI -{ - - const size_t ITEM_NONE = ~(size_t)0; - const int DEFAULT ((int)-1); - const float ALPHA_MAX = 1.0f; - const float ALPHA_MIN = 0.0f; - - //FIXME - #define MYGUI_FLAG_NONE 0 - #define MYGUI_FLAG(num) (1<<(num)) - -} // namespace MyGUI - - -#endif // __MYGUI_MACROS_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MainSkin.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MainSkin.h deleted file mode 100644 index 2164c5c9b..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MainSkin.h +++ /dev/null @@ -1,47 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_MAIN_SKIN_H__ -#define __MYGUI_MAIN_SKIN_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_SubSkin.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT MainSkin : public SubSkin - { - MYGUI_RTTI_DERIVED( MainSkin ) - - public: - MainSkin(); - virtual ~MainSkin(); - - /*internal:*/ - void _setAlign(const IntSize& _oldsize, bool _update); - void _setAlign(const IntCoord& _oldsize, bool _update) { SubSkin::_setAlign(_oldsize, _update); } - }; - -} // namespace MyGUI - -#endif // __MYGUI_SUB_SKIN_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MaskPickInfo.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MaskPickInfo.h deleted file mode 100644 index dda95375a..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MaskPickInfo.h +++ /dev/null @@ -1,61 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_MASK_PICK_INFO_H__ -#define __MYGUI_MASK_PICK_INFO_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT MaskPickInfo - { - public: - MaskPickInfo() : width(0), height(0) { } - - bool load(const std::string& _file); - - bool pick(const IntPoint& _point, const IntCoord& _coord) const - { - if ((0 == _coord.width) || (0 == _coord.height)) return false; - - int x = ((_point.left * width)-1) / _coord.width; - int y = ((_point.top * height)-1) / _coord.height; - - return 0 != data[(size_t)(y * width + x)]; - } - - bool empty() const - { - return data.empty(); - } - - private: - std::vector data; - int width, height; - }; - -} // namespace MyGUI - -#endif // __MYGUI_MASK_PICK_INFO_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MenuBar.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MenuBar.h deleted file mode 100644 index e56d2ac4b..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MenuBar.h +++ /dev/null @@ -1,56 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 05/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_MENU_BAR_H__ -#define __MYGUI_MENU_BAR_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_MenuCtrl.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT MenuBar : - public MenuCtrl - { - MYGUI_RTTI_DERIVED( MenuBar ) - - public: - MenuBar(); - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - protected: - virtual ~MenuBar(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - }; - -} // namespace MyGUI - -#endif // __MYGUI_MENU_BAR_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MenuCtrl.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MenuCtrl.h deleted file mode 100644 index 48297606d..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MenuCtrl.h +++ /dev/null @@ -1,371 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_MENU_CTRL_H__ -#define __MYGUI_MENU_CTRL_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include "MyGUI_MenuItemType.h" -#include "MyGUI_Widget.h" -#include "MyGUI_Any.h" -#include "MyGUI_EventPair.h" -#include "MyGUI_MenuItemType.h" -#include "MyGUI_ControllerFadeAlpha.h" - -namespace MyGUI -{ - - typedef delegates::CDelegate2 EventHandle_MenuCtrlPtrMenuItemPtr; - typedef delegates::CDelegate1 EventHandle_MenuCtrlPtr; - - class MYGUI_EXPORT MenuCtrl : - public Widget - { - MYGUI_RTTI_DERIVED( MenuCtrl ) - - public: - MenuCtrl(); - - enum ItemImage - { - ItemImageNone, - ItemImagePopup - }; - - struct ItemInfo - { - ItemInfo(MenuItem* _item, const UString& _name, MenuItemType _type, MenuCtrl* _submenu, const std::string& _id, Any _data) : - item(_item), - name(_name), - type(_type), - submenu(_submenu), - id(_id), - data(_data), - width(0) - { - } - - /** Item */ - MenuItem* item; - /** Item name*/ - UString name; - /** Widget have separator after item */ - MenuItemType type; - /** Sub menu (or nullptr if no submenu) */ - MenuCtrl* submenu; - /** Item id*/ - std::string id; - /** User data */ - Any data; - /** Item width */ - int width; - }; - - typedef std::vector VectorMenuItemInfo; - - public: - /** @copydoc Widget::setVisible */ - virtual void setVisible(bool _value); - - /** Hide or show Menu smooth */ - void setVisibleSmooth(bool _value); - - //------------------------------------------------------------------------------// - // манипуляции айтемами - - //! Get number of items - size_t getItemCount() const { return mItemsInfo.size(); } - - //! Insert an item into a array at a specified position - MenuItem* insertItemAt(size_t _index, const UString& _name, MenuItemType _type = MenuItemType::Normal, const std::string& _id = "", Any _data = Any::Null); - //! Insert an item into a array - MenuItem* insertItem(MenuItem* _to, const UString& _name, MenuItemType _type = MenuItemType::Normal, const std::string& _id = "", Any _data = Any::Null); - - //! Add an item to the end of a array - MenuItem* addItem(const UString& _name, MenuItemType _type = MenuItemType::Normal, const std::string& _id = "", Any _data = Any::Null); - - //! Remove item at a specified position - void removeItemAt(size_t _index); - //! Remove item - void removeItem(MenuItem* _item); - - //! Remove all items - void removeAllItems(); - - - //! Get item from specified position - MenuItem* getItemAt(size_t _index); - - //! Get item index - size_t getItemIndex(MenuItem* _item); - - //! Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found - size_t findItemIndex(MenuItem* _item); - - //! Search item, returns the item of the first occurrence in array or nullptr if item not found - MenuItem* findItemWith(const UString& _name); - - //------------------------------------------------------------------------------// - // манипуляции данными - - //! Replace an item data at a specified position - void setItemDataAt(size_t _index, Any _data); - //! Replace an item data - void setItemData(MenuItem* _item, Any _data) { setItemDataAt(getItemIndex(_item), _data); } - - //! Clear an item data at a specified position - void clearItemDataAt(size_t _index) { setItemDataAt(_index, Any::Null); } - //! Clear an item data - void clearItemData(MenuItem* _item) { clearItemDataAt(getItemIndex(_item)); } - - //! Get item data from specified position - template - ValueType * getItemDataAt(size_t _index, bool _throw = true) - { - MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuCtrl::getItemDataAt"); - return mItemsInfo[_index].data.castType(_throw); - } - //! Get item data - template - ValueType * getItemData(MenuItem* _item, bool _throw = true) - { - return getItemDataAt(getItemIndex(_item), _throw); - } - - //! Replace an item id at a specified position - void setItemIdAt(size_t _index, const std::string& _id); - //! Replace an item id - void setItemId(MenuItem* _item, const std::string& _id) { setItemIdAt(getItemIndex(_item), _id); } - - //! Get item id from specified position - const std::string& getItemIdAt(size_t _index); - //! Get item id - const std::string& getItemId(MenuItem* _item) { return getItemIdAt(getItemIndex(_item)); } - - /** Get item by id */ - MenuItem* getItemById(const std::string& _id); - - /** Get item index by id */ - size_t getItemIndexById(const std::string& _id); - //------------------------------------------------------------------------------// - // манипуляции отображением - - //! Replace an item name at a specified position - void setItemNameAt(size_t _index, const UString& _name); - //! Replace an item name - void setItemName(MenuItem* _item, const UString& _name) { setItemNameAt(getItemIndex(_item), _name); } - - //! Get item from specified position - const UString& getItemNameAt(size_t _index); - //! Get item from specified position - const UString& getItemName(MenuItem* _item) { return getItemNameAt(getItemIndex(_item)); } - - //! Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found - size_t findItemIndexWith(const UString& _name); - - /** Show or hide item (submenu) at a specified position */ - void setItemChildVisibleAt(size_t _index, bool _visible); - /** Show or hide item (submenu) */ - void setItemChildVisible(MenuItem* _item, bool _visible) { setItemChildVisibleAt(getItemIndex(_item), _visible); } - - //------------------------------------------------------------------------------// - // остальные манипуляции - - /** Create specific type child item (submenu) for item by index */ - template - Type * createItemChildTAt(size_t _index) - { - return static_cast(createItemChildByType(_index, Type::getClassTypeName())); - } - - /** Create specific type child item (submenu) for item */ - template - Type * createItemChildT(MenuItem* _item) { return createItemChildTAt(getItemIndex(_item)); } - - /** Get child item (submenu) from item by index */ - MenuCtrl* getItemChildAt(size_t _index); - - /** Get child item (submenu) from item */ - MenuCtrl* getItemChild(MenuItem* _item) { return getItemChildAt(getItemIndex(_item)); } - - /** Create child item (submenu) for item by index */ - MenuCtrl* createItemChildAt(size_t _index) { return createItemChildTAt(_index); } - - /** Create child item (submenu) for item */ - MenuCtrl* createItemChild(MenuItem* _item) { return createItemChildAt(getItemIndex(_item)); } - - /** Remove child item (submenu) for item by index */ - void removeItemChildAt(size_t _index); - - /** Remove child item (submenu) for item */ - void removeItemChild(MenuItem* _item) { removeItemChildAt(getItemIndex(_item)); } - - - /** Get item type (see MenuItemType) from item by index */ - MenuItemType getItemTypeAt(size_t _index); - - /** Get item type (see MenuItemType) from item */ - MenuItemType getItemType(MenuItem* _item) { return getItemTypeAt(getItemIndex(_item)); } - - /** Set item type (see MenuItemType) from item by index */ - void setItemTypeAt(size_t _index, MenuItemType _type); - /** Set item type (see MenuItemType) from item */ - void setItemType(MenuItem* _item, MenuItemType _type) { setItemTypeAt(getItemIndex(_item), _type); } - - /** Set mode when clicking on item with submenu generate eventMenuCtrlAccept and closes menu */ - void setPopupAccept(bool _value) { mPopupAccept = _value; } - /** Get mode when clicking on item with submenu generate eventMenuCtrlAccept and closes menu */ - bool getPopupAccept() { return mPopupAccept; } - - /** Get parent menu item or nullptr if no item */ - MenuItem* getMenuItemParent() { return mOwner; } - - - /*event:*/ - /** Event : Enter pressed or mouse clicked.\n - signature : void method(MyGUI::MenuCtrl* _sender, MyGUI::MenuItem* _item)\n - @param _sender widget that called this event - @param _item Selected item - */ - EventHandle_MenuCtrlPtrMenuItemPtr eventMenuCtrlAccept; - - /** Event : Menu was closed by select or focus change.\n - signature : void method(MyGUI::MenuCtrl* _sender)\n - @param _sender widget that called this event - */ - EventHandle_MenuCtrlPtr eventMenuCtrlClose; - - - /*internal:*/ - void _notifyDeleteItem(MenuItem* _item); - void _notifyUpdateName(MenuItem* _item); - void _wrapItemChild(MenuItem* _item, MenuCtrl* _widget); - - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void Widget::setVisible(bool _value)") - void showMenu() { setVisible(true); } - MYGUI_OBSOLETE("use : void Widget::setVisible(bool _value)") - void hideMenu() { setVisible(false); } - MYGUI_OBSOLETE("use : bool Widget::isVisible()") - bool isShowMenu() { return isVisible(); } - - MYGUI_OBSOLETE("use : void setItemChildVisibleAt(size_t _index, bool _visible)") - void showItemChildAt(size_t _index) { setItemChildVisibleAt(_index, true); } - MYGUI_OBSOLETE("use : void setItemChildVisible(MenuItem* _item, bool _visible)") - void showItemChild(MenuItem* _item) { setItemChildVisible(_item, true); } - MYGUI_OBSOLETE("use : void setItemChildVisibleAt(size_t _index, bool _visible)") - void hideItemChildAt(size_t _index) { setItemChildVisibleAt(_index, false); } - MYGUI_OBSOLETE("use : void setItemChildVisible(MenuItem* _item, bool _visible)") - void hideItemChild(MenuItem* _item) { setItemChildVisible(_item, false); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - protected: - virtual ~MenuCtrl(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - // переопределяем для особого обслуживания - virtual Widget* baseCreateWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name); - - virtual void onKeyChangeRootFocus(bool _focus); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - void notifyRootKeyChangeFocus(Widget* _sender, bool _focus); - void notifyMouseButtonClick(Widget* _sender); - void notifyMouseSetFocus(Widget* _sender, Widget* _new); - - const std::string& getSkinByType(MenuItemType _type) - { - return _type == MenuItemType::Separator ? mSeparatorSkin : mSkinLine; - } - - size_t getIconIndexByType(MenuItemType _type) - { - return _type == MenuItemType::Popup ? ItemImagePopup : ItemImageNone; - } - - void update(); - - void setButtonImageIndex(Button* _button, size_t _index); - - MenuItemType getItemType(bool _submenu, bool _separator) - { - if (_submenu) return MenuItemType::Popup; - else if (_separator) return MenuItemType::Separator; - return MenuItemType::Normal; - } - - void notifyMenuCtrlAccept(MenuItem* _item); - - Widget* createItemChildByType(size_t _index, const std::string& _type); - - void _wrapItem(MenuItem* _item, size_t _index, const UString& _name, MenuItemType _type, const std::string& _id, Any _data); - - ControllerFadeAlpha* createControllerFadeAlpha(float _alpha, float _coef, bool _enable); - - Widget* _getClientWidget(); - const Widget* _getClientWidget() const; - - protected: - bool mHideByAccept; - // нужно ли выбрасывать по нажатию - bool mMenuDropMode; - bool mIsMenuDrop; - bool mHideByLostKey; - - private: - VectorMenuItemInfo mItemsInfo; - - int mHeightLine; - std::string mSkinLine; - - int mSubmenuImageSize; - - std::string mSubMenuSkin; - std::string mSubMenuLayer; - - // флаг, чтобы отсеч уведомления от айтемов, при общем шутдауне виджета - bool mShutdown; - - int mSeparatorHeight; - std::string mSeparatorSkin; - - bool mAlignVert; - int mDistanceButton; - bool mPopupAccept; - MenuItem* mOwner; - bool mAnimateSmooth; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_MENU_CTRL_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MenuItem.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MenuItem.h deleted file mode 100644 index f91fa496f..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MenuItem.h +++ /dev/null @@ -1,131 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_MENU_ITEM_H__ -#define __MYGUI_MENU_ITEM_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Button.h" -#include "MyGUI_MenuCtrl.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT MenuItem : - public Button - { - MYGUI_RTTI_DERIVED( MenuItem ) - - public: - MenuItem(); - - /** @copydoc Widget::setCaption(const UString& _value) */ - virtual void setCaption(const UString& _value); - - //! Replace an item name - void setItemName(const UString& _value); - //! Get item name - const UString& getItemName(); - - //! Replace an item name - void setItemData(Any _value); - - //! Get item data - template - ValueType* getItemData(bool _throw = true) - { - return mOwner->getItemData(this, _throw); - } - - //! Remove item - void removeItem(); - - //! Replace an item id at a specified position - void setItemId(const std::string& _value); - //! Get item id from specified position - const std::string& getItemId(); - - //! Get item index - size_t getItemIndex(); - - /** Create child item (submenu), MenuItem can have only one child */ - MenuCtrl* createItemChild(); - - /** Create specific type child item (submenu), MenuItem can have only one child */ - template - Type * createItemChildT() - { - return mOwner->createItemChildT(this); - } - - /** Set item type (see MenuItemType) */ - void setItemType(MenuItemType _value); - /** Get item type (see MenuItemType) */ - MenuItemType getItemType(); - - /** Hide or show child item (submenu) */ - void setItemChildVisible(bool _value); - - /** Get parent MenuCtrl */ - MenuCtrl* getMenuCtrlParent() { return mOwner; } - - /** Get child item (submenu) */ - MenuCtrl* getItemChild(); - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void setItemChildVisible(bool _visible)") - void showItemChild() { setItemChildVisible(true); } - MYGUI_OBSOLETE("use : void setItemChildVisible(bool _visible)") - void hideItemChild() { setItemChildVisible(false); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - protected: - virtual ~MenuItem(); - - virtual Widget* baseCreateWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name); - - virtual void baseChangeWidgetSkin(ResourceSkin* _info); - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - private: - virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id); - virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id); - - private: - MenuCtrl* mOwner; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_MENU_ITEM_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MenuItemType.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MenuItemType.h deleted file mode 100644 index 9a7214a0e..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MenuItemType.h +++ /dev/null @@ -1,89 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_MENU_ITEM_TYPE_H__ -#define __MYGUI_MENU_ITEM_TYPE_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - struct MYGUI_EXPORT MenuItemType - { - enum Enum - { - Normal, - Popup, - Separator, - MAX - }; - - static MenuItemType parse(const std::string& _value) - { - MenuItemType type; - int value = 0; - while (true) - { - const char * name = type.getValueName(value); - if (strcmp(name, "") == 0 || name == _value) break; - value++; - } - type.value = MenuItemType::Enum(value); - return type; - } - - MenuItemType(Enum _value = MAX) : value(_value) { } - - friend bool operator == (MenuItemType const& a, MenuItemType const& b) { return a.value == b.value; } - friend bool operator != (MenuItemType const& a, MenuItemType const& b) { return a.value != b.value; } - - friend std::ostream& operator << ( std::ostream& _stream, const MenuItemType& _value ) - { - _stream << _value.getValueName(_value.value); - return _stream; - } - - friend std::istream& operator >> ( std::istream& _stream, MenuItemType& _value ) - { - std::string value; - _stream >> value; - _value = MenuItemType::parse(value); - return _stream; - } - - std::string print() const { return getValueName(value); } - - private: - const char * getValueName(int _index) const - { - static const char * values[MAX + 1] = { "Normal", "Popup", "Separator", "" }; - return values[(_index < MAX && _index >= 0) ? _index : MAX]; - } - - private: - Enum value; - }; - -} // namespace MyGUI - -#endif // __MYGUI_MENU_ITEM_TYPE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Message.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Message.h deleted file mode 100644 index aa1be2ba0..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Message.h +++ /dev/null @@ -1,155 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_MESSAGE_H__ -#define __MYGUI_MESSAGE_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Window.h" -#include "MyGUI_ResourceImageSet.h" -#include "MyGUI_EventPair.h" -#include "MyGUI_MessageStyle.h" -#include "MyGUI_ControllerFadeAlpha.h" - -namespace MyGUI -{ - - typedef delegates::CDelegate2 EventHandle_MessagePtrMessageStyle; - - class MYGUI_EXPORT Message : - public Window - { - MYGUI_RTTI_DERIVED( Message ) - - public: - Message(); - - /** Set message text*/ - void setMessageText(const UString& _value); - - /** Create button with specific name*/ - MessageBoxStyle addButtonName(const UString& _name); - - /** Set smooth message showing*/ - void setSmoothShow(bool _value); - - /** Get name of default layer for Message*/ - const std::string& getDefaultLayer() { return mDefaultLayer; } - - /** Set message icon*/ - void setMessageIcon(MessageBoxStyle _value); - /** Set fade under message*/ - void setWindowFade(bool _value); - - void endMessage(MessageBoxStyle _result); - void endMessage(); - - /** Create button using MessageBoxStyle*/ - void setMessageButton(MessageBoxStyle _value); - - /** Set message style (button and icon)*/ - void setMessageStyle(MessageBoxStyle _value); - - void setMessageModal(bool _value); - - /** Static method for creating message with one command - @param - _modal if true all other GUI elements will be blocked untill message is closed - @param - _style any combination of flags from ViewValueInfo - @param - _button1 ... _button4 specific buttons names - */ - static MyGUI::Message* createMessageBox( - const std::string& _skin, - const UString& _caption, - const UString& _message, - MessageBoxStyle _style = MessageBoxStyle::Ok | MessageBoxStyle::IconDefault, - const std::string& _layer = "", - bool _modal = true, - const std::string& _button1 = "", - const std::string& _button2 = "", - const std::string& _button3 = "", - const std::string& _button4 = ""); - - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*event:*/ - /** Event : button on message window pressed.\n - signature : void method(MyGUI::Message* _sender, MyGUI::MessageBoxStyle _result)\n - @param _sender widget that called this event - @param _result - id of pressed button - */ - EventHandle_MessagePtrMessageStyle eventMessageBoxResult; - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - protected: - virtual ~Message(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - void updateSize(); - void notifyButtonClick(MyGUI::Widget* _sender); - void clearButton(); - - void onKeyButtonPressed(KeyCode _key, Char _char); - void _destroyMessage(MessageBoxStyle _result); - - UString getButtonName(MessageBoxStyle _style); - const char * getIconName(size_t _index); - const char * getButtonName(size_t _index); - const char * getButtonTag(size_t _index); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - ControllerFadeAlpha* createControllerFadeAlpha(float _alpha, float _coef, bool _enable); - - private: - IntSize mOffsetText; - Widget* mWidgetText; - - std::string mButtonSkin, mButtonType; - IntSize mButtonSize, mButtonOffset; - - VectorWidgetPtr mVectorButton; - MessageBoxStyle mInfoOk; - MessageBoxStyle mInfoCancel; - bool mSmoothShow; - - std::string mDefaultLayer, mDefaultCaption; - std::string mFadeSkin, mFadeLayer; - Widget* mWidgetFade; - StaticImage* mIcon; - int mLeftOffset1; - int mLeftOffset2; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_MESSAGE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MessageStyle.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MessageStyle.h deleted file mode 100644 index 85171feee..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MessageStyle.h +++ /dev/null @@ -1,224 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 08/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_MESSAGE_BOX_STYLE_H__ -#define __MYGUI_MESSAGE_BOX_STYLE_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - - struct MYGUI_EXPORT MessageBoxStyle - { - - enum Enum - { - None = MYGUI_FLAG_NONE, - Ok = MYGUI_FLAG(0), - Yes = MYGUI_FLAG(1), - No = MYGUI_FLAG(2), - Abort = MYGUI_FLAG(3), - Retry = MYGUI_FLAG(4), - Ignore = MYGUI_FLAG(5), - Cancel = MYGUI_FLAG(6), - Try = MYGUI_FLAG(7), - Continue = MYGUI_FLAG(8), - - _IndexUserButton1 = 9, // - - Button1 = MYGUI_FLAG(_IndexUserButton1), - Button2 = MYGUI_FLAG(_IndexUserButton1 + 1), - Button3 = MYGUI_FLAG(_IndexUserButton1 + 2), - Button4 = MYGUI_FLAG(_IndexUserButton1 + 3), - - _CountUserButtons = 4, // - _IndexIcon1 = _IndexUserButton1 + _CountUserButtons, // - - IconDefault = MYGUI_FLAG(_IndexIcon1), - - IconInfo = MYGUI_FLAG(_IndexIcon1), - IconQuest = MYGUI_FLAG(_IndexIcon1 + 1), - IconError = MYGUI_FLAG(_IndexIcon1 + 2), - IconWarning = MYGUI_FLAG(_IndexIcon1 + 3), - - Icon1 = MYGUI_FLAG(_IndexIcon1), - Icon2 = MYGUI_FLAG(_IndexIcon1 + 1), - Icon3 = MYGUI_FLAG(_IndexIcon1 + 2), - Icon4 = MYGUI_FLAG(_IndexIcon1 + 3), - Icon5 = MYGUI_FLAG(_IndexIcon1 + 4), - Icon6 = MYGUI_FLAG(_IndexIcon1 + 5), - Icon7 = MYGUI_FLAG(_IndexIcon1 + 6), - Icon8 = MYGUI_FLAG(_IndexIcon1 + 7) - }; - - MessageBoxStyle(Enum _value = None) : value(_value) { } - - MessageBoxStyle& operator |= (MessageBoxStyle const& _other) { value = Enum(int(value) | int(_other.value)); return *this; } - friend MessageBoxStyle operator | (Enum const& a, Enum const& b) { return MessageBoxStyle(Enum(int(a) | int(b))); } - MessageBoxStyle operator | (Enum const& a) { return MessageBoxStyle(Enum(int(value) | int(a))); } - - friend bool operator == (MessageBoxStyle const& a, MessageBoxStyle const& b) { return a.value == b.value; } - friend bool operator != (MessageBoxStyle const& a, MessageBoxStyle const& b) { return a.value != b.value; } - - friend std::ostream& operator << ( std::ostream& _stream, const MessageBoxStyle& _value ) - { - //_stream << _value.print(); - return _stream; - } - - friend std::istream& operator >> ( std::istream& _stream, MessageBoxStyle& _value ) - { - std::string value; - _stream >> value; - _value = MessageBoxStyle::parse(value); - return _stream; - } - - // - size_t getIconIndex() - { - size_t index = 0; - int num = value >> _IndexIcon1; - - while (num != 0) - { - if ((num & 1) == 1) return index; - - ++index; - num >>= 1; - } - - return ITEM_NONE; - } - - // - size_t getButtonIndex() - { - size_t index = 0; - int num = value; - - while (num != 0) - { - if ((num & 1) == 1) return index; - - ++index; - num >>= 1; - } - - return ITEM_NONE; - } - - // - std::vector getButtons() - { - std::vector buttons; - - size_t index = 0; - int num = value; - while (index < _IndexIcon1) - { - if ((num & 1) == 1) - { - buttons.push_back( MessageBoxStyle::Enum( MYGUI_FLAG(index) ) ); - } - - ++index; - num >>= 1; - } - - return buttons; - } - - typedef std::map MapAlign; - - static MessageBoxStyle parse(const std::string& _value) - { - MessageBoxStyle result(MessageBoxStyle::Enum(0)); - const MapAlign& map_names = result.getValueNames(); - const std::vector& vec = utility::split(_value); - for (size_t pos=0; possecond)); - } - else - { - MYGUI_LOG(Warning, "Cannot parse type '" << vec[pos] << "'"); - } - } - return result; - } - - private: - const MapAlign& getValueNames() - { - static MapAlign map_names; - - if (map_names.empty()) - { - MYGUI_REGISTER_VALUE(map_names, None); - MYGUI_REGISTER_VALUE(map_names, Ok); - MYGUI_REGISTER_VALUE(map_names, Yes); - MYGUI_REGISTER_VALUE(map_names, No); - MYGUI_REGISTER_VALUE(map_names, Abort); - MYGUI_REGISTER_VALUE(map_names, Retry); - MYGUI_REGISTER_VALUE(map_names, Ignore); - MYGUI_REGISTER_VALUE(map_names, Cancel); - MYGUI_REGISTER_VALUE(map_names, Try); - MYGUI_REGISTER_VALUE(map_names, Continue); - - MYGUI_REGISTER_VALUE(map_names, Button1); - MYGUI_REGISTER_VALUE(map_names, Button2); - MYGUI_REGISTER_VALUE(map_names, Button3); - MYGUI_REGISTER_VALUE(map_names, Button4); - - MYGUI_REGISTER_VALUE(map_names, IconDefault); - - MYGUI_REGISTER_VALUE(map_names, IconInfo); - MYGUI_REGISTER_VALUE(map_names, IconQuest); - MYGUI_REGISTER_VALUE(map_names, IconError); - MYGUI_REGISTER_VALUE(map_names, IconWarning); - - MYGUI_REGISTER_VALUE(map_names, Icon1); - MYGUI_REGISTER_VALUE(map_names, Icon2); - MYGUI_REGISTER_VALUE(map_names, Icon3); - MYGUI_REGISTER_VALUE(map_names, Icon4); - MYGUI_REGISTER_VALUE(map_names, Icon5); - MYGUI_REGISTER_VALUE(map_names, Icon6); - MYGUI_REGISTER_VALUE(map_names, Icon7); - MYGUI_REGISTER_VALUE(map_names, Icon8); - } - - return map_names; - } - - private: - Enum value; - }; - -} // namespace MyGUI - -#endif // __MYGUI_MESSAGE_BOX_STYLE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MultiList.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MultiList.h deleted file mode 100644 index 9f4cc81b6..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_MultiList.h +++ /dev/null @@ -1,385 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 04/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_MULTI_LIST_H__ -#define __MYGUI_MULTI_LIST_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Widget.h" -#include "MyGUI_List.h" -#include "MyGUI_Any.h" -#include "MyGUI_BiIndexBase.h" -#include "MyGUI_EventPair.h" - -namespace MyGUI -{ - - //OBSOLETE - typedef delegates::CDelegate5 EventHandle_WidgetIntUTFStringUTFStringBool; - - typedef delegates::CDelegate5 EventHandle_MultiListPtrSizeTCUTFStringRefCUTFStringRefBoolRef; - typedef delegates::CDelegate2 EventHandle_MultiListPtrSizeT; - - class MYGUI_EXPORT MultiList : - public Widget, - public BiIndexBase - { - MYGUI_RTTI_DERIVED( MultiList ) - - public: - MultiList(); - - //------------------------------------------------------------------------------// - // Methods for work with columns (RU:методы для работы со столбцами) - //------------------------------------------------------------------------------// - // манипуляции айтемами - - //! Get number of columns - size_t getColumnCount() { return mVectorColumnInfo.size(); } - - /** Insert new column - @param _column New column will be inserted before _column - @param _name Name of new column - @param _width Width of new column - */ - void insertColumnAt(size_t _column, const UString& _name, int _width, Any _data = Any::Null); - - /** Add new column at last position - @param _width Width of new column - @param _name Name of new column - */ - void addColumn(const UString& _name, int _width, Any _data = Any::Null) { insertColumnAt(ITEM_NONE, _name, _width, _data); } - - /** Delete column */ - void removeColumnAt(size_t _column); - - /** Delete all columns */ - void removeAllColumns(); - - - //------------------------------------------------------------------------------// - // манипуляции отображением - - /** Set column name - @param _column Index of column - @param _name New name of column - */ - void setColumnNameAt(size_t _column, const UString& _name); - - /** Set column width - @param _column Index of column - @param _name New width of column - */ - void setColumnWidthAt(size_t _column, int _width); - - /** Get _column name */ - const UString& getColumnNameAt(size_t _column); - - /** Get _column width */ - int getColumnWidthAt(size_t _column); - - /** Sort multilist by column */ - void sortByColumn(size_t _column, bool _backward = false); - - //------------------------------------------------------------------------------// - // манипуляции данными - - //! Replace an item data at a specified position - void setColumnDataAt(size_t _index, Any _data); - - //! Clear an item data at a specified position - void clearColumnDataAt(size_t _index) { setColumnDataAt(_index, Any::Null); } - - //! Get item data from specified position - template - ValueType * getColumnDataAt(size_t _index, bool _throw = true) - { - MYGUI_ASSERT_RANGE(_index, mVectorColumnInfo.size(), "MultiList::getItemDataAt"); - return mVectorColumnInfo[_index].data.castType(_throw); - } - - //------------------------------------------------------------------------------// - // Methods for work with lines (RU:методы для работы со строками) - /** @note - All indexes used here is indexes of unsorted Multilist. Even if you sorted - it - all items indexes will be same as before sort. - */ - - //------------------------------------------------------------------------------// - // манипуляции айтемами - - /** Get number of items (lines) */ - size_t getItemCount() const; - - /** Insert new item before _index line */ - void insertItemAt(size_t _index, const UString& _name, Any _data = Any::Null); - - /** Add new item at the end */ - void addItem(const UString& _name, Any _data = Any::Null) { insertItemAt(ITEM_NONE, _name, _data); } - - //! Remove item at a specified position - void removeItemAt(size_t _index); - - /** Delete all items */ - void removeAllItems(); - - //! Swap items at a specified positions - void swapItemsAt(size_t _index1, size_t _index2); - - - //------------------------------------------------------------------------------// - // манипуляции отображением - - //! Replace an item name - void setItemNameAt(size_t _index, const UString& _name) { setSubItemNameAt(0, _index, _name); } - - //! Get item name from specified position - const UString& getItemNameAt(size_t _index) { return getSubItemNameAt(0, _index); } - - - //------------------------------------------------------------------------------// - // манипуляции выделениями - - /** Get index of selected item (ITEM_NONE if none selected) */ - size_t getIndexSelected() { return mItemSelected; } - - /** Select specified _index */ - void setIndexSelected(size_t _index); - - /** Clear item selection */ - void clearIndexSelected() { setIndexSelected(ITEM_NONE); } - - - //------------------------------------------------------------------------------// - // манипуляции данными - - //! Replace an item data at a specified position - void setItemDataAt(size_t _index, Any _data) { setSubItemDataAt(0, _index, _data); } - - //! Clear an item data at a specified position - void clearItemDataAt(size_t _index) { setItemDataAt(_index, Any::Null); } - - //! Get item data from specified position - template - ValueType * getItemDataAt(size_t _index, bool _throw = true) - { - return getSubItemDataAt(0, _index, _throw); - } - - - //------------------------------------------------------------------------------// - // Methods for work with sub lines (RU:методы для работы со саб строками) - //------------------------------------------------------------------------------// - // манипуляции данными - - /** Set sub item - @param _column Index of column - @param _index Index of line - @param _name New sub item value - */ - void setSubItemNameAt(size_t _column, size_t _index, const UString& _name); - - /** Get sub item name*/ - const UString& getSubItemNameAt(size_t _column, size_t _index); - - /** Search item in specified _column, returns index of the first occurrence in column or ITEM_NONE if item not found */ - size_t findSubItemWith(size_t _column, const UString& _name); - - //------------------------------------------------------------------------------// - // манипуляции данными - - //! Replace an item data at a specified position - void setSubItemDataAt(size_t _column, size_t _index, Any _data); - - //! Clear an item data at a specified position - void clearSubItemDataAt(size_t _column, size_t _index) { setSubItemDataAt(_column, _index, Any::Null); } - - //! Get item data from specified position - template - ValueType * getSubItemDataAt(size_t _column, size_t _index, bool _throw = true) - { - MYGUI_ASSERT_RANGE(_column, mVectorColumnInfo.size(), "MultiList::getSubItemDataAt"); - MYGUI_ASSERT_RANGE(_index, mVectorColumnInfo.begin()->list->getItemCount(), "MultiList::getSubItemDataAt"); - - size_t index = BiIndexBase::convertToBack(_index); - return mVectorColumnInfo[_column].list->getItemDataAt(index, _throw); - } - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - /*event:*/ - /** Event : Enter pressed or double click.\n - signature : void method(MyGUI::MultiList* _sender, size_t _index)\n - @param _sender widget that called this event - @param _index of selected item - */ - EventPair eventListSelectAccept; - - /** Event : Selected item position changed.\n - signature : void method(MyGUI::MultiList* _sender, size_t _index)\n - @param _sender widget that called this event - @param _index of new item - */ - EventPair eventListChangePosition; - - /** Event : Less than operator for sort multilist by columns.\n - signature : void method(MyGUI::MultiList* _sender, size_t _column, const UString& _firstItem, const UString& _secondItem, bool& _less)\n - @param _sender widget that called this event - @param _column Index of column - @param _firstItem Strings for compare - @param _secondItem Strings for compare - @param _less Comparsion result (write your value here) - */ - EventHandle_MultiListPtrSizeTCUTFStringRefCUTFStringRefBoolRef requestOperatorLess; - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : size_t MultiList::getIndexSelected()") - size_t getItemIndexSelected() { return getIndexSelected(); } - MYGUI_OBSOLETE("use : void MultiList::setIndexSelected(size_t _index)") - void setItemSelectedAt(size_t _index) { setIndexSelected(_index); } - MYGUI_OBSOLETE("use : void MultiList::clearIndexSelected()") - void clearItemSelected() { clearIndexSelected(); } - - MYGUI_OBSOLETE("use : size_t MultiList::findSubItemWith(size_t _column, const UString& _name)") - size_t findItem(size_t _column, const UString& _name) { return findSubItemWith(_column, _name); } - MYGUI_OBSOLETE("use : const UString& MultiList::getSubItemNameAt(size_t _column, size_t _index)") - const UString& getSubItem(size_t _column, size_t _index) { return getSubItemNameAt(_column, _index); } - MYGUI_OBSOLETE("use : void MultiList::setSubItemNameAt(size_t _column, size_t _index, const UString& _name)") - void setSubItem(size_t _column, size_t _index, const UString& _name) { setSubItemNameAt(_column, _index, _name); } - MYGUI_OBSOLETE("use : void MultiList::removeColumnAt(size_t _column)") - void deleteColumn(size_t _column) { removeColumnAt(_column); } - MYGUI_OBSOLETE("use : void MultiList::removeAllColumns()") - void deleteAllColumns() { removeAllColumns(); } - MYGUI_OBSOLETE("use : int MultiList::getColumnWidthAt(size_t _column)") - int getColumnWidth(size_t _column) { return getColumnWidthAt(_column); } - MYGUI_OBSOLETE("use : const UString& MultiList::getColumnNameAt(size_t _column)") - const UString& getColumnName(size_t _column) { return getColumnNameAt(_column); } - MYGUI_OBSOLETE("use : void MultiList::setColumnWidthAt(size_t _column, int _width)") - void setColumnWidth(size_t _column, int _width) { setColumnWidthAt(_column, _width); } - MYGUI_OBSOLETE("use : void MultiList::addColumn(const UString& _name, int _width, Any _data)") - void addColumn(int _width, const UString& _name) { addColumn(_name, _width); } - MYGUI_OBSOLETE("use : void MultiList::setColumnNameAt(size_t _column, const UString& _name)") - void setColumnName(size_t _column, const UString& _name) { setColumnNameAt(_column, _name); } - MYGUI_OBSOLETE("use : void MultiList::insertColumnAt(size_t _column, const UString& _name, int _width, Any _data)") - void insertColumn(size_t _column, int _width, const UString& _name) { insertColumnAt(_column, _name, _width); } - MYGUI_OBSOLETE("use : size_t MultiList::getIndexSelected()") - size_t getItemSelect() { return getIndexSelected(); } - MYGUI_OBSOLETE("use : void MultiList::clearIndexSelected()") - void resetItemSelect() { clearIndexSelected(); } - MYGUI_OBSOLETE("use : void MultiList::setIndexSelected(size_t _index)") - void setItemSelect(size_t _index) { setIndexSelected(_index); } - MYGUI_OBSOLETE("use : void MultiList::insertItemAt(size_t _index, const UString& _name, Any _data)") - void insertItem(size_t _index, const UString& _name) { insertItemAt(_index, _name); } - MYGUI_OBSOLETE("use : void MultiList::setItemNameAt(size_t _index, const UString& _name)") - void setItem(size_t _index, const UString& _name) { setItemNameAt(_index, _name); } - MYGUI_OBSOLETE("use : const UString& MultiList::getItemNameAt(size_t _index)") - const UString& getItem(size_t _index) { return getItemNameAt(_index); } - MYGUI_OBSOLETE("use : void MultiList::removeItemAt(size_t _index)") - void deleteItem(size_t _index) { removeItemAt(_index); } - MYGUI_OBSOLETE("use : void MultiList::removeAllItems()") - void deleteAllItems() { removeAllItems(); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - protected: - virtual ~MultiList(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - void notifyListChangePosition(List* _sender, size_t _position); - void notifyListChangeFocus(List* _sender, size_t _position); - void notifyListChangeScrollPosition(List* _sender, size_t _position); - void notifyButtonClick(Widget* _sender); - void notifyListSelectAccept(List* _sender, size_t _position); - - void updateColumns(); - void redrawButtons(); - void updateOnlyEmpty(); - - bool compare(List* _list, size_t _left, size_t _right); - void sortList(); - void flipList(); - - Widget* getSeparator(size_t _index); - - void setButtonImageIndex(Button* _button, size_t _index); - - void updateBackSelected(size_t _index); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - void frameEntered(float _frame); - - void frameAdvise(bool _advise); - - private: - struct ColumnInfo - { - List* list; - Button* button; - int width; - UString name; - Any data; - }; - - typedef std::vector VectorColumnInfo; - - enum ImageSort - { - SORT_NONE, - SORT_UP, - SORT_DOWN - }; - - private: - int mHeightButton; - int mWidthBar; - std::string mSkinButton, mSkinList; - Button* mButtonMain; - - VectorColumnInfo mVectorColumnInfo; - - VectorWidgetPtr mSeparators; - - size_t mLastMouseFocusIndex; - - bool mSortUp; - size_t mSortColumnIndex; - - int mWidthSeparator; - std::string mSkinSeparator; - int mOffsetButtonSeparator; - - size_t mItemSelected; - - bool mFrameAdvise; - Widget* mClient; - }; - -} // namespace MyGUI - -#endif // __MYGUI_MULTI_LIST_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_OverlappedLayer.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_OverlappedLayer.h deleted file mode 100644 index bf5e58030..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_OverlappedLayer.h +++ /dev/null @@ -1,74 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_OVERLAPPED_LAYER_H__ -#define __MYGUI_OVERLAPPED_LAYER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include "MyGUI_ILayer.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT OverlappedLayer : - public ILayer - { - MYGUI_RTTI_DERIVED( OverlappedLayer ) - - public: - OverlappedLayer(); - virtual ~OverlappedLayer(); - - virtual void deserialization(xml::ElementPtr _node, Version _version); - - // - virtual ILayerNode* createChildItemNode(); - // - virtual void destroyChildItemNode(ILayerNode* _node); - - // - virtual void upChildItemNode(ILayerNode* _node); - - // - virtual EnumeratorILayerNode getEnumerator(); - - // - virtual ILayerItem* getLayerItemByPoint(int _left, int _top); - - virtual IntPoint getPosition(int _left, int _top) const; - - virtual const IntSize& getSize() const; - - // - virtual void renderToTarget(IRenderTarget* _target, bool _update); - - virtual void dumpStatisticToLog(); - - protected: - bool mIsPick; - VectorILayerNode mChildItems; - }; - -} // namespace MyGUI - -#endif // __MYGUI_OVERLAPPED_LAYER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Platform.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Platform.h deleted file mode 100644 index 9f8b59b93..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Platform.h +++ /dev/null @@ -1,151 +0,0 @@ -/*! - @file - @author Denis Koronchik - @author Georgiy Evmenov - @author Albert Semenov - @date 09/2007 -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ - -#ifndef __MYGUI_PLATFORM_H__ -#define __MYGUI_PLATFORM_H__ - -// Definnition of platforms -#define MYGUI_PLATFORM_WIN32 1 -#define MYGUI_PLATFORM_LINUX 2 -#define MYGUI_PLATFORM_APPLE 3 - -// Definition of compilers -#define MYGUI_COMPILER_MSVC 1 -#define MYGUI_COMPILER_GNUC 2 - - -// Find platform -#if defined (__WIN32__) || defined (_WIN32) -# define MYGUI_PLATFORM MYGUI_PLATFORM_WIN32 -#elif defined (__APPLE_CC__) -# define MYGUI_PLATFORM MYGUI_PLATFORM_APPLE -#else -# define MYGUI_PLATFORM MYGUI_PLATFORM_LINUX -#endif - -// Find compiler -#if defined( _MSC_VER ) -# define MYGUI_COMPILER MYGUI_COMPILER_MSVC -# define MYGUI_COMP_VER _MSC_VER - -#elif defined( __GNUC__ ) -# define MYGUI_COMPILER MYGUI_COMPILER_GNUC -# define MYGUI_COMP_VER (((__GNUC__)*100) + \ - (__GNUC_MINOR__*10) + \ - __GNUC_PATCHLEVEL__) -#else -# pragma error "Unknown compiler! Stop building!!!" -#endif - -// See if we can use __forceinline or if we need to use __inline instead -#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC -# if MYGUI_COMP_VER >= 1200 -# define MYGUI_FORCEINLINE __forceinline -# endif -#elif defined(__MINGW32__) -# if !defined(MYGUI_FORCEINLINE) -# define MYGUI_FORCEINLINE __inline -# endif -#else -# define MYGUI_FORCEINLINE __inline -#endif - - -// Windows settings -#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32 -# -# if defined( MYGUI_STATIC ) -# define MYGUI_EXPORT -# elif defined( MYGUI_BUILD ) -# define MYGUI_EXPORT __declspec( dllexport ) -# else -# if defined( __MINGW32__ ) -# define MYGUI_EXPORT -# else -# define MYGUI_EXPORT __declspec( dllimport ) -# endif -# endif -# -# if defined( MYGUI_STATIC ) -# define MYGUI_EXPORT_DLL -# elif defined( MYGUI_BUILD_DLL ) -# define MYGUI_EXPORT_DLL __declspec( dllexport ) -# else -# if defined( __MINGW32__ ) -# define MYGUI_EXPORT_DLL -# else -# define MYGUI_EXPORT_DLL __declspec( dllimport ) -# endif -# endif -# -#// Win32 compilers use _DEBUG for specifying debug builds. -# ifdef _DEBUG -# define MYGUI_DEBUG_MODE 1 -# else -# define MYGUI_DEBUG_MODE 0 -# endif -#endif - - -// Linux/Apple Settings -#if MYGUI_PLATFORM == MYGUI_PLATFORM_LINUX || MYGUI_PLATFORM == MYGUI_PLATFORM_APPLE -# -// Add -fvisibility=hidden to compiler options. With -fvisibility=hidden, you are telling -// GCC that every declaration not explicitly marked with a visibility attribute (MYGUI_EXPORT) -// has a hidden visibility (like in windows). -# if __GNUC__ >= 4 -# define MYGUI_EXPORT __attribute__ ((visibility("default"))) -# else -# define MYGUI_EXPORT -# endif -# -# if __GNUC__ >= 4 -# define MYGUI_EXPORT_DLL __attribute__ ((visibility("default"))) -# else -# define MYGUI_EXPORT_DLL -# endif -# -// A quick define to overcome different names for the same function -# define stricmp strcasecmp -# -// Unlike the Win32 compilers, Linux compilers seem to use DEBUG for when -// specifying a debug build. -// (??? this is wrong, on Linux debug builds aren't marked in any way unless -// you mark it yourself any way you like it -- zap ???) -# ifdef DEBUG -# define MYGUI_DEBUG_MODE 1 -# else -# define MYGUI_DEBUG_MODE 0 -# endif - -# if MYGUI_PLATFORM == MYGUI_PLATFORM_APPLE -# define MYGUI_PLATFORM_LIB "MYGUIPlatform.bundle" -# else // if MYGUI_PLATFORM_LINUX -# define MYGUI_PLATFORM_LIB "libMYGUIPlatform.so" -# endif - -#endif - - -#endif // __MYGUI_PLATFORM_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Plugin.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Plugin.h deleted file mode 100644 index b06681c7e..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Plugin.h +++ /dev/null @@ -1,67 +0,0 @@ -/*! - @file - @author Denis Koronchik - @date 09/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_PLUGIN_H__ -#define __MYGUI_PLUGIN_H__ - -#include "MyGUI_Prerequest.h" -#include - -namespace MyGUI -{ - - /*! \brief Base plugin class - */ - class MYGUI_EXPORT IPlugin - { - public: - IPlugin() { } - - virtual ~IPlugin() { } - - /*! Get the name of the plugin. - @remarks An implementation must be supplied for this method to uniquely - identify the plugin - */ - virtual const std::string& getName() const = 0; - - /*! Perform the plugin initial installation sequence - */ - virtual void install() = 0; - - /*! Perform any tasks the plugin needs to perform on full system - initialisation. - */ - virtual void initialize() = 0; - - /*! Perform any tasks the plugin needs to perform when the system is shut down - */ - virtual void shutdown() = 0; - - /*! Perform the final plugin uninstallation sequence - */ - virtual void uninstall() = 0; - }; - -} - -#endif // __MYGUI_PLUGIN_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_PluginManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_PluginManager.h deleted file mode 100644 index 61df0029d..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_PluginManager.h +++ /dev/null @@ -1,91 +0,0 @@ -/*! - @file - @author Denis Koronchik - @date 09/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_PLUGIN_MANAGER_H__ -#define __MYGUI_PLUGIN_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Instance.h" -#include "MyGUI_Plugin.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_Version.h" -#include - -namespace MyGUI -{ - - /*! \brief Plugin manager. Load/unload and register plugins. - */ - class MYGUI_EXPORT PluginManager - { - MYGUI_INSTANCE_HEADER( PluginManager ) - - public: - typedef void (*DLL_START_PLUGIN)(void); - typedef void (*DLL_STOP_PLUGIN)(void); - - public: - void initialise(); - void shutdown(); - - public: - //! Load plugin - bool loadPlugin(const std::string& _file); - - //! Unload plugin - void unloadPlugin(const std::string& _file); - - /** Load additional MyGUI *_plugin.xml file */ - bool load(const std::string& _file); - void _load(xml::ElementPtr _node, const std::string& _file, Version _version); - - /*! Install plugin - @remarks Calls from plugin - */ - void installPlugin(IPlugin* _plugin); - - /*! Uninstall plugin - @remarks Calls from plugin - */ - void uninstallPlugin(IPlugin* _plugin); - - //! Unload all plugins - void unloadAllPlugins(); - - private: - //! List of dynamic libraries - typedef std::map DynLibList; - - //! List of plugins - typedef std::set PluginList; - - //! Loaded libraries - DynLibList mLibs; - - //! Installed plugins - PluginList mPlugins; - - }; - -} - -#endif // __MYGUI_PLUGIN_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_PointerManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_PointerManager.h deleted file mode 100644 index fa0306259..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_PointerManager.h +++ /dev/null @@ -1,131 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_POINTER_MANAGER_H__ -#define __MYGUI_POINTER_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Instance.h" -#include "MyGUI_IUnlinkWidget.h" -#include "MyGUI_IWidgetCreator.h" -#include "MyGUI_StaticImage.h" -#include "MyGUI_IPointer.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT PointerManager : - public IUnlinkWidget, - public IWidgetCreator - { - MYGUI_INSTANCE_HEADER( PointerManager ) - - public: - void initialise(); - void shutdown(); - - public: - /** Load additional MyGUI *_pointer.xml file */ - bool load(const std::string& _file); - - void _load(xml::ElementPtr _node, const std::string& _file, Version _version); - - /** Show or hide mouse pointer */ - void setVisible(bool _visible); - /** Is mouse pointer visible */ - bool isVisible() const { return mVisible; } - - /** Set pointer that will be shown - @param _name of pointer - */ - void setPointer(const std::string& _name); - /** Reset to default pointer */ - void resetToDefaultPointer(); - - /** Get default pointer */ - const std::string& getDefaultPointer() { return mDefaultName; } - /** Set default pointer */ - void setDeafultPointer(const std::string& _value); - - const std::string& getLayerName() { return mLayerName; } - void setLayerName(const std::string& _value); - - /** Get pointer resource */ - IPointer* getByName(const std::string& _name) const; - - /*event:*/ - /** Event : Mouse pointer has been changed.\n - signature : void method(const std::string& _pointerName)\n - @param _pointerName Name of current mouse pointer - */ - delegates::CMultiDelegate1 - eventChangeMousePointer; - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void PointerManager::setVisible(bool _visible)") - void show() { setVisible(true); } - MYGUI_OBSOLETE("use : void PointerManager::setVisible(bool _visible)") - void hide() { setVisible(false); } - MYGUI_OBSOLETE("use : bool PointerManager::isVisible()") - bool isShow() { return isVisible(); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - private: - void _unlinkWidget(Widget* _widget); - - // создает виджет - virtual Widget* baseCreateWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name); - - // удяляет неудачника - virtual void _destroyChildWidget(Widget* _widget); - - // удаляет всех детей - virtual void _destroyAllChildWidget(); - - void Update(); - - void notifyFrameStart(float _time); - void notifyChangeMouseFocus(Widget* _widget); - void setPointer(const std::string& _name, Widget* _owner); - - private: - // вектор всех детей виджетов - VectorWidgetPtr mWidgetChild; - - std::string mDefaultName; - IntPoint mPoint; - bool mVisible; - std::string mLayerName; - std::string mSkinName; - - Widget* mWidgetOwner; - StaticImage* mMousePointer; - IPointer* mPointer; - std::string mCurrentMousePointer; - }; - -} // namespace MyGUI - -#endif // __MYGUI_POINTER_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_PopupMenu.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_PopupMenu.h deleted file mode 100644 index 441f13bc1..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_PopupMenu.h +++ /dev/null @@ -1,56 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_POPUP_MENU_H__ -#define __MYGUI_POPUP_MENU_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_MenuCtrl.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT PopupMenu : - public MenuCtrl - { - MYGUI_RTTI_DERIVED( PopupMenu ) - - public: - PopupMenu(); - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - protected: - virtual ~PopupMenu(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - }; - -} // namespace MyGUI - -#endif // __MYGUI_POPUP_MENU_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Precompiled.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Precompiled.h deleted file mode 100644 index d9c2b8bf1..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Precompiled.h +++ /dev/null @@ -1,49 +0,0 @@ -/*! - @file - @author Alexander Ptakhin - @date 01/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_PRECOMPILED_H__ -#define __MYGUI_PRECOMPILED_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Common.h" -#include "MyGUI_Macros.h" -#include "MyGUI_Guid.h" -#include "MyGUI_LogManager.h" -#include "MyGUI_Instance.h" -#include "MyGUI_Types.h" -#include "MyGUI_Any.h" -#include "MyGUI_IResource.h" -#include "MyGUI_Utility.h" -#include "MyGUI_InputDefine.h" -#include "MyGUI_Version.h" -#include "MyGUI_RenderOut.h" -#include "MyGUI_WidgetStyle.h" -#include "MyGUI_ActionController.h" -#include "MyGUI_ControllerFadeAlpha.h" -#include "MyGUI_ControllerPosition.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_CastWidget.h" -#include "MyGUI_IObject.h" -#include "MyGUI_ISerializable.h" -#include "MyGUI_GenericFactory.h" - -#endif // __MYGUI_PRECOMPILED_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Prerequest.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Prerequest.h deleted file mode 100644 index d0db4e814..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Prerequest.h +++ /dev/null @@ -1,192 +0,0 @@ -/*! - @file - @author Denis Koronchik - @author Georgiy Evmenov - @author Ну и я чуть чуть =) - @date 09/2007 -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ - -#ifndef __MYGUI_PREREQUEST_H__ -#define __MYGUI_PREREQUEST_H__ - -#include "MyGUI_Platform.h" - -#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC -# ifndef _CRT_SECURE_NO_WARNINGS -# define _CRT_SECURE_NO_WARNINGS -# endif -#endif - -#define MYGUI_DEFINE_VERSION(major, minor, patch) ((major << 16) | (minor << 8) | patch) - -#ifndef MYGUI_DONT_REPLACE_NULLPTR - #if MYGUI_COMPILER == MYGUI_COMPILER_MSVC - #ifndef _MANAGED - #define nullptr 0 - #endif - #else - #define nullptr 0 - #endif -#endif - -namespace MyGUI -{ - - class Gui; - class IWidgetCreator; - - // managers - class LogManager; - class InputManager; - class SubWidgetManager; - class LayerManager; - class SkinManager; - class WidgetManager; - class FontManager; - class ControllerManager; - class PointerManager; - class ClipboardManager; - class LayoutManager; - class PluginManager; - class DynLibManager; - class LanguageManager; - class ResourceManager; - class RenderManager; - class FactoryManager; - class TextureManager; - - class IWidgetFactory; - - class DynLib; - - namespace factory - { - template - class BaseWidgetFactory; - } - - class Widget; - class Button; - class Window; - class List; - class HScroll; - class VScroll; - class Edit; - class ComboBox; - class StaticText; - class Tab; - class TabItem; - class Progress; - class ItemBox; - class MultiList; - class StaticImage; - class Message; - class MenuCtrl; - class MenuItem; - class PopupMenu; - class MenuBar; - class ScrollView; - class DDContainer; - class Canvas; - class ListCtrl; - class ListBox; - - typedef Widget* WidgetPtr; - typedef Button* ButtonPtr; - typedef Window* WindowPtr; - typedef List* ListPtr; - typedef HScroll* HScrollPtr; - typedef VScroll* VScrollPtr; - typedef Edit* EditPtr; - typedef ComboBox* ComboBoxPtr; - typedef StaticText* StaticTextPtr; - typedef Tab* TabPtr; - typedef TabItem* TabItemPtr; - typedef Progress* ProgressPtr; - typedef ItemBox* ItemBoxPtr; - typedef MultiList* MultiListPtr; - typedef StaticImage* StaticImagePtr; - typedef Message* MessagePtr; - typedef MenuCtrl* MenuCtrlPtr; - typedef MenuItem* MenuItemPtr; - typedef PopupMenu* PopupMenuPtr; - typedef MenuBar* MenuBarPtr; - typedef ScrollView* ScrollViewPtr; - typedef DDContainer* DDContainerPtr; - typedef Canvas* CanvasPtr; - typedef ListCtrl* ListCtrlPtr; - typedef ListBox* ListBoxPtr; - -#ifndef MYGUI_DONT_USE_OBSOLETE - - typedef TabItem Sheet; - typedef TabItem* SheetPtr; - typedef Canvas RenderBox; - typedef Canvas* RenderBoxPtr; - -#endif // MYGUI_DONT_USE_OBSOLETE - - // Define version - #define MYGUI_VERSION_MAJOR 3 - #define MYGUI_VERSION_MINOR 0 - #define MYGUI_VERSION_PATCH 1 - - #define MYGUI_VERSION MYGUI_DEFINE_VERSION(MYGUI_VERSION_MAJOR, MYGUI_VERSION_MINOR, MYGUI_VERSION_PATCH) - - // Disable warnings for MSVC compiler -#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC - -// Turn off warnings generated by long std templates -// This warns about truncation to 255 characters in debug/browse info -# pragma warning (disable : 4786) - -// Turn off warnings generated by long std templates -// This warns about truncation to 255 characters in debug/browse info -# pragma warning (disable : 4503) - -// disable: "conversion from 'double' to 'float', possible loss of data -# pragma warning (disable : 4244) - -// disable: "truncation from 'double' to 'float' -# pragma warning (disable : 4305) - -// disable: " needs to have dll-interface to be used by clients' -// Happens on STL member variables which are not public therefore is ok -# pragma warning (disable : 4251) - -// disable: "non dll-interface class used as base for dll-interface class" -// Happens when deriving from Singleton because bug in compiler ignores -// template export -# pragma warning (disable : 4275) - -// disable: "C++ Exception Specification ignored" -// This is because MSVC 6 did not implement all the C++ exception -// specifications in the ANSI C++ draft. -# pragma warning( disable : 4290 ) - -// disable: "no suitable definition provided for explicit template -// instantiation request" Occurs in VC7 for no justifiable reason on all -// #includes of Singleton -# pragma warning( disable: 4661) - -#endif - -} // namespace MyGUI - -#endif // __MYGUI_PREREQUEST_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Progress.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Progress.h deleted file mode 100644 index 0f16807ca..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Progress.h +++ /dev/null @@ -1,131 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_PROGRESS_H__ -#define __MYGUI_PROGRESS_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Align.h" -#include "MyGUI_Widget.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT Progress : - public Widget - { - MYGUI_RTTI_DERIVED( Progress ) - - public: - Progress(); - - /** Set progress range */ - void setProgressRange(size_t _value); - /** Get progress range */ - size_t getProgressRange() { return mRange; } - - /** Set progress position */ - void setProgressPosition(size_t _value); - /** Get progress position */ - size_t getProgressPosition() { return mEndPosition; } - - /** Enable or disable progress auto tracking */ - void setProgressAutoTrack(bool _value); - /** Get progress auto tracking flag */ - bool getProgressAutoTrack() { return mAutoTrack; } - - /** Set progress start point - For example with Align::Top if will be filled from top to bottom. - */ - void setProgressStartPoint(Align _value); - /** Get progress start point */ - Align getProgressStartPoint() { return mStartPoint; } - - //! @copydoc Widget::setPosition(const IntPoint& _value) - virtual void setPosition(const IntPoint& _value); - //! @copydoc Widget::setSize(const IntSize& _value) - virtual void setSize(const IntSize& _value); - //! @copydoc Widget::setCoord(const IntCoord& _value) - virtual void setCoord(const IntCoord& _value); - - /** @copydoc Widget::setPosition(int _left, int _top) */ - void setPosition(int _left, int _top) { setPosition(IntPoint(_left, _top)); } - /** @copydoc Widget::setSize(int _width, int _height) */ - void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); } - /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ - void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); } - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void Widget::setCoord(const IntCoord& _coord)") - void setPosition(const IntCoord& _coord) { setCoord(_coord); } - MYGUI_OBSOLETE("use : void Widget::setCoord(int _left, int _top, int _width, int _height)") - void setPosition(int _left, int _top, int _width, int _height) { setCoord(_left, _top, _width, _height); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - protected: - virtual ~Progress(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - void frameEntered(float _time); - void updateTrack(); - - int getClientWidth() { return ((mStartPoint.isLeft()) || (mStartPoint.isRight())) ? mClient->getWidth() : mClient->getHeight(); } - int getClientHeight() { return ((mStartPoint.isLeft()) || (mStartPoint.isRight())) ? mClient->getHeight() : mClient->getWidth(); } - - void setTrackPosition(Widget* _widget, int _left, int _top, int _width, int _height); - - private: - std::string mTrackSkin; - int mTrackWidth; - int mTrackStep; - int mTrackMin; - - VectorWidgetPtr mVectorTrack; - size_t mRange; - size_t mStartPosition, mEndPosition; - float mAutoPosition; - bool mAutoTrack; - bool mFillTrack; - - Align mStartPoint; - - Widget* mClient; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_PROGRESS_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RTTI.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RTTI.h deleted file mode 100644 index a980d0a4e..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RTTI.h +++ /dev/null @@ -1,104 +0,0 @@ -/*! - @file - @author Alexander Buryak - Rageous - @author Albert Semenov - @date 09/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RTTI_H__ -#define __MYGUI_RTTI_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Diagnostic.h" -#include -#include - -namespace MyGUI -{ - - //VC++ 7.1 - #if MYGUI_COMPILER == MYGUI_COMPILER_MSVC && MYGUI_COMP_VER == 1310 - #define MYGUI_DECLARE_TYPE_NAME( Type ) \ - private: \ - struct TypeNameHolder { const std::string& getClassTypeName() { static std::string type = #Type; return type; } }; \ - public: \ - static const std::string& getClassTypeName() { TypeNameHolder type; return type.getClassTypeName(); } \ - /** Get type name as string */ \ - virtual const std::string& getTypeName() const { return Type::getClassTypeName(); } - #else - #define MYGUI_DECLARE_TYPE_NAME( Type ) \ - public: \ - static const std::string& getClassTypeName() { static std::string type = #Type; return type; } \ - /** Get type name as string */ \ - virtual const std::string& getTypeName() const { return Type::getClassTypeName(); } - #endif - - #define MYGUI_RTTI_BASE( BaseType ) \ - public: \ - typedef BaseType RTTIBase; \ - MYGUI_DECLARE_TYPE_NAME( BaseType ) \ - /** Compare with selected type */ \ - virtual bool isType( const std::type_info& _type) const { return typeid( BaseType ) == _type; } \ - /** Compare with selected type */ \ - template bool isType() const { return isType( typeid( Type )); } \ - /** Try to cast pointer to selected type. \ - @param _throw If true throw exception when casting in wrong type, else return nullptr \ - */ \ - template Type* castType(bool _throw = true) \ - { \ - if (this->isType()) return static_cast( this ); \ - MYGUI_ASSERT(!_throw, "Error cast type '" << this->getTypeName() << "' to type '" << Type::getClassTypeName() << "' .") \ - return nullptr; \ - } \ - /** Try to cast pointer to selected type. \ - @param _throw If true throw exception when casting in wrong type, else return nullptr \ - */ \ - template const Type* castType(bool _throw = true) const \ - { \ - if (this->isType()) return static_cast( this ); \ - MYGUI_ASSERT(!_throw, "Error cast type '" << this->getTypeName() << "' to type '" << Type::getClassTypeName() << "' .") \ - return nullptr; \ - } - - #define MYGUI_RTTI_DERIVED( DerivedType ) \ - public: \ - MYGUI_DECLARE_TYPE_NAME( DerivedType ) \ - typedef RTTIBase Base; \ - typedef DerivedType RTTIBase; \ - /** Compare with selected type */ \ - virtual bool isType( const std::type_info& _type ) const { return typeid( DerivedType ) == _type || Base::isType( _type ); } \ - /** Compare with selected type */ \ - template bool isType() const { return isType( typeid( DerivedType )); } - - //OBSOLETE - #define MYGUI_RTTI_CHILD_HEADER( DerivedType, BaseType ) \ - public: \ - MYGUI_DECLARE_TYPE_NAME( DerivedType ) \ - typedef BaseType Base; \ - typedef DerivedType RTTIBase; \ - /** Compare with selected type */ \ - virtual bool isType( const std::type_info& _type ) const { return typeid( DerivedType ) == _type || BaseType::isType( _type ); } - - - //OBSOLETE - #define MYGUI_RTTI_BASE_HEADER( BaseType ) MYGUI_RTTI_BASE( BaseType ) - -} // namespace MyGUI - -#endif // __MYGUI_RTTI_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RawRect.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RawRect.h deleted file mode 100644 index 4e2c2e7ba..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RawRect.h +++ /dev/null @@ -1,77 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 09/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RAW_RECT_H__ -#define __MYGUI_RAW_RECT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Colour.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_Types.h" -#include "MyGUI_ICroppedRectangle.h" -#include "MyGUI_SubSkin.h" -#include "MyGUI_RenderFormat.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT RawRect : public SubSkin - { - MYGUI_RTTI_DERIVED( RawRect ) - - public: - RawRect(); - virtual ~RawRect(); - - virtual void setAlpha(float _alpha); - - void setRectColour(const Colour& _colourLT, const Colour& _colourRT, const Colour& _colourLB, const Colour& _colourRB); - - void setRectTexture(const FloatPoint& _pointLT, const FloatPoint& _pointRT, const FloatPoint& _pointLB, const FloatPoint& _pointRB); - - virtual void setStateData(IStateInfo * _data); - - // метод для отрисовки себя - virtual void doRender(); - - private: - FloatPoint mRectTextureLT; - FloatPoint mRectTextureRT; - FloatPoint mRectTextureLB; - FloatPoint mRectTextureRB; - - Colour mColourLT; - Colour mColourRT; - Colour mColourLB; - Colour mColourRB; - - uint32 mRenderColourLT; - uint32 mRenderColourRT; - uint32 mRenderColourLB; - uint32 mRenderColourRB; - - VertexColourType mVertexFormat; - }; - -} // namespace MyGUI - -#endif // __MYGUI_RAW_RECT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderFormat.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderFormat.h deleted file mode 100644 index 734b9921e..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderFormat.h +++ /dev/null @@ -1,100 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 04/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RENDER_FORMAT_H__ -#define __MYGUI_RENDER_FORMAT_H__ - -#include "MyGUI_Macros.h" - -namespace MyGUI -{ - - struct MYGUI_EXPORT VertexColourType - { - enum Enum - { - ColourARGB, // D3D style compact colour - ColourABGR, // GL style compact colour - MAX - }; - - VertexColourType(Enum _value = MAX) : value(_value) { } - - friend bool operator == (VertexColourType const& a, VertexColourType const& b) { return a.value == b.value; } - friend bool operator != (VertexColourType const& a, VertexColourType const& b) { return a.value != b.value; } - - private: - Enum value; - }; - - struct MYGUI_EXPORT PixelFormat - { - enum Enum - { - Unknow, - L8, // 1 byte pixel format, 1 byte luminance - L8A8, // 2 byte pixel format, 1 byte luminance, 1 byte alpha - R8G8B8, // 24-bit pixel format, 8 bits for red, green and blue. - R8G8B8A8 // 32-bit pixel format, 8 bits for red, green, blue and alpha. - }; - - PixelFormat(Enum _value = Unknow) : value(_value) { } - - friend bool operator == (PixelFormat const& a, PixelFormat const& b) { return a.value == b.value; } - friend bool operator != (PixelFormat const& a, PixelFormat const& b) { return a.value != b.value; } - - private: - Enum value; - }; - - struct MYGUI_EXPORT TextureUsage - { - enum Enum - { - Default = MYGUI_FLAG_NONE, - Static = MYGUI_FLAG(0), - Dynamic = MYGUI_FLAG(1), - Stream = MYGUI_FLAG(2), - Read = MYGUI_FLAG(3), - Write = MYGUI_FLAG(4), - RenderTarget = MYGUI_FLAG(5) - }; - - TextureUsage(Enum _value = Default) : value(_value) { } - - friend bool operator == (TextureUsage const& a, TextureUsage const& b) { return a.value == b.value; } - friend bool operator != (TextureUsage const& a, TextureUsage const& b) { return a.value != b.value; } - - TextureUsage& operator |= (TextureUsage const& _other) { value = Enum(int(value) | int(_other.value)); return *this; } - friend TextureUsage operator | (Enum const& a, Enum const& b) { return TextureUsage(Enum(int(a) | int(b))); } - friend TextureUsage operator | (TextureUsage const& a, TextureUsage const& b) { return TextureUsage(Enum(int(a.value) | int(b.value))); } - - bool isValue(Enum _value) { return 0 != (value & _value); } - - private: - Enum value; - }; - -} // namespace MyGUI - - -#endif // __MYGUI_RENDER_FORMAT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderItem.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderItem.h deleted file mode 100644 index d122a3268..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderItem.h +++ /dev/null @@ -1,94 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RENDER_ITEM_H__ -#define __MYGUI_RENDER_ITEM_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_ISubWidget.h" -#include "MyGUI_IVertexBuffer.h" -#include "MyGUI_VertexData.h" -#include "MyGUI_IRenderTarget.h" - -namespace MyGUI -{ - - typedef std::pair DrawItemInfo; - typedef std::vector VectorDrawItem; - - class MYGUI_EXPORT RenderItem - { - public: - RenderItem(); - virtual ~RenderItem(); - - void renderToTarget(IRenderTarget* _target, bool _update); - - void setTexture(ITexture* _value); - ITexture* getTexture(); - - void addDrawItem(ISubWidget* _item, size_t _count); - void removeDrawItem(ISubWidget* _item); - void reallockDrawItem(ISubWidget* _item, size_t _count); - - void outOfDate() { mOutDate = true; } - - size_t getNeedVertexCount() const { return mNeedVertexCount; } - size_t getVertexCount() const { return mCountVertex; } - - bool getCurrentUpdate() const { return mCurrentUpdate; } - Vertex* getCurrentVertextBuffer() const { return mCurrentVertext; } - - void setLastVertexCount(size_t _count) { mLastVertextCount = _count; } - - IRenderTarget* getRenderTarget() { return mRenderTarget; } - - bool getCompression(); - - private: -#if MYGUI_DEBUG_MODE == 1 - std::string mTextureName; -#endif - - ITexture* mTexture; - - size_t mNeedVertexCount; - - bool mOutDate; - VectorDrawItem mDrawItems; - - // - size_t mCountVertex; - - bool mCurrentUpdate; - Vertex* mCurrentVertext; - size_t mLastVertextCount; - - IVertexBuffer* mVertexBuffer; - IRenderTarget* mRenderTarget; - - bool mCompression; - }; - -} // namespace MyGUI - -#endif // __MYGUI_RENDER_ITEM_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderManager.h deleted file mode 100644 index fb151c5d5..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderManager.h +++ /dev/null @@ -1,69 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 04/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RENDER_MANAGER_H__ -#define __MYGUI_RENDER_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_RenderFormat.h" -#include "MyGUI_ITexture.h" -#include "MyGUI_IVertexBuffer.h" -#include "MyGUI_IRenderTarget.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT RenderManager - { - public: - RenderManager(); - virtual ~RenderManager() = 0; - - static RenderManager& getInstance(); - static RenderManager* getInstancePtr(); - - virtual IVertexBuffer* createVertexBuffer() = 0; - virtual void destroyVertexBuffer(IVertexBuffer* _buffer) = 0; - - virtual ITexture* createTexture(const std::string& _name) = 0; - virtual void destroyTexture(ITexture* _texture) = 0; - virtual ITexture* getTexture(const std::string& _name) = 0; - - //FIXME - virtual const IntSize& getViewSize() const = 0; - - virtual VertexColourType getVertexFormat() = 0; - - virtual bool isFormatSupported(PixelFormat _format, TextureUsage _usage) { return true; } - -#if MYGUI_DEBUG_MODE == 1 - virtual bool checkTexture(ITexture* _texture) { return true; } -#endif - - private: - static RenderManager* msInstance; - bool mIsInitialise; - }; - -} // namespace MyGUI - -#endif // __MYGUI_RENDER_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderOut.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderOut.h deleted file mode 100644 index 8ad9fd284..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderOut.h +++ /dev/null @@ -1,71 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RENDER_OUT_H__ -#define __MYGUI_RENDER_OUT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Utility.h" - -namespace MyGUI -{ - namespace implement - { - void MYGUI_EXPORT render_out(const std::string& _value); - } - - template inline - void MYGUI_OUT (T p) { implement::render_out(utility::toString(p)); } - - template inline - void MYGUI_OUT (T1 p1, T2 p2) { implement::render_out(utility::toString(p1, p2)); } - - template inline - void MYGUI_OUT (T1 p1, T2 p2, T3 p3) { implement::render_out(utility::toString(p1, p2, p3)); } - - template inline - void MYGUI_OUT (T1 p1, T2 p2, T3 p3, T4 p4) { implement::render_out(utility::toString(p1, p2, p3, p4)); } - - template inline - void MYGUI_OUT (T1 p1, T2 p2, T3 p3, T4 p4, T5 p5) { implement::render_out(utility::toString(p1, p2, p3, p4, p5)); } - - template inline - void MYGUI_OUT (T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6) { implement::render_out(utility::toString(p1, p2, p3, p4, p5, p6)); } - - template inline - void MYGUI_OUT (T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7) { implement::render_out(utility::toString(p1, p2, p3, p4, p5, p6, p7)); } - - template inline - void MYGUI_OUT (T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8) { implement::render_out(utility::toString(p1, p2, p3, p4, p5, p6, p7, p8)); } - - template inline - void MYGUI_OUT_SPACES (T1 p1, T2 p2) { implement::render_out(utility::toString(p1, " ", p2)); } - - template inline - void MYGUI_OUT_SPACES (T1 p1, T2 p2, T3 p3) { implement::render_out(utility::toString(p1, " ", p2, " ", p3)); } - - template inline - void MYGUI_OUT_SPACES (T1 p1, T2 p2, T3 p3, T4 p4) { implement::render_out(utility::toString(p1, " ", p2, " ", p3, " ", p4 )); } - -} // namespace MyGUI - -#endif // __MYGUI_RENDER_OUT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderTargetInfo.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderTargetInfo.h deleted file mode 100644 index bbded7394..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RenderTargetInfo.h +++ /dev/null @@ -1,65 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 05/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RENDER_TARGET_INFO_H__ -#define __MYGUI_RENDER_TARGET_INFO_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - struct MYGUI_EXPORT RenderTargetInfo - { - RenderTargetInfo() : - maximumDepth(0), - pixScaleX(1), - pixScaleY(1), - hOffset(0), - vOffset(0), - aspectCoef(1), - leftOffset(0), - topOffset(0) - { - } - - void setOffset(int _left, int _top) const - { - leftOffset = _left; - topOffset = _top; - } - - float maximumDepth; - float pixScaleX; - float pixScaleY; - float hOffset; - float vOffset; - float aspectCoef; - - mutable int leftOffset; - mutable int topOffset; - }; - - -} // namespace MyGUI - -#endif // __MYGUI_RENDER_TARGET_INFO_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceHolder.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceHolder.h deleted file mode 100644 index 505e5e8a9..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceHolder.h +++ /dev/null @@ -1,96 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RESOURCE_HOLDER_H__ -#define __MYGUI_RESOURCE_HOLDER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Enumerator.h" - -namespace MyGUI -{ - - template - class /*MYGUI_EXPORT */ResourceHolder - { - public: - typedef std::map MapResource; - typedef Enumerator EnumeratorPtr; - - virtual ~ResourceHolder() { } - public: - /** Check is resource exist */ - bool isExist(const std::string& _name) const - { - return mResources.find(_name) != mResources.end(); - } - - /** Find resource by name*/ - Type* findByName(const std::string& _name) const - { - typename MapResource::const_iterator item = mResources.find(_name); - return (item == mResources.end()) ? nullptr : item->second; - } - - /** Get resource by name*/ - Type* getByName(const std::string& _name, bool _throw = true) const - { - Type* result = findByName(_name); - MYGUI_ASSERT(result || !_throw, "Resource '" << _name << "' not found"); - return result; - } - - bool remove(const std::string& _name) - { - typename MapResource::const_iterator item = mResources.find(_name); - if (item != mResources.end()) - { - delete item->second; - mResources.erase(item->first); - return true; - } - return false; - } - - void clear() - { - for (typename MapResource::iterator item=mResources.begin(); item!=mResources.end(); ++item) - { - delete item->second; - } - mResources.clear(); - } - - EnumeratorPtr getEnumerator() - { - return EnumeratorPtr(mResources); - } - - size_t getCount() const { return mResources.size(); } - - protected: - MapResource mResources; - }; - -} // namespace MyGUI - -#endif // __MYGUI_RESOURCE_HOLDER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceImageSet.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceImageSet.h deleted file mode 100644 index 5699d06dc..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceImageSet.h +++ /dev/null @@ -1,139 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 09/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RESOURCE_IMAGE_SET_H__ -#define __MYGUI_RESOURCE_IMAGE_SET_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Macros.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_IResource.h" -#include "MyGUI_ImageInfo.h" -#include "MyGUI_Enumerator.h" -#include "MyGUI_ResourceManager.h" -#include "MyGUI_GenericFactory.h" - -namespace MyGUI -{ - - class ResourceImageSet; - typedef ResourceImageSet * ResourceImageSetPtr; - - struct IndexImage - { - std::string name; - float rate; - std::vector frames; - }; - typedef std::vector VectorIndexImage; - - struct GroupImage - { - std::string name; - std::string texture; - IntSize size; - VectorIndexImage indexes; - }; - typedef std::vector VectorGroupImage; - typedef Enumerator EnumeratorGroupImage; - - class MYGUI_EXPORT ResourceImageSet : - public IResource - { - friend class GenericFactory; - - MYGUI_RTTI_DERIVED( ResourceImageSet ) - - private: - ResourceImageSet() { } - virtual ~ResourceImageSet() { } - - virtual void deserialization(xml::ElementPtr _node, Version _version); - - //-------------------------------------------------------------// - private: - size_t getGroupIndex(const std::string& _name) - { - for (size_t index=0; index= mGroups.size()) return mSizeEmpty; - return mGroups[_index].size; - } - - const IntSize& getGroupSize(const std::string& _group) - { - for (size_t index=0; index mFramesEmpty; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_RESOURCE_IMAGE_SET_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceImageSetPointer.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceImageSetPointer.h deleted file mode 100644 index d41ddc50c..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceImageSetPointer.h +++ /dev/null @@ -1,54 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RESOURCE_IMAGE_SET_POINTER_H__ -#define __MYGUI_RESOURCE_IMAGE_SET_POINTER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_IPointer.h" -#include "MyGUI_ResourceImageSet.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT ResourceImageSetPointer : public IPointer - { - MYGUI_RTTI_DERIVED( ResourceImageSetPointer ) - - public: - ResourceImageSetPointer(); - virtual ~ResourceImageSetPointer() { } - - virtual void deserialization(xml::ElementPtr _node, Version _version); - - virtual void setImage(StaticImage* _image); - virtual void setPosition(StaticImage* _image, const IntPoint& _point); - - private: - IntPoint mPoint; - IntSize mSize; - ResourceImageSetPtr mImageSet; - }; - -} // namespace MyGUI - -#endif // __MYGUI_RESOURCE_IMAGE_SET_POINTER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceManager.h deleted file mode 100644 index 0aeddff6b..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceManager.h +++ /dev/null @@ -1,102 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 09/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RESOURCE_MANAGER_H__ -#define __MYGUI_RESOURCE_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Instance.h" -#include "MyGUI_Enumerator.h" -#include "MyGUI_Guid.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_IResource.h" -#include "MyGUI_ResourceHolder.h" -#include "MyGUI_Delegate.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT ResourceManager : - public ResourceHolder - { - MYGUI_INSTANCE_HEADER( ResourceManager ) - - public: - void initialise(); - void shutdown(); - - public: - - /** Load additional MyGUI *_resource.xml file */ - bool load(const std::string& _file); - - bool _loadImplement(const std::string& _file, bool _match, const std::string& _type, const std::string& _instance); - void _load(xml::ElementPtr _node, const std::string& _file, Version _version); - void _loadList(xml::ElementPtr _node, const std::string& _file, Version _version); - - /** Get resource by GUID */ - IResourcePtr getByID(const Guid& _id, bool _throw = true); - - std::string getFileNameByID(const Guid& _id); - - void addResource(IResourcePtr _item); - - void removeResource(IResourcePtr _item); - - typedef delegates::CDelegate3 LoadXmlDelegate; - - LoadXmlDelegate& registerLoadXmlDelegate(const std::string& _key); - - void unregisterLoadXmlDelegate(const std::string& _key); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : size_t ResourceManager::getCount()") - size_t getResourceCount() { return getCount(); } - - MYGUI_OBSOLETE("use : IResourcePtr ResourceManager::getByName(const std::string& _name, bool _throw)") - IResourcePtr getResource(const std::string& _name, bool _throw = true) { return getByName(_name, _throw); } - - MYGUI_OBSOLETE("use : IResourcePtr ResourceManager::getByID(const Guid& _id, bool _throw)") - IResourcePtr getResource(const Guid& _id, bool _throw = true) { return getByID(_id, _throw); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - private: - typedef std::map MapResourceID; - MapResourceID mResourcesID; - - // карта с делегатами для парсинга хмл блоков - typedef std::map MapLoadXmlDelegate; - MapLoadXmlDelegate mMapLoadXmlDelegate; - - std::string mResourceGroup; - typedef std::vector VectorGuid; - typedef std::map MapVectorString; - - MapVectorString mListFileGuid; - }; - -} // namespace MyGUI - -#endif // __MYGUI_RESOURCE_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceManualFont.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceManualFont.h deleted file mode 100644 index b531cd3f4..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceManualFont.h +++ /dev/null @@ -1,83 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RESOURCE_MANUAL_FONT_H__ -#define __MYGUI_RESOURCE_MANUAL_FONT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_ITexture.h" -#include "MyGUI_IFont.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT ResourceManualFont : - public IFont - { - MYGUI_RTTI_DERIVED( ResourceManualFont ) - - private: - typedef std::vector VectorRangeInfo; - typedef std::vector VectorPairCodeCoord; - - public: - ResourceManualFont(); - virtual ~ResourceManualFont(); - - virtual void deserialization(xml::ElementPtr _node, Version _version); - - virtual GlyphInfo* getGlyphInfo(Char _id); - - virtual ITexture* getTextureFont() { return mTexture; } - - // , - virtual int getDefaultHeight() { return mDefaultHeight; } - - private: - void addGlyph(Char _index, const IntCoord& _coord); - - void initialise(); - - void addGlyph(GlyphInfo * _info, Char _index, int _left, int _top, int _right, int _bottom, int _finalw, int _finalh, float _aspect, int _addHeight = 0); - - void addRange(VectorPairCodeCoord& _info, size_t _first, size_t _last, int _width, int _height, float _aspect); - void checkTexture(); - - private: - std::string mSource; - int mDefaultHeight; - - // - GlyphInfo mSpaceGlyphInfo; - - // - VectorPairCodeCoord mVectorPairCodeCoord; - - // - VectorRangeInfo mVectorRangeInfo; - - MyGUI::ITexture* mTexture; - }; - -} // namespace MyGUI - -#endif // __MYGUI_RESOURCE_MANUAL_FONT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceManualPointer.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceManualPointer.h deleted file mode 100644 index 277d1ee7f..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceManualPointer.h +++ /dev/null @@ -1,55 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RESOURCE_MANUAL_POINTER_H__ -#define __MYGUI_RESOURCE_MANUAL_POINTER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_IPointer.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT ResourceManualPointer : - public IPointer - { - MYGUI_RTTI_DERIVED( ResourceManualPointer ) - - public: - ResourceManualPointer() { } - virtual ~ResourceManualPointer() { } - - virtual void deserialization(xml::ElementPtr _node, Version _version); - - virtual void setImage(StaticImage* _image); - virtual void setPosition(StaticImage* _image, const IntPoint& _point); - - private: - IntPoint mPoint; - IntSize mSize; - FloatRect mOffset; - std::string mTexture; - }; - -} // namespace MyGUI - -#endif // __MYGUI_RESOURCE_MANUAL_POINTER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceSkin.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceSkin.h deleted file mode 100644 index 01b6adcbd..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceSkin.h +++ /dev/null @@ -1,86 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RESOURCE_SKIN_H__ -#define __MYGUI_RESOURCE_SKIN_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_SubWidgetBinding.h" -#include "MyGUI_ChildSkinInfo.h" -#include "MyGUI_MaskPickInfo.h" -#include "MyGUI_IResource.h" -#include "MyGUI_SubWidgetInfo.h" - -namespace MyGUI -{ - - // вспомогательный класс для инициализации одного скина - class MYGUI_EXPORT ResourceSkin : - public IResource - { - MYGUI_RTTI_DERIVED( ResourceSkin ) - - public: - ResourceSkin(); - - virtual void deserialization(xml::ElementPtr _node, Version _version); - - const IntSize& getSize() const { return mSize; } - const std::string& getTextureName() const { return mTexture; } - const VectorSubWidgetInfo& getBasisInfo() const { return mBasis; } - const MapWidgetStateInfo& getStateInfo() const { return mStates; } - const MapString& getProperties() const { return mProperties; } - const VectorChildSkinInfo& getChild() const { return mChilds; } - MaskPickInfo const * getMask() const { return &mMaskPeek; } - const std::string& getSkinName() { return mSkinName; } - - private: - void setInfo(const IntSize& _size, const std::string &_texture); - void addInfo(const SubWidgetBinding& _bind); - void addProperty(const std::string &_key, const std::string &_value); - void addChild(const ChildSkinInfo& _child); - bool loadMask(const std::string& _file); - void clear(); - - void checkState(const MapStateInfo& _states); - void checkState(const std::string& _name); - void checkBasis(); - void fillState(const MapStateInfo& _states, size_t _index); - - private: - IntSize mSize; - std::string mTexture; - VectorSubWidgetInfo mBasis; - MapWidgetStateInfo mStates; - // дополнительные параметры скина - MapString mProperties; - // дети скина - VectorChildSkinInfo mChilds; - // маска для этого скина для пикинга - MaskPickInfo mMaskPeek; - std::string mSkinName; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_RESOURCE_SKIN_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceTrueTypeFont.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceTrueTypeFont.h deleted file mode 100644 index 6754d9c9a..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ResourceTrueTypeFont.h +++ /dev/null @@ -1,105 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 06/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_RESOURCE_TRUE_TYPE_FONT_H__ -#define __MYGUI_RESOURCE_TRUE_TYPE_FONT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_ITexture.h" -#include "MyGUI_IFont.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT ResourceTrueTypeFont : - public IFont - { - MYGUI_RTTI_DERIVED( ResourceTrueTypeFont ) - - public: - typedef std::vector VectorPairCodePoint; - typedef std::vector VectorRangeInfo; - typedef std::vector VectorPairCodeCoord; - - public: - ResourceTrueTypeFont(); - virtual ~ResourceTrueTypeFont(); - - virtual void deserialization(xml::ElementPtr _node, Version _version); - - virtual GlyphInfo* getGlyphInfo(Char _id); - - virtual ITexture* getTextureFont() { return mTexture; } - - // получившаяся высота при генерации в пикселях - virtual int getDefaultHeight() { return mHeightPix; } - - private: - void addCodePointRange(Char _first, Char _second); - void addHideCodePointRange(Char _first, Char _second); - - // проверяет, входит ли символ в зоны ненужных символов - bool checkHidePointCode(Char _id); - - /** Clear the list of code point ranges. */ - void clearCodePointRanges(); - - void initialise(); - - void addGlyph(GlyphInfo * _info, Char _index, int _left, int _top, int _right, int _bottom, int _finalw, int _finalh, float _aspect, int _addHeight = 0); - // write 2 or 4 bytes into buffer: LA or LLLA if _rgba is true - uint8* writeData(uint8* _pDest, unsigned char _luminance, unsigned char _alpha, bool _rgba); - - private: - // Source of the font - std::string mSource; - // Size of the truetype font, in points - float mTtfSize; - // Resolution (dpi) of truetype font - uint mTtfResolution; - - bool mAntialiasColour; - - int mDistance; - int mSpaceWidth; - int mTabWidth; - int mCursorWidth; - int mSelectionWidth; - int mOffsetHeight; - int mHeightPix; - - // отдельная информация о символах - GlyphInfo mSpaceGlyphInfo, mTabGlyphInfo, mSelectGlyphInfo, mSelectDeactiveGlyphInfo, mCursorGlyphInfo; - - // символы которые не нужно рисовать - VectorPairCodePoint mVectorHideCodePoint; - - // вся информация о символах - VectorRangeInfo mVectorRangeInfo; - - MyGUI::ITexture* mTexture; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_RESOURCE_TRUE_TYPE_FONT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RotatingSkin.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RotatingSkin.h deleted file mode 100644 index 80847841f..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_RotatingSkin.h +++ /dev/null @@ -1,77 +0,0 @@ -/*! - @file - @author George Evmenov - @date 05/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_ROTATING_SKIN_H__ -#define __MYGUI_ROTATING_SKIN_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_Types.h" -#include "MyGUI_ICroppedRectangle.h" -#include "MyGUI_SubSkin.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT RotatingSkin : public SubSkin - { - MYGUI_RTTI_DERIVED( RotatingSkin ) - - public: - RotatingSkin(); - virtual ~RotatingSkin(); - - /** Set angle of rotation */ - void setAngle(float _angle); - /** Get angle of rotation */ - float getAngle() const { return mAngle; } - - /** Set center of rotation - @param _center Center point. - @param _local If true - _center point calculated as point on SubWidget, else calculated as point on screen. - */ - void setCenter(const IntPoint &_center, bool _local = true); - /** Get center of rotation */ - IntPoint getCenter(bool _local = true) const; - - // - virtual void doRender(); - - protected: - void recalculateAngles(); - - private: - float mAngle; - IntPoint mCenterPos; - bool mLocalCenter; - - /* - 0 3 - 1 2 - */ - float mBaseAngles[4]; - float mBaseDistances[4]; - }; - -} // namespace MyGUI - -#endif // __MYGUI_ROTATING_SKIN_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ScrollView.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ScrollView.h deleted file mode 100644 index e59bbe04a..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ScrollView.h +++ /dev/null @@ -1,156 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 08/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_SCROLL_VIEW_H__ -#define __MYGUI_SCROLL_VIEW_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Widget.h" -#include "MyGUI_ScrollViewBase.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT ScrollView : - public Widget, - protected ScrollViewBase - { - MYGUI_RTTI_DERIVED( ScrollView ) - - public: - ScrollView(); - - //! @copydoc Widget::setPosition(const IntPoint& _value) - virtual void setPosition(const IntPoint& _value); - //! @copydoc Widget::setSize(const IntSize& _value) - virtual void setSize(const IntSize& _value); - //! @copydoc Widget::setCoord(const IntCoord& _value) - virtual void setCoord(const IntCoord& _value); - - /** @copydoc Widget::setPosition(int _left, int _top) */ - void setPosition(int _left, int _top) { setPosition(IntPoint(_left, _top)); } - /** @copydoc Widget::setSize(int _width, int _height) */ - void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); } - /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ - void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); } - - /** Show VScroll when text size larger than Edit */ - void setVisibleVScroll(bool _value); - /** Get Show VScroll flag */ - bool isVisibleVScroll() { return mVisibleVScroll; } - - /** Show HScroll when text size larger than Edit */ - void setVisibleHScroll(bool _value); - /** Get Show HScroll flag */ - bool isVisibleHScroll() { return mVisibleHScroll; } - - /** Set canvas align */ - void setCanvasAlign(Align _value); - /** Get canvas align */ - Align getCanvasAlign() { return mContentAlign; } - - /** Set canvas size */ - void setCanvasSize(const IntSize& _value); - /** Set canvas size */ - void setCanvasSize(int _width, int _height) { setCanvasSize(IntSize(_width, _height)); } - /** Get canvas size */ - IntSize getCanvasSize(); - - /** Get rect where child widgets placed */ - const IntCoord& getClientCoord(); - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void Widget::setCoord(const IntCoord& _coord)") - void setPosition(const IntCoord& _coord) { setCoord(_coord); } - MYGUI_OBSOLETE("use : void Widget::setCoord(int _left, int _top, int _width, int _height)") - void setPosition(int _left, int _top, int _width, int _height) { setCoord(_left, _top, _width, _height); } - - MYGUI_OBSOLETE("use : void ScrollView::setVisibleVScroll(bool _visible)") - void showVScroll(bool _visible) { setVisibleVScroll(_visible); } - MYGUI_OBSOLETE("use : bool ScrollView::isVisibleVScroll()") - bool isShowVScroll() { return isVisibleVScroll(); } - MYGUI_OBSOLETE("use : void ScrollView::setVisibleHScroll(bool _visible)") - void showHScroll(bool _visible) { setVisibleHScroll(_visible); } - MYGUI_OBSOLETE("use : bool ScrollView::isVisibleHScroll()") - bool isShowHScroll() { return isVisibleHScroll(); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - protected: - virtual ~ScrollView(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - // переопределяем для присвоению холста - virtual Widget* baseCreateWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name); - - void notifyMouseSetFocus(Widget* _sender, Widget* _old); - void notifyMouseLostFocus(Widget* _sender, Widget* _new); - void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id); - void notifyMouseReleased(Widget* _sender, int _left, int _top, MouseButton _id); - - void notifyScrollChangePosition(VScroll* _sender, size_t _position); - void notifyMouseWheel(Widget* _sender, int _rel); - - virtual void onKeyLostFocus(Widget* _new); - virtual void onKeySetFocus(Widget* _old); - - void updateScrollViewState(); - void updateView(); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - // размер данных - virtual IntSize getContentSize(); - // смещение данных - virtual IntPoint getContentPosition(); - virtual void setContentPosition(const IntPoint& _point); - // размер окна, через которые видно данные - virtual IntSize getViewSize() const; - // размер на который прокручиваются данные при щелчке по скролу - virtual size_t getVScrollPage(); - virtual size_t getHScrollPage(); - - virtual Align getContentAlign() { return mContentAlign; } - - protected: - bool mIsFocus; - bool mIsPressed; - - Widget* mScrollClient; - Align mContentAlign; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_SCROLL_VIEW_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ScrollViewBase.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ScrollViewBase.h deleted file mode 100644 index 4ec39e274..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ScrollViewBase.h +++ /dev/null @@ -1,75 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 10/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_SCROLL_VIEW_BASE_H__ -#define __MYGUI_SCROLL_VIEW_BASE_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" - -namespace MyGUI -{ - - class ScrollViewBase - { - - protected: - ScrollViewBase(); - virtual ~ScrollViewBase() { } - - void updateScrollSize(); - void updateScrollPosition(); - - // - virtual IntSize getContentSize() { return IntSize(); } - // - virtual IntPoint getContentPosition() { return IntPoint(); } - virtual void setContentPosition(const IntPoint& _value) { } - // , - virtual IntSize getViewSize() const { return IntSize(); } - // - virtual size_t getHScrollPage() { return 1; } - virtual size_t getVScrollPage() { return 1; } - - virtual Align getContentAlign() { return Align::Center; } - - virtual void eraseContent() { } - - protected: - VScroll* mVScroll; - HScroll* mHScroll; - Widget* mClient; - - bool mVisibleHScroll; - bool mVisibleVScroll; - - size_t mVRange; - size_t mHRange; - - // - bool mChangeContentByResize; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_SCROLL_VIEW_BASE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SharedLayer.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SharedLayer.h deleted file mode 100644 index efa6611a1..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SharedLayer.h +++ /dev/null @@ -1,75 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_SHARED_LAYER_H__ -#define __MYGUI_SHARED_LAYER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include "MyGUI_ILayer.h" -#include "MyGUI_SharedLayerNode.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT SharedLayer : - public ILayer - { - MYGUI_RTTI_DERIVED( SharedLayer ) - - public: - SharedLayer(); - virtual ~SharedLayer(); - - virtual void deserialization(xml::ElementPtr _node, Version _version); - - // - virtual ILayerNode* createChildItemNode(); - // - virtual void destroyChildItemNode(ILayerNode* _node); - - // - virtual void upChildItemNode(ILayerNode* _node); - - // - virtual EnumeratorILayerNode getEnumerator(); - - // - virtual ILayerItem* getLayerItemByPoint(int _left, int _top); - - virtual IntPoint getPosition(int _left, int _top) const; - - virtual const IntSize& getSize() const; - - // - virtual void renderToTarget(IRenderTarget* _target, bool _update); - - virtual void dumpStatisticToLog(); - - protected: - bool mIsPick; - SharedLayerNode* mChildItem; - }; - -} // namespace MyGUI - -#endif // __MYGUI_SHARED_LAYER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SharedLayerNode.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SharedLayerNode.h deleted file mode 100644 index 8b8149e55..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SharedLayerNode.h +++ /dev/null @@ -1,50 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 05/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_SHARED_LAYER_NODE_H__ -#define __MYGUI_SHARED_LAYER_NODE_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_LayerNode.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT SharedLayerNode : public LayerNode - { - MYGUI_RTTI_DERIVED( SharedLayerNode ) - - public: - explicit SharedLayerNode(ILayer* _layer, ILayerNode* _parent = nullptr); - virtual ~SharedLayerNode(); - - void addUsing() { mCountUsing++; } - void removeUsing() { mCountUsing--; } - size_t countUsing() { return mCountUsing; } - - private: - size_t mCountUsing; - }; - -} // namespace MyGUI - -#endif // __MYGUI_SHARED_LAYER_NODE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SimpleText.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SimpleText.h deleted file mode 100644 index 4998cfd94..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SimpleText.h +++ /dev/null @@ -1,51 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_SIMPLE_TEXT_H__ -#define __MYGUI_SIMPLE_TEXT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_Types.h" -#include "MyGUI_ISubWidgetText.h" -#include "MyGUI_EditText.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT SimpleText : public EditText - { - MYGUI_RTTI_DERIVED( SimpleText ) - - public: - SimpleText(); - virtual ~SimpleText(); - - virtual void setViewOffset(const IntPoint& _point); - - virtual void doRender(); - - }; - -} // namespace MyGUI - -#endif // __MYGUI_SIMPLE_TEXT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SkinManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SkinManager.h deleted file mode 100644 index e7a88efff..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SkinManager.h +++ /dev/null @@ -1,73 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_SKIN_MANAGER_H__ -#define __MYGUI_SKIN_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Instance.h" -#include "MyGUI_Enumerator.h" -#include "MyGUI_ResourceSkin.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_ResourceManager.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT SkinManager - { - MYGUI_INSTANCE_HEADER( SkinManager ) - - public: - void initialise(); - void shutdown(); - - /** Load additional MyGUI *_skin.xml file */ - bool load(const std::string& _file); - void _load(xml::ElementPtr _node, const std::string& _file, Version _version); - - ResourceSkin* getByName(const std::string& _name) const; - - bool isExist(const std::string& _name) const; - - const std::string getDefaultSkin() const { return mDefaultName; } - void setDefaultSkin(const std::string& _value); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : ResourceSkin* SkinManager::getByName(const std::string& _name)") - ResourceSkin* getSkin(const std::string& _name) const { return getByName(_name); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - private: - void createDefault(const std::string& _value); - - private: - std::string mDefaultName; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_SKIN_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_StaticImage.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_StaticImage.h deleted file mode 100644 index 945976d7e..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_StaticImage.h +++ /dev/null @@ -1,246 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_STATIC_IMAGE_H__ -#define __MYGUI_STATIC_IMAGE_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Widget.h" -#include "MyGUI_ResourceImageSet.h" -#include "MyGUI_ImageInfo.h" -#include "MyGUI_Guid.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT StaticImage : - public Widget - { - MYGUI_RTTI_DERIVED( StaticImage ) - - public: - StaticImage(); - - //------------------------------------------------------------------------------// - // The simple interface - //------------------------------------------------------------------------------// - - /* Set texture and size of image _tile - @param _texture file name or texture name - @param _coord - part of texture where we take tiles - @param _tile size - */ - void setImageInfo(const std::string& _texture, const IntCoord& _coord, const IntSize& _tile); - - /* Set texture - @param _texture file name or texture name - */ - void setImageTexture(const std::string& _value); - - /** Set _rect - part of texture where we take tiles */ - void setImageRect(const IntRect& _value); - - /** Set _coord - part of texture where we take tiles */ - void setImageCoord(const IntCoord& _value); - - /** Set _tile size */ - void setImageTile(const IntSize& _value); - - /** Set current tile index - @param _index - tile index - @remarks Tiles in file start numbering from left to right and from top to bottom. - \n \bExample:\n -
-				+---+---+---+
-				| 0 | 1 | 2 |
-				+---+---+---+
-				| 3 | 4 | 5 |
-				+---+---+---+
-			
- */ - void setImageIndex(size_t _index); - /** Get current tile index */ - size_t getImageIndex(); - - //------------------------------------------------------------------------------// - // The expanded interface - //------------------------------------------------------------------------------// - - //! Get number of items - size_t getItemCount() const { return mItems.size(); } - - //! Select specified _index - void setItemSelect(size_t _index); - //! Get index of selected item (ITEM_NONE if none selected) - size_t getItemSelect() { return mIndexSelect; } - //! Reset item selection - void resetItemSelect() { setItemSelect(ITEM_NONE); } - - //! Insert an item into a list at a specified position - void insertItem(size_t _index, const IntCoord& _item); - //! Add an item to the end of a list - void addItem(const IntCoord& _item) { insertItem(ITEM_NONE, _item); } - //! Replace an item at a specified position - void setItem(size_t _index, const IntCoord& _item); - - //! Delete item at a specified position - void deleteItem(size_t _index); - //! Delete all items - void deleteAllItems(); - - // работа с фреймами анимированных индексов - /** Add frame - @param _index Image item index - @param _item Frame coordinates at image texture - */ - void addItemFrame(size_t _index, const IntCoord& _item); - - /** Insert frame - @param _index Image item index - @param _indexFrame Frame index where we insert frame - @param _item Frame coordinates at image texture - */ - void insertItemFrame(size_t _index, size_t _indexFrame, const IntCoord& _item); - - /** Add copy of frame (similar to StaticImage::addItemFrame but we copy frame coordinates) - @param _index Image item index - @param _indexSourceFrame Frame index of frame that we copying - */ - void addItemFrameDublicate(size_t _index, size_t _indexSourceFrame); - - /** Insert copy of frame (similar to StaticImage::insertItemFrame but we copy frame coordinates) - @param _index Image item index - @param _indexFrame Frame index where we insert frame - @param _indexSourceFrame Frame index of frame that we copying - */ - void insertItemFrameDublicate(size_t _index, size_t _indexFrame, size_t _indexSourceFrame); - - /** Change frame - @param _index Image item index - @param _indexFrame Frame index to change - @param _item Frame coordinates at image texture - */ - void setItemFrame(size_t _index, size_t _indexFrame, const IntCoord& _item); - - /** Delete frame - @param _index Image item index - @param _indexFrame Frame index that we delete - */ - void deleteItemFrame(size_t _index, size_t _indexFrame); - - /** Delete all frames - @param _index Image item index - */ - void deleteAllItemFrames(size_t _index); - - /** Set item frame rate - @param _index Image item index - @param _rate Duration of one frame in seconds - */ - void setItemFrameRate(size_t _index, float _rate); - - /** Get item frame rate - @param _index Image item index - */ - float getItemFrameRate(size_t _index); - - //------------------------------------------------------------------------------// - // The interface with support of resources - //------------------------------------------------------------------------------// - - /** Select current items resource used in StaticImage - @param _id Resource guid - @return false if resource with such guid not exist - */ - bool setItemResource(const Guid& _id); - - /** Select current items resource used in StaticImage - @param _id Resource name - @return false if resource with such name not exist - */ - bool setItemResource(const std::string& _name); - - /** Select current item group */ - void setItemGroup(const std::string& _value); - /** Select current item mane */ - void setItemName(const std::string& _value); - - /** Select current items resource used in StaticImage - @param _resource Resource pointer - */ - void setItemResourcePtr(ResourceImageSetPtr _resource); - /** Set current item */ - void setItemResourceInfo(const ImageIndexInfo& _info); - - /** Get current items resource used in StaticImage */ - ResourceImageSetPtr getItemResource() { return mResource; } - /** Select current item resource, group and name */ - void setItemResourceInfo(ResourceImageSetPtr _resource, const std::string& _group, const std::string& _name); - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - protected: - virtual ~StaticImage(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - void frameEntered(float _frame); - - void recalcIndexes(); - void updateSelectIndex(size_t _index); - - void frameAdvise(bool _advise); - - private: - // кусок в текстуре наших картинок - IntRect mRectImage; - // размер одной картинки - IntSize mSizeTile; - // размер текстуры - IntSize mSizeTexture; - // текущая картинка - size_t mIndexSelect; - - VectorImages mItems; - - bool mFrameAdvise; - float mCurrentTime; - size_t mCurrentFrame; - - ResourceImageSetPtr mResource; - std::string mItemName; - std::string mItemGroup; - std::string mCurrentTextureName; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_STATIC_IMAGE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_StaticText.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_StaticText.h deleted file mode 100644 index 146d03f66..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_StaticText.h +++ /dev/null @@ -1,85 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_STATIC_TEXT_H__ -#define __MYGUI_STATIC_TEXT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Widget.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT StaticText : - public Widget - { - MYGUI_RTTI_DERIVED( StaticText ) - - public: - StaticText(); - - /** Get text region coordinate */ - IntCoord getTextRegion(); - - /** Get text region size */ - IntSize getTextSize(); - - /** Set widget text font */ - virtual void setFontName(const std::string& _value); - /** Get widget text font name */ - const std::string& getFontName(); - - /** Set widget text font height */ - virtual void setFontHeight(int _value); - /** Get widget text font height */ - int getFontHeight(); - - /** Set widget text align */ - virtual void setTextAlign(Align _value); - /** Get widget text align */ - Align getTextAlign(); - - /** Set widget text colour */ - virtual void setTextColour(const Colour& _value); - /** Get widget text colour */ - const Colour& getTextColour(); - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - protected: - virtual ~StaticText(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - }; - -} // namespace MyGUI - -#endif // __MYGUI_STATIC_TEXT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SubSkin.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SubSkin.h deleted file mode 100644 index 80b97ab91..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SubSkin.h +++ /dev/null @@ -1,84 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 02/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_SUB_SKIN_H__ -#define __MYGUI_SUB_SKIN_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_ISubWidgetRect.h" -#include "MyGUI_ResourceSkin.h" -#include "MyGUI_IStateInfo.h" - -namespace MyGUI -{ - - class RenderItem; - - class MYGUI_EXPORT SubSkin : - public ISubWidgetRect - { - MYGUI_RTTI_DERIVED( SubSkin ) - - public: - SubSkin(); - virtual ~SubSkin(); - - void setAlpha(float _alpha); - - virtual void setVisible(bool _visible); - - virtual void setStateData(IStateInfo* _data); - - virtual void createDrawItem(ITexture* _texture, ILayerNode * _node); - virtual void destroyDrawItem(); - - // метод для отрисовки себя - virtual void doRender(); - - /*internal:*/ - void _updateView(); - void _correctView(); - - void _setAlign(const IntSize& _oldsize, bool _update); - void _setAlign(const IntCoord& _oldcoord, bool _update); - - virtual void _setUVSet(const FloatRect& _rect); - virtual void _setColour(const Colour& _value); - - protected: - FloatRect mRectTexture; - bool mEmptyView; - - uint32 mCurrentColour; - - FloatRect mCurrentTexture; - IntCoord mCurrentCoord; - - ILayerNode* mNode; - RenderItem* mRenderItem; - }; - -} // namespace MyGUI - -#endif // __MYGUI_SUB_SKIN_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SubWidgetBinding.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SubWidgetBinding.h deleted file mode 100644 index b6388b2b6..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SubWidgetBinding.h +++ /dev/null @@ -1,88 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_SUB_WIDGET_BINDING_H__ -#define __MYGUI_SUB_WIDGET_BINDING_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_ISubWidget.h" - -namespace MyGUI -{ - - // вспомогательный класс для инициализации сабскинов - class MYGUI_EXPORT SubWidgetBinding - { - // для доступа к внутренним членам - friend class ResourceSkin; - - public: - SubWidgetBinding() - { - clear(); - } - - SubWidgetBinding(const IntCoord& _coord, Align _aligin, const std::string& _type) - { - create(_coord, _aligin, _type); - } - - void create(const IntCoord& _coord, Align _aligin, const std::string& _type) - { - clear(); - mOffset = _coord; - mAlign = _aligin; - mType = _type; - } - - void clear() - { - mType = ""; - mAlign = Align::Default; - mStates.clear(); - } - - void add(const std::string& _name, IStateInfo* _data, const std::string& _skin) - { - // ищем такой же ключ - MapStateInfo::const_iterator iter = mStates.find(_name); - if (iter != mStates.end()) - { - delete _data; - MYGUI_LOG(Warning, "state with name '" << _name << "' already exist in skin '" << _skin << "'"); - return; - } - // добавляем - mStates[_name] = _data; - } - - private: - IntCoord mOffset; - Align mAlign; - std::string mType; - MapStateInfo mStates; - }; - -} // namespace MyGUI - - -#endif // __MYGUI_SUB_WIDGET_BINDING_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SubWidgetInfo.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SubWidgetInfo.h deleted file mode 100644 index 0d2bd1e45..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SubWidgetInfo.h +++ /dev/null @@ -1,50 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 26/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_SUB_WIDGET_INFO_H__ -#define __MYGUI_SUB_WIDGET_INFO_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - // , - struct SubWidgetInfo - { - SubWidgetInfo(const std::string& _type, const IntCoord& _coord, Align _align) : - coord(_coord), - align(_align), - type(_type) - { - } - - IntCoord coord; - Align align; - std::string type; - }; - - typedef std::vector VectorSubWidgetInfo; - -} // namespace MyGUI - -#endif // __MYGUI_SUB_WIDGET_INFO_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SubWidgetManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SubWidgetManager.h deleted file mode 100644 index cfbeb4a93..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_SubWidgetManager.h +++ /dev/null @@ -1,44 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_SUB_WIDGET_MANAGER_H__ -#define __MYGUI_SUB_WIDGET_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Instance.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT SubWidgetManager - { - MYGUI_INSTANCE_HEADER( SubWidgetManager ) - - public: - void initialise(); - void shutdown(); - - }; - -} // namespace MyGUI - -#endif // __MYGUI_SUB_WIDGET_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TCoord.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TCoord.h deleted file mode 100644 index 165e0aa56..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TCoord.h +++ /dev/null @@ -1,229 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MyGUI_TCOORD_H__ -#define __MyGUI_TCOORD_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_TPoint.h" -#include "MyGUI_TSize.h" - -namespace MyGUI -{ - namespace types - { - - template< typename T > struct TCoord - { - T left, top, width, height; - - TCoord() : left( 0 ), top( 0 ), width( 0 ), height( 0 ) { } - TCoord( T const& _left, T const& _top, T const& _width, T const& _height ) : left( _left ), top( _top ), width( _width ), height( _height ) { } - TCoord( TCoord const& _obj ) : left( _obj.left ), top( _obj.top ), width( _obj.width ), height( _obj.height ) { } - TCoord( TPoint const& _point, TSize const& _size ) : left( _point.left ), top( _point.top ), width( _size.width ), height( _size.height ) { } - - TCoord& operator-=( TCoord const& _obj ) - { - left -= _obj.left; - top -= _obj.top; - width -= _obj.width; - height -= _obj.height; - return *this; - } - - TCoord& operator+=( TCoord const& _obj ) - { - left += _obj.left; - top += _obj.top; - width += _obj.width; - height += _obj.height; - return *this; - } - - TCoord operator-( TCoord const& _obj ) const - { - return TCoord(left - _obj.left, top - _obj.top, width - _obj.width, height - _obj.height); - } - - TCoord operator-( TPoint const& _obj ) const - { - return TCoord(left - _obj.left, top - _obj.top, width, height); - } - - TCoord operator-( TSize const& _obj ) const - { - return TCoord(left, top, width - _obj.width, height - _obj.height); - } - - TCoord operator+( TCoord const& _obj ) const - { - return TCoord(left + _obj.left, top + _obj.top, width + _obj.width, height + _obj.height); - } - - TCoord operator+( TPoint const& _obj ) const - { - return TCoord(left + _obj.left, top + _obj.top, width, height); - } - - TCoord operator+( TSize const& _obj ) const - { - return TCoord(left, top, width + _obj.width, height + _obj.height); - } - - TCoord& operator=( TCoord const& _obj ) - { - left = _obj.left; - top = _obj.top; - width = _obj.width; - height = _obj.height; - return *this; - } - - template< typename U > - TCoord& operator=( TCoord const& _obj ) - { - left = _obj.left; - top = _obj.top; - width = _obj.width; - height = _obj.height; - return *this; - } - - TCoord& operator=( TPoint const& _obj ) - { - left = _obj.left; - top = _obj.top; - return *this; - } - - TCoord& operator=( TSize const& _obj ) - { - width = _obj.width; - height = _obj.height; - return *this; - } - - - bool operator==( TCoord const& _obj ) const - { - return ((left == _obj.left) && (top == _obj.top) && (width == _obj.width) && (height == _obj.height)); - } - - bool operator!=( TCoord const& _obj ) const - { - return ! ((left == _obj.left) && (top == _obj.top) && (width == _obj.width) && (height == _obj.height)); - } - - T right() const - { - return left + width; - } - - T bottom() const - { - return top + height; - } - - void clear() - { - left = top = width = height = 0; - } - - void set( T const& _left, T const& _top, T const& _width, T const& _height ) - { - left = _left; - top = _top; - width = _width; - height = _height; - } - - void swap(TCoord& _value) - { - TCoord tmp = _value; - _value = *this; - *this = tmp; - } - - bool empty() const - { - return ((left == 0) && (top == 0) && (width == 0) && (height == 0)); - } - - TPoint point() const - { - return TPoint(left, top); - } - - TSize size() const - { - return TSize(width, height); - } - - bool inside(const TPoint& _value) const - { - return ( (_value.left >= left) && (_value.left <= right()) && (_value.top >= top) && (_value.top <= bottom()) ); - } - - std::string print() const - { - std::ostringstream stream; - stream << *this; - return stream.str(); - } - - static TCoord parse(const std::string& _value) - { - TCoord result; - std::istringstream stream(_value); - stream >> result.left >> result.top >> result.width >> result.height; - if (stream.fail()) return TCoord(); - else - { - int item = stream.get(); - while (item != -1) - { - if (item != ' ' && item != '\t') return TCoord(); - item = stream.get(); - } - } - return result; - } - - friend std::ostream& operator << ( std::ostream& _stream, const TCoord& _value ) - { - _stream << _value.left << " " << _value.top << " " << _value.width << " " << _value.height; - return _stream; - } - - friend std::istream& operator >> ( std::istream& _stream, TCoord& _value ) - { - _stream >> _value.left >> _value.top >> _value.width >> _value.height; - if (_stream.fail()) _value.clear(); - return _stream; - } - - }; - - } // namespace types -} // namespace MyGUI - -#endif // __MyGUI_TCOORD_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TPoint.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TPoint.h deleted file mode 100644 index bfeb692f9..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TPoint.h +++ /dev/null @@ -1,155 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_TPONT_H__ -#define __MYGUI_TPONT_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - namespace types - { - template< typename T > struct TPoint - { - T left, top; - - TPoint() : left( 0 ), top( 0 ) { } - TPoint( T const& _left, T const& _top) : left( _left ), top( _top ) { } - TPoint( TPoint const& o ) : left( o.left ), top( o.top ) { } - - TPoint& operator-=( TPoint const& o ) - { - left -= o.left; - top -= o.top; - return *this; - } - - TPoint& operator+=( TPoint const& o ) - { - left += o.left; - top += o.top; - return *this; - } - - TPoint operator-( TPoint const& o ) const - { - return TPoint(left - o.left, top - o.top); - } - - TPoint operator+( TPoint const& o ) const - { - return TPoint(left + o.left, top + o.top); - } - - TPoint& operator=( TPoint const& o ) - { - left = o.left; - top = o.top; - return *this; - } - - template< typename U > - TPoint& operator=( TPoint const& o ) - { - left = o.left; - top = o.top; - return *this; - } - - bool operator==( TPoint const& o ) const - { - return ((left == o.left) && (top == o.top)); - } - - bool operator!=( TPoint const& o ) const - { - return ! ((left == o.left) && (top == o.top)); - } - - void clear() - { - left = top = 0; - } - - void set( T const& _left, T const& _top) - { - left = _left; - top = _top; - } - - void swap(TPoint& _value) - { - TPoint tmp = _value; - _value = *this; - *this = tmp; - } - - bool empty() const - { - return ((left == 0) && (top == 0)); - } - - std::string print() const - { - std::ostringstream stream; - stream << *this; - return stream.str(); - } - - static TPoint parse(const std::string& _value) - { - TPoint result; - std::istringstream stream(_value); - stream >> result.left >> result.top; - if (stream.fail()) return TPoint(); - else - { - int item = stream.get(); - while (item != -1) - { - if (item != ' ' && item != '\t') return TPoint(); - item = stream.get(); - } - } - return result; - } - - friend std::ostream& operator << ( std::ostream& _stream, const TPoint& _value ) - { - _stream << _value.left << " " << _value.top; - return _stream; - } - - friend std::istream& operator >> ( std::istream& _stream, TPoint& _value ) - { - _stream >> _value.left >> _value.top; - if (_stream.fail()) _value.clear(); - return _stream; - } - - }; - - } // namespace types -} // namespace MyGUI - -#endif // __MYGUI_TPONT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TRect.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TRect.h deleted file mode 100644 index c0e41c6f6..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TRect.h +++ /dev/null @@ -1,191 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_TRECT_H__ -#define __MYGUI_TRECT_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - namespace types - { - - template< typename T > struct TRect - { - T left, top, right, bottom; - - TRect() : left( 0 ), top( 0 ), right( 0 ), bottom( 0 ) { } - TRect( T const& _left, T const& _top, T const& _right, T const& _bottom ) : left( _left ), top( _top ), right( _right ), bottom( _bottom ) { } - TRect( TRect const& o ) : left( o.left ), top( o.top ), right( o.right ), bottom( o.bottom ) { } - - TRect& operator-=( TRect const& o ) - { - left -= o.left; - top -= o.top; - right -= o.right; - bottom -= o.bottom; - return *this; - } - - TRect& operator+=( TRect const& o ) - { - left += o.left; - top += o.top; - right += o.right; - bottom += o.bottom; - return *this; - } - - TRect operator-( TRect const& o ) const - { - return TRect(left - o.left, top - o.top, right - o.right, bottom - o.bottom); - } - - TRect operator+( TRect const& o ) const - { - return TRect(left + o.left, top + o.top, right + o.right, bottom + o.bottom); - } - - TRect& operator=( TRect const& o ) - { - left = o.left; - top = o.top; - right = o.right; - bottom = o.bottom; - return *this; - } - - template< typename U > - TRect& operator=( TRect const& o ) - { - left = o.left; - top = o.top; - right = o.right; - bottom = o.bottom; - return *this; - } - - bool operator==( TRect const& o ) const - { - return ((left == o.left) && (top == o.top) && (right == o.right) && (bottom == o.bottom)); - } - - bool operator!=( TRect const& o ) const - { - return ! ((left == o.left) && (top == o.top) && (right == o.right) && (bottom == o.bottom)); - } - - T width() const - { - return right - left; - } - - T height() const - { - return bottom - top; - } - - void clear() - { - left = top = right = bottom = 0; - } - - void set( T const& _left, T const& _top, T const& _right, T const& _bottom ) - { - left = _left; - top = _top; - right = _right; - bottom = _bottom; - } - - void swap(TRect& _value) - { - TRect tmp = _value; - _value = *this; - *this = tmp; - } - - bool empty() const - { - return ((left == 0) && (top == 0) && (right == 0) && (bottom == 0)); - } - - bool inside(const TRect& _value) const - { - return ( (_value.left >= left) && (_value.right <= right) && (_value.top >= top) && (_value.bottom <= bottom) ); - } - - bool intersect(const TRect& _value) const - { - return ( (_value.left <= right) && (_value.right >= left) && (_value.top <= bottom) && (_value.bottom >= top) ); - } - - bool inside(const TPoint& _value) const - { - return ( (_value.left >= left) && (_value.left <= right) && (_value.top >= top) && (_value.top <= bottom) ); - } - - std::string print() const - { - std::ostringstream stream; - stream << *this; - return stream.str(); - } - - static TRect parse(const std::string& _value) - { - TRect result; - std::istringstream stream(_value); - stream >> result.left >> result.top >> result.right >> result.bottom; - if (stream.fail()) return TRect(); - else - { - int item = stream.get(); - while (item != -1) - { - if (item != ' ' && item != '\t') return TRect(); - item = stream.get(); - } - } - return result; - } - - friend std::ostream& operator << ( std::ostream& _stream, const TRect& _value ) - { - _stream << _value.left << " " << _value.top << " " << _value.right << " " << _value.bottom; - return _stream; - } - - friend std::istream& operator >> ( std::istream& _stream, TRect& _value ) - { - _stream >> _value.left >> _value.top >> _value.right >> _value.bottom; - if (_stream.fail()) _value.clear(); - return _stream; - } - - }; - - } // namespace types -} // namespace MyGUI - -#endif // __MYGUI_TRECT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TSize.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TSize.h deleted file mode 100644 index 3b896d25b..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TSize.h +++ /dev/null @@ -1,156 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_TSIZE_H__ -#define __MYGUI_TSIZE_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - namespace types - { - - template< typename T > struct TSize - { - T width, height; - - TSize() : width( 0 ), height( 0 ) { } - TSize( T const& w, T const& h) : width( w ), height( h ) { } - TSize( TSize const& o ) : width( o.width ), height( o.height ) { } - - TSize& operator-=( TSize const& o ) - { - width -= o.width; - height -= o.height; - return *this; - } - - TSize& operator+=( TSize const& o ) - { - width += o.width; - height += o.height; - return *this; - } - - TSize operator-( TSize const& o ) const - { - return TSize(width - o.width, height - o.height); - } - - TSize operator+( TSize const& o ) const - { - return TSize(width + o.width, height + o.height); - } - - TSize& operator=( TSize const& o ) - { - width = o.width; - height = o.height; - return *this; - } - - template< typename U > - TSize& operator=( TSize const& o ) - { - width = o.width; - height = o.height; - return *this; - } - - bool operator==( TSize const& o ) const - { - return ((width == o.width) && (height == o.height)); - } - - bool operator!=( TSize const& o ) const - { - return ! ((width == o.width) && (height == o.height)); - } - - void clear() - { - width = height = 0; - } - - void set( T const& w, T const& h) - { - width = w; - height = h; - } - - void swap(TSize& _value) - { - TSize tmp = _value; - _value = *this; - *this = tmp; - } - - bool empty() const - { - return ((width == 0) && (height == 0)); - } - - std::string print() const - { - std::ostringstream stream; - stream << *this; - return stream.str(); - } - - static TSize parse(const std::string& _value) - { - TSize result; - std::istringstream stream(_value); - stream >> result.width >> result.height; - if (stream.fail()) return TSize(); - else - { - int item = stream.get(); - while (item != -1) - { - if (item != ' ' && item != '\t') return TSize(); - item = stream.get(); - } - } - return result; - } - - friend std::ostream& operator << ( std::ostream& _stream, const TSize& _value ) - { - _stream << _value.width << " " << _value.height; - return _stream; - } - - friend std::istream& operator >> ( std::istream& _stream, TSize& _value ) - { - _stream >> _value.width >> _value.height; - if (_stream.fail()) _value.clear(); - return _stream; - } - - }; - - } // namespace types -} // namespace MyGUI - -#endif // __MYGUI_TSIZE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Tab.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Tab.h deleted file mode 100644 index 73056a4f6..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Tab.h +++ /dev/null @@ -1,369 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_TAB_H__ -#define __MYGUI_TAB_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Widget.h" -#include "MyGUI_Any.h" -#include "MyGUI_EventPair.h" -#include "MyGUI_ControllerFadeAlpha.h" - -namespace MyGUI -{ - - typedef delegates::CDelegate2 EventHandle_TabPtrSizeT; - - class MYGUI_EXPORT Tab : - public Widget - { - // для уведобления об удалении - //FIXME - friend class TabItem; - - MYGUI_RTTI_DERIVED( Tab ) - - public: - Tab(); - - struct TabItemInfo - { - TabItemInfo(int _width, const UString& _name, TabItem* _item, Any _data) : - width(_width), - name(_name), - item(_item), - data(_data) - { - } - - int width; - UString name; - TabItem* item; - Any data; - }; - - typedef std::vector VectorTabItemInfo; - - //! @copydoc Widget::setPosition(const IntPoint& _value) - virtual void setPosition(const IntPoint& _value); - //! @copydoc Widget::setSize(const IntSize& _value) - virtual void setSize(const IntSize& _value); - //! @copydoc Widget::setCoord(const IntCoord& _value) - virtual void setCoord(const IntCoord& _value); - - /** @copydoc Widget::setPosition(int _left, int _top) */ - void setPosition(int _left, int _top) { setPosition(IntPoint(_left, _top)); } - /** @copydoc Widget::setSize(int _width, int _height) */ - void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); } - /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ - void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); } - - //------------------------------------------------------------------------------// - // манипуляции айтемами - - //! Get number of items - size_t getItemCount() const { return mItemsInfo.size(); } - - //! Insert an item into a array at a specified position - TabItem* insertItemAt(size_t _index, const UString& _name, Any _data = Any::Null); - //! Insert an item into a array - TabItem* insertItem(TabItem* _to, const UString& _name, Any _data = Any::Null) - { - return insertItemAt(getItemIndex(_to), _name, _data); - } - - //! Add an item to the end of a array - TabItem* addItem(const UString& _name, Any _data = Any::Null) - { - return insertItemAt(ITEM_NONE, _name, _data); - } - - //! Remove item at a specified position - void removeItemAt(size_t _index); - //! Remove item - void removeItem(TabItem* _item) { removeItemAt(getItemIndex(_item)); } - - //! Remove all items - void removeAllItems(); - - - //! Get item from specified position - TabItem* getItemAt(size_t _index); - - //! Get item index - size_t getItemIndex(TabItem* _item); - - //! Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found - size_t findItemIndex(TabItem* _item); - - //! Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found - size_t findItemIndexWith(const UString& _name); - - //! Search item, returns the item of the first occurrence in array or nullptr if item not found - TabItem* findItemWith(const UString& _name); - - - //------------------------------------------------------------------------------// - // манипуляции выделениями - - //! Get index of selected item (ITEM_NONE if none selected) - size_t getIndexSelected() { return mIndexSelect; } - - //! Get selected item (nullptr if none selected) - TabItem* getItemSelected(); - - //! Select specified _index - void setIndexSelected(size_t _index); - - //! Select item - void setItemSelected(TabItem* _item) { setIndexSelected(getItemIndex(_item)); } - - - //------------------------------------------------------------------------------// - // манипуляции данными - - //! Replace an item data at a specified position - void setItemDataAt(size_t _index, Any _data); - //! Replace an item data - void setItemData(TabItem* _item, Any _data) { setItemDataAt(getItemIndex(_item), _data); } - - //! Clear an item data at a specified position - void clearItemDataAt(size_t _index) { setItemDataAt(_index, Any::Null); } - //! Clear an item data - void clearItemData(TabItem* _item) { clearItemDataAt(getItemIndex(_item)); } - - //! Get item data from specified position - template - ValueType * getItemDataAt(size_t _index, bool _throw = true) - { - MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "Tab::getItemDataAt"); - return mItemsInfo[_index].data.castType(_throw); - } - //! Get item data - template - ValueType * getItemData(TabItem* _item, bool _throw = true) - { - return getItemDataAt(getItemIndex(_item), _throw); - } - - - //------------------------------------------------------------------------------// - // манипуляции отображением - - //! Replace an item name at a specified position - void setItemNameAt(size_t _index, const UString& _name); - - //! Replace an item name - void setItemName(TabItem* _item, const UString& _name) { setItemNameAt(getItemIndex(_item), _name); } - - //! Get item name from specified position - const UString& getItemNameAt(size_t _index); - - //! Get item name - const UString& getItemName(TabItem* _item) { return getItemNameAt(getItemIndex(_item)); } - - - //------------------------------------------------------------------------------// - // манипуляции выдимостью - - //! Move all elements so specified becomes visible - void beginToItemAt(size_t _index); - - //! Move all elements so specified becomes visible - void beginToItem(TabItem* _item) { beginToItemAt(getItemIndex(_item)); } - - //! Move all elements so first becomes visible - void beginToItemFirst() { if (getItemCount()) beginToItemAt(0); } - - //! Move all elements so last becomes visible - void beginToItemLast() { if (getItemCount()) beginToItemAt(getItemCount() - 1); } - - //! Move all elements so selected becomes visible - void beginToItemSelected() { if (getIndexSelected() != ITEM_NONE) beginToItemAt(getIndexSelected()); } - - - //------------------------------------------------------------------------------// - // остальные манипуляции - - //! Set button width at a specified position - void setButtonWidthAt(size_t _index, int _width = DEFAULT); - //! Set button width - void setButtonWidth(TabItem* _item, int _width = DEFAULT) { setButtonWidthAt(getItemIndex(_item), _width); } - - //! Get button width at a specified position - int getButtonWidthAt(size_t _index); - //! Get button width - int getButtonWidth(TabItem* _item) { return getButtonWidthAt(getItemIndex(_item)); } - - //------------------------------------------------------------------------------// - - /** Set default button width and disable autowidth mode */ - void setButtonDefaultWidth(int _value); - /** Get default button width */ - int getButtonDefaultWidth() { return mButtonDefaultWidth; } - - /** Enable or disable button auto width */ - void setButtonAutoWidth(bool _value); - /** Get button auto width flag */ - bool getButtonAutoWidth() { return mButtonAutoWidth; } - - /** Enable or disable smooth sheets showing */ - void setSmoothShow(bool _value) { mSmoothShow = _value; } - /** Get smooth sheets showing flag */ - bool getSmoothShow() { return mSmoothShow; } - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*event:*/ - /** Event : Active Tab sheet changed \n - signature : void method(MyGUI::Tab* _sender, size_t _index)\n - @param _sender widget that called this event - @param _index Index of selected sheet - */ - EventPair eventTabChangeSelect; - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void Widget::setCoord(const IntCoord& _coord)") - void setPosition(const IntCoord& _coord) { setCoord(_coord); } - MYGUI_OBSOLETE("use : void Widget::setCoord(int _left, int _top, int _width, int _height)") - void setPosition(int _left, int _top, int _width, int _height) { setCoord(_left, _top, _width, _height); } - - MYGUI_OBSOLETE("use : int Tab::getButtonWidthAt(size_t _index)") - int getSheetButtonWidthIndex(size_t _index) { return getButtonWidthAt(_index); } - MYGUI_OBSOLETE("use : int Tab::getButtonWidth(TabItem* _item)") - int getSheetButtonWidth(TabItem* _sheet) { return getButtonWidth(_sheet); } - MYGUI_OBSOLETE("use : void Tab::setButtonWidthAt(size_t _index, int _width)") - void setSheetButtonWidthIndex(size_t _index, int _width = DEFAULT) { setButtonWidthAt(_index, _width); } - MYGUI_OBSOLETE("use : void Tab::setButtonWidth(TabItem* _item, int _width)") - void setSheetButtonWidth(TabItem* _sheet, int _width = DEFAULT) { setButtonWidth(_sheet, _width); } - MYGUI_OBSOLETE("use : void Tab::beginToItemAt(size_t _index)") - void showBarButton(size_t _index) { beginToItemAt(_index); } - MYGUI_OBSOLETE("use : void Tab::beginToItemSelected()") - void showBarSelectButton() { beginToItemSelected(); } - MYGUI_OBSOLETE("use : size_t Tab::getItemCount()") - size_t getSheetCount() { return getItemCount(); } - MYGUI_OBSOLETE("use : const UString& Tab::getItemName(TabItem* _item)") - const UString& getSheetName(TabItem* _sheet) { return getItemName(_sheet); } - MYGUI_OBSOLETE("use : const UString& Tab::getItemNameAt(size_t _index)") - const UString& getSheetNameIndex(size_t _index) { return getItemNameAt(_index); } - MYGUI_OBSOLETE("use : TabItem* Tab::getItemAt(size_t _index)") - TabItem* getSheet(size_t _index) { return getItemAt(_index); } - MYGUI_OBSOLETE("use : void Tab::setItemNameAt(size_t _index, const UString& _name)") - void setSheetNameIndex(size_t _index, const UString& _name, int _width = DEFAULT) { setItemNameAt(_index, _name); } - MYGUI_OBSOLETE("use : void Tab::setItemName(TabItem* _item, const UString& _name)") - void setSheetName(TabItem* _sheet, const UString& _name, int _width = DEFAULT) { setItemName(_sheet, _name); } - MYGUI_OBSOLETE("use : TabItem* Tab::addItem(const UString& _name, Any _data)") - TabItem* addSheet(const UString& _name, int _width = DEFAULT) { return addItem(_name, _width); } - MYGUI_OBSOLETE("use : TabItem* Tab::insertItemAt(size_t _index, const UString& _name, Any _data)") - TabItem* insertSheet(size_t _index, const UString& _name, int _width = DEFAULT) { return insertItemAt(_index, _name); } - MYGUI_OBSOLETE("use : void Tab::removeItemAt(size_t _index)") - void removeSheetIndex(size_t _index) { removeItemAt(_index); } - MYGUI_OBSOLETE("use : void Tab::removeItem(TabItem* _item)") - void removeSheet(TabItem* _sheet) { removeItem(_sheet); } - MYGUI_OBSOLETE("use : void Tab::setIndexSelected(size_t _index)") - void selectSheetIndex(size_t _index, bool _smooth = true) { setIndexSelected(_index); } - MYGUI_OBSOLETE("use : void Tab::setItemSelected(TabItem* _item)") - void selectSheet(TabItem* _sheet, bool _smooth = true) { setItemSelected(_sheet); } - MYGUI_OBSOLETE("use : size_t Tab::getIndexSelected()") - size_t getSelectSheetIndex() { return getIndexSelected(); } - - MYGUI_OBSOLETE("use : size_t Widget::getIndexSelected()") - size_t getItemIndexSelected() { return getIndexSelected(); } - MYGUI_OBSOLETE("use : void Widget::setIndexSelected(size_t _index)") - void setItemSelectedAt(size_t _index) { setIndexSelected(_index); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - protected: - virtual ~Tab(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - // переопределяем для особого обслуживания страниц - virtual Widget* baseCreateWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name); - - void updateBar(); - - void notifyPressedButtonEvent(MyGUI::Widget* _sender); - void notifyPressedBarButtonEvent(MyGUI::Widget* _sender); - - int _getTextWidth(const UString& _text); - - void _showItem(TabItem* _sheet, bool _show, bool _smooth); - - void _createItemButton(); - - void _insertItem(size_t _index, const UString& _name, TabItem* _sheet, Any _data); - - // вкладка при удалении уведомляет таб - void _notifyDeleteItem(TabItem* _item); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - void actionWidgetHide(Widget* _widget); - - ControllerFadeAlpha* createControllerFadeAlpha(float _alpha, float _coef, bool _enable); - - Widget* _getWidgetTemplate(); - Widget* _getWidgetBar(); - - private: - int mOffsetTab; // смещение бара при показе кнопок - bool mButtonShow; - int mWidthBar; // ширина в которую помещаються все кнопки - VectorWidgetPtr mItemButton; // список кнопок, не должно равно списку страниц - std::string mButtonSkinName, mEmptySkinName; - - Widget* mWidgetBar; - Button* mButtonLeft; - Button* mButtonRight; - Button* mButtonList; - Widget* mButtonDecor; - VectorWidgetPtr mWidgetsPatch; // список виджетов которые нужно показать при показе кнопки - Widget* mEmptyBarWidget; - Widget* mItemTemplate; - - // информация о вкладках - VectorTabItemInfo mItemsInfo; - size_t mStartIndex; - size_t mIndexSelect; - - int mButtonDefaultWidth; - bool mSmoothShow; - bool mButtonAutoWidth; - - // флаг, чтобы отсеч уведомления от вкладок, при общем шутдауне виджета - bool mShutdown; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_TAB_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TabItem.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TabItem.h deleted file mode 100644 index ab6d27e3e..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TabItem.h +++ /dev/null @@ -1,90 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 01/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_TAB_ITEM_H__ -#define __MYGUI_TAB_ITEM_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Widget.h" -#include "MyGUI_Tab.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT TabItem : - public Widget - { - MYGUI_RTTI_DERIVED( TabItem ) - - public: - TabItem(); - - /** Set item caption */ - virtual void setCaption(const UString& _value); - /** Get item caption */ - virtual const UString& getCaption(); - - //! Set button width - void setButtonWidth(int _value = DEFAULT); - //! Get button width - int getButtonWidth(); - - //! Replace an item name - void setItemName(const UString& _value); - //! Get item name - const UString& getItemName(); - - //! Replace an item name - void setItemData(Any _value); - - //! Get item data - template - ValueType * getItemData(bool _throw = true) - { - return mOwner->getItemData(this, _throw); - } - - //! Select sheet - void setItemSelected(); - - //! Remove item - void removeItem(); - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*internal*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - protected: - virtual ~TabItem(); - - void setSelected(bool _value); - - private: - Tab* mOwner; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_TAB_ITEM_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TextChangeHistory.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TextChangeHistory.h deleted file mode 100644 index 204ee565b..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TextChangeHistory.h +++ /dev/null @@ -1,67 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_TEXT_CHANGE_HISTORY_H__ -#define __MYGUI_TEXT_CHANGE_HISTORY_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Macros.h" -#include "MyGUI_UString.h" -#include - -namespace MyGUI -{ - - // инфо об одной операции - struct TextCommandInfo - { - // типы операций - enum CommandType - { - COMMAND_POSITION, - COMMAND_INSERT, - COMMAND_ERASE - }; - - // для удаления и вставки текста - TextCommandInfo(const UString& _text, size_t _start, CommandType _type) - : text(_text), type(_type), start(_start), undo(ITEM_NONE), redo(ITEM_NONE), length(ITEM_NONE) { } - // для указания позиции - TextCommandInfo(size_t _undo, size_t _redo, size_t _length) - : type(COMMAND_POSITION), start(ITEM_NONE), undo(_undo), redo(_redo), length(_length) { } - - // строка харрактиризуещая изменения - UString text; - // тип операции - CommandType type; - // инфа о начале позиции - size_t start; - // инфа о псевдо позиции - size_t undo, redo, length; - }; - - typedef std::vector VectorChangeInfo; - typedef std::deque DequeUndoRedoInfo; - -} // namespace MyGUI - -#endif // __MYGUI_TEXT_CHANGE_HISTORY_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TextIterator.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TextIterator.h deleted file mode 100644 index b1284fb72..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TextIterator.h +++ /dev/null @@ -1,125 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_TEXT_ITERATOR_H__ -#define __MYGUI_TEXT_ITERATOR_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Colour.h" -#include "MyGUI_TextChangeHistory.h" -#include "MyGUI_IFont.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT TextIterator - { - private: - TextIterator(); - - public: - TextIterator(const UString& _text, VectorChangeInfo * _history = nullptr); - - bool moveNext(); - - // возвращает цвет - UString getTagColour(bool _clear = false); - - // возвращает цвет - bool getTagColour(UString& _colour); - - // удаляет цвет - void clearTagColour() { getTagColour(true); } - - bool setTagColour(const Colour& _colour); - - bool setTagColour(UString _colour); - - // сохраняет текущий итератор - bool saveStartPoint(); - - // возвращает строку от сохраненного итератора до текущего - UString getFromStart(); - - // удаляет от запомненной точки до текущей - bool eraseFromStart(); - - // возвращает текущую псевдо позицию - size_t getPosition() const { return mPosition; } - - const UString& getText() const { return mText; } - - void insertText(const UString& _insert, bool _multiLine); - - void clearNewLine(UString& _text); - - //очищает весь текст - void clearText() { clear(); } - - // возвращает размер строки - size_t getSize() const; - - void setText(const UString& _text, bool _multiLine); - - void cutMaxLength(size_t _max); - - void cutMaxLengthFromBeginning(size_t _max); - - // возвращает текст без тегов - static UString getOnlyText(const UString& _text); - - static UString getTextNewLine() { return L"\n"; } - - static UString getTextCharInfo(Char _char); - - // просто конвертируем цвет в строку - static UString convertTagColour(const Colour& _colour); - - static UString toTagsString(const UString& _text); - - private: - - // возвращает цвет - bool getTagColour(UString& _colour, UString::iterator& _iter); - - void insert(UString::iterator& _start, UString& _insert); - - UString::iterator erase(UString::iterator _start, UString::iterator _end); - - void clear(); - - private: - UString mText; - UString::iterator mCurrent, mEnd, mSave; - - // позиция и размер - size_t mPosition; - mutable size_t mSize; - bool mFirst; - - VectorChangeInfo * mHistory; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_TEXT_ITERATOR_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TextView.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TextView.h deleted file mode 100644 index a8384fd0c..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TextView.h +++ /dev/null @@ -1,358 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 09/2009 - @module -*/ -#ifndef __MYGUI_TEXT_VIEW_H__ -#define __MYGUI_TEXT_VIEW_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_TextureUtility.h" - -namespace MyGUI -{ - - class CharInfo - { - public: - CharInfo() : width(0) { } - CharInfo(const FloatRect& _rect, int _width) : rect(_rect), width(_width) { } - CharInfo(uint32 _colour) : rect(-1, 0, 0, 0), width((int)_colour) { } - - bool isColour() const { return rect.left == -1; } - int getWidth() const { return width; } - const FloatRect& getUVRect() const { return rect; } - uint32 getColour() const { return (uint32)width; } - - private: - FloatRect rect; - int width; - }; - - typedef std::vector VectorCharInfo; - - struct LineInfo - { - LineInfo() : width(0), offset(0), count(0) { } - void clear() { width = 0; count = 0; simbols.clear(); offset = 0; } - int width; - int offset; - size_t count; - VectorCharInfo simbols; - }; - - typedef std::vector VectorLineInfo; - - class RollBackPoint - { - public: - RollBackPoint() : - position(0), - count(0), - lenght(0), - rollback(false) - { } - - void set( - size_t _position, - UString::const_iterator& _space_point, - size_t _count, - int _length - ) - { - position = _position; - space_point = _space_point; - count = _count; - lenght = _length; - rollback = true; - } - - void clear() { rollback = false; } - bool empty() const { return !rollback; } - int getLenght() const { MYGUI_DEBUG_ASSERT(rollback, "rollback point not valid"); return lenght; } - size_t getCount() const { MYGUI_DEBUG_ASSERT(rollback, "rollback point not valid"); return count; } - size_t getPosition() const { MYGUI_DEBUG_ASSERT(rollback, "rollback point not valid"); return position; } - UString::const_iterator getTextIter() { MYGUI_DEBUG_ASSERT(rollback, "rollback point not valid"); return space_point; } - - private: - size_t position; - UString::const_iterator space_point; - size_t count; - int lenght; - bool rollback; - }; - - class TextView - { - public: - TextView() : - mLength(0), - mFontHeight(0) - { - } - - void update(const UString& _text, IFont* _font, int _height, Align _align, VertexColourType _format, int _maxheight = -1) - { - mFontHeight = _height; - - // - static const char convert_colour[64] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, - 0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - - mViewSize.clear(); - - RollBackPoint roll_back; - IntSize result; - int width = 0; - size_t count = 0; - mLength = 0; - mLineInfo.clear(); - LineInfo line_info; - int font_height = _font->getDefaultHeight(); - - UString::const_iterator end = _text.end(); - UString::const_iterator index = _text.begin(); - - /*if (index == end) - return;*/ - - result.height += _height; - - for (; index!=end; ++index) - { - Char character = *index; - - // - if (character == FontCodeType::CR - || character == FontCodeType::NEL - || character == FontCodeType::LF) - { - if (character == FontCodeType::CR) - { - UString::const_iterator peeki = index; - peeki ++; - if ((peeki != end) && (*peeki == FontCodeType::LF)) - index = peeki; // skip both as one newline - } - - line_info.width = width; - line_info.count = count; - mLength += line_info.count + 1; - - result.height += _height; - if (result.width < width) - result.width = width; - width = 0; - count = 0; - - mLineInfo.push_back(line_info); - line_info.clear(); - - // - roll_back.clear(); - - continue; - } - // - else if (character == L'#') - { - // - ++ index; - if (index == end) { --index; continue; } // - - character = *index; - // , , - if (character != L'#') - { - // - uint32 colour = convert_colour[(character-48) & 0x3F]; - - // - for (char i=0; i<5; i++) - { - ++ index; - if (index == end) { --index; continue; } // - colour <<= 4; - colour += convert_colour[ ((*index) - 48) & 0x3F ]; - } - - // , - texture_utility::convertColour(colour, _format); - - line_info.simbols.push_back( CharInfo(colour) ); - - continue; - } - } - - GlyphInfo* info = _font->getGlyphInfo(character); - if (FontCodeType::Space == character) - { - roll_back.set(line_info.simbols.size(), index, count, width); - } - else if (FontCodeType::Tab == character) - { - roll_back.set(line_info.simbols.size(), index, count, width); - } - - int char_width = info->width; - if (font_height != _height) - { - char_width = char_width * _height / font_height; - if (!char_width) char_width = 1; - } - - // - if (_maxheight != -1 - && (width + char_width) > _maxheight - && !roll_back.empty()) - { - // - width = roll_back.getLenght(); - count = roll_back.getCount(); - index = roll_back.getTextIter(); - line_info.simbols.erase(line_info.simbols.begin() + roll_back.getPosition(), line_info.simbols.end()); - - // , - line_info.width = width; - line_info.count = count; - mLength += line_info.count + 1; - - result.height += _height; - if (result.width < width) - result.width = width; - width = 0; - count = 0; - - mLineInfo.push_back(line_info); - line_info.clear(); - - // - roll_back.clear(); - - continue; - } - - line_info.simbols.push_back(CharInfo(info->uvRect, char_width)); - width += char_width; - count ++; - } - - line_info.width = width; - line_info.count = count; - mLength += line_info.count; - - mLineInfo.push_back(line_info); - - if (result.width < width) - result.width = width; - - // - for (VectorLineInfo::iterator line=mLineInfo.begin(); line!=mLineInfo.end(); ++line) - { - if (_align.isRight()) - line->offset = result.width - line->width; - else if (_align.isHCenter()) - line->offset = (result.width - line->width) / 2; - } - - mViewSize = result; - } - - size_t getCursorPosition(const IntPoint& _value) - { - const int height = mFontHeight; - size_t result = 0; - int top = 0; - - for (VectorLineInfo::const_iterator line=mLineInfo.begin(); line!=mLineInfo.end(); ++line) - { - // - bool lastline = !(line + 1 != mLineInfo.end()); - - // - if (top + height > _value.top || lastline) - { - top += height; - int left = line->offset; - int count = 0; - - // - for (VectorCharInfo::const_iterator sim=line->simbols.begin(); sim!=line->simbols.end(); ++sim) - { - if (sim->isColour()) - continue; - - if ((left + (sim->getWidth() / 2)) > _value.left) - { - break; - } - left += sim->getWidth(); - count ++; - } - - result += count; - break; - } - - if (!lastline) - { - top += height; - result += line->count + 1; - } - } - - return result; - } - - IntPoint getCursorPoint(size_t _position) - { - if (_position >= mLength + 1) _position = mLength; - - size_t position = 0; - int top = 0; - int left = 0; - for (VectorLineInfo::const_iterator line=mLineInfo.begin(); line!=mLineInfo.end(); ++line) - { - left = line->offset; - if (position + line->count >= _position) - { - for (VectorCharInfo::const_iterator sim=line->simbols.begin(); sim!=line->simbols.end(); ++sim) - { - if (sim->isColour()) - continue; - - if (position == _position) - break; - - position ++; - left += sim->getWidth(); - } - break; - } - position += line->count + 1; - top += mFontHeight; - } - - return IntPoint(left, top); - } - - const IntSize& getViewSize() const { return mViewSize; } - size_t getTextLength() const { return mLength; } - const VectorLineInfo& getData() { return mLineInfo; } - - private: - IntSize mViewSize; - size_t mLength; - VectorLineInfo mLineInfo; - int mFontHeight; - }; - - -} // namespace MyGUI - -#endif // __MYGUI_TEXT_VIEW_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TextureUtility.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TextureUtility.h deleted file mode 100644 index 4883d2ca8..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TextureUtility.h +++ /dev/null @@ -1,50 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 09/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_TEXTURE_UTILITY_H__ -#define __MYGUI_TEXTURE_UTILITY_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Colour.h" -#include "MyGUI_RenderFormat.h" - -namespace MyGUI -{ - - namespace texture_utility - { - - MYGUI_EXPORT const IntSize& getTextureSize(const std::string& _texture, bool _cache = true); - MYGUI_EXPORT uint32 toColourARGB(const Colour& _colour); - - MYGUI_FORCEINLINE void convertColour(uint32& _colour, VertexColourType _format) - { - if (_format == VertexColourType::ColourABGR) - _colour = ((_colour & 0x00FF0000) >> 16) | ((_colour & 0x000000FF) << 16) | (_colour & 0xFF00FF00); - } - - - } // namespace texture_utility - -} // namespace MyGUI - -#endif // __MYGUI_TEXTURE_UTILITY_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TileRect.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TileRect.h deleted file mode 100644 index b79817f98..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_TileRect.h +++ /dev/null @@ -1,94 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 05/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_TILE_RECT_H__ -#define __MYGUI_TILE_RECT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_XmlDocument.h" -#include "MyGUI_Types.h" -#include "MyGUI_ISubWidgetRect.h" -#include "MyGUI_ResourceSkin.h" - -namespace MyGUI -{ - - class RenderItem; - - class MYGUI_EXPORT TileRect : public ISubWidgetRect - { - MYGUI_RTTI_DERIVED( TileRect ) - - public: - TileRect(); - virtual ~TileRect(); - - void setAlpha(float _alpha); - - virtual void setVisible(bool _visible); - - virtual void createDrawItem(ITexture* _texture, ILayerNode * _node); - virtual void destroyDrawItem(); - - // метод для отрисовки себя - virtual void doRender(); - - virtual void setStateData(IStateInfo * _data); - - /*internal:*/ - void _updateView(); - void _correctView(); - - void _setAlign(const IntSize& _oldsize, bool _update); - void _setAlign(const IntCoord& _oldcoord, bool _update); - - virtual void _setUVSet(const FloatRect& _rect); - virtual void _setColour(const Colour& _value); - - protected: - FloatRect mRectTexture; - bool mEmptyView; - - uint32 mCurrentColour; - - FloatRect mCurrentTexture; - IntCoord mCurrentCoord; - - ILayerNode* mNode; - RenderItem* mRenderItem; - - IntSize mTileSize; - size_t mCountVertex; - - float mRealTileWidth; - float mRealTileHeight; - - float mTextureHeightOne; - float mTextureWidthOne; - - bool mTileH; - bool mTileV; - }; - -} // namespace MyGUI - -#endif // __MYGUI_TILE_RECT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Timer.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Timer.h deleted file mode 100644 index a93845091..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Timer.h +++ /dev/null @@ -1,48 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 04/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_TIMER_H__ -#define __MYGUI_TIMER_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT Timer - { - public: - Timer(); - - void reset(); - unsigned long getMilliseconds(); - - private: - unsigned long getCurrentMilliseconds(); - - private: - unsigned long mTimeStart; - }; - -} // namespace MyGUI - -#endif // __MYGUI_TIMER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Types.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Types.h deleted file mode 100644 index 2051c6c1c..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Types.h +++ /dev/null @@ -1,70 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_TYPES_H__ -#define __MYGUI_TYPES_H__ - -#include "MyGUI_Prerequest.h" - -#include -#include -#include - -#include "MyGUI_Utility.h" -#include "MyGUI_Align.h" -#include "MyGUI_TPoint.h" -#include "MyGUI_TSize.h" -#include "MyGUI_TRect.h" -#include "MyGUI_TCoord.h" - -namespace MyGUI -{ - - // определяем типы - typedef types::TPoint IntPoint; - typedef types::TPoint FloatPoint; - - typedef types::TSize IntSize; - typedef types::TSize FloatSize; - - typedef types::TRect IntRect; - typedef types::TRect FloatRect; - - typedef types::TCoord IntCoord; - typedef types::TCoord FloatCoord; - - typedef std::map MapString; - typedef std::vector VectorString; - - typedef char int8; - typedef short int16; - typedef int int32; - typedef unsigned char uint8; - typedef unsigned short uint16; - typedef unsigned int uint32; - typedef unsigned int uint; - - typedef unsigned int Char; - -} // namespace MyGUI - -#endif // __MYGUI_TYPES_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_UString.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_UString.h deleted file mode 100644 index f42268102..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_UString.h +++ /dev/null @@ -1,2765 +0,0 @@ -// Modified from OpenGUI under lenient license -// Original copyright details and licensing below: -// OpenGUI (http://opengui.sourceforge.net) -// This source code is released under the BSD License - -// Permission is given to the Ogre project to use the contents of file within its -// source and binary applications, as well as any derivative works, in accordance -// with the terms of any license under which Ogre is or will be distributed. -// -// Ogre may relicense its copy of this file, as well as any OpenGUI released updates -// to this file, under any terms that it deems fit, and is not required to maintain -// the original BSD licensing terms of this file, however OpenGUI retains the right -// to present its copy of this file under the terms of any license under which -// OpenGUI is distributed. -// -// Ogre is not required to release to OpenGUI any future changes that it makes to -// this file, and understands and agrees that any such changes that are released -// back to OpenGUI will become available under the terms of any license under which -// OpenGUI is distributed. -// -// For brevity, this permission text may be removed from this file if desired. -// The original record kept within the SourceForge (http://sourceforge.net/) tracker -// is sufficient. -// -// - Eric Shorkey (zero/zeroskill) [January 20th, 2007] - -#ifndef __MYGUI_U_STRING_H__ -#define __MYGUI_U_STRING_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include "MyGUI_Diagnostic.h" -#include "MyGUI_LogManager.h" - -// these are explained later -#include -#include -#include - -// this pragma used to avoid warnings from some advanced gcc warnings flags -#if MYGUI_COMPILER == MYGUI_COMPILER_GNUC -#pragma GCC system_header -#endif - -// Workaround for VC7: -// when build with /MD or /MDd, VC7 have both std::basic_string and -// basic_string<__wchar_t> instantiated in msvcprt[d].lib/MSVCP71[D].dll, but the header -// files tells compiler that only one of them is over there (based on /Zc:wchar_t compile -// option). And since this file used both of them, causing compiler instantiating another -// one in user object code, which lead to duplicate symbols with msvcprt.lib/MSVCP71[D].dll. -// -#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC && (1300 <= MYGUI_COMP_VER && MYGUI_COMP_VER <= 1310) - -# if defined(_DLL_CPPLIB) - -namespace std -{ - template class _CRTIMP2 basic_string, - allocator >; - - template class _CRTIMP2 basic_string<__wchar_t, char_traits<__wchar_t>, - allocator<__wchar_t> >; -} - -# endif // defined(_DLL_CPPLIB) - -#endif // MYGUI_COMPILER == MYGUI_COMPILER_MSVC && MYGUI_COMP_VER == 1300 - - -namespace MyGUI -{ - - /* READ THIS NOTICE BEFORE USING IN YOUR OWN APPLICATIONS - =NOTICE= - This class is not a complete Unicode solution. It purposefully does not - provide certain functionality, such as proper lexical sorting for - Unicode values. It does provide comparison operators for the sole purpose - of using UString as an index with std::map and other operator< sorted - containers, but it should NOT be relied upon for meaningful lexical - operations, such as alphabetical sorts. If you need this type of - functionality, look into using ICU instead (http://icu.sourceforge.net/). - - =REQUIREMENTS= - There are a few requirements for proper operation. They are fairly small, - and shouldn't restrict usage on any reasonable target. - * Compiler must support unsigned 16-bit integer types - * Compiler must support signed 32-bit integer types - * wchar_t must be either UTF-16 or UTF-32 encoding, and specified as such - using the WCHAR_UTF16 macro as outlined below. - * You must include , , and . Probably more, but - these are the most obvious. - - =REQUIRED PREPROCESSOR MACROS= - This class requires two preprocessor macros to be defined in order to - work as advertised. - INT32 - must be mapped to a signed 32 bit integer (ex. #define INT32 int) - UINT16 - must be mapped to an unsigned 16 bit integer (ex. #define UINT32 unsigned short) - - Additionally, a third macro should be defined to control the evaluation of wchar_t: - WCHAR_UTF16 - should be defined when wchar_t represents UTF-16 code points, - such as in Windows. Otherwise it is assumed that wchar_t is a 32-bit - integer representing UTF-32 code points. - */ - - // THIS IS A VERY BRIEF AUTO DETECTION. YOU MAY NEED TO TWEAK THIS -#ifdef __STDC_ISO_10646__ -// for any compiler that provides this, wchar_t is guaranteed to hold any Unicode value with a single code point (32-bit or larger) -// so we can safely skip the rest of the testing -#else // #ifdef __STDC_ISO_10646__ -#if defined( __WIN32__ ) || defined( _WIN32 ) -#define WCHAR_UTF16 // All currently known Windows platforms utilize UTF-16 encoding in wchar_t -#else // #if defined( __WIN32__ ) || defined( _WIN32 ) -#if WCHAR_MAX <= 0xFFFF // this is a last resort fall back test; WCHAR_MAX is defined in -#define WCHAR_UTF16 // best we can tell, wchar_t is not larger than 16-bit -#endif // #if WCHAR_MAX <= 0xFFFF -#endif // #if defined( __WIN32__ ) || defined( _WIN32 ) -#endif // #ifdef __STDC_ISO_10646__ - - -// MYGUI_IS_NATIVE_WCHAR_T means that wchar_t isn't a typedef of -// uint16 or uint32. -#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC - -// Don't define wchar_t related functions since it'll duplicate -// with UString::code_point related functions when compile -// without /Zc:wchar_t, because in this case both of them are -// a typedef of uint16. -# if defined(_NATIVE_WCHAR_T_DEFINED) -# define MYGUI_IS_NATIVE_WCHAR_T 1 -# else -# define MYGUI_IS_NATIVE_WCHAR_T 0 -# endif - -#else // MYGUI_COMPILER != MYGUI_COMPILER_MSVC - -// Assumed wchar_t is natively for other compilers -# define MYGUI_IS_NATIVE_WCHAR_T 1 - -#endif // MYGUI_COMPILER == MYGUI_COMPILER_MSVC - - //! A UTF-16 string with implicit conversion to/from std::string and std::wstring - /*! This class provides a complete 1 to 1 map of most std::string functions (at least to my - knowledge). Implicit conversions allow this string class to work with all common C++ string - formats, with specialty functions defined where implicit conversion would cause potential - problems or is otherwise unavailable. - - Some additional functionality is present to assist in working with characters using the - 32-bit UTF-32 encoding. (Which is guaranteed to fit any Unicode character into a single - code point.) \b Note: Reverse iterators do not have this functionality due to the - ambiguity that surrounds working with UTF-16 in reverse. (Such as, where should an - iterator point to represent the beginning of a surrogate pair?) - - - \par Supported Input Types - The supported string types for input, and their assumed encoding schemes, are: - - std::string (UTF-8) - - char* (UTF-8) - - std::wstring (autodetected UTF-16 / UTF-32 based on compiler) - - wchar_t* (autodetected UTF-16 / UTF-32 based on compiler) - - - \see - - For additional information on UTF-16 encoding: http://en.wikipedia.org/wiki/UTF-16 - - For additional information on UTF-8 encoding: http://en.wikipedia.org/wiki/UTF-8 - - For additional information on UTF-32 encoding: http://en.wikipedia.org/wiki/UTF-32 - */ - class UString - { - // constants used in UTF-8 conversions - static const unsigned char _lead1 = 0xC0; //110xxxxx - static const unsigned char _lead1_mask = 0x1F; //00011111 - static const unsigned char _lead2 = 0xE0; //1110xxxx - static const unsigned char _lead2_mask = 0x0F; //00001111 - static const unsigned char _lead3 = 0xF0; //11110xxx - static const unsigned char _lead3_mask = 0x07; //00000111 - static const unsigned char _lead4 = 0xF8; //111110xx - static const unsigned char _lead4_mask = 0x03; //00000011 - static const unsigned char _lead5 = 0xFC; //1111110x - static const unsigned char _lead5_mask = 0x01; //00000001 - static const unsigned char _cont = 0x80; //10xxxxxx - static const unsigned char _cont_mask = 0x3F; //00111111 - - public: - //! size type used to indicate string size and character positions within the string - typedef size_t size_type; - //! the usual constant representing: not found, no limit, etc - static const size_type npos = ~(size_t)0; - - //! a single 32-bit Unicode character - typedef uint32 unicode_char; - - //! a single UTF-16 code point - typedef uint16 code_point; - - //! value type typedef for use in iterators - typedef code_point value_type; - - typedef std::basic_string dstring; // data string - - //! string type used for returning UTF-32 formatted data - typedef std::basic_string utf32string; - - //! This exception is used when invalid data streams are encountered - class invalid_data: public std::runtime_error - { /* i don't know why the beautifier is freaking out on this line */ - public: - //! constructor takes a string message that can be later retrieved by the what() function - explicit invalid_data( const std::string& _Message ): std::runtime_error( _Message ) - { - /* The thing is, Bob, it's not that I'm lazy, it's that I just don't care. */ - } - }; - - //######################################################################### - //! base iterator class for UString - class _base_iterator: public std::iterator - { /* i don't know why the beautifier is freaking out on this line */ - friend class UString; - protected: - _base_iterator() - { - mString = 0; - } - - void _seekFwd( size_type c ) - { - mIter += c; - } - void _seekRev( size_type c ) - { - mIter -= c; - } - void _become( const _base_iterator& i ) - { - mIter = i.mIter; - mString = i.mString; - } - bool _test_begin() const - { - return mIter == mString->mData.begin(); - } - bool _test_end() const - { - return mIter == mString->mData.end(); - } - size_type _get_index() const - { - return mIter - mString->mData.begin(); - } - void _jump_to( size_type index ) - { - mIter = mString->mData.begin() + index; - } - - unicode_char _getCharacter() const - { - size_type current_index = _get_index(); - return mString->getChar( current_index ); - } - int _setCharacter( unicode_char uc ) - { - size_type current_index = _get_index(); - int change = mString->setChar( current_index, uc ); - _jump_to( current_index ); - return change; - } - - void _moveNext() - { - _seekFwd( 1 ); // move 1 code point forward - if ( _test_end() ) return; // exit if we hit the end - if ( _utf16_surrogate_follow( mIter[0] ) ) - { - // landing on a follow code point means we might be part of a bigger character - // so we test for that - code_point lead_half = 0; - //NB: we can't possibly be at the beginning here, so no need to test - lead_half = mIter[-1]; // check the previous code point to see if we're part of a surrogate pair - if ( _utf16_surrogate_lead( lead_half ) ) - { - _seekFwd( 1 ); // if so, then advance 1 more code point - } - } - } - void _movePrev() - { - _seekRev( 1 ); // move 1 code point backwards - if ( _test_begin() ) return; // exit if we hit the beginning - if ( _utf16_surrogate_follow( mIter[0] ) ) - { - // landing on a follow code point means we might be part of a bigger character - // so we test for that - code_point lead_half = 0; - lead_half = mIter[-1]; // check the previous character to see if we're part of a surrogate pair - if ( _utf16_surrogate_lead( lead_half ) ) - { - _seekRev( 1 ); // if so, then rewind 1 more code point - } - } - } - - dstring::iterator mIter; - UString* mString; - }; - - //######################################################################### - // FORWARD ITERATORS - //######################################################################### - class _const_fwd_iterator; // forward declaration - - //! forward iterator for UString - class _fwd_iterator: public _base_iterator - { /* i don't know why the beautifier is freaking out on this line */ - friend class _const_fwd_iterator; - public: - _fwd_iterator() { } - _fwd_iterator( const _fwd_iterator& i ) - { - _become( i ); - } - - //! pre-increment - _fwd_iterator& operator++() - { - _seekFwd( 1 ); - return *this; - } - //! post-increment - _fwd_iterator operator++( int ) - { - _fwd_iterator tmp( *this ); - _seekFwd( 1 ); - return tmp; - } - - //! pre-decrement - _fwd_iterator& operator--() - { - _seekRev( 1 ); - return *this; - } - //! post-decrement - _fwd_iterator operator--( int ) - { - _fwd_iterator tmp( *this ); - _seekRev( 1 ); - return tmp; - } - - //! addition operator - _fwd_iterator operator+( size_type n ) - { - _fwd_iterator tmp( *this ); - tmp._seekFwd( n ); - return tmp; - } - //! addition operator - _fwd_iterator operator+( difference_type n ) - { - _fwd_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekRev( -n ); - else - tmp._seekFwd( n ); - return tmp; - } - //! subtraction operator - _fwd_iterator operator-( size_type n ) - { - _fwd_iterator tmp( *this ); - tmp._seekRev( n ); - return tmp; - } - //! subtraction operator - _fwd_iterator operator-( difference_type n ) - { - _fwd_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekFwd( -n ); - else - tmp._seekRev( n ); - return tmp; - } - - //! addition assignment operator - _fwd_iterator& operator+=( size_type n ) - { - _seekFwd( n ); - return *this; - } - //! addition assignment operator - _fwd_iterator& operator+=( difference_type n ) - { - if ( n < 0 ) - _seekRev( -n ); - else - _seekFwd( n ); - return *this; - } - //! subtraction assignment operator - _fwd_iterator& operator-=( size_type n ) - { - _seekRev( n ); - return *this; - } - //! subtraction assignment operator - _fwd_iterator& operator-=( difference_type n ) - { - if ( n < 0 ) - _seekFwd( -n ); - else - _seekRev( n ); - return *this; - } - - //! dereference operator - value_type& operator*() const - { - return *mIter; - } - - //! dereference at offset operator - value_type& operator[]( size_type n ) const - { - _fwd_iterator tmp( *this ); - tmp += n; - return *tmp; - } - //! dereference at offset operator - value_type& operator[]( difference_type n ) const - { - _fwd_iterator tmp( *this ); - tmp += n; - return *tmp; - } - - //! advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream - _fwd_iterator& moveNext() - { - _moveNext(); - return *this; - } - //! rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream - _fwd_iterator& movePrev() - { - _movePrev(); - return *this; - } - //! Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed) - unicode_char getCharacter() const - { - return _getCharacter(); - } - //! Sets the Unicode value of the character at the current position (adding a surrogate pair if needed); returns the amount of string length change caused by the operation - int setCharacter( unicode_char uc ) - { - return _setCharacter( uc ); - } - }; - - - //######################################################################### - //! const forward iterator for UString - class _const_fwd_iterator: public _base_iterator - { /* i don't know why the beautifier is freaking out on this line */ - public: - _const_fwd_iterator() { } - _const_fwd_iterator( const _const_fwd_iterator& i ) - { - _become( i ); - } - _const_fwd_iterator( const _fwd_iterator& i ) - { - _become( i ); - } - - //! pre-increment - _const_fwd_iterator& operator++() - { - _seekFwd( 1 ); - return *this; - } - //! post-increment - _const_fwd_iterator operator++( int ) - { - _const_fwd_iterator tmp( *this ); - _seekFwd( 1 ); - return tmp; - } - - //! pre-decrement - _const_fwd_iterator& operator--() - { - _seekRev( 1 ); - return *this; - } - //! post-decrement - _const_fwd_iterator operator--( int ) - { - _const_fwd_iterator tmp( *this ); - _seekRev( 1 ); - return tmp; - } - - //! addition operator - _const_fwd_iterator operator+( size_type n ) - { - _const_fwd_iterator tmp( *this ); - tmp._seekFwd( n ); - return tmp; - } - //! addition operator - _const_fwd_iterator operator+( difference_type n ) - { - _const_fwd_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekRev( -n ); - else - tmp._seekFwd( n ); - return tmp; - } - //! subtraction operator - _const_fwd_iterator operator-( size_type n ) - { - _const_fwd_iterator tmp( *this ); - tmp._seekRev( n ); - return tmp; - } - //! subtraction operator - _const_fwd_iterator operator-( difference_type n ) - { - _const_fwd_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekFwd( -n ); - else - tmp._seekRev( n ); - return tmp; - } - - //! addition assignment operator - _const_fwd_iterator& operator+=( size_type n ) - { - _seekFwd( n ); - return *this; - } - //! addition assignment operator - _const_fwd_iterator& operator+=( difference_type n ) - { - if ( n < 0 ) - _seekRev( -n ); - else - _seekFwd( n ); - return *this; - } - //! subtraction assignment operator - _const_fwd_iterator& operator-=( size_type n ) - { - _seekRev( n ); - return *this; - } - //! subtraction assignment operator - _const_fwd_iterator& operator-=( difference_type n ) - { - if ( n < 0 ) - _seekFwd( -n ); - else - _seekRev( n ); - return *this; - } - - //! dereference operator - const value_type& operator*() const - { - return *mIter; - } - - //! dereference at offset operator - const value_type& operator[]( size_type n ) const - { - _const_fwd_iterator tmp( *this ); - tmp += n; - return *tmp; - } - //! dereference at offset operator - const value_type& operator[]( difference_type n ) const - { - _const_fwd_iterator tmp( *this ); - tmp += n; - return *tmp; - } - - //! advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream - _const_fwd_iterator& moveNext() - { - _moveNext(); - return *this; - } - //! rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream - _const_fwd_iterator& movePrev() - { - _movePrev(); - return *this; - } - //! Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed) - unicode_char getCharacter() const - { - return _getCharacter(); - } - - //! difference operator - friend size_type operator-( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - //! equality operator - friend bool operator==( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - //! inequality operator - friend bool operator!=( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - //! less than - friend bool operator<( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - //! less than or equal - friend bool operator<=( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - //! greater than - friend bool operator>( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - //! greater than or equal - friend bool operator>=( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); - - }; - - //######################################################################### - // REVERSE ITERATORS - //######################################################################### - class _const_rev_iterator; // forward declaration - //! forward iterator for UString - class _rev_iterator: public _base_iterator - { /* i don't know why the beautifier is freaking out on this line */ - friend class _const_rev_iterator; - public: - _rev_iterator() { } - _rev_iterator( const _rev_iterator& i ) - { - _become( i ); - } - - //! pre-increment - _rev_iterator& operator++() - { - _seekRev( 1 ); - return *this; - } - //! post-increment - _rev_iterator operator++( int ) - { - _rev_iterator tmp( *this ); - _seekRev( 1 ); - return tmp; - } - - //! pre-decrement - _rev_iterator& operator--() - { - _seekFwd( 1 ); - return *this; - } - //! post-decrement - _rev_iterator operator--( int ) - { - _rev_iterator tmp( *this ); - _seekFwd( 1 ); - return tmp; - } - - //! addition operator - _rev_iterator operator+( size_type n ) - { - _rev_iterator tmp( *this ); - tmp._seekRev( n ); - return tmp; - } - //! addition operator - _rev_iterator operator+( difference_type n ) - { - _rev_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekFwd( -n ); - else - tmp._seekRev( n ); - return tmp; - } - //! subtraction operator - _rev_iterator operator-( size_type n ) - { - _rev_iterator tmp( *this ); - tmp._seekFwd( n ); - return tmp; - } - //! subtraction operator - _rev_iterator operator-( difference_type n ) - { - _rev_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekRev( -n ); - else - tmp._seekFwd( n ); - return tmp; - } - - //! addition assignment operator - _rev_iterator& operator+=( size_type n ) - { - _seekRev( n ); - return *this; - } - //! addition assignment operator - _rev_iterator& operator+=( difference_type n ) - { - if ( n < 0 ) - _seekFwd( -n ); - else - _seekRev( n ); - return *this; - } - //! subtraction assignment operator - _rev_iterator& operator-=( size_type n ) - { - _seekFwd( n ); - return *this; - } - //! subtraction assignment operator - _rev_iterator& operator-=( difference_type n ) - { - if ( n < 0 ) - _seekRev( -n ); - else - _seekFwd( n ); - return *this; - } - - //! dereference operator - value_type& operator*() const - { - return mIter[-1]; - } - - //! dereference at offset operator - value_type& operator[]( size_type n ) const - { - _rev_iterator tmp( *this ); - tmp -= n; - return *tmp; - } - //! dereference at offset operator - value_type& operator[]( difference_type n ) const - { - _rev_iterator tmp( *this ); - tmp -= n; - return *tmp; - } - }; - //######################################################################### - //! const reverse iterator for UString - class _const_rev_iterator: public _base_iterator - { /* i don't know why the beautifier is freaking out on this line */ - public: - _const_rev_iterator() { } - _const_rev_iterator( const _const_rev_iterator& i ) - { - _become( i ); - } - _const_rev_iterator( const _rev_iterator& i ) - { - _become( i ); - } - //! pre-increment - _const_rev_iterator& operator++() - { - _seekRev( 1 ); - return *this; - } - //! post-increment - _const_rev_iterator operator++( int ) - { - _const_rev_iterator tmp( *this ); - _seekRev( 1 ); - return tmp; - } - - //! pre-decrement - _const_rev_iterator& operator--() - { - _seekFwd( 1 ); - return *this; - } - //! post-decrement - _const_rev_iterator operator--( int ) - { - _const_rev_iterator tmp( *this ); - _seekFwd( 1 ); - return tmp; - } - - //! addition operator - _const_rev_iterator operator+( size_type n ) - { - _const_rev_iterator tmp( *this ); - tmp._seekRev( n ); - return tmp; - } - //! addition operator - _const_rev_iterator operator+( difference_type n ) - { - _const_rev_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekFwd( -n ); - else - tmp._seekRev( n ); - return tmp; - } - //! subtraction operator - _const_rev_iterator operator-( size_type n ) - { - _const_rev_iterator tmp( *this ); - tmp._seekFwd( n ); - return tmp; - } - //! subtraction operator - _const_rev_iterator operator-( difference_type n ) - { - _const_rev_iterator tmp( *this ); - if ( n < 0 ) - tmp._seekRev( -n ); - else - tmp._seekFwd( n ); - return tmp; - } - - //! addition assignment operator - _const_rev_iterator& operator+=( size_type n ) - { - _seekRev( n ); - return *this; - } - //! addition assignment operator - _const_rev_iterator& operator+=( difference_type n ) - { - if ( n < 0 ) - _seekFwd( -n ); - else - _seekRev( n ); - return *this; - } - //! subtraction assignment operator - _const_rev_iterator& operator-=( size_type n ) - { - _seekFwd( n ); - return *this; - } - //! subtraction assignment operator - _const_rev_iterator& operator-=( difference_type n ) - { - if ( n < 0 ) - _seekRev( -n ); - else - _seekFwd( n ); - return *this; - } - - //! dereference operator - const value_type& operator*() const - { - return mIter[-1]; - } - - //! dereference at offset operator - const value_type& operator[]( size_type n ) const - { - _const_rev_iterator tmp( *this ); - tmp -= n; - return *tmp; - } - //! dereference at offset operator - const value_type& operator[]( difference_type n ) const - { - _const_rev_iterator tmp( *this ); - tmp -= n; - return *tmp; - } - - //! difference operator - friend size_type operator-( const _const_rev_iterator& left, const _const_rev_iterator& right ); - //! equality operator - friend bool operator==( const _const_rev_iterator& left, const _const_rev_iterator& right ); - //! inequality operator - friend bool operator!=( const _const_rev_iterator& left, const _const_rev_iterator& right ); - //! less than - friend bool operator<( const _const_rev_iterator& left, const _const_rev_iterator& right ); - //! less than or equal - friend bool operator<=( const _const_rev_iterator& left, const _const_rev_iterator& right ); - //! greater than - friend bool operator>( const _const_rev_iterator& left, const _const_rev_iterator& right ); - //! greater than or equal - friend bool operator>=( const _const_rev_iterator& left, const _const_rev_iterator& right ); - }; - //######################################################################### - - typedef _fwd_iterator iterator; //!< iterator - typedef _rev_iterator reverse_iterator; //!< reverse iterator - typedef _const_fwd_iterator const_iterator; //!< const iterator - typedef _const_rev_iterator const_reverse_iterator; //!< const reverse iterator - - - //!\name Constructors/Destructor - //@{ - //! default constructor, creates an empty string - UString() - { - _init(); - } - //! copy constructor - UString( const UString& copy ) - { - _init(); - mData = copy.mData; - } - //! \a length copies of \a ch - UString( size_type length, const code_point& ch ) - { - _init(); - assign( length, ch ); - } - //! duplicate of nul-terminated sequence \a str - UString( const code_point* str ) - { - _init(); - assign( str ); - } - //! duplicate of \a str, \a length code points long - UString( const code_point* str, size_type length ) - { - _init(); - assign( str, length ); - } - //! substring of \a str starting at \a index and \a length code points long - UString( const UString& str, size_type index, size_type length ) - { - _init(); - assign( str, index, length ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! duplicate of nul-terminated \c wchar_t array - UString( const wchar_t* w_str ) - { - _init(); - assign( w_str ); - } - //! duplicate of \a w_str, \a length characters long - UString( const wchar_t* w_str, size_type length ) - { - _init(); - assign( w_str, length ); - } -#endif - //! duplicate of \a wstr - UString( const std::wstring& wstr ) - { - _init(); - assign( wstr ); - } - //! duplicate of nul-terminated C-string \a c_str (UTF-8 encoding) - UString( const char* c_str ) - { - _init(); - assign( c_str ); - } - //! duplicate of \a c_str, \a length characters long (UTF-8 encoding) - UString( const char* c_str, size_type length ) - { - _init(); - assign( c_str, length ); - } - //! duplicate of \a str (UTF-8 encoding) - UString( const std::string& str ) - { - _init(); - assign( str ); - } - //! destructor - ~UString() - { - _cleanBuffer(); - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name Utility functions - //@{ - //! Returns the number of code points in the current string - size_type size() const - { - return mData.size(); - } - //! Returns the number of code points in the current string - size_type length() const - { - return size(); - } - //! Returns the number of Unicode characters in the string - /*! Executes in linear time. */ - size_type length_Characters() const - { - const_iterator i = begin(), ie = end(); - size_type c = 0; - while ( i != ie ) - { - i.moveNext(); - ++c; - } - return c; - } - //! returns the maximum number of UTF-16 code points that the string can hold - size_type max_size() const - { - return mData.max_size(); - } - //! sets the capacity of the string to at least \a size code points - void reserve( size_type size ) - { - mData.reserve( size ); - } - //! changes the size of the string to \a size, filling in any new area with \a val - void resize( size_type num, const code_point& val = 0 ) - { - mData.resize( num, val ); - } - //! exchanges the elements of the current string with those of \a from - void swap( UString& from ) - { - mData.swap( from.mData ); - } - //! returns \c true if the string has no elements, \c false otherwise - bool empty() const - { - return mData.empty(); - } - //! returns a pointer to the first character in the current string - const code_point* c_str() const - { - return mData.c_str(); - } - //! returns a pointer to the first character in the current string - const code_point* data() const - { - return c_str(); - } - //! returns the number of elements that the string can hold before it will need to allocate more space - size_type capacity() const - { - return mData.capacity(); - } - //! deletes all of the elements in the string - void clear() - { - mData.clear(); - } - //! returns a substring of the current string, starting at \a index, and \a num characters long. - /*! If \a num is omitted, it will default to \c UString::npos, and the substr() function will simply return the remainder of the string starting at \a index. */ - UString substr( size_type index, size_type num = npos ) const - { - // this could avoid the extra copy if we used a private specialty constructor - dstring data = mData.substr( index, num ); - UString tmp; - tmp.mData.swap( data ); - return tmp; - } - //! appends \a val to the end of the string - void push_back( unicode_char val ) - { - code_point cp[2]; - size_t c = _utf32_to_utf16( val, cp ); - if ( c > 0 ) push_back( cp[0] ); - if ( c > 1 ) push_back( cp[1] ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! appends \a val to the end of the string - void push_back( wchar_t val ) - { - // we do this because the Unicode method still preserves UTF-16 code points - mData.push_back( static_cast( val ) ); - } -#endif - //! appends \a val to the end of the string - /*! This can be used to push surrogate pair code points, you'll just need to push them - one after the other. */ - void push_back( code_point val ) - { - mData.push_back( val ); - } - //! appends \a val to the end of the string - /*! Limited to characters under the 127 value barrier. */ - void push_back( char val ) - { - mData.push_back( static_cast( val ) ); - } - //! returns \c true if the given Unicode character \a ch is in this string - bool inString( unicode_char ch ) const - { - const_iterator i, ie = end(); - for ( i = begin(); i != ie; i.moveNext() ) - { - if ( i.getCharacter() == ch ) - return true; - } - return false; - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name Stream variations - //@{ - //! returns the current string in UTF-8 form within a std::string - const std::string& asUTF8() const - { - _load_buffer_UTF8(); - return *m_buffer.mStrBuffer; - } - //! returns the current string in UTF-8 form as a nul-terminated char array - const char* asUTF8_c_str() const - { - _load_buffer_UTF8(); - return m_buffer.mStrBuffer->c_str(); - } - //! returns the current string in UTF-32 form within a utf32string - const utf32string& asUTF32() const - { - _load_buffer_UTF32(); - return *m_buffer.mUTF32StrBuffer; - } - //! returns the current string in UTF-32 form as a nul-terminated unicode_char array - const unicode_char* asUTF32_c_str() const - { - _load_buffer_UTF32(); - return m_buffer.mUTF32StrBuffer->c_str(); - } - //! returns the current string in the native form of std::wstring - const std::wstring& asWStr() const - { - _load_buffer_WStr(); - return *m_buffer.mWStrBuffer; - } - //! returns the current string in the native form of a nul-terminated wchar_t array - const wchar_t* asWStr_c_str() const - { - _load_buffer_WStr(); - return m_buffer.mWStrBuffer->c_str(); - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name Single Character Access - //@{ - //! returns a reference to the element in the string at index \c loc - code_point& at( size_type loc ) - { - return mData.at( loc ); - } - //! returns a reference to the element in the string at index \c loc - const code_point& at( size_type loc ) const - { - return mData.at( loc ); - } - //! returns the data point \a loc evaluated as a UTF-32 value - /*! This function will will only properly decode surrogate pairs when \a loc points to the index - of a lead code point that is followed by a trailing code point. Evaluating the trailing code point - itself, or pointing to a code point that is a sentinel value (part of a broken pair) will return - the value of just that code point (not a valid Unicode value, but useful as a sentinel value). */ - unicode_char getChar( size_type loc ) const - { - const code_point* ptr = c_str(); - unicode_char uc; - size_t len = _utf16_char_length( ptr[loc] ); - code_point cp[2] = { /* blame the code beautifier */ 0, 0 }; - cp[0] = ptr[loc]; - - if ( len == 2 && ( loc + 1 ) < mData.length() ) - { - cp[1] = ptr[loc+1]; - } - _utf16_to_utf32( cp, uc ); - return uc; - } - //! sets the value of the character at \a loc to the Unicode value \a ch (UTF-32) - /*! Providing sentinel values (values between U+D800-U+DFFF) are accepted, but you should be aware - that you can also unwittingly create a valid surrogate pair if you don't pay attention to what you - are doing. \note This operation may also lengthen the string if a surrogate pair is needed to - represent the value given, but one is not available to replace; or alternatively shorten the string - if an existing surrogate pair is replaced with a character that is representable without a surrogate - pair. The return value will signify any lengthening or shortening performed, returning 0 if no change - was made, -1 if the string was shortened, or 1 if the string was lengthened. Any single call can - only change the string length by + or - 1. */ - int setChar( size_type loc, unicode_char ch ) - { - code_point cp[2] = { /* blame the code beautifier */ 0, 0 }; - size_t lc = _utf32_to_utf16( ch, cp ); - unicode_char existingChar = getChar( loc ); - size_t existingSize = _utf16_char_length( existingChar ); - size_t newSize = _utf16_char_length( ch ); - - if ( newSize > existingSize ) - { - at( loc ) = cp[0]; - insert( loc + 1, 1, cp[1] ); - return 1; - } - if ( newSize < existingSize ) - { - erase( loc, 1 ); - at( loc ) = cp[0]; - return -1; - } - - // newSize == existingSize - at( loc ) = cp[0]; - if ( lc == 2 ) at( loc + 1 ) = cp[1]; - return 0; - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name iterator acquisition - //@{ - //! returns an iterator to the first element of the string - iterator begin() - { - iterator i; - i.mIter = mData.begin(); - i.mString = this; - return i; - } - //! returns an iterator to the first element of the string - const_iterator begin() const - { - const_iterator i; - i.mIter = const_cast( this )->mData.begin(); - i.mString = const_cast( this ); - return i; - } - //! returns an iterator just past the end of the string - iterator end() - { - iterator i; - i.mIter = mData.end(); - i.mString = this; - return i; - } - //! returns an iterator just past the end of the string - const_iterator end() const - { - const_iterator i; - i.mIter = const_cast( this )->mData.end(); - i.mString = const_cast( this ); - return i; - } - //! returns a reverse iterator to the last element of the string - reverse_iterator rbegin() - { - reverse_iterator i; - i.mIter = mData.end(); - i.mString = this; - return i; - } - //! returns a reverse iterator to the last element of the string - const_reverse_iterator rbegin() const - { - const_reverse_iterator i; - i.mIter = const_cast( this )->mData.end(); - i.mString = const_cast( this ); - return i; - } - //! returns a reverse iterator just past the beginning of the string - reverse_iterator rend() - { - reverse_iterator i; - i.mIter = mData.begin(); - i.mString = this; - return i; - } - //! returns a reverse iterator just past the beginning of the string - const_reverse_iterator rend() const - { - const_reverse_iterator i; - i.mIter = const_cast( this )->mData.begin(); - i.mString = const_cast( this ); - return i; - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name assign - //@{ - //! gives the current string the values from \a start to \a end - UString& assign( iterator start, iterator end ) - { - mData.assign( start.mIter, end.mIter ); - return *this; - } - //! assign \a str to the current string - UString& assign( const UString& str ) - { - mData.assign( str.mData ); - return *this; - } - //! assign the nul-terminated \a str to the current string - UString& assign( const code_point* str ) - { - mData.assign( str ); - return *this; - } - //! assign the first \a num characters of \a str to the current string - UString& assign( const code_point* str, size_type num ) - { - mData.assign( str, num ); - return *this; - } - //! assign \a len entries from \a str to the current string, starting at \a index - UString& assign( const UString& str, size_type index, size_type len ) - { - mData.assign( str.mData, index, len ); - return *this; - } - //! assign \a num copies of \a ch to the current string - UString& assign( size_type num, const code_point& ch ) - { - mData.assign( num, ch ); - return *this; - } - //! assign \a wstr to the current string (\a wstr is treated as a UTF-16 stream) - UString& assign( const std::wstring& wstr ) - { - mData.clear(); - mData.reserve( wstr.length() ); // best guess bulk allocate -#ifdef WCHAR_UTF16 // if we're already working in UTF-16, this is easy - code_point tmp; - std::wstring::const_iterator i, ie = wstr.end(); - for ( i = wstr.begin(); i != ie; ++i ) - { - tmp = static_cast( *i ); - mData.push_back( tmp ); - } -#else // otherwise we do it the safe way (which is still 100% safe to pass UTF-16 through, just slower) - code_point cp[3] = { 0, 0, 0 }; - unicode_char tmp; - std::wstring::const_iterator i, ie = wstr.end(); - for ( i = wstr.begin(); i != ie; i++ ) - { - tmp = static_cast( *i ); - size_t lc = _utf32_to_utf16( tmp, cp ); - if ( lc > 0 ) mData.push_back( cp[0] ); - if ( lc > 1 ) mData.push_back( cp[1] ); - } -#endif - return *this; - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! assign \a w_str to the current string - UString& assign( const wchar_t* w_str ) - { - std::wstring tmp; - tmp.assign( w_str ); - return assign( tmp ); - } - //! assign the first \a num characters of \a w_str to the current string - UString& assign( const wchar_t* w_str, size_type num ) - { - std::wstring tmp; - tmp.assign( w_str, num ); - return assign( tmp ); - } -#endif - //! assign \a str to the current string (\a str is treated as a UTF-8 stream) - UString& assign( const std::string& str ) - { - size_type len = _verifyUTF8( str ); - clear(); // empty our contents, if there are any - reserve( len ); // best guess bulk capacity growth - - // This is a 3 step process, converting each byte in the UTF-8 stream to UTF-32, - // then converting it to UTF-16, then finally appending the data buffer - - unicode_char uc; // temporary Unicode character buffer - unsigned char utf8buf[7]; // temporary UTF-8 buffer - utf8buf[6] = 0; - size_t utf8len; // UTF-8 length - code_point utf16buff[3]; // temporary UTF-16 buffer - utf16buff[2] = 0; - size_t utf16len; // UTF-16 length - - std::string::const_iterator i, ie = str.end(); - for ( i = str.begin(); i != ie; ++i ) - { - utf8len = _utf8_char_length( static_cast( *i ) ); // estimate bytes to load - for ( size_t j = 0; j < utf8len; j++ ) - { // load the needed UTF-8 bytes - utf8buf[j] = ( static_cast( *( i + j ) ) ); // we don't increment 'i' here just in case the estimate is wrong (shouldn't happen, but we're being careful) - } - utf8buf[utf8len] = 0; // nul terminate so we throw an exception before running off the end of the buffer - utf8len = _utf8_to_utf32( utf8buf, uc ); // do the UTF-8 -> UTF-32 conversion - i += utf8len - 1; // we subtract 1 for the increment of the 'for' loop - - utf16len = _utf32_to_utf16( uc, utf16buff ); // UTF-32 -> UTF-16 conversion - append( utf16buff, utf16len ); // append the characters to the string - } - return *this; - } - //! assign \a c_str to the current string (\a c_str is treated as a UTF-8 stream) - UString& assign( const char* c_str ) - { - std::string tmp( c_str ); - return assign( tmp ); - } - //! assign the first \a num characters of \a c_str to the current string (\a c_str is treated as a UTF-8 stream) - UString& assign( const char* c_str, size_type num ) - { - std::string tmp; - tmp.assign( c_str, num ); - return assign( tmp ); - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name append - //@{ - //! appends \a str on to the end of the current string - UString& append( const UString& str ) - { - mData.append( str.mData ); - return *this; - } - //! appends \a str on to the end of the current string - UString& append( const code_point* str ) - { - mData.append( str ); - return *this; - } - //! appends a substring of \a str starting at \a index that is \a len characters long on to the end of the current string - UString& append( const UString& str, size_type index, size_type len ) - { - mData.append( str.mData, index, len ); - return *this; - } - //! appends \a num characters of \a str on to the end of the current string - UString& append( const code_point* str, size_type num ) - { - mData.append( str, num ); - return *this; - } - //! appends \a num repetitions of \a ch on to the end of the current string - UString& append( size_type num, code_point ch ) - { - mData.append( num, ch ); - return *this; - } - //! appends the sequence denoted by \a start and \a end on to the end of the current string - UString& append( iterator start, iterator end ) - { - mData.append( start.mIter, end.mIter ); - return *this; - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! appends \a num characters of \a str on to the end of the current string - UString& append( const wchar_t* w_str, size_type num ) - { - std::wstring tmp( w_str, num ); - return append( tmp ); - } - //! appends \a num repetitions of \a ch on to the end of the current string - UString& append( size_type num, wchar_t ch ) - { - return append( num, static_cast( ch ) ); - } -#endif - //! appends \a num characters of \a str on to the end of the current string (UTF-8 encoding) - UString& append( const char* c_str, size_type num ) - { - UString tmp( c_str, num ); - append( tmp ); - return *this; - } - //! appends \a num repetitions of \a ch on to the end of the current string (Unicode values less than 128) - UString& append( size_type num, char ch ) - { - append( num, static_cast( ch ) ); - return *this; - } - //! appends \a num repetitions of \a ch on to the end of the current string (Full Unicode spectrum) - UString& append( size_type num, unicode_char ch ) - { - code_point cp[2] = { 0, 0 }; - if ( _utf32_to_utf16( ch, cp ) == 2 ) - { - for ( size_type i = 0; i < num; i++ ) - { - append( 1, cp[0] ); - append( 1, cp[1] ); - } - } - else - { - for ( size_type i = 0; i < num; i++ ) - { - append( 1, cp[0] ); - } - } - return *this; - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name insert - //@{ - //! inserts \a ch before the code point denoted by \a i - iterator insert( iterator i, const code_point& ch ) - { - iterator ret; - ret.mIter = mData.insert( i.mIter, ch ); - ret.mString = this; - return ret; - } - //! inserts \a str into the current string, at location \a index - UString& insert( size_type index, const UString& str ) - { - mData.insert( index, str.mData ); - return *this; - } - //! inserts \a str into the current string, at location \a index - UString& insert( size_type index, const code_point* str ) - { - mData.insert( index, str ); - return *this; - } - //! inserts a substring of \a str (starting at \a index2 and \a num code points long) into the current string, at location \a index1 - UString& insert( size_type index1, const UString& str, size_type index2, size_type num ) - { - mData.insert( index1, str.mData, index2, num ); - return *this; - } - //! inserts the code points denoted by \a start and \a end into the current string, before the code point specified by \a i - void insert( iterator i, iterator start, iterator end ) - { - mData.insert( i.mIter, start.mIter, end.mIter ); - } - //! inserts \a num code points of \a str into the current string, at location \a index - UString& insert( size_type index, const code_point* str, size_type num ) - { - mData.insert( index, str, num ); - return *this; - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! inserts \a num code points of \a str into the current string, at location \a index - UString& insert( size_type index, const wchar_t* w_str, size_type num ) - { - UString tmp( w_str, num ); - insert( index, tmp ); - return *this; - } -#endif - //! inserts \a num code points of \a str into the current string, at location \a index - UString& insert( size_type index, const char* c_str, size_type num ) - { - UString tmp( c_str, num ); - insert( index, tmp ); - return *this; - } - //! inserts \a num copies of \a ch into the current string, at location \a index - UString& insert( size_type index, size_type num, code_point ch ) - { - mData.insert( index, num, ch ); - return *this; - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! inserts \a num copies of \a ch into the current string, at location \a index - UString& insert( size_type index, size_type num, wchar_t ch ) - { - insert( index, num, static_cast( ch ) ); - return *this; - } -#endif - //! inserts \a num copies of \a ch into the current string, at location \a index - UString& insert( size_type index, size_type num, char ch ) - { - insert( index, num, static_cast( ch ) ); - return *this; - } - //! inserts \a num copies of \a ch into the current string, at location \a index - UString& insert( size_type index, size_type num, unicode_char ch ) - { - code_point cp[3] = { 0, 0, 0 }; - size_t lc = _utf32_to_utf16( ch, cp ); - if ( lc == 1 ) - { - return insert( index, num, cp[0] ); - } - for ( size_type c = 0; c < num; c++ ) - { - // insert in reverse order to preserve ordering after insert - insert( index, 1, cp[1] ); - insert( index, 1, cp[0] ); - } - return *this; - } - //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i - void insert( iterator i, size_type num, const code_point& ch ) - { - mData.insert( i.mIter, num, ch ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i - void insert( iterator i, size_type num, const wchar_t& ch ) - { - insert( i, num, static_cast( ch ) ); - } -#endif - //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i - void insert( iterator i, size_type num, const char& ch ) - { - insert( i, num, static_cast( ch ) ); - } - //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i - void insert( iterator i, size_type num, const unicode_char& ch ) - { - code_point cp[3] = { 0, 0, 0 }; - size_t lc = _utf32_to_utf16( ch, cp ); - if ( lc == 1 ) - { - insert( i, num, cp[0] ); - } - else - { - for ( size_type c = 0; c < num; c++ ) - { - // insert in reverse order to preserve ordering after insert - insert( i, 1, cp[1] ); - insert( i, 1, cp[0] ); - } - } - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name erase - //@{ - //! removes the code point pointed to by \a loc, returning an iterator to the next character - iterator erase( iterator loc ) - { - iterator ret; - ret.mIter = mData.erase( loc.mIter ); - ret.mString = this; - return ret; - } - //! removes the code points between \a start and \a end (including the one at \a start but not the one at \a end), returning an iterator to the code point after the last code point removed - iterator erase( iterator start, iterator end ) - { - iterator ret; - ret.mIter = mData.erase( start.mIter, end.mIter ); - ret.mString = this; - return ret; - } - //! removes \a num code points from the current string, starting at \a index - UString& erase( size_type index = 0, size_type num = npos ) - { - if ( num == npos ) - mData.erase( index ); - else - mData.erase( index, num ); - return *this; - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name replace - //@{ - //! replaces up to \a num1 code points of the current string (starting at \a index1) with \a str - UString& replace( size_type index1, size_type num1, const UString& str ) - { - mData.replace( index1, num1, str.mData, 0, npos ); - return *this; - } - //! replaces up to \a num1 code points of the current string (starting at \a index1) with up to \a num2 code points from \a str - UString& replace( size_type index1, size_type num1, const UString& str, size_type num2 ) - { - mData.replace( index1, num1, str.mData, 0, num2 ); - return *this; - } - //! replaces up to \a num1 code points of the current string (starting at \a index1) with up to \a num2 code points from \a str beginning at \a index2 - UString& replace( size_type index1, size_type num1, const UString& str, size_type index2, size_type num2 ) - { - mData.replace( index1, num1, str.mData, index2, num2 ); - return *this; - } - //! replaces code points in the current string from \a start to \a end with \a num code points from \a str - UString& replace( iterator start, iterator end, const UString& str, size_type num = npos ) - { - _const_fwd_iterator st(start); //Work around for gcc, allow it to find correct overload - - size_type index1 = begin() - st; - size_type num1 = end - st; - return replace( index1, num1, str, 0, num ); - } - //! replaces up to \a num1 code points in the current string (beginning at \a index) with \c num2 copies of \c ch - UString& replace( size_type index, size_type num1, size_type num2, code_point ch ) - { - mData.replace( index, num1, num2, ch ); - return *this; - } - //! replaces the code points in the current string from \a start to \a end with \a num copies of \a ch - UString& replace( iterator start, iterator end, size_type num, code_point ch ) - { - _const_fwd_iterator st(start); //Work around for gcc, allow it to find correct overload - - size_type index1 = begin() - st; - size_type num1 = end - st; - return replace( index1, num1, num, ch ); - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name compare - //@{ - //! compare \a str to the current string - int compare( const UString& str ) const - { - return mData.compare( str.mData ); - } - //! compare \a str to the current string - int compare( const code_point* str ) const - { - return mData.compare( str ); - } - //! compare \a str to a substring of the current string, starting at \a index for \a length characters - int compare( size_type index, size_type length, const UString& str ) const - { - return mData.compare( index, length, str.mData ); - } - //! compare a substring of \a str to a substring of the current string, where \a index2 and \a length2 refer to \a str and \a index and \a length refer to the current string - int compare( size_type index, size_type length, const UString& str, size_type index2, size_type length2 ) const - { - return mData.compare( index, length, str.mData, index2, length2 ); - } - //! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 characters long, and the substring of the current string begins at \a index and is \a length characters long - int compare( size_type index, size_type length, const code_point* str, size_type length2 ) const - { - return mData.compare( index, length, str, length2 ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 elements long, and the substring of the current string begins at \a index and is \a length characters long - int compare( size_type index, size_type length, const wchar_t* w_str, size_type length2 ) const - { - UString tmp( w_str, length2 ); - return compare( index, length, tmp ); - } -#endif - //! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 UTF-8 code points long, and the substring of the current string begins at \a index and is \a length characters long - int compare( size_type index, size_type length, const char* c_str, size_type length2 ) const - { - UString tmp( c_str, length2 ); - return compare( index, length, tmp ); - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name find & rfind - //@{ - //! returns the index of the first occurrence of \a str within the current string, starting at \a index; returns \c UString::npos if nothing is found - /*! \a str is a UTF-16 encoded string, but through implicit casting can also be a UTF-8 encoded string (const char* or std::string) */ - size_type find( const UString& str, size_type index = 0 ) const - { - return mData.find( str.c_str(), index ); - } - //! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UString::npos if nothing is found - /*! \a cp_str is a UTF-16 encoded string */ - size_type find( const code_point* cp_str, size_type index, size_type length ) const - { - UString tmp( cp_str ); - return mData.find( tmp.c_str(), index, length ); - } - //! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UString::npos if nothing is found - /*! \a cp_str is a UTF-8 encoded string */ - size_type find( const char* c_str, size_type index, size_type length ) const - { - UString tmp( c_str ); - return mData.find( tmp.c_str(), index, length ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UString::npos if nothing is found - /*! \a cp_str is a UTF-16 encoded string */ - size_type find( const wchar_t* w_str, size_type index, size_type length ) const - { - UString tmp( w_str ); - return mData.find( tmp.c_str(), index, length ); - } -#endif - //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UString::npos if nothing is found - /*! \a ch is only capable of representing Unicode values up to U+007F (127) */ - size_type find( char ch, size_type index = 0 ) const - { - return find( static_cast( ch ), index ); - } - //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UString::npos if nothing is found - /*! \a ch is only capable of representing Unicode values up to U+FFFF (65535) */ - size_type find( code_point ch, size_type index = 0 ) const - { - return mData.find( ch, index ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UString::npos if nothing is found - /*! \a ch is only capable of representing Unicode values up to U+FFFF (65535) */ - size_type find( wchar_t ch, size_type index = 0 ) const - { - return find( static_cast( ch ), index ); - } -#endif - //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UString::npos if nothing is found - /*! \a ch can fully represent any Unicode character */ - size_type find( unicode_char ch, size_type index = 0 ) const - { - code_point cp[3] = { 0, 0, 0 }; - size_t lc = _utf32_to_utf16( ch, cp ); - return find( UString( cp, lc ), index ); - } - - //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type rfind( const UString& str, size_type index = 0 ) const - { - return mData.rfind( str.c_str(), index ); - } - //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UString::npos if nothing is found - size_type rfind( const code_point* cp_str, size_type index, size_type num ) const - { - UString tmp( cp_str ); - return mData.rfind( tmp.c_str(), index, num ); - } - //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UString::npos if nothing is found - size_type rfind( const char* c_str, size_type index, size_type num ) const - { - UString tmp( c_str ); - return mData.rfind( tmp.c_str(), index, num ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UString::npos if nothing is found - size_type rfind( const wchar_t* w_str, size_type index, size_type num ) const - { - UString tmp( w_str ); - return mData.rfind( tmp.c_str(), index, num ); - } -#endif - //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type rfind( char ch, size_type index = 0 ) const - { - return rfind( static_cast( ch ), index ); - } - //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type rfind( code_point ch, size_type index ) const - { - return mData.rfind( ch, index ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type rfind( wchar_t ch, size_type index = 0 ) const - { - return rfind( static_cast( ch ), index ); - } -#endif - //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type rfind( unicode_char ch, size_type index = 0 ) const - { - code_point cp[3] = { 0, 0, 0 }; - size_t lc = _utf32_to_utf16( ch, cp ); - return rfind( UString( cp, lc ), index ); - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name find_first/last_(not)_of - //@{ - //! Returns the index of the first character within the current string that matches \b any character in \a str, beginning the search at \a index and searching at most \a num characters; returns \c UString::npos if nothing is found - size_type find_first_of( const UString &str, size_type index = 0, size_type num = npos ) const - { - size_type i = 0; - const size_type len = length(); - while ( i < num && ( index + i ) < len ) - { - unicode_char ch = getChar( index + i ); - if ( str.inString( ch ) ) - return index + i; - i += _utf16_char_length( ch ); // increment by the Unicode character length - } - return npos; - } - //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UString::npos if nothing is found - size_type find_first_of( code_point ch, size_type index = 0 ) const - { - UString tmp; - tmp.assign( 1, ch ); - return find_first_of( tmp, index ); - } - //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UString::npos if nothing is found - size_type find_first_of( char ch, size_type index = 0 ) const - { - return find_first_of( static_cast( ch ), index ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UString::npos if nothing is found - size_type find_first_of( wchar_t ch, size_type index = 0 ) const - { - return find_first_of( static_cast( ch ), index ); - } -#endif - //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UString::npos if nothing is found - size_type find_first_of( unicode_char ch, size_type index = 0 ) const - { - code_point cp[3] = { 0, 0, 0 }; - size_t lc = _utf32_to_utf16( ch, cp ); - return find_first_of( UString( cp, lc ), index ); - } - - //! returns the index of the first character within the current string that does not match any character in \a str, beginning the search at \a index and searching at most \a num characters; returns \c UString::npos if nothing is found - size_type find_first_not_of( const UString& str, size_type index = 0, size_type num = npos ) const - { - size_type i = 0; - const size_type len = length(); - while ( i < num && ( index + i ) < len ) - { - unicode_char ch = getChar( index + i ); - if ( !str.inString( ch ) ) - return index + i; - i += _utf16_char_length( ch ); // increment by the Unicode character length - } - return npos; - } - //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UString::npos if nothing is found - size_type find_first_not_of( code_point ch, size_type index = 0 ) const - { - UString tmp; - tmp.assign( 1, ch ); - return find_first_not_of( tmp, index ); - } - //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UString::npos if nothing is found - size_type find_first_not_of( char ch, size_type index = 0 ) const - { - return find_first_not_of( static_cast( ch ), index ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UString::npos if nothing is found - size_type find_first_not_of( wchar_t ch, size_type index = 0 ) const - { - return find_first_not_of( static_cast( ch ), index ); - } -#endif - //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UString::npos if nothing is found - size_type find_first_not_of( unicode_char ch, size_type index = 0 ) const - { - code_point cp[3] = { 0, 0, 0 }; - size_t lc = _utf32_to_utf16( ch, cp ); - return find_first_not_of( UString( cp, lc ), index ); - } - - //! returns the index of the first character within the current string that matches any character in \a str, doing a reverse search from \a index and searching at most \a num characters; returns \c UString::npos if nothing is found - size_type find_last_of( const UString& str, size_type index = npos, size_type num = npos ) const - { - size_type i = 0; - const size_type len = length(); - if ( index > len ) index = len - 1; - - while ( i < num && ( index - i ) != npos ) - { - size_type j = index - i; - // careful to step full Unicode characters - if ( j != 0 && _utf16_surrogate_follow( at( j ) ) && _utf16_surrogate_lead( at( j - 1 ) ) ) - { - j = index - ++i; - } - // and back to the usual dull test - unicode_char ch = getChar( j ); - if ( str.inString( ch ) ) - return j; - i++; - } - return npos; - } - //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type find_last_of( code_point ch, size_type index = npos ) const - { - UString tmp; - tmp.assign( 1, ch ); - return find_last_of( tmp, index ); - } - //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type find_last_of( char ch, size_type index = npos ) const - { - return find_last_of( static_cast( ch ), index ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type find_last_of( wchar_t ch, size_type index = npos ) const - { - return find_last_of( static_cast( ch ), index ); - } -#endif - //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type find_last_of( unicode_char ch, size_type index = npos ) const - { - code_point cp[3] = { 0, 0, 0 }; - size_t lc = _utf32_to_utf16( ch, cp ); - return find_last_of( UString( cp, lc ), index ); - } - - //! returns the index of the last character within the current string that does not match any character in \a str, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type find_last_not_of( const UString& str, size_type index = npos, size_type num = npos ) const - { - size_type i = 0; - const size_type len = length(); - if ( index > len ) index = len - 1; - - while ( i < num && ( index - i ) != npos ) - { - size_type j = index - i; - // careful to step full Unicode characters - if ( j != 0 && _utf16_surrogate_follow( at( j ) ) && _utf16_surrogate_lead( at( j - 1 ) ) ) - { - j = index - ++i; - } - // and back to the usual dull test - unicode_char ch = getChar( j ); - if ( !str.inString( ch ) ) - return j; - i++; - } - return npos; - } - //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type find_last_not_of( code_point ch, size_type index = npos ) const - { - UString tmp; - tmp.assign( 1, ch ); - return find_last_not_of( tmp, index ); - } - //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type find_last_not_of( char ch, size_type index = npos ) const - { - return find_last_not_of( static_cast( ch ), index ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type find_last_not_of( wchar_t ch, size_type index = npos ) const - { - return find_last_not_of( static_cast( ch ), index ); - } -#endif - //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UString::npos if nothing is found - size_type find_last_not_of( unicode_char ch, size_type index = npos ) const - { - code_point cp[3] = { 0, 0, 0 }; - size_t lc = _utf32_to_utf16( ch, cp ); - return find_last_not_of( UString( cp, lc ), index ); - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name Operators - //@{ - //! less than operator - bool operator<( const UString& right ) const - { - return compare( right ) < 0; - } - //! less than or equal operator - bool operator<=( const UString& right ) const - { - return compare( right ) <= 0; - } - //! greater than operator - bool operator>( const UString& right ) const - { - return compare( right ) > 0; - } - //! greater than or equal operator - bool operator>=( const UString& right ) const - { - return compare( right ) >= 0; - } - //! equality operator - bool operator==( const UString& right ) const - { - return compare( right ) == 0; - } - //! inequality operator - bool operator!=( const UString& right ) const - { - return !operator==( right ); - } - //! assignment operator, implicitly casts all compatible types - UString& operator=( const UString& s ) - { - return assign( s ); - } - //! assignment operator - UString& operator=( code_point ch ) - { - clear(); - return append( 1, ch ); - } - //! assignment operator - UString& operator=( char ch ) - { - clear(); - return append( 1, ch ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! assignment operator - UString& operator=( wchar_t ch ) - { - clear(); - return append( 1, ch ); - } -#endif - //! assignment operator - UString& operator=( unicode_char ch ) - { - clear(); - return append( 1, ch ); - } - //! code point dereference operator - code_point& operator[]( size_type index ) - { - return at( index ); - } - //! code point dereference operator - const code_point& operator[]( size_type index ) const - { - return at( index ); - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name Implicit Cast Operators - //@{ - //! implicit cast to std::string - operator std::string() const - { - return std::string( asUTF8() ); - } - //! implicit cast to std::wstring - operator std::wstring() const - { - return std::wstring( asWStr() ); - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name UTF-16 character encoding/decoding - //@{ - //! returns \c true if \a cp does not match the signature for the lead of follow code point of a surrogate pair in a UTF-16 sequence - static bool _utf16_independent_char( code_point cp ) - { - if ( 0xD800 <= cp && cp <= 0xDFFF ) // tests if the cp is within the surrogate pair range - return false; // it matches a surrogate pair signature - return true; // everything else is a standalone code point - } - //! returns \c true if \a cp matches the signature of a surrogate pair lead character - static bool _utf16_surrogate_lead( code_point cp ) - { - if ( 0xD800 <= cp && cp <= 0xDBFF ) // tests if the cp is within the 2nd word of a surrogate pair - return true; // it is a 1st word - return false; // it isn't - } - //! returns \c true if \a cp matches the signature of a surrogate pair following character - static bool _utf16_surrogate_follow( code_point cp ) - { - if ( 0xDC00 <= cp && cp <= 0xDFFF ) // tests if the cp is within the 2nd word of a surrogate pair - return true; // it is a 2nd word - return false; // everything else isn't - } - //! estimates the number of UTF-16 code points in the sequence starting with \a cp - static size_t _utf16_char_length( code_point cp ) - { - if ( 0xD800 <= cp && cp <= 0xDBFF ) // test if cp is the beginning of a surrogate pair - return 2; // if it is, then we are 2 words long - return 1; // otherwise we are only 1 word long - } - //! returns the number of UTF-16 code points needed to represent the given UTF-32 character \a cp - static size_t _utf16_char_length( unicode_char uc ) - { - if ( uc > 0xFFFF ) // test if uc is greater than the single word maximum - return 2; // if so, we need a surrogate pair - return 1; // otherwise we can stuff it into a single word - } - //! converts the given UTF-16 character buffer \a in_cp to a single UTF-32 Unicode character \a out_uc, returns the number of code points used to create the output character (2 for surrogate pairs, otherwise 1) - /*! This function does it's best to prevent error conditions, verifying complete - surrogate pairs before applying the algorithm. In the event that half of a pair - is found it will happily generate a value in the 0xD800 - 0xDFFF range, which is - normally an invalid Unicode value but we preserve them for use as sentinel values. */ - static size_t _utf16_to_utf32( const code_point in_cp[2], unicode_char& out_uc ) - { - const code_point& cp1 = in_cp[0]; - const code_point& cp2 = in_cp[1]; - bool wordPair = false; - - // does it look like a surrogate pair? - if ( 0xD800 <= cp1 && cp1 <= 0xDBFF ) - { - // looks like one, but does the other half match the algorithm as well? - if ( 0xDC00 <= cp2 && cp2 <= 0xDFFF ) - wordPair = true; // yep! - } - - if ( !wordPair ) - { // if we aren't a 100% authentic surrogate pair, then just copy the value - out_uc = cp1; - return 1; - } - - unsigned short cU = cp1, cL = cp2; // copy upper and lower words of surrogate pair to writable buffers - cU -= 0xD800; // remove the encoding markers - cL -= 0xDC00; - - out_uc = ( cU & 0x03FF ) << 10; // grab the 10 upper bits and set them in their proper location - out_uc |= ( cL & 0x03FF ); // combine in the lower 10 bits - out_uc += 0x10000; // add back in the value offset - - return 2; // this whole operation takes to words, so that's what we'll return - } - //! writes the given UTF-32 \a uc_in to the buffer location \a out_cp using UTF-16 encoding, returns the number of code points used to encode the input (always 1 or 2) - /*! This function, like its counterpart, will happily create invalid UTF-16 surrogate pairs. These - invalid entries will be created for any value of \c in_uc that falls in the range U+D800 - U+DFFF. - These are generally useful as sentinel values to represent various program specific conditions. - \note This function will also pass through any single UTF-16 code point without modification, - making it a safe method of ensuring a stream that is unknown UTF-32 or UTF-16 is truly UTF-16.*/ - static size_t _utf32_to_utf16( const unicode_char& in_uc, code_point out_cp[2] ) - { - if ( in_uc <= 0xFFFF ) - { // we blindly preserve sentinel values because our decoder understands them - out_cp[0] = in_uc; - return 1; - } - unicode_char uc = in_uc; // copy to writable buffer - unsigned short tmp; // single code point buffer - uc -= 0x10000; // subtract value offset - - //process upper word - tmp = ( uc >> 10 ) & 0x03FF; // grab the upper 10 bits - tmp += 0xD800; // add encoding offset - out_cp[0] = tmp; // write - - // process lower word - tmp = uc & 0x03FF; // grab the lower 10 bits - tmp += 0xDC00; // add encoding offset - out_cp[1] = tmp; // write - - return 2; // return used word count (2 for surrogate pairs) - } - //@} - - ////////////////////////////////////////////////////////////////////////// - - //!\name UTF-8 character encoding/decoding - //@{ - //! returns \c true if \a cp is the beginning of a UTF-8 sequence - static bool _utf8_start_char( unsigned char cp ) - { - return ( cp & ~_cont_mask ) != _cont; - } - //! estimates the number of UTF-8 code points in the sequence starting with \a cp - static size_t _utf8_char_length( unsigned char cp ) - { - if ( !( cp & 0x80 ) ) return 1; - if (( cp & ~_lead1_mask ) == _lead1 ) return 2; - if (( cp & ~_lead2_mask ) == _lead2 ) return 3; - if (( cp & ~_lead3_mask ) == _lead3 ) return 4; - if (( cp & ~_lead4_mask ) == _lead4 ) return 5; - if (( cp & ~_lead5_mask ) == _lead5 ) return 6; - throw invalid_data( "invalid UTF-8 sequence header value" ); - } - //! returns the number of UTF-8 code points needed to represent the given UTF-32 character \a cp - static size_t _utf8_char_length( unicode_char uc ) - { - /* - 7 bit: U-00000000 - U-0000007F: 0xxxxxxx - 11 bit: U-00000080 - U-000007FF: 110xxxxx 10xxxxxx - 16 bit: U-00000800 - U-0000FFFF: 1110xxxx 10xxxxxx 10xxxxxx - 21 bit: U-00010000 - U-001FFFFF: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - 26 bit: U-00200000 - U-03FFFFFF: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx - 31 bit: U-04000000 - U-7FFFFFFF: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx - */ - if ( !( uc & ~0x0000007F ) ) return 1; - if ( !( uc & ~0x000007FF ) ) return 2; - if ( !( uc & ~0x0000FFFF ) ) return 3; - if ( !( uc & ~0x001FFFFF ) ) return 4; - if ( !( uc & ~0x03FFFFFF ) ) return 5; - if ( !( uc & ~0x7FFFFFFF ) ) return 6; - throw invalid_data( "invalid UTF-32 value" ); - } - - //! converts the given UTF-8 character buffer to a single UTF-32 Unicode character, returns the number of bytes used to create the output character (maximum of 6) - static size_t _utf8_to_utf32( const unsigned char in_cp[6], unicode_char& out_uc ) - { - size_t len = _utf8_char_length( in_cp[0] ); - if ( len == 1 ) - { // if we are only 1 byte long, then just grab it and exit - out_uc = in_cp[0]; - return 1; - } - - unicode_char c = 0; // temporary buffer - size_t i = 0; - switch ( len ) - { // load header byte - case 6: - c = in_cp[i] & _lead5_mask; - break; - case 5: - c = in_cp[i] & _lead4_mask; - break; - case 4: - c = in_cp[i] & _lead3_mask; - break; - case 3: - c = in_cp[i] & _lead2_mask; - break; - case 2: - c = in_cp[i] & _lead1_mask; - break; - } - - for ( ++i; i < len; i++ ) - { // load each continuation byte - if (( in_cp[i] & ~_cont_mask ) != _cont ) - throw invalid_data( "bad UTF-8 continuation byte" ); - c <<= 6; - c |= ( in_cp[i] & _cont_mask ); - } - - out_uc = c; // write the final value and return the used byte length - return len; - } - //! writes the given UTF-32 \a uc_in to the buffer location \a out_cp using UTF-8 encoding, returns the number of bytes used to encode the input - static size_t _utf32_to_utf8( const unicode_char& in_uc, unsigned char out_cp[6] ) - { - size_t len = _utf8_char_length( in_uc ); // predict byte length of sequence - unicode_char c = in_uc; // copy to temp buffer - - //stuff all of the lower bits - for ( size_t i = len - 1; i > 0; i-- ) - { - out_cp[i] = (( c ) & _cont_mask ) | _cont; - c >>= 6; - } - - //now write the header byte - switch ( len ) - { - case 6: - out_cp[0] = (( c ) & _lead5_mask ) | _lead5; - break; - case 5: - out_cp[0] = (( c ) & _lead4_mask ) | _lead4; - break; - case 4: - out_cp[0] = (( c ) & _lead3_mask ) | _lead3; - break; - case 3: - out_cp[0] = (( c ) & _lead2_mask ) | _lead2; - break; - case 2: - out_cp[0] = (( c ) & _lead1_mask ) | _lead1; - break; - case 1: - default: - out_cp[0] = ( c ) & 0x7F; - break; - } - - // return the byte length of the sequence - return len; - } - - //! verifies a UTF-8 stream, returning the total number of Unicode characters found - static size_type _verifyUTF8( const unsigned char* c_str ) - { - std::string tmp( reinterpret_cast( c_str ) ); - return _verifyUTF8( tmp ); - } - //! verifies a UTF-8 stream, returning the total number of Unicode characters found - static size_type _verifyUTF8( const std::string& str ) - { - std::string::const_iterator i, ie = str.end(); - i = str.begin(); - size_type length = 0; - - while ( i != ie ) - { - // characters pass until we find an extended sequence - if (( *i ) & 0x80 ) - { - unsigned char c = ( *i ); - size_t contBytes = 0; - - // get continuation byte count and test for overlong sequences - if (( c & ~_lead1_mask ) == _lead1 ) - { // 1 additional byte - if ( c == _lead1 ) throw invalid_data( "overlong UTF-8 sequence" ); - contBytes = 1; - - } - else if (( c & ~_lead2_mask ) == _lead2 ) - { // 2 additional bytes - contBytes = 2; - if ( c == _lead2 ) - { // possible overlong UTF-8 sequence - c = ( *( i + 1 ) ); // look ahead to next byte in sequence - if (( c & _lead2 ) == _cont ) throw invalid_data( "overlong UTF-8 sequence" ); - } - - } - else if (( c & ~_lead3_mask ) == _lead3 ) - { // 3 additional bytes - contBytes = 3; - if ( c == _lead3 ) - { // possible overlong UTF-8 sequence - c = ( *( i + 1 ) ); // look ahead to next byte in sequence - if (( c & _lead3 ) == _cont ) throw invalid_data( "overlong UTF-8 sequence" ); - } - - } - else if (( c & ~_lead4_mask ) == _lead4 ) - { // 4 additional bytes - contBytes = 4; - if ( c == _lead4 ) - { // possible overlong UTF-8 sequence - c = ( *( i + 1 ) ); // look ahead to next byte in sequence - if (( c & _lead4 ) == _cont ) throw invalid_data( "overlong UTF-8 sequence" ); - } - - } - else if (( c & ~_lead5_mask ) == _lead5 ) - { // 5 additional bytes - contBytes = 5; - if ( c == _lead5 ) - { // possible overlong UTF-8 sequence - c = ( *( i + 1 ) ); // look ahead to next byte in sequence - if (( c & _lead5 ) == _cont ) throw invalid_data( "overlong UTF-8 sequence" ); - } - } - - // check remaining continuation bytes for - while ( contBytes-- ) - { - c = ( *( ++i ) ); // get next byte in sequence - if (( c & ~_cont_mask ) != _cont ) - throw invalid_data( "bad UTF-8 continuation byte" ); - } - } - length++; - i++; - } - return length; - } - //@} - - private: - //template friend class _iterator; - dstring mData; - - //! buffer data type identifier - enum BufferType - { - bt_none, - bt_string, - bt_wstring, - bt_utf32string - }; - - //! common constructor operations - void _init() - { - m_buffer.mVoidBuffer = 0; - m_bufferType = bt_none; - m_bufferSize = 0; - } - - /////////////////////////////////////////////////////////////////////// - // Scratch buffer - //! auto cleans the scratch buffer using the proper delete for the stored type - void _cleanBuffer() const - { - if ( m_buffer.mVoidBuffer != 0 ) - { - switch ( m_bufferType ) - { - case bt_string: - delete m_buffer.mStrBuffer; - break; - case bt_wstring: - delete m_buffer.mWStrBuffer; - break; - case bt_utf32string: - delete m_buffer.mUTF32StrBuffer; - break; - case bt_none: // under the worse of circumstances, this is all we can do, and hope it works out - default: - //delete m_buffer.mVoidBuffer; - // delete void* is undefined, don't do that - MYGUI_ASSERT(false, "This should never happen - mVoidBuffer should never contain something if we " - "don't know the type"); - break; - } - m_buffer.mVoidBuffer = 0; - m_bufferSize = 0; - } - } - - //! create a std::string in the scratch buffer area - void _getBufferStr() const - { - if ( m_bufferType != bt_string ) - { - _cleanBuffer(); - m_buffer.mStrBuffer = new std::string(); - m_bufferType = bt_string; - } - m_buffer.mStrBuffer->clear(); - } - //! create a std::wstring in the scratch buffer area - void _getBufferWStr() const - { - if ( m_bufferType != bt_wstring ) - { - _cleanBuffer(); - m_buffer.mWStrBuffer = new std::wstring(); - m_bufferType = bt_wstring; - } - m_buffer.mWStrBuffer->clear(); - } - //! create a utf32string in the scratch buffer area - void _getBufferUTF32Str() const - { - if ( m_bufferType != bt_utf32string ) - { - _cleanBuffer(); - m_buffer.mUTF32StrBuffer = new utf32string(); - m_bufferType = bt_utf32string; - } - m_buffer.mUTF32StrBuffer->clear(); - } - - void _load_buffer_UTF8() const - { - _getBufferStr(); - std::string& buffer = ( *m_buffer.mStrBuffer ); - buffer.reserve( length() ); - - unsigned char utf8buf[6]; - char* charbuf = ( char* )utf8buf; - unicode_char c; - size_t len; - - const_iterator i, ie = end(); - for ( i = begin(); i != ie; i.moveNext() ) - { - c = i.getCharacter(); - len = _utf32_to_utf8( c, utf8buf ); - size_t j = 0; - while ( j < len ) - buffer.push_back( charbuf[j++] ); - } - } - void _load_buffer_WStr() const - { - _getBufferWStr(); - std::wstring& buffer = ( *m_buffer.mWStrBuffer ); - buffer.reserve( length() ); // may over reserve, but should be close enough -#ifdef WCHAR_UTF16 // wchar_t matches UTF-16 - const_iterator i, ie = end(); - for ( i = begin(); i != ie; ++i ) - { - buffer.push_back(( wchar_t )( *i ) ); - } -#else // wchar_t fits UTF-32 - unicode_char c; - const_iterator i, ie = end(); - for ( i = begin(); i != ie; i.moveNext() ) - { - c = i.getCharacter(); - buffer.push_back(( wchar_t )c ); - } -#endif - } - void _load_buffer_UTF32() const - { - _getBufferUTF32Str(); - utf32string& buffer = ( *m_buffer.mUTF32StrBuffer ); - buffer.reserve( length() ); // may over reserve, but should be close enough - - unicode_char c; - - const_iterator i, ie = end(); - for ( i = begin(); i != ie; i.moveNext() ) - { - c = i.getCharacter(); - buffer.push_back( c ); - } - } - - mutable BufferType m_bufferType; // identifies the data type held in m_buffer - mutable size_t m_bufferSize; // size of the CString buffer - - // multi-purpose buffer used everywhere we need a throw-away buffer - union Buffer - { - mutable void* mVoidBuffer; - mutable std::string* mStrBuffer; - mutable std::wstring* mWStrBuffer; - mutable utf32string* mUTF32StrBuffer; - } - m_buffer; - }; - - //! string addition operator \relates UString - inline UString operator+( const UString& s1, const UString& s2 ) - { - return UString( s1 ).append( s2 ); - } - //! string addition operator \relates UString - inline UString operator+( const UString& s1, UString::code_point c ) - { - return UString( s1 ).append( 1, c ); - } - //! string addition operator \relates UString - inline UString operator+( const UString& s1, UString::unicode_char c ) - { - return UString( s1 ).append( 1, c ); - } - //! string addition operator \relates UString - inline UString operator+( const UString& s1, char c ) - { - return UString( s1 ).append( 1, c ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! string addition operator \relates UString - inline UString operator+( const UString& s1, wchar_t c ) - { - return UString( s1 ).append( 1, c ); - } -#endif - //! string addition operator \relates UString - inline UString operator+( UString::code_point c, const UString& s2 ) - { - return UString().append( 1, c ).append( s2 ); - } - //! string addition operator \relates UString - inline UString operator+( UString::unicode_char c, const UString& s2 ) - { - return UString().append( 1, c ).append( s2 ); - } - //! string addition operator \relates UString - inline UString operator+( char c, const UString& s2 ) - { - return UString().append( 1, c ).append( s2 ); - } -#if MYGUI_IS_NATIVE_WCHAR_T - //! string addition operator \relates UString - inline UString operator+( wchar_t c, const UString& s2 ) - { - return UString().append( 1, c ).append( s2 ); - } -#endif - - // (const) forward iterator common operators - inline UString::size_type operator-( const UString::_const_fwd_iterator& left, const UString::_const_fwd_iterator& right ) - { - return ( left.mIter - right.mIter ); - } - inline bool operator==( const UString::_const_fwd_iterator& left, const UString::_const_fwd_iterator& right ) - { - return left.mIter == right.mIter; - } - inline bool operator!=( const UString::_const_fwd_iterator& left, const UString::_const_fwd_iterator& right ) - { - return left.mIter != right.mIter; - } - inline bool operator<( const UString::_const_fwd_iterator& left, const UString::_const_fwd_iterator& right ) - { - return left.mIter < right.mIter; - } - inline bool operator<=( const UString::_const_fwd_iterator& left, const UString::_const_fwd_iterator& right ) - { - return left.mIter <= right.mIter; - } - inline bool operator>( const UString::_const_fwd_iterator& left, const UString::_const_fwd_iterator& right ) - { - return left.mIter > right.mIter; - } - inline bool operator>=( const UString::_const_fwd_iterator& left, const UString::_const_fwd_iterator& right ) - { - return left.mIter >= right.mIter; - } - - // (const) reverse iterator common operators - // NB: many of these operations are evaluated in reverse because this is a reverse iterator wrapping a forward iterator - inline UString::size_type operator-( const UString::_const_rev_iterator& left, const UString::_const_rev_iterator& right ) - { - return ( right.mIter - left.mIter ); - } - inline bool operator==( const UString::_const_rev_iterator& left, const UString::_const_rev_iterator& right ) - { - return left.mIter == right.mIter; - } - inline bool operator!=( const UString::_const_rev_iterator& left, const UString::_const_rev_iterator& right ) - { - return left.mIter != right.mIter; - } - inline bool operator<( const UString::_const_rev_iterator& left, const UString::_const_rev_iterator& right ) - { - return right.mIter < left.mIter; - } - inline bool operator<=( const UString::_const_rev_iterator& left, const UString::_const_rev_iterator& right ) - { - return right.mIter <= left.mIter; - } - inline bool operator>( const UString::_const_rev_iterator& left, const UString::_const_rev_iterator& right ) - { - return right.mIter > left.mIter; - } - inline bool operator>=( const UString::_const_rev_iterator& left, const UString::_const_rev_iterator& right ) - { - return right.mIter >= left.mIter; - } - - //! std::ostream write operator \relates UString - inline std::ostream& operator << ( std::ostream& os, const UString& s ) - { - return os << s.asUTF8(); - } - - //! std::wostream write operator \relates UString - //inline std::wostream& operator << ( std::wostream& os, const UString& s ) - //{ - // return os << s.asWStr(); - //} - - - -} - -#endif // __MYGUI_U_STRING_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Utility.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Utility.h deleted file mode 100644 index 1cc81d70f..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Utility.h +++ /dev/null @@ -1,355 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_UTILITY_H__ -#define __MYGUI_UTILITY_H__ - -#include "MyGUI_Prerequest.h" -#include -#include - -namespace MyGUI -{ - namespace utility - { - - inline void trim(std::string& _str, bool _left = true, bool _right = true) - { - if (_right) _str.erase(_str.find_last_not_of(" \t\r")+1); - if (_left) _str.erase(0, _str.find_first_not_of(" \t\r")); - } - - // конвертирование в строку - template - inline std::string toString (T p) - { - std::ostringstream stream; - stream << p; - return stream.str(); - } - - inline const std::string& toString (const std::string& _value) - { - return _value; - } - - template - inline std::string toString (T1 p1, T2 p2) - { - std::ostringstream stream; - stream << p1 << p2; - return stream.str(); - } - - template - inline std::string toString (T1 p1, T2 p2, T3 p3) - { - std::ostringstream stream; - stream << p1 << p2 << p3; - return stream.str(); - } - - template - inline std::string toString (T1 p1, T2 p2, T3 p3, T4 p4) - { - std::ostringstream stream; - stream << p1 << p2 << p3 << p4; - return stream.str(); - } - - template - inline std::string toString (T1 p1, T2 p2, T3 p3, T4 p4, T5 p5) - { - std::ostringstream stream; - stream << p1 << p2 << p3 << p4 << p5; - return stream.str(); - } - - template - inline std::string toString (T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6) - { - std::ostringstream stream; - stream << p1 << p2 << p3 << p4 << p5 << p6; - return stream.str(); - } - - template - inline std::string toString (T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7) - { - std::ostringstream stream; - stream << p1 << p2 << p3 << p4 << p5 << p6 << p7; - return stream.str(); - } - - template - inline std::string toString (T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8) - { - std::ostringstream stream; - stream << p1 << p2 << p3 << p4 << p5 << p6 << p7 << p8; - return stream.str(); - } - - template - inline std::string toString (T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) - { - std::ostringstream stream; - stream << p1 << p2 << p3 << p4 << p5 << p6 << p7 << p8 << p9; - return stream.str(); - } - - template< > - inline std::string toString (bool _value) - { - return _value ? "true" : "false"; - } - - - // утилиты для парсинга - template - inline T parseValue( const std::string& _value ) - { - std::istringstream stream(_value); - T result; - stream >> result; - if (stream.fail()) return T(); - else - { - int item = stream.get(); - while (item != -1) - { - if (item != ' ' && item != '\t') return T(); - item = stream.get(); - } - } - return result; - } - - // отдельная имплементация под bool - template<> - inline bool parseValue( const std::string& _value ) - { - if (_value == "true" || _value == "1") return true; - return false; - } - - // отдельная имплементация под char - template<> - inline char parseValue( const std::string& _value ) { return (char)parseValue(_value); } - - // отдельная имплементация под unsigned char - template<> - inline unsigned char parseValue( const std::string& _value ) { return (unsigned char)parseValue(_value); } - - - inline short parseShort(const std::string& _value) { return parseValue(_value); } - inline unsigned short parseUShort(const std::string& _value) { return parseValue(_value); } - inline int parseInt(const std::string& _value) { return parseValue(_value); } - inline unsigned int parseUInt(const std::string& _value) { return parseValue(_value); } - inline size_t parseSizeT(const std::string& _value) { return parseValue(_value); } - inline float parseFloat(const std::string& _value) { return parseValue(_value); } - inline double parseDouble(const std::string& _value) { return parseValue(_value); } - - inline bool parseBool(const std::string& _value) { return parseValue(_value); } - inline char parseChar(const std::string& _value) { return parseValue(_value); } - inline unsigned char parseUChar(const std::string& _value) { return parseValue(_value); } - - // для парсинга сложных типов, состоящих из простых - template - inline T1 parseValueEx2(const std::string& _value) - { - T2 p1, p2; - std::istringstream stream(_value); - stream >> p1 >> p2; - if (stream.fail()) return T1(); - else - { - int item = stream.get(); - while (item != -1) - { - if (item != ' ' && item != '\t') return T1(); - item = stream.get(); - } - } - return T1(p1, p2); - } - - template - inline T1 parseValueEx3(const std::string& _value) - { - T2 p1, p2, p3; - std::istringstream stream(_value); - stream >> p1 >> p2 >> p3; - if (stream.fail()) return T1(); - else - { - int item = stream.get(); - while (item != -1) - { - if (item != ' ' && item != '\t') return T1(); - item = stream.get(); - } - } - return T1(p1, p2, p3); - } - - template - inline T1 parseValueEx4(const std::string& _value) - { - T2 p1, p2, p3, p4; - std::istringstream stream(_value); - stream >> p1 >> p2 >> p3 >> p4; - if (stream.fail()) return T1(); - else - { - int item = stream.get(); - while (item != -1) - { - if (item != ' ' && item != '\t') return T1(); - item = stream.get(); - } - } - return T1(p1, p2, p3, p4); - } - - namespace templates - { - template - inline void split(std::vector& _ret, const std::string& _source, const std::string& _delims) - { - size_t start = _source.find_first_not_of(_delims); - while (start != _source.npos) - { - size_t end = _source.find_first_of(_delims, start); - if (end != _source.npos) _ret.push_back(_source.substr(start, end-start)); - else - { - _ret.push_back(_source.substr(start)); - break; - } - start = _source.find_first_not_of(_delims, end + 1); - } - } - } // namespace templates - - inline std::vector split(const std::string& _source, const std::string& _delims = "\t\n ") - { - std::vector result; - templates::split(result, _source, _delims); - return result; - } - - template - inline bool parseComplex(const std::string& _value, T1& _p1, T2& _p2, T3& _p3, T4& _p4) - { - std::istringstream stream(_value); - - stream >> _p1 >> _p2 >> _p3 >> _p4; - - if (stream.fail()) return false; - int item = stream.get(); - while (item != -1) - { - if (item != ' ' && item != '\t') return false; - item = stream.get(); - } - - return true; - } - - template - inline bool parseComplex(const std::string& _value, T1& _p1, T2& _p2, T3& _p3) - { - std::istringstream stream(_value); - - stream >> _p1 >> _p2 >> _p3; - - if (stream.fail()) return false; - int item = stream.get(); - while (item != -1) - { - if (item != ' ' && item != '\t') return false; - item = stream.get(); - } - - return true; - } - - template - inline bool parseComplex(const std::string& _value, T1& _p1, T2& _p2) - { - std::istringstream stream(_value); - - stream >> _p1 >> _p2; - - if (stream.fail()) return false; - int item = stream.get(); - while (item != -1) - { - if (item != ' ' && item != '\t') return false; - item = stream.get(); - } - - return true; - } - - template - inline bool parseComplex(const std::string& _value, T1& _p1) - { - std::istringstream stream(_value); - - stream >> _p1; - - if (stream.fail()) return false; - int item = stream.get(); - while (item != -1) - { - if (item != ' ' && item != '\t') return false; - item = stream.get(); - } - - return true; - } - - template<> - inline bool parseComplex(const std::string& _value, bool& _p1) - { - std::string value(_value); - trim(value); - if ((value == "true") || (value == "1")) - { - _p1 = true; - return true; - } - else if ((value == "false") || (value == "0")) - { - _p1 = false; - return true; - } - - return false; - } - - } // namespace utility - -} // namespace MyGUI - -#endif // __MYGUI_UTILITY_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_VScroll.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_VScroll.h deleted file mode 100644 index 8f2b59cc9..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_VScroll.h +++ /dev/null @@ -1,176 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_VSCROLL_H__ -#define __MYGUI_VSCROLL_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Widget.h" -#include "MyGUI_EventPair.h" - -namespace MyGUI -{ - - typedef delegates::CDelegate2 EventHandle_VScrollPtrSizeT; - - class MYGUI_EXPORT VScroll : - public Widget - { - MYGUI_RTTI_DERIVED( VScroll ) - - public: - VScroll(); - - /** Set scroll range */ - void setScrollRange(size_t _value); - /** Get scroll range */ - size_t getScrollRange() { return mScrollRange; } - - /** Set scroll position (value from 0 to range - 1) */ - void setScrollPosition(size_t _value); - /** Get scroll position (value from 0 to range - 1) */ - size_t getScrollPosition() { return mScrollPosition; } - - /** Set scroll page - @param _page Tracker step when buttons pressed - */ - void setScrollPage(size_t _value) { mScrollPage = _value; } - /** Get scroll page */ - size_t getScrollPage() { return mScrollPage; } - - /** Set scroll view page - @param _viewPage Tracker step when pressed on scroll line - */ - void setScrollViewPage(size_t _value) { mScrollViewPage = _value; } - /** Get scroll view page */ - size_t getScrollViewPage() { return mScrollViewPage; } - - /** Get size in pixels of area where scroll moves */ - virtual int getLineSize(); - - /** Set size of track in pixels - @param _value in pixels, if less than MinTrackSize, MinTrackSize used - */ - virtual void setTrackSize(int _value); - /** Get size of track in pixels */ - virtual int getTrackSize(); - - /** Set minimal track size (used for setTrackSize)*/ - void setMinTrackSize(int _value) { mMinTrackSize = _value; } - /** Get minimal track size */ - int getMinTrackSize() { return mMinTrackSize; } - - /** Enable or disable move to click mode.\n - Move to click mode: Tracker moves to cursor when pressed on scroll line.\n - Disabled (false) by default. - */ - void setMoveToClick(bool _value) { mMoveToClick = _value; } - /** Get move to click mode flag */ - bool getMoveToClick() { return mMoveToClick; } - - //! @copydoc Widget::setPosition(const IntPoint& _value) - virtual void setPosition(const IntPoint& _value); - //! @copydoc Widget::setSize(const IntSize& _value) - virtual void setSize(const IntSize& _value); - //! @copydoc Widget::setCoord(const IntCoord& _value) - virtual void setCoord(const IntCoord& _value); - - /** @copydoc Widget::setPosition(int _left, int _top) */ - void setPosition(int _left, int _top) { setPosition(IntPoint(_left, _top)); } - /** @copydoc Widget::setSize(int _width, int _height) */ - void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); } - /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ - void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); } - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*event:*/ - /** Event : scroll tracker position changed.\n - signature : void method(MyGUI::VScroll* _sender, size_t _position)\n - @param _sender widget that called this event - @param _position - new tracker position - */ - EventPair eventScrollChangePosition; - - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void Widget::setCoord(const IntCoord& _coord)") - void setPosition(const IntCoord& _coord) { setCoord(_coord); } - MYGUI_OBSOLETE("use : void Widget::setCoord(int _left, int _top, int _width, int _height)") - void setPosition(int _left, int _top, int _width, int _height) { setCoord(_left, _top, _width, _height); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - protected: - virtual ~VScroll(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - virtual void updateTrack(); - virtual void TrackMove(int _left, int _top); - - virtual void onMouseWheel(int _rel); - - void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id); - void notifyMouseReleased(Widget* _sender, int _left, int _top, MouseButton _id); - void notifyMouseDrag(Widget* _sender, int _left, int _top); - void notifyMouseWheel(Widget* _sender, int _rel); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - protected: - // наши кнопки - Button* mWidgetStart; - Button* mWidgetEnd; - Button* mWidgetTrack; - // куски между кнопками - Button* mWidgetFirstPart; - Button* mWidgetSecondPart; - - // смещение внутри окна - IntPoint mPreActionOffset; - - // диапазон на который трек может двигаться - size_t mSkinRangeStart; - size_t mSkinRangeEnd; - - size_t mScrollRange; - size_t mScrollPosition; - size_t mScrollPage; // на сколько перещелкивать, при щелчке на кнопке - size_t mScrollViewPage; // на сколько перещелкивать, при щелчке по полосе - - int mMinTrackSize; - bool mMoveToClick; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_VSCROLL_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Version.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Version.h deleted file mode 100644 index 33c69b2dc..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Version.h +++ /dev/null @@ -1,96 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_VERSION_H__ -#define __MYGUI_VERSION_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include "MyGUI_Utility.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT Version - { - public: - Version() : value(0) { } - Version(uint8 _major, uint8 _minor, uint16 _patch) : value((uint32(_major) << 24) + (uint32(_minor) << 16) + uint32(_patch)) { } - Version(uint8 _major, uint8 _minor) : value((uint32(_major) << 24) + (uint32(_minor) << 16)) { } - explicit Version(const std::string& _value) : value(parse(_value).value) { } - - friend bool operator < (Version const& a, Version const& b) { return a.getPoorVersion() < b.getPoorVersion(); } - friend bool operator >= (Version const& a, Version const& b) { return !(a < b); } - friend bool operator > (Version const& a, Version const& b) { return (b < a); } - friend bool operator <= (Version const& a, Version const& b) { return !(a > b); } - - friend bool operator == (Version const& a, Version const& b) { return !(a < b) && !(a > b); } - friend bool operator != (Version const& a, Version const& b) { return !(a == b); } - - friend std::ostream& operator << ( std::ostream& _stream, const Version& _value ) - { - _stream << _value.print(); - return _stream; - } - - friend std::istream& operator >> ( std::istream& _stream, Version& _value ) - { - std::string value; - _stream >> value; - _value = Version::parse(value); - return _stream; - } - - uint8 getMajor() const { return uint8((value & 0xFF000000) >> 24); } - uint8 getMinor() const { return uint8((value & 0x00FF0000) >> 16); } - uint16 getPatch() const { return uint16(value & 0x0000FFFF); } - - uint32 getPoorVersion() const { return value & 0xFFFF0000; } - uint32 getFullVersion() const { return value; } - - std::string print() const - { - if (getPatch() == 0) return utility::toString(getMajor(), ".", getMinor()); - return utility::toString(getMajor(), ".", getMinor(), ".", getPatch()); - } - - static Version parse(const std::string& _value) - { - const std::vector& vec = utility::split(_value, "."); - if (vec.empty()) return Version(); - uint8 major = (uint8)utility::parseValue(vec[0]); - uint8 minor = vec.size() > 1 ? (uint8)utility::parseValue(vec[1]) : uint8(0); - uint16 patch = vec.size() > 2 ? (uint16)utility::parseValue(vec[2]) : uint16(0); - return Version(major, minor, patch); - } - - private: - union - { - uint32 value; - uint8 value_data[4]; - }; - }; - -} // namespace MyGUI - -#endif // __MYGUI_VERSION_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_VertexData.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_VertexData.h deleted file mode 100644 index 716749092..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_VertexData.h +++ /dev/null @@ -1,87 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 05/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_VERTEX_DATA_H__ -#define __MYGUI_VERTEX_DATA_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" - -namespace MyGUI -{ - - struct Vertex - { - void set(float _x, float _y, float _z, float _u, float _v, uint32 _colour) - { - x = _x; - y = _y; - z = _z; - u = _u; - v = _v; - colour = _colour; - } - - float x, y, z; - uint32 colour; - float u, v; - }; - - struct VertexQuad - { - enum Enum - { - CornerLT = 0, - CornerRT = 1, - CornerLB = 2, - CornerLB2 = 3, - CornerRT2 = 4, - CornerRB = 5, - VertexCount = 6 - }; - - void set(float _l, float _t, float _r, float _b, float _z, float _u1, float _v1, float _u2, float _v2, uint32 _colour) - { - vertex[CornerLT].set(_l, _t, _z, _u1, _v1, _colour); - vertex[CornerRT].set(_r, _t, _z, _u2, _v1, _colour); - vertex[CornerLB].set(_l, _b, _z, _u1, _v2, _colour); - vertex[CornerRB].set(_r, _b, _z, _u2, _v2, _colour); - vertex[CornerRT2] = vertex[CornerRT]; - vertex[CornerLB2] = vertex[CornerLB]; - } - - void set(float _x1, float _y1, float _x2, float _y2, float _x3, float _y3, float _x4, float _y4, float _z, float _u1, float _v1, float _u2, float _v2, uint32 _colour) - { - vertex[CornerLT].set(_x1, _y1, _z, _u1, _v1, _colour); - vertex[CornerRT].set(_x2, _y2, _z, _u2, _v1, _colour); - vertex[CornerLB].set(_x4, _y4, _z, _u1, _v2, _colour); - vertex[CornerRB].set(_x3, _y3, _z, _u2, _v2, _colour); - vertex[CornerRT2] = vertex[CornerRT]; - vertex[CornerLB2] = vertex[CornerLB]; - } - - Vertex vertex[6]; - }; - -} // namespace MyGUI - -#endif // __MYGUI_VERTEX_DATA_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Widget.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Widget.h deleted file mode 100644 index 5679bc382..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Widget.h +++ /dev/null @@ -1,503 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_WIDGET_H__ -#define __MYGUI_WIDGET_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Any.h" -#include "MyGUI_ICroppedRectangle.h" -#include "MyGUI_ISubWidgetRect.h" -#include "MyGUI_ISubWidgetText.h" -#include "MyGUI_LayerItem.h" -#include "MyGUI_WidgetUserData.h" -#include "MyGUI_WidgetEvent.h" -#include "MyGUI_IWidgetCreator.h" -#include "MyGUI_ResourceSkin.h" -#include "MyGUI_IObject.h" - -namespace MyGUI -{ - - class MYGUI_EXPORT Widget : - public IObject, - public ICroppedRectangle, - public LayerItem, - public UserData, - public WidgetEvent, - public IWidgetCreator, - public delegates::IDelegateUnlink - { - // для вызова закрытых деструкторов - friend class IWidgetCreator; - - MYGUI_RTTI_BASE( Widget ) - - public: - Widget(); - - /** Create child widget - @param _type widget type - @param _skin widget skin - @param _coord int coordinates of widget (_left, _top, _width, _height) - @param _align widget align (possible values can be found in enum Align) - @param _name if needed (you can use it for finding widget by name later) - */ - Widget* createWidgetT(const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _name = ""); - - /** See Widget::createWidgetT(const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _name = "") */ - Widget* createWidgetT(const std::string& _type, const std::string& _skin, int _left, int _top, int _width, int _height, Align _align, const std::string& _name = ""); - - /** Create widget using coordinates relative to parent. see Widget::createWidgetT(const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _name = "") */ - Widget* createWidgetRealT(const std::string& _type, const std::string& _skin, const FloatCoord& _coord, Align _align, const std::string& _name = ""); - - /** Create widget using coordinates relative to parent. see Widget::createWidgetT(const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _name = "") */ - Widget* createWidgetRealT(const std::string& _type, const std::string& _skin, float _left, float _top, float _width, float _height, Align _align, const std::string& _name = ""); - - // templates for creating widgets by type - /** Same as Widget::createWidgetT but return T pointer instead of Widget* */ - template - T* createWidget(const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _name = "") - { - return static_cast(createWidgetT(T::getClassTypeName(), _skin, _coord, _align, _name)); - } - - /** Same as Widget::createWidgetT but return T pointer instead of Widget* */ - template - T* createWidget(const std::string& _skin, int _left, int _top, int _width, int _height, Align _align, const std::string& _name = "") - { - return static_cast(createWidgetT(T::getClassTypeName(), _skin, IntCoord(_left, _top, _width, _height), _align, _name)); - } - - /** Same as Widget::createWidgetRealT but return T* instead of Widget* */ - template - T* createWidgetReal(const std::string& _skin, const FloatCoord& _coord, Align _align, const std::string& _name = "") - { - return static_cast(createWidgetRealT(T::getClassTypeName(), _skin, _coord, _align, _name)); - } - - /** Same as Widget::createWidgetRealT but return T* instead of Widget* */ - template - T* createWidgetReal(const std::string& _skin, float _left, float _top, float _width, float _height, Align _align, const std::string& _name = "") - { - return static_cast(createWidgetRealT(T::getClassTypeName(), _skin, _left, _top, _width, _height, _align, _name)); - } - - /** Create child widget - @param _style Child, Popup or Overlapped widget style - @param _type widget type - @param _skin widget skin - @param _coord int coordinates of widget (_left, _top, _width, _height) - @param _align widget align (possible values can be found in enum Align) - @param _name if needed (you can use it for finding widget by name later) - */ - Widget* createWidgetT(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer = "", const std::string& _name = ""); - - /** Same as Widget::createWidgetT but return T* instead of Widget* */ - template - T* createWidget(WidgetStyle _style, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer = "", const std::string& _name = "") - { - return static_cast(createWidgetT(_style, T::getClassTypeName(), _skin, _coord, _align, _layer, _name)); - } - - //! Get name of widget - const std::string& getName() const { return mName; } - - - /** Set widget position (position of left top corner) */ - virtual void setPosition(const IntPoint& _value); - /** Set widget size */ - virtual void setSize(const IntSize& _value); - /** Set widget position and size */ - virtual void setCoord(const IntCoord& _value); - - /** See Widget::setPosition(const IntPoint& _pos) */ - void setPosition(int _left, int _top) { setPosition(IntPoint(_left, _top)); } - /** See Widget::setSize(const IntSize& _size) */ - void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); } - /** See Widget::setCoord(const IntCoord& _coord) */ - void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); } - - /** Set widget position (position of left top corner)*/ - void setRealPosition(const FloatPoint& _value); - /** Set widget size */ - void setRealSize(const FloatSize& _value); - /** Set widget position and size*/ - void setRealCoord(const FloatCoord& _value); - - /** See Widget::setRealPosition(const FloatPoint& _point) */ - void setRealPosition(float _left, float _top) { setRealPosition(FloatPoint(_left, _top)); } - /** See Widget::setRealSize(const FloatSize& _size) */ - void setRealSize(float _width, float _height) { setRealSize(FloatSize(_width, _height)); } - /** See Widget::setRealPosition(const FloatCoord& _coord) */ - void setRealCoord(float _left, float _top, float _width, float _height) { setRealCoord(FloatCoord(_left, _top, _width, _height)); } - - /** Hide or show widget */ - virtual void setVisible(bool _value); - - /** Set align */ - virtual void setAlign(Align _value); - - /** Set widget caption */ - virtual void setCaption(const UString& _value); - /** Get widget caption */ - virtual const UString& getCaption(); - - /** Set widget opacity */ - void setAlpha(float _value); - /** Get widget opacity */ - float getAlpha() { return mAlpha; } - - /** Enable or disable inherits alpha mode */ - void setInheritsAlpha(bool _value); - /** Get inherits alpha mode flag */ - bool isInheritsAlpha() { return mInheritsAlpha; } - - /** Set widget's state */ - bool setState(const std::string& _value); - - void setColour(const Colour& _value); - - // являемся ли мы рутовым виджетом - /** Is this widget is root widget (root == without parents) */ - bool isRootWidget() { return nullptr == mCroppedParent; } - - /** Get parent widget or nullptr if no parent */ - Widget* getParent() { return mParent; } - - /** Get child widgets Enumerator */ - EnumeratorWidgetPtr getEnumerator(); - - /** Get child count */ - size_t getChildCount(); - - /** Get child by index (index from 0 to child_count - 1) */ - Widget* getChildAt(size_t _index); - - /** Find widget by name (search recursively through all childs starting from this widget) */ - Widget* findWidget(const std::string& _name); - - /** Set need key focus flag */ - void setNeedKeyFocus(bool _value) { mNeedKeyFocus = _value; } - /** Is need key focus - If disable this widget won't be reacting on keyboard at all.\n - Enabled (true) by default. - */ - bool isNeedKeyFocus() { return mNeedKeyFocus; } - - /** Set need mouse focus flag */ - void setNeedMouseFocus(bool _value) { mNeedMouseFocus = _value; } - /** Is need mouse focus - If disable this widget won't be reacting on mouse at all.\n - Enabled (true) by default. - */ - bool isNeedMouseFocus() { return mNeedMouseFocus; } - - /** Set inherits mode flag - This mode makes all child widgets pickable even if widget don't - need mouse focus (was set setNeedKeyFocus(false) ).\n - Disabled (false) by default. - */ - void setInheritsPick(bool _value) { mInheritsPick = _value; } - /** Get inherits mode flag */ - bool isInheritsPick() { return mInheritsPick; } - - /** Set picking mask for widget */ - void setMaskPick(const std::string& _filename); - - /** Enable or disable widget */ - virtual void setEnabled(bool _value); - /** Enable or disable widget without changing widget's state */ - void setEnabledSilent(bool _value) { mEnabled = _value; } - /** Is widget enabled */ - bool isEnabled() { return mEnabled; } - - /** Set mouse pointer for this widget */ - void setPointer(const std::string& _value) { mPointer = _value; } - /** Get mouse pointer name for this widget */ - const std::string& getPointer(); - - /** Get widget's layer, return "" if widget is not root widget (root == without parents) */ - const std::string& getLayerName(); - - /** Get rect where child widgets placed */ - IntCoord getClientCoord(); - - /** Get clien area widget or nullptr if widget don't have client */ - Widget* getClientWidget() { return mWidgetClient; } - - /** Get text sub widget or nullptr if no text sub widget */ - ISubWidgetText * getSubWidgetText() { return mText; } - /** Get sub widget of first texture or nullptr if no sub widget with texture */ - ISubWidgetRect * getSubWidgetMain() { return mMainSkin; } - - /** Set need tool tip mode flag. Enable this if you need tool tip events for widget */ - void setNeedToolTip(bool _value); - /** Get need tool tip mode flag */ - bool getNeedToolTip() { return mNeedToolTip; } - - /** Enable or disable tooltip event */ - void setEnableToolTip(bool _value); - /** Get tool tip enabled flag */ - bool getEnableToolTip() { return mEnableToolTip; } - - /** Detach widget from widgets hierarchy - @param _layer Attach to specified layer (if any) - */ - void detachFromWidget(const std::string& _layer = ""); - - /** Attach widget to parent - @param _style Child widget type - @param _layer Attach to specified layer (if any) - @note you might also need to call void Widget::setWidgetStyle(WidgetStyle _style); - to set widget style (widget attached with MyGUI::WidgetStyle::Popup by default) - */ - void attachToWidget(Widget* _parent, WidgetStyle _style = WidgetStyle::Child, const std::string& _layer = ""); - - /** Change widget skin */ - void changeWidgetSkin(const std::string& _skinname); - - /** Set widget style. - @param _layer Attach to specified layer (if any) - @note When choosing WidgetStyle::Popup style you also need attach widget to layer - see LayerManager::attachToLayerNode - */ - void setWidgetStyle(WidgetStyle _style, const std::string& _layer = ""); - /** Get widget style */ - WidgetStyle getWidgetStyle() { return mWidgetStyle; } - - /** Set any widget property - @param _key Property name (for example Widget_Alpha or Edit_MultiLine) - @param _value Value converted to string - */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - - /*internal:*/ - // метод для запроса номера айтема и контейнера - virtual void _getContainer(Widget*& _container, size_t& _index); - - // дает приоритет виджету при пиккинге - void _forcePeek(Widget* _widget); - - void _setUVSet(const FloatRect& _rect); - - virtual void _setTextureName(const std::string& _texture); - virtual const std::string& _getTextureName(); - - IWidgetCreator * _getIWidgetCreator() { return mIWidgetCreator; } - - IntCoord _getTextRegion(); - IntSize _getTextSize(); - void _setFontName(const std::string& _font); - const std::string& _getFontName(); - void _setFontHeight(int _height); - int _getFontHeight(); - void _setTextAlign(Align _align); - Align _getTextAlign(); - void _setTextColour(const Colour& _colour); - const Colour& _getTextColour(); - - // устанавливает строку заменив /n на реальный перенос - void setCaptionWithNewLine(const std::string& _value); - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void Widget::setCoord(const IntCoord& _coord)") - void setPosition(const IntCoord& _coord) { setCoord(_coord); } - MYGUI_OBSOLETE("use : void Widget::setCoord(int _left, int _top, int _width, int _height)") - void setPosition(int _left, int _top, int _width, int _height) { setCoord(_left, _top, _width, _height); } - - MYGUI_OBSOLETE("use : void Widget::setEnableToolTip") - void enableToolTip(bool _enable) { setEnableToolTip(_enable); } - - MYGUI_OBSOLETE("use : void setInheritsPick(bool _inherits)") - void setInheritsPeek(bool _inherits) { setInheritsPick(_inherits); } - MYGUI_OBSOLETE("use : bool isInheritsPick()") - bool isInheritsPeek() { return isInheritsPick(); } - - MYGUI_OBSOLETE("use : void setMaskPick(const std::string& _filename)") - void setMaskPeek(const std::string& _filename) { setMaskPick(_filename); } - - MYGUI_OBSOLETE("use : const IntCoord& StaticText::getTextRegion()") - IntCoord getTextCoord() { return _getTextRegion(); } - MYGUI_OBSOLETE("use : IntSize StaticText::getTextSize()") - IntSize getTextSize() { return _getTextSize(); } - - MYGUI_OBSOLETE("use : void StaticText::setFontName(const std::string& _font)") - void setFontName(const std::string& _font) { _setFontName(_font); } - MYGUI_OBSOLETE("use : const std::string& StaticText::getFontName()") - const std::string& getFontName() { return _getFontName(); } - - MYGUI_OBSOLETE("use : void StaticText::setFontHeight(int _height)") - void setFontHeight(int _height) { _setFontHeight(_height); } - MYGUI_OBSOLETE("use : int StaticText::getFontHeight()") - int getFontHeight() { return _getFontHeight(); } - - MYGUI_OBSOLETE("use : void StaticText::setTextAlign(Align _align)") - void setTextAlign(Align _align) { _setTextAlign(_align); } - MYGUI_OBSOLETE("use : Align StaticText::getTextAlign()") - Align getTextAlign() { return _getTextAlign(); } - - MYGUI_OBSOLETE("use : void StaticText::setTextColour(const Colour& _colour)") - void setTextColour(const Colour& _colour) { _setTextColour(_colour); } - MYGUI_OBSOLETE("use : const Colour& StaticText::getTextColour()") - const Colour& getTextColour() { return _getTextColour(); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - protected: - // все создание только через фабрику - Widget(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - virtual ~Widget(); - - virtual void baseChangeWidgetSkin(ResourceSkin* _info); - - void _updateView(); // обновления себя и детей - - void _setAlign(const IntSize& _oldsize, bool _update); - void _setAlign(const IntCoord& _oldcoord, bool _update); - - // создает виджет - virtual Widget* baseCreateWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name); - - // удяляет неудачника - virtual void _destroyChildWidget(Widget* _widget); - - // удаляет всех детей - virtual void _destroyAllChildWidget(); - - // запрашиваем у конейтера айтем по позиции мыши - virtual size_t _getContainerIndex(const IntPoint& _point) { return ITEM_NONE; } - - // сброс всех данных контейнера, тултипы и все остальное - virtual void _resetContainer(bool _update); - - virtual void baseUpdateEnable(); - - // наследуемся он LayerInfo - virtual ILayerItem * getLayerItemByPoint(int _left, int _top); - virtual const IntCoord& getLayerItemCoord() { return mCoord; } - - private: - - void frameEntered(float _frame); - - void initialiseWidgetSkin(ResourceSkin* _info, const IntSize& _size); - void shutdownWidgetSkin(bool _deep = false); - - void _updateAlpha(); - void _updateAbsolutePoint(); - - // для внутреннего использования - void _setInheritsVisible(bool _value); - bool _isInheritsVisible() { return mInheritsVisible; } - - void _setInheritsEnable(bool _value); - bool _isInheritsEnable() { return mInheritsEnabled; } - - // показывает скрывает все сабскины - void _setSubSkinVisible(bool _visible); - - float _getRealAlpha() { return mRealAlpha; } - - // добавляет в список виджет - virtual void _linkChildWidget(Widget* _widget); - // удаляет из списка - virtual void _unlinkChildWidget(Widget* _widget); - - protected: - // список всех стейтов - MapWidgetStateInfo mStateInfo; - // информация о маске для пикинга - MaskPickInfo const * mMaskPickInfo; - MaskPickInfo mOwnMaskPickInfo; - - // вектор всех детей виджетов - VectorWidgetPtr mWidgetChild; - // вектор детей скина - VectorWidgetPtr mWidgetChildSkin; - // вектор всех детей сабскинов - VectorSubWidget mSubSkinChild; - - // указатель на окно текста - ISubWidgetText * mText; - // указатель на первый не текстовой сабскин - ISubWidgetRect * mMainSkin; - - // доступен ли на виджет - bool mEnabled; - bool mInheritsEnabled; - // скрыты ли все сабскины при выходе за границу - bool mSubSkinsVisible; - // для иерархического скрытия - bool mInheritsVisible; - // прозрачность и флаг наследования альфы нашего оверлея - float mAlpha; - float mRealAlpha; - bool mInheritsAlpha; - // имя виджета - std::string mName; - // курсор который будет показан при наведении - std::string mPointer; - std::string mTextureName; - ITexture* mTexture; - - // наш отец в иерархии виджетов - Widget* mParent; - - // это тот кто нас создал, и кто нас будет удалять - IWidgetCreator * mIWidgetCreator; - - // нужен ли виджету ввод с клавы - bool mNeedKeyFocus; - // нужен ли виджету фокус мыши - bool mNeedMouseFocus; - bool mInheritsPick; - - // клиентская зона окна - // если виджет имеет пользовательские окна не в себе - // то обязательно проинициализировать Client - Widget* mWidgetClient; - - bool mNeedToolTip; - bool mEnableToolTip; - bool mToolTipVisible; - float mToolTipCurrentTime; - IntPoint mToolTipOldPoint; - size_t mToolTipOldIndex; - IntPoint m_oldMousePoint; - - // поведение виджета, перекрывающийся дочерний или всплывающий - WidgetStyle mWidgetStyle; - - FloatCoord mRelativeCoord; - bool mDisableUpdateRelative; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_WIDGET_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetDefines.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetDefines.h deleted file mode 100644 index 98aa9414d..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetDefines.h +++ /dev/null @@ -1,41 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_WIDGET_DEFINES_H__ -#define __MYGUI_WIDGET_DEFINES_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Enumerator.h" -#include -#include - -namespace MyGUI -{ - - class Widget; - typedef std::vector VectorWidgetPtr; - typedef std::map MapWidgetPtr; - typedef Enumerator EnumeratorWidgetPtr; - -} // namespace MyGUI - -#endif // __MYGUI_WIDGET_DEFINES_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetEvent.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetEvent.h deleted file mode 100644 index 0b0a4c15b..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetEvent.h +++ /dev/null @@ -1,335 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_WIDGET_EVENT_H__ -#define __MYGUI_WIDGET_EVENT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Macros.h" -#include "MyGUI_WidgetDefines.h" -#include "MyGUI_WidgetToolTip.h" -#include "MyGUI_InputDefine.h" - -namespace MyGUI -{ - - // делегаты для событий виджета - typedef delegates::CDelegate1 EventHandle_WidgetVoid; - typedef delegates::CDelegate2 EventHandle_WidgetWidget; - typedef delegates::CDelegate2 EventHandle_WidgetBool; - typedef delegates::CDelegate2 EventHandle_WidgetInt; - typedef delegates::CDelegate2 EventHandle_WidgetSizeT; - typedef delegates::CDelegate3 EventHandle_WidgetIntInt; - typedef delegates::CDelegate4 EventHandle_WidgetIntIntButton; - typedef delegates::CDelegate2 EventHandle_WidgetKeyCode; - typedef delegates::CDelegate3 EventHandle_WidgetKeyCodeChar; - typedef delegates::CDelegate3 EventHandle_WidgetStringString; - typedef delegates::CDelegate3 EventHandle_WidgetRefWidgetRefSizeT; - typedef delegates::CDelegate2 EventHandle_WidgetToolTip; - - /** - General information about creating delegate for event : - @example "Delegate usage" - @code - void anyFunc(...) { } // global function - - class AnyClass - { - public: - static void anyStaticMethod(...) { } // static class method - void anyMethod(...) { } // class method - }; - - AnyClass anyObject; // class instance - @endcode - - delegate creating: - @code - eventAny = MyGUI::newDelegate(anyFunc); - eventAny = MyGUI::newDelegate(AnyClass::anyStaticMethod); - eventAny = MyGUI::newDelegate(&anyObject, &AnyClass::anyMethod); - @endcode - */ - - class MYGUI_EXPORT WidgetEvent - { - friend class InputManager; - - public: - virtual ~WidgetEvent() { } - - protected: - WidgetEvent() : - mWidgetEventSender(0), - mRootMouseActive(false), - mRootKeyActive(false) - { - } - - public: - - /** Event : Widget lost mouse focus.\n - signature : void method(MyGUI::Widget* _sender, MyGUI::Widget* _new)\n - @param _sender widget that called this event - @param _new widget with mouse focus or nullptr - */ - EventHandle_WidgetWidget eventMouseLostFocus; - - /** Event : Widget got mouse focus.\n - signature : void method(MyGUI::Widget* _sender, MyGUI::Widget* _old)\n - @param _sender widget that called this event - @param _old widget with mouse focus or nullptr - */ - EventHandle_WidgetWidget eventMouseSetFocus; - - /** Event : Widget mouse move with captured widget.\n - signature : void method(MyGUI::Widget* _sender, int _left, int _top)\n - @param _sender widget that called this event - @param _left - pointer position - @param _top - pointer position - */ - EventHandle_WidgetIntInt eventMouseDrag; - - /** Event : Mouse move over widget.\n - signature : void method(MyGUI::Widget* _sender, int _left, int _top)\n - @param _sender widget that called this event - @param _left - pointer position - @param _top - pointer position - */ - EventHandle_WidgetIntInt eventMouseMove; - - /** Event : Mouse wheel over widget.\n - signature : void method(MyGUI::Widget* _sender, int _rel)\n - @param _sender widget that called this event - @param _rel relative wheel position - */ - EventHandle_WidgetInt eventMouseWheel; - - /** Event : Mouse button pressed.\n - signature : void method(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)\n - @param _sender widget that called this event - @param _left - pointer position - @param _top - pointer position - @param _id Mouse button id - */ - EventHandle_WidgetIntIntButton eventMouseButtonPressed; - - /** Event : Mouse button released.\n - signature : void method(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)\n - @param _sender widget that called this event - @param _left - pointer position - @param _top - pointer position - @param _id Mouse button id - */ - EventHandle_WidgetIntIntButton eventMouseButtonReleased; - - /** Event : Mouse button pressed and released.\n - signature : void method(MyGUI::Widget* _sender) - @param _sender widget that called this event - */ - EventHandle_WidgetVoid eventMouseButtonClick; - - /** Event : Mouse button double click.\n - signature : void method(MyGUI::Widget* _sender) - @param _sender widget that called this event - */ - EventHandle_WidgetVoid eventMouseButtonDoubleClick; - - /** Event : Widget lost keyboard focus.\n - signature : void method(MyGUI::Widget* _sender, MyGUI::Widget* _new)\n - @param _sender widget that called this event - @param _new widget with keyboard focus or nullptr - */ - EventHandle_WidgetWidget eventKeyLostFocus; - - /** Event : Widget got keyboard focus.\n - signature : void method(MyGUI::Widget* _sender, MyGUI::Widget* _old)\n - @param _sender widget that called this event - @param _old widget with keyboard focus or nullptr - */ - EventHandle_WidgetWidget eventKeySetFocus; - - /** Event : Key pressed.\n - signature : void method(MyGUI::Widget* _sender, MyGUI::KeyCode _key, MyGUI::Char _char)\n - @param _sender widget that called this event - @param _key code - @param _char of pressed symbol (for multilanguage applications) - */ - EventHandle_WidgetKeyCodeChar eventKeyButtonPressed; - - /** Event : Key released.\n - signature : void method(MyGUI::Widget* _sender, MyGUI::KeyCode _key)\n - @param _sender widget that called this event - @param _key code - */ - EventHandle_WidgetKeyCode eventKeyButtonReleased; - - /** Event : Root widget changed mouse focus.\n - info : this event sends only to root widget\n - signature : void method(MyGUI::Widget* _sender, bool _focus); - @param _sender widget that called this event - @param _focus Is widget got mouse focus. - */ - EventHandle_WidgetBool eventRootMouseChangeFocus; - - /** Event : Root widget changed keyboard focus.\n - info : this event sends only to root widget\n - signature : void method(MyGUI::Widget* _sender, bool _focus); - @param _sender widget that called this event - @param _focus Is widget got keyboard focus. - */ - EventHandle_WidgetBool eventRootKeyChangeFocus; - - /** Event : Event about changing tooltip state.\n - signature : void method(MyGUI::Widget* _sender, const MyGUI::ToolTipInfo& _info); - @param _sender widget that called this event - @param _info about tooltip - */ - EventHandle_WidgetToolTip eventToolTip; - - /** Event : Extendeble event for special cases or plugins.\n - signature : void method(MyGUI::Widget* _sender, const std::string& _key, const std::string& _value); - @param _sender widget that called this event - @param _key - @param _value - */ - EventHandle_WidgetStringString eventActionInfo; - - /** Event : Internal request for parent and item index, used for any widget.\n - signature : void method(MyGUI::Widget* _sender, MyGUI::Widget*& _container, size_t& _index); - @param _sender widget that called this event - @param _container parent - @param _index of container - */ - EventHandle_WidgetRefWidgetRefSizeT _requestGetContainer; - - /** Event : Widget property changed through setProperty (in code, or from layout)\n - signature : void method(MyGUI::Widget* _sender, const std::string& _key, const std::string& _value); - @param _sender widget that called this event - @param _key - @param _value - */ - EventHandle_WidgetStringString eventChangeProperty; - - protected: - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onMouseLostFocus(Widget* _new) - { - eventMouseLostFocus(mWidgetEventSender, _new); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onMouseSetFocus(Widget* _old) - { - eventMouseSetFocus(mWidgetEventSender, _old); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onMouseDrag(int _left, int _top) - { - eventMouseDrag(mWidgetEventSender, _left, _top); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onMouseMove(int _left, int _top) - { - eventMouseMove(mWidgetEventSender, _left, _top); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onMouseWheel(int _rel) - { - eventMouseWheel(mWidgetEventSender, _rel); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id) - { - eventMouseButtonPressed(mWidgetEventSender, _left, _top, _id); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id) - { - eventMouseButtonReleased(mWidgetEventSender, _left, _top, _id); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onMouseButtonClick() - { - eventMouseButtonClick(mWidgetEventSender); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onMouseButtonDoubleClick() - { - eventMouseButtonDoubleClick(mWidgetEventSender); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onKeyLostFocus(Widget* _new) - { - eventKeyLostFocus(mWidgetEventSender, _new); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onKeySetFocus(Widget* _old) - { - eventKeySetFocus(mWidgetEventSender, _old); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onKeyButtonPressed(KeyCode _key, Char _char) - { - eventKeyButtonPressed(mWidgetEventSender, _key, _char); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onKeyButtonReleased(KeyCode _key) - { - eventKeyButtonReleased(mWidgetEventSender, _key); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onMouseChangeRootFocus(bool _focus) - { - eventRootMouseChangeFocus(mWidgetEventSender, _focus); - } - - // !!! ОБЯЗАТЕЛЬНО в родительском классе вызывать последним - virtual void onKeyChangeRootFocus(bool _focus) - { - eventRootKeyChangeFocus(mWidgetEventSender, _focus); - } - - // от чьего имени мы посылаем сообщения - Widget* mWidgetEventSender; - - private: - bool mRootMouseActive; - bool mRootKeyActive; - }; - -} // namespace MyGUI - -#endif // __MYGUI_WIDGET_EVENT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetManager.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetManager.h deleted file mode 100644 index dad77b7bb..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetManager.h +++ /dev/null @@ -1,130 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_WIDGET_MANAGER_H__ -#define __MYGUI_WIDGET_MANAGER_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Instance.h" -#include "MyGUI_IWidgetCreator.h" -#include "MyGUI_IUnlinkWidget.h" -#include "MyGUI_ICroppedRectangle.h" -#include "MyGUI_Widget.h" -#include - -namespace MyGUI -{ - - //OBSOLETE - typedef delegates::CDelegate3 ParseDelegate; - - class MYGUI_EXPORT WidgetManager - { - MYGUI_INSTANCE_HEADER( WidgetManager ) - - public: - //OBSOLETE - typedef std::map MapDelegate; - //OBSOLETE - typedef std::set SetWidgetFactory; - - public: - void initialise(); - void shutdown(); - - Widget* createWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, Widget* _parent, ICroppedRectangle * _cropeedParent, IWidgetCreator * _creator, const std::string& _name); - - /** Destroy _widget */ - void destroyWidget(Widget* _widget); - /** Destroy vector of widgets */ - void destroyWidgets(const VectorWidgetPtr &_widgets); - /** Destroy Enumerator of widgets */ - void destroyWidgets(EnumeratorWidgetPtr _widgets); - - /** Register unlinker (call unlink if for any destroyed widget)*/ - void registerUnlinker(IUnlinkWidget * _unlink); - /** Unregister unlinker (call unlink if for any destroyed widget)*/ - void unregisterUnlinker(IUnlinkWidget * _unlink); - /** Unlink widget */ - void unlinkFromUnlinkers(Widget* _widget); - - // добавляет виджет в список для анлинка - void addWidgetToUnlink(Widget* _widget); - - // проверяет, и если надо обнуляет виджет из списка анликнутых - void removeWidgetFromUnlink(Widget*& _widget); - - bool isFactoryExist(const std::string& _type); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void WidgetManager::destroyWidgets(VectorWidgetPtr &_widgets)") - void destroyWidgetsVector(VectorWidgetPtr &_widgets) { destroyWidgets(_widgets); } - MYGUI_OBSOLETE("") - Widget* findWidgetT(const std::string& _name, bool _throw = true); - MYGUI_OBSOLETE("") - Widget* findWidgetT(const std::string& _name, const std::string& _prefix, bool _throw = true); - MYGUI_OBSOLETE("") - void registerFactory(IWidgetFactory * _factory); - MYGUI_OBSOLETE("") - void unregisterFactory(IWidgetFactory * _factory); - MYGUI_OBSOLETE("use : void Widget::setProperty(const std::string &_key, const std::string &_value)") - void parse(Widget* _widget, const std::string &_key, const std::string &_value); - MYGUI_OBSOLETE("") - ParseDelegate& registerDelegate(const std::string& _key); - MYGUI_OBSOLETE("") - void unregisterDelegate(const std::string& _key); - - template - MYGUI_OBSOLETE("") - T* findWidget(const std::string& _name, bool _throw = true) - { - Widget* widget = findWidgetT(_name, _throw); - if (nullptr == widget) return nullptr; - return widget->castType(_throw); - } - - template - MYGUI_OBSOLETE("") - T* findWidget(const std::string& _name, const std::string& _prefix, bool _throw = true) - { - return findWidget(_prefix + _name, _throw); - } - -#endif // MYGUI_DONT_USE_OBSOLETE - - protected: - SetWidgetFactory mFactoryList; - //MapWidgetPtr mWidgets; - MapDelegate mDelegates; - - // список менеджеров для отписки при удалении - VectorIUnlinkWidget mVectorIUnlinkWidget; - - // список виджетов для отписки - VectorWidgetPtr mUnlinkWidgets; - }; - -} // namespace MyGUI - -#endif // __MYGUI_WIDGET_MANAGER_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetStyle.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetStyle.h deleted file mode 100644 index a0d3998ee..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetStyle.h +++ /dev/null @@ -1,91 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_WIDGET_TYPE_H__ -#define __MYGUI_WIDGET_TYPE_H__ - -#include "MyGUI_Prerequest.h" -#include - -namespace MyGUI -{ - - struct MYGUI_EXPORT WidgetStyle - { - enum Enum - { - Child, /**< child widget, cropped by parent widget borders, no overlapping (used by default for child widgets) */ - Popup, /**< popup widget, have parent widget, but not cropped on its borders */ - Overlapped, /**< child widget, cropped by parent widget borders, can overlap (used by default for root widgets) */ - MAX - }; - - static WidgetStyle parse(const std::string& _value) - { - WidgetStyle type; - int value = 0; - while (true) - { - const char * name = type.getValueName(value); - if (strcmp(name, "") == 0 || name == _value) break; - value++; - } - type.value = (Enum)value; - return type; - } - - WidgetStyle() : value(MAX) { } - WidgetStyle(Enum _value) : value(_value) { } - - friend bool operator == (WidgetStyle const& a, WidgetStyle const& b) { return a.value == b.value; } - friend bool operator != (WidgetStyle const& a, WidgetStyle const& b) { return a.value != b.value; } - - friend std::ostream& operator << ( std::ostream& _stream, const WidgetStyle& _value ) - { - _stream << _value.getValueName(_value.value); - return _stream; - } - - friend std::istream& operator >> ( std::istream& _stream, WidgetStyle& _value ) - { - std::string value; - _stream >> value; - _value = WidgetStyle::parse(value); - return _stream; - } - - std::string print() const { return getValueName(value); } - - private: - const char * getValueName(int _index) const - { - static const char * values[MAX + 1] = { "Child", "Popup", "Overlapped", "" }; - return values[(_index < MAX && _index >= 0) ? _index : MAX]; - } - - private: - Enum value; - }; - -} // namespace MyGUI - -#endif // __MYGUI_WIDGET_TYPE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetToolTip.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetToolTip.h deleted file mode 100644 index d2ba7f051..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetToolTip.h +++ /dev/null @@ -1,55 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 07/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_WIDGET_TOOLTIP_H__ -#define __MYGUI_WIDGET_TOOLTIP_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Types.h" -#include "MyGUI_WidgetToolTip.h" - -namespace MyGUI -{ - - /** Info about tootip state */ - struct ToolTipInfo - { - enum ToolTipType - { - Hide, - Show - }; - - ToolTipInfo(ToolTipType _type) : - type(_type), index(ITEM_NONE) { } - - ToolTipInfo(ToolTipType _type, size_t _index, const IntPoint& _point) : - type(_type), index(_index), point(_point) { } - - ToolTipType type; - size_t index; - IntPoint point; - }; - -} // namespace MyGUI - -#endif //__MYGUI_WIDGET_TOOLTIP_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetTranslate.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetTranslate.h deleted file mode 100644 index 3fb930a5c..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetTranslate.h +++ /dev/null @@ -1,72 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 05/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_WIDGET_TRANSLATE_H__ -#define __MYGUI_WIDGET_TRANSLATE_H__ - -#include "MyGUI_Prerequest.h" - -namespace MyGUI -{ - - inline int getWidgetWidth(Widget* _widget, bool _vert) - { - return _vert ? _widget->getWidth() : _widget->getHeight(); - } - - inline int getWidgetHeight(Widget* _widget, bool _vert) - { - return _vert ? _widget->getHeight() : _widget->getWidth(); - } - - inline int getWidgetLeft(Widget* _widget, bool _vert) - { - return _vert ? _widget->getLeft() : _widget->getTop(); - } - - inline int getWidgetTop(Widget* _widget, bool _vert) - { - return _vert ? _widget->getTop() : _widget->getLeft(); - } - - inline void setWidgetSize(Widget* _widget, int _width, int _height, bool _vert) - { - _vert ? _widget->setSize(_width, _height) : _widget->setSize(_height, _width); - } - - inline void setWidgetCoord(Widget* _widget, int _left, int _top, int _width, int _height, bool _vert) - { - _vert ? _widget->setCoord(_left, _top, _width, _height) : _widget->setCoord(_top, _left, _height, _width); - } - - inline void convertWidgetCoord(IntCoord& _coord, bool _vert) - { - if ( ! _vert ) - { - std::swap(_coord.left, _coord.top); - std::swap(_coord.width, _coord.height); - } - } - -} // namespace MyGUI - -#endif // __MYGUI_WIDGET_TRANSLATE_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetUserData.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetUserData.h deleted file mode 100644 index fd807d076..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_WidgetUserData.h +++ /dev/null @@ -1,123 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_WIDGET_USER_DATA_H__ -#define __MYGUI_WIDGET_USER_DATA_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_WidgetDefines.h" -#include "MyGUI_Any.h" - -namespace MyGUI -{ - /** UserData is parent of Widget class. Used to store any user data and strings inside widget */ - class MYGUI_EXPORT UserData - { - public: - UserData() { } - virtual ~UserData() { } - - /** Set user string */ - void setUserString(const std::string& _key, const std::string& _value) - { - mMapUserString[_key] = _value; - } - - /** Get user string or "" if not found */ - const std::string& getUserString(const std::string& _key) - { - MapString::iterator iter = mMapUserString.find(_key); - if (iter == mMapUserString.end()) - { - static std::string empty; - return empty; - } - return iter->second; - } - - /** Delete user string */ - bool clearUserString(const std::string& _key) - { - MapString::iterator iter = mMapUserString.find(_key); - if (iter != mMapUserString.end()) - { - mMapUserString.erase(iter); - return true; - } - return false; - } - - /** Return true if user string with such key exist */ - bool isUserString(const std::string& _key) - { - return mMapUserString.find(_key) != mMapUserString.end(); - } - - /** Delete all user strings */ - void clearUserStrings() - { - mMapUserString.clear(); - } - - /** Set any user data to store inside widget */ - void setUserData(Any _data) { mUserData = _data; } - - /** Get user data and cast it to ValueType */ - template - ValueType * getUserData(bool _throw = true) - { - return mUserData.castType(_throw); - } - - /*internal:*/ - void _setInternalData(Any _data) { mInternalData = _data; } - - template - ValueType * _getInternalData(bool _throw = true) - { - return mInternalData.castType(_throw); - } - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : template ValueType * UserData::getUserData(bool _throw)") - void * getUserData() - { - return mUserData.castUnsafe(); - } - -#endif // MYGUI_DONT_USE_OBSOLETE - - private: - // пользовательские данные - MapString mMapUserString; - Any mUserData; - - // для внутренниего использования - Any mInternalData; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_WIDGET_USER_DATA_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Window.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Window.h deleted file mode 100644 index 12f4685d7..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Window.h +++ /dev/null @@ -1,197 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_WINDOW_H__ -#define __MYGUI_WINDOW_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_Widget.h" -#include "MyGUI_EventPair.h" -#include "MyGUI_ControllerFadeAlpha.h" - -namespace MyGUI -{ - - // OBSOLETE - typedef delegates::CDelegate2 EventHandle_WidgetString; - typedef delegates::CDelegate2 EventHandle_WindowPtrCStringRef; - typedef delegates::CDelegate1 EventHandle_WindowPtr; - - class MYGUI_EXPORT Window : - public Widget - { - MYGUI_RTTI_DERIVED( Window ) - - public: - Window(); - - /** @copydoc Widget::setVisible */ - virtual void setVisible(bool _value); - - /** Hide or show window smooth */ - void setVisibleSmooth(bool _value); - /** Hide window smooth and then destroy it */ - void destroySmooth(); - - /** Enable or disable auto alpha mode */ - void setAutoAlpha(bool _value); - /** Get auto alpha mode flag */ - bool getAutoAlpha() { return mIsAutoAlpha; } - - /** Set window caption */ - virtual void setCaption(const UString& _value); - /** Get window caption */ - virtual const UString& getCaption(); - - /** Get window caption widget */ - Widget* getCaptionWidget() { return mWidgetCaption; } - - /** Set minimal possible window size */ - void setMinSize(const IntSize& _value); - /** Set minimal possible window size */ - void setMinSize(int _width, int _height) { setMinSize(IntSize(_width, _height)); } - /** Get minimal possible window size */ - IntSize getMinSize(); - - /** Set maximal possible window size */ - void setMaxSize(const IntSize& _value); - /** Set maximal possible window size */ - void setMaxSize(int _width, int _height) { setMaxSize(IntSize(_width, _height)); } - /** Get maximal possible window size */ - IntSize getMaxSize(); - - //! @copydoc Widget::setPosition(const IntPoint& _value) - virtual void setPosition(const IntPoint& _value); - //! @copydoc Widget::setSize(const IntSize& _value) - virtual void setSize(const IntSize& _value); - //! @copydoc Widget::setCoord(const IntCoord& _value) - virtual void setCoord(const IntCoord& _value); - - /** @copydoc Widget::setPosition(int _left, int _top) */ - void setPosition(int _left, int _top) { setPosition(IntPoint(_left, _top)); } - /** @copydoc Widget::setSize(int _width, int _height) */ - void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); } - /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ - void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); } - - /** Get snap to borders mode flag */ - bool getSnap() { return mSnap; } - /** Enable or disable snap to borders mode */ - void setSnap(bool _value) { mSnap = _value; } - - /** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */ - virtual void setProperty(const std::string& _key, const std::string& _value); - - /*event:*/ - /** Event : Window button pressed.\n - signature : void method(MyGUI::Window* _sender, const std::string& _name) - @param _sender widget that called this event - @param _name of pressed button - */ - EventPair eventWindowButtonPressed; - - /** Event : Window coordinate changed (window was resized or moved).\n - signature : void method(MyGUI::Window* _sender) - @param _sender widget that called this event - */ - EventPair eventWindowChangeCoord; - - /*internal:*/ - virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : void Widget::setCoord(const IntCoord& _coord)") - void setPosition(const IntCoord& _coord) { setCoord(_coord); } - MYGUI_OBSOLETE("use : void Widget::setCoord(int _left, int _top, int _width, int _height)") - void setPosition(int _left, int _top, int _width, int _height) { setCoord(_left, _top, _width, _height); } - MYGUI_OBSOLETE("use : void setVisibleSmooth(bool _visible)") - void showSmooth(bool _reset = false) { setVisibleSmooth(true); } - MYGUI_OBSOLETE("use : void setVisibleSmooth(bool _visible)") - void hideSmooth() { setVisibleSmooth(false); } - MYGUI_OBSOLETE("use : void setMinSize(const IntSize& _min) , void setMaxSize(const IntSize& _min)") - void setMinMax(const IntRect& _minmax) { setMinSize(_minmax.left, _minmax.top); setMaxSize(_minmax.right, _minmax.bottom); } - MYGUI_OBSOLETE("use : void setMinSize(const IntSize& _min) , void setMaxSize(const IntSize& _min)") - void setMinMax(int _min_w, int _min_h, int _max_w, int _max_h) { setMinSize(_min_w, _min_h); setMaxSize(_max_w, _max_h); } - MYGUI_OBSOLETE("use : IntSize getMinSize() , IntSize getMaxSize()") - IntRect getMinMax() { return IntRect(getMinSize().width, getMinSize().height, getMaxSize().width, getMaxSize().height); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - protected: - virtual ~Window(); - - void baseChangeWidgetSkin(ResourceSkin* _info); - - // переопределяем для присвоению клиенту - virtual Widget* baseCreateWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Align _align, const std::string& _layer, const std::string& _name); - - void onMouseChangeRootFocus(bool _focus); - void onKeyChangeRootFocus(bool _focus); - void onMouseDrag(int _left, int _top); - void onMouseButtonPressed(int _left, int _top, MouseButton _id); - - void notifyMousePressed(MyGUI::Widget* _sender, int _left, int _top, MouseButton _id); - void notifyPressedButtonEvent(MyGUI::Widget* _sender); - void notifyMouseDrag(MyGUI::Widget* _sender, int _left, int _top); - - // просто обновляет альфу взависимости от флагов - void updateAlpha(); - - void animateStop(Widget* _widget); - - private: - void initialiseWidgetSkin(ResourceSkin* _info); - void shutdownWidgetSkin(); - - float getAlphaVisible(); - void getSnappedCoord(IntCoord& _coord); - - ControllerFadeAlpha* createControllerFadeAlpha(float _alpha, float _coef, bool _enable); - - private: - Widget* mWidgetCaption; - - // размеры окна перед началом его изменений - IntCoord mPreActionCoord; - - // наши главные фокусы - bool mMouseRootFocus; - bool mKeyRootFocus; - - // автоматическое или ручное управление альфой - bool mIsAutoAlpha; - - // минимальные и максимальные размеры окна - IntRect mMinmax; - - bool mSnap; // прилеплять ли к краям - - IntCoord mCurrentActionScale; - bool mAnimateSmooth; - - }; - -} // namespace MyGUI - -#endif // __MYGUI_WINDOW_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_XmlDocument.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_XmlDocument.h deleted file mode 100644 index fbcdba788..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_XmlDocument.h +++ /dev/null @@ -1,334 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#ifndef __MYGUI_XML_DOCUMENT_H__ -#define __MYGUI_XML_DOCUMENT_H__ - -#include "MyGUI_Prerequest.h" -#include "MyGUI_UString.h" -#include "MyGUI_Diagnostic.h" -#include "MyGUI_DataStream.h" - -#include -#include -#include -#include -#include -#include - -namespace MyGUI -{ - namespace xml - { - - struct ElementType - { - enum Enum - { - Comment, - Declaration, - Normal, - MAX - }; - - ElementType(Enum _value = MAX) : value(_value) { } - friend bool operator == (ElementType const& a, ElementType const& b) { return a.value == b.value; } - friend bool operator != (ElementType const& a, ElementType const& b) { return a.value != b.value; } - - private: - Enum value; - }; - - struct ErrorType - { - enum Enum - { - OpenFileFail, - CreateFileFail, - IncorrectContent, - NotClosedElements, - NoXMLDeclaration, - CloseNotOpenedElement, - InconsistentOpenCloseElements, - MoreThanOneXMLDeclaration, - MoreThanOneRootElement, - IncorrectAttribute, - MAX - }; - - ErrorType(Enum _value = MAX) : value(_value) { } - - std::string print() const { return getValueName(value); } - - private: - const char * getValueName(int _index) const - { - static const char * values[MAX + 1] = - { - "Failed to open XML file", - "Failed to ceate XML file", - "XML file contain incorrect content", - "XML file contain not closed elements", - "XML file without declaration", - "XML file contain closed but not opened element", - "XML file contain inconsistent elements", - "XML file contain more than one declaration", - "XML file contain more than one root element", - "XML file contain incorrect attribute", - "" - }; - return values[(_index < MAX && _index >= 0) ? _index : MAX]; - } - private: - Enum value; - }; - - class Element; - class Document; - - typedef Element * ElementPtr; - typedef std::pair PairAttribute; - typedef std::vector VectorAttributes; - typedef std::vector VectorElement; - - //----------------------------------------------------------------------// - // class ElementEnumerator - //----------------------------------------------------------------------// - class MYGUI_EXPORT ElementEnumerator - { - friend class Element; - - private: - ElementEnumerator(VectorElement::iterator _begin, VectorElement::iterator _end); - - public: - bool next(); - bool next(const std::string& _name); - - ElementPtr operator->() const { assert(m_current != m_end); return (*m_current); } - ElementPtr current() { assert(m_current != m_end); return (*m_current); } - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : bool ElementEnumerator::next()") - bool nextNode() { return next(); } - MYGUI_OBSOLETE("use : bool ElementEnumerator::next(const std::string& _name)") - bool nextNode(const std::string& _name) { return next(_name); } - MYGUI_OBSOLETE("use : ElementPtr ElementEnumerator::current()") - ElementPtr currentNode() { return current(); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - private: - bool m_first; - VectorElement::iterator m_current, m_end; - }; - - - //----------------------------------------------------------------------// - // class Element - //----------------------------------------------------------------------// - class MYGUI_EXPORT Element - { - friend class Document; - - public: - ~Element(); - - private: - Element(const std::string &_name, ElementPtr _parent, ElementType _type = ElementType::Normal, const std::string& _content = ""); - void save(std::ostream& _stream, size_t _level); - - public: - ElementPtr createChild(const std::string& _name, const std::string& _content = ""); - - template - void addAttribute(const std::string &_key, const T& _value) - { - mAttributes.push_back(PairAttribute(_key, utility::toString(_value))); - } - - void addAttribute(const std::string& _key, const std::string& _value); - - void removeAttribute(const std::string& _key); - - void setAttribute(const std::string& _key, const std::string& _value); - - template - void addContent(const T& _content) - { - mContent.empty() ? mContent = utility::toString(_content) : mContent += utility::toString(" ", _content); - } - - void addContent(const std::string& _content); - - template - void setContent(const T& _content) - { - mContent = utility::toString(_content); - } - - void setContent(const std::string& _content) { mContent = _content; } - - void clear(); - - bool findAttribute(const std::string& _name, std::string& _value); - std::string findAttribute(const std::string& _name); - - const std::string& getName() const { return mName; } - const std::string& getContent() const { return mContent; } - const VectorAttributes& getAttributes() const { return mAttributes; } - ElementPtr getParent() const { return mParent; } - - ElementEnumerator getElementEnumerator() { return ElementEnumerator(mChilds.begin(), mChilds.end()); } - - ElementType getType() const { return mType; } - - ElementPtr createCopy(); - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - template - MYGUI_OBSOLETE("use : template void Element::addAttribute(const std::string &_key, const T& _value)") - void addAttributes(const std::string &_key, const T& _value) { addAttribute(_key, _value); } - MYGUI_OBSOLETE("use : void Element::addAttribute(const std::string& _key, const std::string& _value)") - void addAttributes(const std::string& _key, const std::string& _value) { addAttribute(_key, _value); } - - template - MYGUI_OBSOLETE("use : template void Element::addContent(const T& _content)") - void addBody(const T& _content) { addContent(_content); } - MYGUI_OBSOLETE("use : void Element::addContent(const std::string& _content)") - void addBody(const std::string& _content) { addContent(_content); } - template - MYGUI_OBSOLETE("use : template void Element::setContent(const T& _content)") - void setBody(const T& _content) { setContent(_content); } - MYGUI_OBSOLETE("use : void Element::setContent(const std::string& _content)") - void setBody(const std::string& _content) { setContent(_content); } - - MYGUI_OBSOLETE("use : const std::string& Element::getContent()") - const std::string& getBody() { return getContent(); } - MYGUI_OBSOLETE("use : ElementEnumerator Element::getElementEnumerator()") - ElementEnumerator getNodeIterator() { return getElementEnumerator(); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - private: - std::string mName; - std::string mContent; - VectorAttributes mAttributes; - VectorElement mChilds; - ElementPtr mParent; - ElementType mType; - }; - - //----------------------------------------------------------------------// - // class Document - //----------------------------------------------------------------------// - class MYGUI_EXPORT Document - { - public: - Document(); - ~Document(); - - // открывает обычным файлом, имя файла в utf8 - bool open(const std::string& _filename); - - // открывает обычным файлом, имя файла в utf16 или utf32 - bool open(const std::wstring& _filename); - - // открывает обычным потоком - bool open(std::istream& _stream); - - bool open(const UString& _filename) { return open(_filename.asWStr()); } - - bool open(IDataStream* _data); - - // сохраняет файл - bool save(const std::string& _filename); - - // сохраняет файл - bool save(const std::wstring& _filename); - - bool save(std::ostream& _stream); - - bool save(const UString& _filename) { return save(_filename.asWStr()); } - - void clear(); - - std::string getLastError(); - - void clearLastError() { mLastError = ErrorType::MAX; } - - ElementPtr createDeclaration(const std::string& _version = "1.0", const std::string& _encoding = "UTF-8"); - ElementPtr createRoot(const std::string& _name); - - ElementPtr getRoot() const { return mRoot; } - - /*obsolete:*/ -#ifndef MYGUI_DONT_USE_OBSOLETE - - MYGUI_OBSOLETE("use : ElementPtr Document::createDeclaration(const std::string& _version, const std::string& _encoding)") - ElementPtr createInfo(const std::string& _version = "1.0", const std::string& _encoding = "UTF-8") { return createDeclaration(_version, _encoding); } - -#endif // MYGUI_DONT_USE_OBSOLETE - - private: - void setLastFileError(const std::string& _filename) { mLastErrorFile = _filename; } - - void setLastFileError(const std::wstring& _filename) { mLastErrorFile = UString(_filename).asUTF8(); } - - bool parseTag(ElementPtr &_currentNode, std::string _content); - - bool checkPair(std::string &_key, std::string &_value); - - bool parseLine(std::string& _line, ElementPtr& _element); - - // ищет символ без учета ковычек - size_t find(const std::string& _text, char _char, size_t _start = 0); - - void clearDeclaration(); - void clearRoot(); - - private: - ElementPtr mRoot; - ElementPtr mDeclaration; - ErrorType mLastError; - std::string mLastErrorFile; - size_t mLine; - size_t mCol; - - }; // class Document - - MYGUI_OBSOLETE("use : class MyGUI::xml::ElementEnumerator") - typedef ElementEnumerator xmlNodeIterator; - MYGUI_OBSOLETE("use : class MyGUI::xml::ElementPtr") - typedef ElementPtr xmlNodePtr; - MYGUI_OBSOLETE("use : class MyGUI::xml::Document") - typedef Document xmlDocument; - - } // namespace xml - -} // namespace MyGUI - -#endif // __MYGUI_XML_DOCUMENT_H__ diff --git a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_ActionController.cpp b/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_ActionController.cpp deleted file mode 100644 index 86904bd6f..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_ActionController.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 03/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ - -#include "MyGUI_Precompiled.h" -#include "MyGUI_ActionController.h" -#include "MyGUI_Widget.h" -#include "MyGUI_WidgetManager.h" - -namespace MyGUI -{ - - namespace action - { - - void actionWidgetHide(Widget* _widget) - { - _widget->setVisible(false); - } - - void actionWidgetShow(Widget* _widget) - { - _widget->setVisible(true); - } - - void actionWidgetDestroy(Widget* _widget) - { - WidgetManager::getInstance().destroyWidget(_widget); - } - - void linearMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _k) - { - _result.set(_startRect.left - int( float(_startRect.left - _destRect.left) * _k ), - _startRect.top - int( float(_startRect.top - _destRect.top) * _k ), - _startRect.width - int( float(_startRect.width - _destRect.width) * _k ), - _startRect.height - int( float(_startRect.height - _destRect.height) * _k ) - ); - } - - void inertionalMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time) - { -#ifndef M_PI - const float M_PI = 3.141593f; -#endif - float k = sin(M_PI * _current_time - M_PI/2.0f); - if (k<0) k = (-pow(-k, 0.7f) + 1)/2; - else k = (pow(k, 0.7f) + 1)/2; - linearMoveFunction(_startRect, _destRect, _result, k); - } - - } // namespace action - -} // namespace MyGUI diff --git a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_Any.cpp b/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_Any.cpp deleted file mode 100644 index 09a5f9544..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_Any.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 10/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ - -#include "MyGUI_Precompiled.h" -#include "MyGUI_Any.h" - -namespace MyGUI -{ - - Any::AnyEmpty Any::Null; - -} // namespace MyGUI diff --git a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_Button.cpp b/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_Button.cpp deleted file mode 100644 index 771402030..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_Button.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#include "MyGUI_Precompiled.h" -#include "MyGUI_Button.h" -#include "MyGUI_ResourceSkin.h" -#include "MyGUI_StaticImage.h" -#include "MyGUI_InputManager.h" - -namespace MyGUI -{ - - Button::Button() : - mIsMousePressed(false), - mIsMouseFocus(false), - mIsStateCheck(false), - mImage(nullptr), - mModeImage(false) - { - } - - void Button::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name) - { - Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name); - - initialiseWidgetSkin(_info); - } - - Button::~Button() - { - shutdownWidgetSkin(); - } - - void Button::baseChangeWidgetSkin(ResourceSkin* _info) - { - shutdownWidgetSkin(); - Base::baseChangeWidgetSkin(_info); - initialiseWidgetSkin(_info); - } - - void Button::initialiseWidgetSkin(ResourceSkin* _info) - { - // парсим свойства - const MapString& properties = _info->getProperties(); - if (!properties.empty()) - { - MapString::const_iterator iter = properties.find("ButtonPressed"); - if (iter != properties.end()) setButtonPressed(utility::parseValue(iter->second)); - iter = properties.find("StateCheck"); - if (iter != properties.end()) setStateCheck(utility::parseValue(iter->second)); - iter = properties.find("ModeImage"); - if (iter != properties.end()) setModeImage(utility::parseValue(iter->second)); - } - - for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter) - { - if (*(*iter)->_getInternalData() == "Image") - { - MYGUI_DEBUG_ASSERT( ! mImage, "widget already assigned"); - mImage = (*iter)->castType(); - } - } - } - - void Button::shutdownWidgetSkin() - { - mImage = nullptr; - } - - void Button::onMouseSetFocus(Widget* _old) - { - _setMouseFocus(true); - - Base::onMouseSetFocus(_old); - } - - void Button::onMouseLostFocus(Widget* _new) - { - _setMouseFocus(false); - - Base::onMouseLostFocus(_new); - } - - void Button::onMouseButtonPressed(int _left, int _top, MouseButton _id) - { - if (_id == MouseButton::Left) - { - mIsMousePressed = true; - updateButtonState(); - } - - Base::onMouseButtonPressed(_left, _top, _id); - } - - void Button::onMouseButtonReleased(int _left, int _top, MouseButton _id) - { - if (_id == MouseButton::Left) - { - mIsMousePressed = false; - updateButtonState(); - } - - Base::onMouseButtonReleased(_left, _top, _id); - } - - void Button::setImageIndex(size_t _index) - { - if (mImage) mImage->setImageIndex(_index); - } - - size_t Button::getImageIndex() - { - if (mImage) return mImage->getImageIndex(); - return ITEM_NONE; - } - - void Button::updateButtonState() - { - if (mIsStateCheck) - { - if (!mEnabled) { if (!_setState("disabled_checked")) _setState("disabled"); } - else if (mIsMousePressed) { if (!_setState("pushed_checked")) _setState("pushed"); } - else if (mIsMouseFocus) { if (!_setState("highlighted_checked")) _setState("pushed"); } - else _setState("normal_checked"); - } - else - { - if (!mEnabled) _setState("disabled"); - else if (mIsMousePressed) _setState("pushed"); - else if (mIsMouseFocus) _setState("highlighted"); - else _setState("normal"); - } - } - - void Button::setStateCheck(bool _check) - { - if (mIsStateCheck == _check) return; - mIsStateCheck = _check; - updateButtonState(); - } - - void Button::_setMouseFocus(bool _focus) - { - mIsMouseFocus = _focus; - updateButtonState(); - } - - void Button::setProperty(const std::string& _key, const std::string& _value) - { - /// @wproperty{Button, Button_Pressed, bool} Set pressed state. - if (_key == "Button_Pressed") setButtonPressed(utility::parseValue(_value)); - else if (_key == "Button_ModeImage") setModeImage(utility::parseValue(_value)); - else if (_key == "Button_ImageResource") setImageResource(_value); - else - { - Base::setProperty(_key, _value); - return; - } - eventChangeProperty(this, _key, _value); - } - - void Button::baseUpdateEnable() - { - updateButtonState(); - if (!mEnabled) - { - mIsMouseFocus = false; - } - } - - void Button::setModeImage(bool _value) - { - mModeImage = _value; - updateButtonState(); - } - - bool Button::_setState(const std::string& _value) - { - if (mModeImage) - { - if (mImage) - mImage->setItemName(_value); - - setState(_value); - return true; - } - - return setState(_value); - } - - void Button::setImageResource(const std::string& _name) - { - if (mImage) - mImage->setItemResource(_name); - updateButtonState(); - } - -} // namespace MyGUI diff --git a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_Canvas.cpp b/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_Canvas.cpp deleted file mode 100644 index 34948bfe4..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_Canvas.cpp +++ /dev/null @@ -1,281 +0,0 @@ -/*! - @file - @author Alexander Ptakhin - @date 01/2009 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#include "MyGUI_Precompiled.h" -#include "MyGUI_Canvas.h" -#include "MyGUI_ResourceManager.h" -#include "MyGUI_Gui.h" -#include "MyGUI_RenderManager.h" -#include "MyGUI_Bitwise.h" - -namespace MyGUI -{ - - Canvas::Canvas() : - mTexture( nullptr ), - mTexResizeMode( TRM_PT_CONST_SIZE ), - mTexData( 0 ), - mTexManaged( true ), - mFrameAdvise( false ) - { - mGenTexName = utility::toString( this, "_Canvas" ); - } - - void Canvas::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name) - { - Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name); - } - - Canvas::~Canvas() - { - _destroyTexture( false ); - } - - void Canvas::createTexture( TextureResizeMode _resizeMode, TextureUsage _usage, PixelFormat _format ) - { - createTexture( getSize(), _resizeMode, _usage, _format ); - } - - void Canvas::createTexture( const IntSize& _size, TextureResizeMode _resizeMode, TextureUsage _usage, PixelFormat _format ) - { - if ( _size.width <= 0 || _size.height <= 0 ) - { - MYGUI_ASSERT( 0, "At least one of dimensions isn't positive!" ); - return; - } - - createTexture( _size.width, _size.height, _resizeMode, _usage, _format ); - } - - void Canvas::createExactTexture( int _width, int _height, TextureUsage _usage, PixelFormat _format ) - { - MYGUI_ASSERT( _width >= 0 && _height >= 0, "negative size" ); - - destroyTexture(); - - mTexture = RenderManager::getInstance().createTexture(mGenTexName); - mTexture->setInvalidateListener(this); - mTexture->createManual( _width, _height, _usage, _format ); - - mTexManaged = true; - - _setTextureName( mGenTexName ); - correctUV(); - requestUpdateCanvas( this, Event( true, true, false ) ); - } - - void Canvas::resize( const IntSize& _size ) - { - if ( _size.width <= 0 || _size.height <= 0 || ! mTexManaged ) - return; - - mReqTexSize = _size; - - frameAdvise( true ); - } - - void Canvas::createTexture( int _width, int _height, TextureResizeMode _resizeMode, TextureUsage _usage, PixelFormat _format ) - { - MYGUI_ASSERT( _width >= 0 && _height >= 0, "negative size" ); - - if ( mReqTexSize.empty() ) - mReqTexSize = IntSize( _width, _height ); - - mTexResizeMode = _resizeMode; - - bool create = checkCreate( _width, _height ); - - _width = Bitwise::firstPO2From(_width); - _height = Bitwise::firstPO2From(_height); - - if ( create ) - createExactTexture( _width, _height, _usage, _format ); - } - - void Canvas::setSize( const IntSize& _size ) - { - resize( _size ); - - Base::setSize( _size ); - } - - void Canvas::setCoord( const IntCoord& _coord ) - { - resize( _coord.size() ); - - Base::setCoord( _coord ); - } - - void Canvas::updateTexture() - { - requestUpdateCanvas( this, Event( false, false, true ) ); - } - - bool Canvas::checkCreate( int _width, int _height ) const - { - if ( mTexture == nullptr ) - return true; - - if ( mTexture->getWidth() >= _width && mTexture->getHeight() >= _height ) - return false; - - return true; - } - - void Canvas::validate( int& _width, int& _height, TextureUsage& _usage, PixelFormat& _format ) const - { - _width = Bitwise::firstPO2From(_width); - _height = Bitwise::firstPO2From(_height); - - // restore usage and format - if ( mTexture != nullptr ) - { - if ( _usage == getDefaultTextureUsage() ) - _usage = mTexture->getUsage(); - - if ( _format == getDefaultTextureFormat() ) - _format = mTexture->getFormat(); - } - } - - void Canvas::destroyTexture() - { - _destroyTexture( true ); - } - - void Canvas::_destroyTexture( bool _sendEvent ) - { - if ( mTexture != nullptr ) - { - if ( _sendEvent ) - { - eventPreTextureChanges( this ); - } - - RenderManager::getInstance().destroyTexture( mTexture ); - mTexture = nullptr; - } - - } - - void Canvas::correctUV() - { - if ( mTexResizeMode == TRM_PT_VIEW_REQUESTED ) - { - _setUVSet( FloatRect( 0, 0, - (float) mReqTexSize.width / (float) getTextureRealWidth(), - (float) mReqTexSize.height / (float) getTextureRealHeight() - ) ); - } - - if ( mTexResizeMode == TRM_PT_CONST_SIZE || mTexResizeMode == TRM_PT_VIEW_ALL ) - { - _setUVSet( FloatRect( 0, 0, 1, 1 ) ); - } - } - - void* Canvas::lock(TextureUsage _usage) - { - void* data = mTexture->lock(_usage); - - mTexData = reinterpret_cast< uint8* >( data ); - - return data; - } - - void Canvas::unlock() - { - mTexture->unlock(); - } - - void Canvas::baseChangeWidgetSkin( ResourceSkin* _info ) - { - Base::baseChangeWidgetSkin( _info ); - } - - void Canvas::initialiseWidgetSkin( ResourceSkin* _info ) - { - } - - void Canvas::shutdownWidgetSkin() - { - } - - bool Canvas::isTextureSrcSize() const - { - return getTextureSrcSize() == getTextureRealSize(); - } - - void Canvas::frameAdvise( bool _advise ) - { - if ( _advise ) - { - if ( ! mFrameAdvise ) - { - MyGUI::Gui::getInstance().eventFrameStart += MyGUI::newDelegate( this, &Canvas::frameEntered ); - mFrameAdvise = true; - } - } - else - { - if ( mFrameAdvise ) - { - MyGUI::Gui::getInstance().eventFrameStart -= MyGUI::newDelegate( this, &Canvas::frameEntered ); - mFrameAdvise = false; - } - } - } - - void Canvas::frameEntered( float _time ) - { - int width = mReqTexSize.width; - int height = mReqTexSize.height; - TextureUsage usage = getDefaultTextureUsage(); - PixelFormat format = getDefaultTextureFormat(); - - validate( width, height, usage, format ); - - bool create = checkCreate( width, height ); - - if ( mTexResizeMode == TRM_PT_CONST_SIZE ) - create = false; - - if ( create ) - { - createExactTexture( width, height, usage, format ); - correctUV(); - } - else // I thought order is important - { - correctUV(); - requestUpdateCanvas( this, Event( false, true, false ) ); - } - - frameAdvise( false ); - } - - void Canvas::textureInvalidate(ITexture* _texture) - { - updateTexture(); - } - -} // namespace MyGUI diff --git a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_ClipboardManager.cpp b/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_ClipboardManager.cpp deleted file mode 100644 index 0de57f43d..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_ClipboardManager.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 11/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#include "MyGUI_Precompiled.h" -#include "MyGUI_ClipboardManager.h" -#include "MyGUI_Gui.h" -#include "MyGUI_TextIterator.h" - -#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32 -#include -#endif - -namespace MyGUI -{ - -#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32 - - HWND g_hWnd = NULL; - - BOOL CALLBACK EnumWindowProc(HWND hWnd, LPARAM lParam) - { - DWORD dwProcessID = 0; - ::GetWindowThreadProcessId(hWnd, &dwProcessID); - - if (dwProcessID != (DWORD)lParam) - return TRUE; - - if (::GetParent(hWnd) == NULL) - { - // Нашли. hWnd - то что надо - g_hWnd = hWnd; - return FALSE; - } - - return TRUE; - } - - BOOL CALLBACK EnumChildWindowProc(HWND hWnd, LPARAM lParam) - { - DWORD dwProcessID = 0; - ::GetWindowThreadProcessId(hWnd, &dwProcessID); - - if (dwProcessID != ::GetCurrentProcessId()) - return TRUE; - -#ifdef _M_X64 - if (::GetWindowLongPtr(hWnd, GWLP_HINSTANCE) == lParam) -#else - if (::GetWindowLong(hWnd, GWL_HINSTANCE) == lParam) -#endif - { - // Нашли. hWnd - то что надо - g_hWnd = hWnd; - return FALSE; - } - - return TRUE; - } - -#endif - - MYGUI_INSTANCE_IMPLEMENT( ClipboardManager ) - - void ClipboardManager::initialise() - { - MYGUI_ASSERT(!mIsInitialise, INSTANCE_TYPE_NAME << " initialised twice"); - MYGUI_LOG(Info, "* Initialise: " << INSTANCE_TYPE_NAME); - -#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32 - // берем имя нашего экзешника - char buf[MAX_PATH]; - ::GetModuleFileName(0, (LPCH)&buf, MAX_PATH); - // берем инстанс нашего модуля - HINSTANCE instance = ::GetModuleHandle(buf); - - ::EnumChildWindows(::GetDesktopWindow(), (WNDENUMPROC)EnumWindowProc, (LPARAM)instance); - mHwnd = (size_t)g_hWnd; - -#endif - - MYGUI_LOG(Info, INSTANCE_TYPE_NAME << " successfully initialized"); - mIsInitialise = true; - } - - void ClipboardManager::shutdown() - { - if (!mIsInitialise) return; - MYGUI_LOG(Info, "* Shutdown: " << INSTANCE_TYPE_NAME); - - MYGUI_LOG(Info, INSTANCE_TYPE_NAME << " successfully shutdown"); - mIsInitialise = false; - } - - void ClipboardManager::setClipboardData(const std::string& _type, const std::string& _data) - { - mClipboardData[_type] = _data; - -#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32 - if (_type == "Text") - { - mPutTextInClipboard = TextIterator::getOnlyText(UString(_data)); - size_t size = (mPutTextInClipboard.size() + 1) * 2; - //открываем буфер обмена - if (::OpenClipboard((HWND)mHwnd)) - { - ::EmptyClipboard(); //очищаем буфер - HGLOBAL hgBuffer = ::GlobalAlloc(GMEM_DDESHARE, size);//выделяем память - wchar_t * chBuffer = NULL; - if ((hgBuffer) && (chBuffer = (wchar_t*)GlobalLock(hgBuffer))) - { - ::memcpy(chBuffer, mPutTextInClipboard.asWStr_c_str(), size); - ::GlobalUnlock(hgBuffer);//разблокируем память - ::SetClipboardData(CF_UNICODETEXT, hgBuffer);//помещаем текст в буфер обмена - } - ::CloseClipboard(); //закрываем буфер обмена - } - } -#endif - } - - void ClipboardManager::clearClipboardData(const std::string& _type) - { - MapString::iterator iter = mClipboardData.find(_type); - if (iter != mClipboardData.end()) mClipboardData.erase(iter); - } - - std::string ClipboardManager::getClipboardData(const std::string& _type) - { -#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32 - if (_type == "Text") - { - UString buff; - //открываем буфер обмена - if ( ::OpenClipboard((HWND)mHwnd) ) - { - HANDLE hData = ::GetClipboardData(CF_UNICODETEXT);//извлекаем текст из буфера обмена - wchar_t * chBuffer = NULL; - if ((hData) && (chBuffer = (wchar_t*)::GlobalLock(hData))) - { - buff = chBuffer; - ::GlobalUnlock(hData);//разблокируем память - } - ::CloseClipboard();//закрываем буфер обмена - } - // если в буфере не то что мы ложили, то берем из буфера - if (mPutTextInClipboard != buff) - { - // вставляем теги, если нуно - const UString& text = TextIterator::toTagsString(buff); - return text.asUTF8(); - } - - MapString::iterator iter = mClipboardData.find(_type); - if (iter != mClipboardData.end()) return (*iter).second; - return ""; - } -#endif - - MapString::iterator iter = mClipboardData.find(_type); - if (iter != mClipboardData.end()) return (*iter).second; - return ""; - } - -} // namespace MyGUI diff --git a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_Colour.cpp b/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_Colour.cpp deleted file mode 100644 index 804736cd8..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_Colour.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2008 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#include "MyGUI_Precompiled.h" -#include "MyGUI_Colour.h" - -namespace MyGUI -{ - - const Colour Colour::Zero = Colour(0, 0, 0, 0); - const Colour Colour::Black = Colour(0, 0, 0, 1); - const Colour Colour::White = Colour(1, 1, 1, 1); - const Colour Colour::Red = Colour(1, 0, 0, 1); - const Colour Colour::Green = Colour(0, 1, 0, 1); - const Colour Colour::Blue = Colour(0, 0, 1, 1); - -} // namespace MyGUI diff --git a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_ComboBox.cpp b/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_ComboBox.cpp deleted file mode 100644 index 3fde498e8..000000000 --- a/extern/mygui_3.0.1/MyGUIEngine/src/MyGUI_ComboBox.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/*! - @file - @author Albert Semenov - @date 12/2007 - @module -*/ -/* - This file is part of MyGUI. - - MyGUI is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - MyGUI 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with MyGUI. If not, see . -*/ -#include "MyGUI_Precompiled.h" -#include "MyGUI_ComboBox.h" -#include "MyGUI_ControllerManager.h" -#include "MyGUI_InputManager.h" -#include "MyGUI_WidgetManager.h" -#include "MyGUI_Gui.h" -#include "MyGUI_List.h" -#include "MyGUI_Button.h" -#include "MyGUI_ResourceSkin.h" -#include "MyGUI_LayerManager.h" - -namespace MyGUI -{ - - const float COMBO_ALPHA_MAX = ALPHA_MAX; - const float COMBO_ALPHA_MIN = ALPHA_MIN; - const float COMBO_ALPHA_COEF = 4.0f; - - ComboBox::ComboBox() : - mButton(nullptr), - mList(nullptr), - mListShow(false), - mMaxHeight(0), - mItemIndex(ITEM_NONE), - mModeDrop(false), - mDropMouse(false), - mShowSmooth(false), - mManualList(true) - { - } - - void ComboBox::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name) - { - Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name); - - initialiseWidgetSkin(_info); - } - - ComboBox::~ComboBox() - { - shutdownWidgetSkin(); - } - - void ComboBox::baseChangeWidgetSkin(ResourceSkin* _info) - { - shutdownWidgetSkin(); - Base::baseChangeWidgetSkin(_info); - initialiseWidgetSkin(_info); - } - - void ComboBox::initialiseWidgetSkin(ResourceSkin* _info) - { - // парсим свойства - const MapString& properties = _info->getProperties(); - if (!properties.empty()) - { - MapString::const_iterator iter = properties.find("HeightList"); - if (iter != properties.end()) mMaxHeight = utility::parseValue(iter->second); - - iter = properties.find("ListSmoothShow"); - if (iter != properties.end()) setSmoothShow(utility::parseBool(iter->second)); - } - - // парсим кнопку - for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter) - { - if (*(*iter)->_getInternalData() == "Button") - { - MYGUI_DEBUG_ASSERT( ! mButton, "widget already assigned"); - mButton = (*iter)->castType