MyGUI_3.2.0/0000775000000000000000000000000011723345160011232 5ustar rootrootMyGUI_3.2.0/CMake/0000775000000000000000000000000011723345154012215 5ustar rootrootMyGUI_3.2.0/CMake/ConfigureBuild.cmake0000664000000000000000000000345011721331046016113 0ustar rootroot####################################################################### # This file takes care of configuring MyGUI to build with the settings # given in CMake. It creates the necessary config.h file and will # also prepare package files for pkg-config and CMake. ####################################################################### # should we build static libs? if (MYGUI_STATIC) set(MYGUI_LIB_TYPE STATIC) else () set(MYGUI_LIB_TYPE SHARED) endif () set(MYGUI_STATIC_LIB 0) if (MYGUI_STATIC) set(MYGUI_STATIC_LIB 1) add_definitions(-DMYGUI_STATIC) endif() if (WIN32) configure_file(${MYGUI_TEMPLATES_DIR}/updateListFiles.bat.in ${MYGUI_BINARY_DIR}/updateListFiles.bat) endif () # Create the pkg-config package files on Unix systems if (UNIX) set(MYGUI_LIB_SUFFIX "") set(MYGUI_PLUGIN_PREFIX "") set(MYGUI_PLUGIN_EXT ".so") if (MYGUI_STATIC) set(MYGUI_LIB_SUFFIX "${MYGUI_LIB_SUFFIX}Static") set(MYGUI_PLUGIN_PREFIX "lib") set(MYGUI_PLUGIN_EXT ".a") endif () string(TOLOWER "${CMAKE_BUILD_TYPE}" MYGUI_BUILD_TYPE) if (MYGUI_BUILD_TYPE STREQUAL "debug") set(MYGUI_LIB_SUFFIX "${MYGUI_LIB_SUFFIX}_d") endif () set(MYGUI_ADDITIONAL_LIBS "") set(MYGUI_CFLAGS "") set(MYGUI_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}) set(MYGUI_ADDITIONAL_LIBS "${MYGUI_ADDITIONAL_LIBS}") if (MYGUI_STATIC) configure_file(${MYGUI_TEMPLATES_DIR}/MYGUIStatic.pc.in ${MYGUI_BINARY_DIR}/pkgconfig/MYGUI${MYGUI_LIB_SUFFIX}.pc @ONLY) else () configure_file(${MYGUI_TEMPLATES_DIR}/MYGUI.pc.in ${MYGUI_BINARY_DIR}/pkgconfig/MYGUI${MYGUI_LIB_SUFFIX}.pc @ONLY) endif () install(FILES ${MYGUI_BINARY_DIR}/pkgconfig/MYGUI${MYGUI_LIB_SUFFIX}.pc DESTINATION lib/pkgconfig) # configure additional packages endif () if (MYGUI_STANDALONE_BUILD) set(CMAKE_SUPPRESS_REGENERATION true) endif() MyGUI_3.2.0/CMake/Packaging.cmake0000664000000000000000000000402211722044610015071 0ustar rootrootoption(MYGUI_CREATE_PACKAGE "Create package." FALSE) if (MYGUI_CREATE_PACKAGE) set(CPACK_PACKAGE_VERSION ${MYGUI_VERSION}) set(CPACK_PACKAGE_VERSION_MAJOR ${MYGUI_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${MYGUI_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${MYGUI_VERSION_PATCH}) set(CPACK_INSTALL_CMAKE_PROJECTS "${MYGUI_BINARY_DIR}" "MYGUI" "ALL" "/") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MyGUI - fast, flexible and simple GUI") set(CPACK_PACKAGE_INSTALL_DIRECTORY "MYGUI") set(CPACK_PACKAGE_NAME "MYGUI") set(CPACK_PACKAGE_VENDOR "") set(CPACK_RESOURCE_FILE_LICENSE "${MYGUI_SOURCE_DIR}/COPYING.LESSER") set(CPACK_PACKAGE_CONTACT "MYGUI Team ") if (WIN32 AND NOT UNIX) set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "WriteRegStr \\\${WriteEnvStr_RegKey} \\\"MYGUI_HOME\\\" $INSTDIR") # There is a bug in NSIS that does not handle full unix paths properly. Make # sure there is at least one set of four (4) backlasshes. SET(CPACK_PACKAGE_ICON "${MYGUI_SOURCE_DIR}/Media/Common/Sources\\\\MyGUI_Logo.bmp") SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin/Debug\\\\LayoutEditor.exe") SET(CPACK_NSIS_MUI_ICON "Common/Base\\\\mygui.ico") SET(CPACK_NSIS_DISPLAY_NAME "MyGUI") SET(CPACK_NSIS_HELP_LINK "http://my-gui.sourceforge.net/") # SET(CPACK_NSIS_MENU_LINKS # "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-gui.html" "cmake-gui Help" # "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help" # "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-properties.html" # "CMake Properties and Variables Help" # "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/ctest.html" "CTest Help" # "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-modules.html" "CMake Modules Help" # "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-commands.html" "CMake Commands Help" # "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cpack.html" "CPack Help" # "http://MyGUI.info" "MyGUI Web Site" # ) endif () include(CPack) endif () MyGUI_3.2.0/CMake/Templates/0000775000000000000000000000000011723345154014153 5ustar rootrootMyGUI_3.2.0/CMake/Templates/MYGUIConfig.cmake.in0000664000000000000000000000126411721331046017576 0ustar rootroot# Find MYGUI includes and library # # This module defines # MYGUI_INCLUDE_DIRS # MYGUI_LIBRARIES, the libraries to link against to use MYGUI. # MYGUI_LIBRARY_DIRS, the location of the libraries # MYGUI_FOUND, If false, do not try to use MYGUI # include(FindPackageMessage) set(MYGUI_PREFIX_DIR "@CMAKE_INSTALL_PREFIX@") get_filename_component(MYGUI_LIBRARY_DIRS "${MYGUI_PREFIX_DIR}/lib" ABSOLUTE) get_filename_component(MYGUI_INCLUDE_DIRS "${MYGUI_PREFIX_DIR}/include/MYGUI" ABSOLUTE) set(MYGUI_LIBRARIES "MyGUIEngine") message(STATUS "Found MYGUI") message(STATUS " libraries : '${MYGUI_LIBRARIES}' from ${MYGUI_LIBRARY_DIRS}") message(STATUS " includes : ${MYGUI_INCLUDE_DIRS}") MyGUI_3.2.0/CMake/Templates/VisualStudio2010UserFile.vcxproj.user.in0000664000000000000000000000225711721331046023546 0ustar rootroot $(OutDir) WindowsLocalDebugger $(OutDir) WindowsLocalDebugger $(OutDir) WindowsLocalDebugger $(OutDir) WindowsLocalDebugger MyGUI_3.2.0/CMake/Templates/VisualStudioUserFile.vcproj.user.in0000664000000000000000000000304211721331046023044 0ustar rootroot MyGUI_3.2.0/CMake/Templates/MYGUI.pc.in0000664000000000000000000000052211721331046015766 0ustar rootrootprefix=@MYGUI_PREFIX_PATH@ exec_prefix=${prefix} libdir=${prefix}/lib includedir=${prefix}/include Name: MyGUI Description: Fast, flexible and simple GUI Version: @MYGUI_VERSION@ URL: http://mygui.info Libs: -L${libdir} -lMyGUIEngine@MYGUI_LIB_SUFFIX@ @MYGUI_ADDITIONAL_LIBS@ Cflags: -I${includedir} -I${includedir}/MYGUI @MYGUI_CFLAGS@ MyGUI_3.2.0/CMake/Templates/MYGUIStatic.pc.in0000664000000000000000000000056311721331046017143 0ustar rootrootprefix=@MYGUI_PREFIX_PATH@ exec_prefix=${prefix} libdir=${prefix}/lib includedir=${prefix}/include Name: MyGUI (static lib) Description: Fast, flexible and simple GUI Version: @MYGUI_VERSION@ URL: http://mygui.info Requires: freetype2 Libs: -L${libdir} -lMyGUIEngine@MYGUI_LIB_SUFFIX@ @MYGUI_ADDITIONAL_LIBS@ Cflags: -I${includedir} -I${includedir}/MYGUI @MYGUI_CFLAGS@ MyGUI_3.2.0/CMake/Templates/plugins_d.cfg.in0000664000000000000000000000027311721331046017220 0ustar rootroot# Defines plugins to load # Define plugin folder PluginFolder=@MYGUI_PLUGIN_DIR@ # Define plugins @MYGUI_NO_PLUGIN_OGRE_DIRECTX@Plugin=RenderSystem_Direct3D9_d Plugin=RenderSystem_GL_d MyGUI_3.2.0/CMake/Templates/updateListFiles.bat.in0000664000000000000000000000013411721331046020340 0ustar rootrootchdir @MYGUI_SOURCE_DIR@/Scripts @MYGUI_SOURCE_DIR@/Scripts/parseXML.exe @MYGUI_BINARY_DIR@MyGUI_3.2.0/CMake/Templates/resources.xml.in0000664000000000000000000000022311721331046017302 0ustar rootroot @MYGUI_MEDIA_DIR@ @MYGUI_MEDIA_DIR@/MyGUI_Media MyGUI_3.2.0/CMake/Templates/plugins.cfg.in0000664000000000000000000000026711721331046016720 0ustar rootroot# Defines plugins to load # Define plugin folder PluginFolder=@MYGUI_PLUGIN_DIR@ # Define plugins @MYGUI_NO_PLUGIN_OGRE_DIRECTX@Plugin=RenderSystem_Direct3D9 Plugin=RenderSystem_GL MyGUI_3.2.0/CMake/Templates/html.cfg.in0000664000000000000000000002176311721331046016207 0ustar rootroot# Doxyfile 1.5.3 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = MYGUI PROJECT_NUMBER = ${MYGUI_VERSION} OUTPUT_DIRECTORY = ${MYGUI_BINARY_DIR}/api/ CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = "The $name class " \ "The $name widget " \ "The $name file " \ is \ provides \ specifies \ contains \ represents \ a \ an \ the ALWAYS_DETAILED_SEC = YES INLINE_INHERITED_MEMB = YES FULL_PATH_NAMES = NO STRIP_FROM_PATH = STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = NO INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 4 ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO DISTRIBUTE_GROUP_DOC = NO SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = YES EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES INLINE_INFO = NO SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO SORT_BY_SCOPE_NAME = NO GENERATE_TODOLIST = NO GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_DIRECTORIES = YES FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text " WARN_LOGFILE = ${MYGUI_BINARY_DIR}/doxygen_warnings.log #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = ${MYGUI_SOURCE_DIR}/MyGUIEngine \ ${MYGUI_SOURCE_DIR}/Docs/src \ main_page.txt INPUT_ENCODING = UTF-8 FILE_PATTERNS = MyGUI_*.h RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = *UTF* EXCLUDE_SYMBOLS = EXAMPLE_PATH = EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES REFERENCES_LINK_SOURCE = YES USE_HTAGS = NO VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES COLS_IN_ALPHA_INDEX = 3 IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html HTML_HEADER = header.html HTML_FOOTER = footer.html HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = YES HTML_DYNAMIC_SECTIONS = NO CHM_FILE = OgreAPIReference.chm HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = YES DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4 EXTRA_PACKAGES = LATEX_HEADER = PDF_HYPERLINKS = YES USE_PDFLATEX = YES LATEX_BATCHMODE = YES LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml XML_SCHEMA = XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES MSCGEN_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES CLASS_GRAPH = YES COLLABORATION_GRAPH = NO GROUP_GRAPHS = YES UML_LOOK = NO TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = NO INCLUDED_BY_GRAPH = NO CALL_GRAPH = NO CALLER_GRAPH = NO GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = gif DOT_PATH = DOTFILE_DIRS = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 4 DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = YES GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO MyGUI_3.2.0/CMake/Templates/MYGUIConfigVersion.cmake.in0000664000000000000000000000165711721331046021152 0ustar rootroot# MYGUI CMake package file # - check if package version satisfies requested version set(PACKAGE_VERSION @MYGUI_VERSION@) set(PACKAGE_VERSION_MAJOR @MYGUI_VERSION_MAJOR@) set(PACKAGE_VERSION_MINOR @MYGUI_VERSION_MINOR@) set(PACKAGE_VERSION_EXACT FALSE) set(PACKAGE_VERSION_COMPATIBLE FALSE) if(${PACKAGE_VERSION} VERSION_EQUAL ${PACKAGE_FIND_VERSION}) set(PACKAGE_VERSION_EXACT TRUE) set(PACKAGE_VERSION_COMPATIBLE TRUE) elseif(${PACKAGE_VERSION} VERSION_GREATER ${PACKAGE_FIND_VERSION}) # compatibility is only guaranteed if major and minor version numbers match if (PACKAGE_FIND_VERSION_MAJOR EQUAL ${PACKAGE_VERSION_MAJOR} AND PACKAGE_FIND_VERSION_MINOR EQUAL ${PACKAGE_VERSION_MINOR}) set(PACKAGE_VERSION_COMPATIBLE TRUE) endif (PACKAGE_FIND_VERSION_MAJOR EQUAL ${PACKAGE_VERSION_MAJOR} AND PACKAGE_FIND_VERSION_MINOR EQUAL ${PACKAGE_VERSION_MINOR}) endif(${PACKAGE_VERSION} VERSION_EQUAL ${PACKAGE_FIND_VERSION}) MyGUI_3.2.0/CMake/Templates/buildsettings.h.in0000664000000000000000000000021411721331046017577 0ustar rootroot#ifndef __Custom_Config_H_ #define __Custom_Config_H_ // CMake auto-generated configuration options #cmakedefine MYGUI_STATIC_LIB #endif MyGUI_3.2.0/CMake/CMakeLists.txt0000664000000000000000000000227311721331046014752 0ustar rootroot############################################################# # Install useful CMake modules. # These are necessary to compile the samples from the install # directory, but can also be used for custom projects. ############################################################# if(WIN32) set(MYGUI_CMAKE_DIR "CMake") else(WIN32) set(MYGUI_CMAKE_DIR "lib/MYGUI/cmake") endif(WIN32) set(INST_FILES Packages/FindOIS.cmake Packages/FindOGRE.cmake Utils/FindPkgMacros.cmake Utils/PreprocessorUtils.cmake Utils/MyGUIConfigTargets.cmake Utils/MyGUIGetVersion.cmake Utils/MyGUIFindFrameworks.cmake Templates/VisualStudioUserFile.vcproj.user.in Templates/VisualStudio2010UserFile.vcxproj.user.in ) set(STATIC_INST_FILES Packages/FindDirectX.cmake Packages/FindDirectX11.cmake Packages/FindFreetype.cmake ) if (APPLE) set(INST_FILES ${INST_FILES} Packages/FindIOKit.cmake ) set(STATIC_INST_FILES ${STATIC_INST_FILES} Packages/FindCarbon.cmake Packages/FindCocoa.cmake ) endif () #install(FILES ${INST_FILES} DESTINATION ${MYGUI_CMAKE_DIR}) if (MYGUI_STATIC) install(FILES ${STATIC_INST_FILES} DESTINATION ${MYGUI_CMAKE_DIR}) endif ()MyGUI_3.2.0/CMake/InstallResources.cmake0000664000000000000000000001031211721331046016506 0ustar rootroot################################################################## # Generate and install the config files needed for the samples ################################################################## function(install_file FILENAME) if (WIN32) install(FILES ${MYGUI_BINARY_DIR}/bin/debug/${FILENAME} DESTINATION "bin${MYGUI_DEBUG_PATH}" CONFIGURATIONS Debug ) install(FILES ${MYGUI_BINARY_DIR}/bin/release/${FILENAME} DESTINATION "bin${MYGUI_RELEASE_PATH}" CONFIGURATIONS Release None "" ) install(FILES ${MYGUI_BINARY_DIR}/bin/release/${FILENAME} DESTINATION "bin${MYGUI_RELWDBG_PATH}" CONFIGURATIONS RelWithDebInfo ) install(FILES ${MYGUI_BINARY_DIR}/bin/release/${FILENAME} DESTINATION "bin${MYGUI_MINSIZE_PATH}" CONFIGURATIONS MinSizeRel ) else () install(FILES ${MYGUI_BINARY_DIR}/bin/${FILENAME} DESTINATION "bin" ) endif () endfunction(install_file) if (MYGUI_RENDERSYSTEM EQUAL 2) if (WIN32) option(MYGUI_OGRE_WAS_BUILT_WITH_DIRECTX "Ogre have DirectX render ssystem and we don't need to disable it" TRUE) MARK_AS_ADVANCED(MYGUI_OGRE_WAS_BUILT_WITH_DIRECTX) set(MYGUI_PLUGIN_DIR ".") if (MYGUI_OGRE_WAS_BUILT_WITH_DIRECTX) set(MYGUI_NO_PLUGIN_OGRE_DIRECTX "") else () set(MYGUI_NO_PLUGIN_OGRE_DIRECTX "#") endif () elseif (UNIX) set(MYGUI_PLUGIN_DIR "/usr/lib/OGRE") set(MYGUI_NO_PLUGIN_OGRE_DIRECTX "#") endif() endif () # install resource files if (MYGUI_INSTALL_SAMPLES OR MYGUI_INSTALL_TOOLS) if (WIN32) set(MYGUI_MEDIA_DIR "../../Media") elseif (UNIX) set(MYGUI_MEDIA_DIR "../share/MYGUI/Media") else () set(MYGUI_MEDIA_DIR "../../Media") endif () if (WIN32) # create resources.xml configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/debug/resources.xml) configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/release/resources.xml) if (MYGUI_RENDERSYSTEM EQUAL 2) # create plugins.cfg configure_file(${MYGUI_TEMPLATES_DIR}/plugins_d.cfg.in ${MYGUI_BINARY_DIR}/bin/debug/plugins.cfg) configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/release/plugins.cfg) endif () else() # other OS only need one cfg file string(TOLOWER "${CMAKE_BUILD_TYPE}" MYGUI_BUILD_TYPE) if (MYGUI_BUILD_TYPE STREQUAL "debug" AND NOT APPLE) set(MYGUI_CFG_SUFFIX "_d") endif () # create resources.xml configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/resources.xml) if (MYGUI_RENDERSYSTEM EQUAL 2) # create plugins.cfg configure_file(${MYGUI_TEMPLATES_DIR}/plugins${MYGUI_CFG_SUFFIX}.cfg.in ${MYGUI_BINARY_DIR}/bin/plugins.cfg) endif () endif () install_file (resources.xml) if (MYGUI_RENDERSYSTEM EQUAL 2) install_file (plugins.cfg) endif () else () set(MYGUI_MEDIA_DIR "${MYGUI_SOURCE_DIR}/Media") if (WIN32) # create resources.xml configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/debug/resources.xml) configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/release/resources.xml) configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/relwithdebinfo/resources.xml) configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/minsizerel/resources.xml) if (MYGUI_RENDERSYSTEM EQUAL 2) # create plugins.cfg configure_file(${MYGUI_TEMPLATES_DIR}/plugins_d.cfg.in ${MYGUI_BINARY_DIR}/bin/debug/plugins.cfg) configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/release/plugins.cfg) configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/relwithdebinfo/plugins.cfg) configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/minsizerel/plugins.cfg) endif () else() # other OS only need one cfg file string(TOLOWER "${CMAKE_BUILD_TYPE}" MYGUI_BUILD_TYPE) if (MYGUI_BUILD_TYPE STREQUAL "debug" AND NOT APPLE) set(MYGUI_CFG_SUFFIX "_d") endif () # create resources.xml configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/resources.xml) if (MYGUI_RENDERSYSTEM EQUAL 2) # create plugins.cfg configure_file(${MYGUI_TEMPLATES_DIR}/plugins${MYGUI_CFG_SUFFIX}.cfg.in ${MYGUI_BINARY_DIR}/bin/plugins.cfg) endif () endif () endif () MyGUI_3.2.0/CMake/Dependencies.cmake0000664000000000000000000001022711721331046015600 0ustar rootroot####################################################################### # Find all necessary and optional MYGUI dependencies ####################################################################### # MYGUI_DEPENDENCIES_DIR can be used to specify a single base # folder where the required dependencies may be found. set(MYGUI_DEPENDENCIES_DIR "Dependencies" CACHE PATH "Path to prebuilt MYGUI dependencies") include(FindPkgMacros) getenv_path(MYGUI_DEPENDENCIES_DIR) set(MYGUI_DEP_SEARCH_PATH ${MYGUI_DEPENDENCIES_DIR} ${ENV_MYGUI_DEPENDENCIES_DIR} "${MYGUI_BINARY_DIR}/Dependencies" "${MYGUI_SOURCE_DIR}/Dependencies" "${MYGUI_BINARY_DIR}/../Dependencies" "${MYGUI_SOURCE_DIR}/../Dependencies" ) # Set hardcoded path guesses for various platforms if (UNIX) set(MYGUI_DEP_SEARCH_PATH ${MYGUI_DEP_SEARCH_PATH} /usr/local) endif () # give guesses as hints to the find_package calls set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${MYGUI_DEP_SEARCH_PATH}) set(CMAKE_FRAMEWORK_PATH ${CMAKE_FRAMEWORK_PATH} ${MYGUI_DEP_SEARCH_PATH}) if (WIN32) include(MyGUIInstallDependencies) endif () ####################################################################### # Core dependencies ####################################################################### if (MYGUI_USE_FREETYPE) # Find FreeType find_package(Freetype) macro_log_feature(FREETYPE_FOUND "freetype" "Portable font engine" "http://www.freetype.org" TRUE "" "") endif() ####################################################################### # RenderSystem dependencies ####################################################################### if(MYGUI_RENDERSYSTEM EQUAL 1) # Find DirectX if(WIN32) find_package(DirectX) macro_log_feature(DirectX_FOUND "DirectX" "Support for the DirectX render system" "http://msdn.microsoft.com/en-us/directx/" TRUE "" "") endif() elseif(MYGUI_RENDERSYSTEM EQUAL 2) # Find OGRE find_package(OGRE_Old) macro_log_feature(OGRE_FOUND "ogre" "Support for the Ogre render system" "" TRUE "" "") elseif(MYGUI_RENDERSYSTEM EQUAL 3) #find_package(ZLIB) #macro_log_feature(ZLIB_FOUND "zlib" "Simple data compression library" "http://www.zlib.net" TRUE "" "") #find_package(PNG) #macro_log_feature(PNG_FOUND "PNG" "Png image codec" "http://www.libpng.org/" TRUE "" "") find_package(OpenGL) macro_log_feature(OPENGL_FOUND "opengl" "Support for the OpenGL render system" "" TRUE "" "") elseif(MYGUI_RENDERSYSTEM EQUAL 4) # Find DirectX11 if(WIN32) find_package(DirectX11) macro_log_feature(DirectX_FOUND "DirectX11" "Support for the DirectX11 render system" "http://msdn.microsoft.com/en-us/directx/" TRUE "" "") endif() endif() ####################################################################### # Demos and tools optional dependencies ####################################################################### # Find OIS if (MYGUI_SAMPLES_INPUT EQUAL 1) find_package(OIS) macro_log_feature(OIS_FOUND "OIS" "Input library needed for the samples" "http://sourceforge.net/projects/wgois" FALSE "" "") elseif (MYGUI_SAMPLES_INPUT EQUAL 3) find_package(OIS) macro_log_feature(OIS_FOUND "OIS" "Input library needed for the samples" "http://sourceforge.net/projects/wgois" FALSE "" "") endif() ####################################################################### # Tools ####################################################################### find_package(Doxygen) macro_log_feature(DOXYGEN_FOUND "Doxygen" "Tool for building API documentation" "http://doxygen.org" FALSE "" "") ####################################################################### # Apple-specific ####################################################################### if (APPLE) find_package(Carbon) macro_log_feature(Carbon_FOUND "Carbon" "Carbon" "http://www.apple.com" TRUE "" "") find_package(Cocoa) macro_log_feature(Cocoa_FOUND "Cocoa" "Cocoa" "http://www.apple.com" TRUE "" "") find_package(IOKit) macro_log_feature(IOKit_FOUND "IOKit" "IOKit HID framework needed by the samples" "http://www.apple.com" FALSE "" "") endif(APPLE) # Display results, terminate if anything required is missing MACRO_DISPLAY_FEATURE_LOG() MyGUI_3.2.0/CMake/MyGUIInstallDependencies.cmake0000664000000000000000000000554311721331046020007 0ustar rootroot##################################################### # Install dependencies on Windows ##################################################### function(install_dll_file DEBUG_FILEPATH RELEASE_FILEPATH FILENAME) if (EXISTS ${DEBUG_FILEPATH}${FILENAME}_d.dll) install(FILES ${DEBUG_FILEPATH}${FILENAME}_d.dll DESTINATION bin/debug CONFIGURATIONS Debug ) install(FILES ${RELEASE_FILEPATH}${FILENAME}.dll DESTINATION bin/release CONFIGURATIONS Release None "" ) install(FILES ${RELEASE_FILEPATH}${FILENAME}.dll DESTINATION bin/relwithdebinfo CONFIGURATIONS RelWithDebInfo ) install(FILES ${RELEASE_FILEPATH}${FILENAME}.dll DESTINATION bin/minsizerel CONFIGURATIONS MinSizeRel ) configure_file(${DEBUG_FILEPATH}${FILENAME}_d.dll ${MYGUI_BINARY_DIR}/bin/debug/${FILENAME}_d.dll COPYONLY) configure_file(${RELEASE_FILEPATH}${FILENAME}.dll ${MYGUI_BINARY_DIR}/bin/release/${FILENAME}.dll COPYONLY) configure_file(${RELEASE_FILEPATH}${FILENAME}.dll ${MYGUI_BINARY_DIR}/bin/relwithdebinfo/${FILENAME}.dll COPYONLY) configure_file(${RELEASE_FILEPATH}${FILENAME}.dll ${MYGUI_BINARY_DIR}/bin/minsizerel/${FILENAME}.dll COPYONLY) endif () endfunction(install_dll_file) if (MYGUI_DEPENDENCIES_DIR STREQUAL "") set(MYGUI_DEP_BIN_DIR ${MYGUI_SOURCE_DIR}/Dependencies/bin) else () set(MYGUI_DEP_BIN_DIR ${MYGUI_DEPENDENCIES_DIR}/bin) endif () option(MYGUI_TRY_TO_COPY_DLLS "Copy dlls needed for sample builds" TRUE) if (MYGUI_TRY_TO_COPY_DLLS) # copy the dependency DLLs to the right places if (MYGUI_SAMPLES_INPUT EQUAL 1) install_dll_file(${MYGUI_DEP_BIN_DIR}/debug/ ${MYGUI_DEP_BIN_DIR}/release/ OIS) elseif (MYGUI_SAMPLES_INPUT EQUAL 2) elseif (MYGUI_SAMPLES_INPUT EQUAL 3) install_dll_file(${MYGUI_DEP_BIN_DIR}/debug/ ${MYGUI_DEP_BIN_DIR}/release/ OIS) endif () if (MYGUI_RENDERSYSTEM EQUAL 2) if (EXISTS ${OGRE_LIB_DIR}/../bin/debug/OgreMain_d.dll) set(DEBUG_DLLS_DIR ${OGRE_LIB_DIR}/../bin/debug) set(RELEASE_DLLS_DIR ${OGRE_LIB_DIR}/../bin/release) MESSAGE(STATUS " DLL's was copied from bin") elseif (EXISTS "${OGRE_LIB_DIR}/OgreMain_d.dll") set(DEBUG_DLLS_DIR ${OGRE_LIB_DIR}) set(RELEASE_DLLS_DIR ${OGRE_LIB_DIR}) MESSAGE(STATUS " DLL's was copied from lib") elseif (EXISTS ${OGRE_BUILD}/bin/debug/OgreMain_d.dll) set(DEBUG_DLLS_DIR ${OGRE_BUILD}/bin/debug) set(RELEASE_DLLS_DIR ${OGRE_BUILD}/bin/release) MESSAGE(STATUS " DLL's was copied from build bin") else () set(DEBUG_DLLS_DIR "") set(RELEASE_DLLS_DIR "") MESSAGE(ERROR " compiled OGRE DLL's wasn't found") endif () install_dll_file(${DEBUG_DLLS_DIR}/ ${RELEASE_DLLS_DIR}/ OgreMain) install_dll_file(${DEBUG_DLLS_DIR}/ ${RELEASE_DLLS_DIR}/ RenderSystem_Direct3D9) install_dll_file(${DEBUG_DLLS_DIR}/ ${RELEASE_DLLS_DIR}/ RenderSystem_GL) endif () endif () MyGUI_3.2.0/CMake/Utils/0000775000000000000000000000000011723345154013315 5ustar rootrootMyGUI_3.2.0/CMake/Utils/MyGUIConfigTargets.cmake0000664000000000000000000002605711721331046017734 0ustar rootroot# Configure settings and install targets # FIXME: Copypasted from Ogre and need lots of changes if (WIN32) set(MYGUI_RELEASE_PATH "/Release") set(MYGUI_RELWDBG_PATH "/RelWithDebInfo") set(MYGUI_MINSIZE_PATH "/MinSizeRel") set(MYGUI_DEBUG_PATH "/Debug") set(MYGUI_LIB_RELEASE_PATH "/Release") set(MYGUI_LIB_RELWDBG_PATH "/RelWithDebInfo") set(MYGUI_LIB_MINSIZE_PATH "/MinSizeRel") set(MYGUI_LIB_DEBUG_PATH "/Debug") set(MYGUI_PLUGIN_PATH "/opt") elseif (UNIX) set(MYGUI_RELEASE_PATH "") set(MYGUI_RELWDBG_PATH "") set(MYGUI_MINSIZE_PATH "") set(MYGUI_DEBUG_PATH "/debug") set(MYGUI_LIB_RELEASE_PATH "") set(MYGUI_LIB_RELWDBG_PATH "") set(MYGUI_LIB_MINSIZE_PATH "") set(MYGUI_LIB_DEBUG_PATH "") set(MYGUI_PLUGIN_PATH "/MYGUI") endif () if (APPLE) set(MYGUI_FRAMEWORK_PATH /Library/Frameworks) endif () # create vcproj.user file for Visual Studio to set debug working directory function(mygui_create_vcproj_userfile TARGETNAME) if (MSVC) # for VisualStudioUserFile.vcproj.user.in if(CMAKE_CL_64) set(MYGUI_WIN_BUILD_CONFIGURATION "x64") else() set(MYGUI_WIN_BUILD_CONFIGURATION "Win32") endif() if (${CMAKE_GENERATOR} STREQUAL "Visual Studio 10" OR ${CMAKE_GENERATOR} STREQUAL "Visual Studio 10 Win64") configure_file( ${MYGUI_TEMPLATES_DIR}/VisualStudio2010UserFile.vcxproj.user.in ${CMAKE_CURRENT_BINARY_DIR}/${TARGETNAME}.vcxproj.user @ONLY ) else () configure_file( ${MYGUI_TEMPLATES_DIR}/VisualStudioUserFile.vcproj.user.in ${CMAKE_CURRENT_BINARY_DIR}/${TARGETNAME}.vcproj.user @ONLY ) endif () endif () endfunction(mygui_create_vcproj_userfile) # install targets according to current build type function(mygui_install_target TARGETNAME SUFFIX) install(TARGETS ${TARGETNAME} RUNTIME DESTINATION "bin${MYGUI_RELEASE_PATH}" CONFIGURATIONS Release None "" LIBRARY DESTINATION "lib${MYGUI_LIB_RELEASE_PATH}${SUFFIX}" CONFIGURATIONS Release None "" ARCHIVE DESTINATION "lib${MYGUI_LIB_RELEASE_PATH}${SUFFIX}" CONFIGURATIONS Release None "" FRAMEWORK DESTINATION "${MYGUI_FRAMEWORK_PATH}" CONFIGURATIONS Release None "" ) install(TARGETS ${TARGETNAME} RUNTIME DESTINATION "bin${MYGUI_RELWDBG_PATH}" CONFIGURATIONS RelWithDebInfo LIBRARY DESTINATION "lib${MYGUI_LIB_RELWDBG_PATH}${SUFFIX}" CONFIGURATIONS RelWithDebInfo ARCHIVE DESTINATION "lib${MYGUI_LIB_RELWDBG_PATH}${SUFFIX}" CONFIGURATIONS RelWithDebInfo FRAMEWORK DESTINATION "${MYGUI_FRAMEWORK_PATH}" CONFIGURATIONS RelWithDebInfo ) install(TARGETS ${TARGETNAME} RUNTIME DESTINATION "bin${MYGUI_MINSIZE_PATH}" CONFIGURATIONS MinSizeRel LIBRARY DESTINATION "lib${MYGUI_LIB_MINSIZE_PATH}${SUFFIX}" CONFIGURATIONS MinSizeRel ARCHIVE DESTINATION "lib${MYGUI_LIB_MINSIZE_PATH}${SUFFIX}" CONFIGURATIONS MinSizeRel FRAMEWORK DESTINATION "${MYGUI_FRAMEWORK_PATH}" CONFIGURATIONS MinSizeRel ) install(TARGETS ${TARGETNAME} RUNTIME DESTINATION "bin${MYGUI_DEBUG_PATH}" CONFIGURATIONS Debug LIBRARY DESTINATION "lib${MYGUI_LIB_DEBUG_PATH}${SUFFIX}" CONFIGURATIONS Debug ARCHIVE DESTINATION "lib${MYGUI_LIB_DEBUG_PATH}${SUFFIX}" CONFIGURATIONS Debug FRAMEWORK DESTINATION "${MYGUI_FRAMEWORK_PATH}" CONFIGURATIONS Debug ) endfunction(mygui_install_target) # setup common target settings function(mygui_config_common TARGETNAME) set_target_properties(${TARGETNAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${MYGUI_BINARY_DIR}/lib LIBRARY_OUTPUT_DIRECTORY ${MYGUI_BINARY_DIR}/lib RUNTIME_OUTPUT_DIRECTORY ${MYGUI_BINARY_DIR}/bin ) mygui_create_vcproj_userfile(${TARGETNAME}) endfunction(mygui_config_common) #setup Demo builds function(mygui_app PROJECTNAME SOLUTIONFOLDER) include_directories( . ${MYGUI_SOURCE_DIR}/Common ${MYGUI_SOURCE_DIR}/MyGUIEngine/include ) # define the sources include(${PROJECTNAME}.list) if (${SOLUTIONFOLDER} STREQUAL "Tools") include(PrecompiledHeader) # specify a precompiled header to use use_precompiled_header(${PROJECTNAME} "../../Common/Precompiled.h" "../../Common/Precompiled.cpp" ) endif () # Set up dependencies if(MYGUI_RENDERSYSTEM EQUAL 1) include_directories(../../Common/Base/DirectX) add_definitions("-DMYGUI_DIRECTX_PLATFORM") include_directories( ${MYGUI_SOURCE_DIR}/Platforms/DirectX/DirectXPlatform/include ${DirectX_INCLUDE_DIR} ) link_directories(${DIRECTX_LIB_DIR}) elseif(MYGUI_RENDERSYSTEM EQUAL 2) include_directories(../../Common/Base/Ogre) add_definitions("-DMYGUI_OGRE_PLATFORM") include_directories( ${MYGUI_SOURCE_DIR}/Platforms/Ogre/OgrePlatform/include ${OGRE_INCLUDE_DIR} ) link_directories(${OGRE_LIB_DIR}) elseif(MYGUI_RENDERSYSTEM EQUAL 3) include_directories(../../Common/Base/OpenGL) add_definitions("-DMYGUI_OPENGL_PLATFORM") include_directories( ${MYGUI_SOURCE_DIR}/Platforms/OpenGL/OpenGLPlatform/include ${OPENGL_INCLUDE_DIR} ) link_directories(${OPENGL_LIB_DIR}) elseif(MYGUI_RENDERSYSTEM EQUAL 4) include_directories(../../Common/Base/DirectX11) add_definitions("-DMYGUI_DIRECTX11_PLATFORM") include_directories( ${MYGUI_SOURCE_DIR}/Platforms/DirectX11/DirectX11Platform/include ${DirectX_INCLUDE_DIR} ) link_directories(${DIRECTX_LIB_DIR}) endif() if(MYGUI_SAMPLES_INPUT EQUAL 1) add_definitions("-DMYGUI_SAMPLES_INPUT_OIS") include_directories(../../Common/Input/OIS) include_directories(${OIS_INCLUDE_DIRS}) elseif(MYGUI_SAMPLES_INPUT EQUAL 2) add_definitions("-DMYGUI_SAMPLES_INPUT_WIN32") include_directories(../../Common/Input/Win32) elseif(MYGUI_SAMPLES_INPUT EQUAL 3) add_definitions("-DMYGUI_SAMPLES_INPUT_WIN32_OIS") include_directories(../../Common/Input/Win32_OIS) include_directories(${OIS_INCLUDE_DIRS}) endif() # setup demo target if (${SOLUTIONFOLDER} STREQUAL "Wrappers") add_library(${PROJECTNAME} ${MYGUI_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES}) else () # determine specific executable type if (APPLE) set(MYGUI_EXEC_TYPE MACOSX_BUNDLE) elseif (WIN32) set(MYGUI_EXEC_TYPE WIN32) endif () add_executable(${PROJECTNAME} ${MYGUI_EXEC_TYPE} ${HEADER_FILES} ${SOURCE_FILES}) endif () set_target_properties(${PROJECTNAME} PROPERTIES FOLDER ${SOLUTIONFOLDER}) add_dependencies(${PROJECTNAME} MyGUIEngine Common) mygui_config_sample(${PROJECTNAME}) # link Common, Platform and MyGUIEngine target_link_libraries(${PROJECTNAME} Common ) if(MYGUI_RENDERSYSTEM EQUAL 1) add_dependencies(${PROJECTNAME} MyGUI.DirectXPlatform) target_link_libraries(${PROJECTNAME} MyGUI.DirectXPlatform) elseif(MYGUI_RENDERSYSTEM EQUAL 2) add_dependencies(${PROJECTNAME} MyGUI.OgrePlatform) target_link_libraries(${PROJECTNAME} MyGUI.OgrePlatform) elseif(MYGUI_RENDERSYSTEM EQUAL 3) add_dependencies(${PROJECTNAME} MyGUI.OpenGLPlatform) target_link_libraries(${PROJECTNAME} MyGUI.OpenGLPlatform) target_link_libraries(${PROJECTNAME} gdiplus) endif() target_link_libraries(${PROJECTNAME} MyGUIEngine ) if (APPLE) find_library(CF_LIBRARY CoreFoundation) find_library(IOKIT_LIBRARY IOKit) target_link_libraries(${PROJECTNAME} ${CF_LIBRARY}) target_link_libraries(${PROJECTNAME} ${IOKIT_LIBRARY}) endif () endfunction(mygui_app) function(mygui_demo PROJECTNAME) mygui_app(${PROJECTNAME} Demos) if (MYGUI_INSTALL_SAMPLES) mygui_install_app(${PROJECTNAME}) endif () endfunction(mygui_demo) function(mygui_tool PROJECTNAME) mygui_app(${PROJECTNAME} Tools) if (MYGUI_INSTALL_TOOLS) mygui_install_app(${PROJECTNAME}) endif () endfunction(mygui_tool) function(mygui_unit_test PROJECTNAME) mygui_app(${PROJECTNAME} UnitTest) endfunction(mygui_unit_test) #function(mygui_wrapper_base_app PROJECTNAME) # mygui_app(${PROJECTNAME} Wrappers) #endfunction(mygui_wrapper_base_app) function(mygui_install_app PROJECTNAME) if (MYGUI_INSTALL_PDB) # install debug pdb files install(FILES ${MYGUI_BINARY_DIR}/bin${MYGUI_DEBUG_PATH}/${PROJECTNAME}.pdb DESTINATION bin${MYGUI_DEBUG_PATH} CONFIGURATIONS Debug ) install(FILES ${MYGUI_BINARY_DIR}/bin${MYGUI_RELWDBG_PATH}/${PROJECTNAME}.pdb DESTINATION bin${MYGUI_RELWDBG_PATH} CONFIGURATIONS RelWithDebInfo ) endif () mygui_install_target(${PROJECTNAME} "") endfunction(mygui_install_app) #setup Plugin builds function(mygui_plugin PROJECTNAME) include_directories(.) # define the sources include(${PROJECTNAME}.list) add_definitions("-D_USRDLL -DMYGUI_BUILD_DLL") add_library(${PROJECTNAME} ${MYGUI_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES}) set_target_properties(${PROJECTNAME} PROPERTIES FOLDER "Plugins") add_dependencies(${PROJECTNAME} MyGUIEngine) target_link_libraries(${PROJECTNAME} MyGUIEngine) mygui_config_lib(${PROJECTNAME}) install(FILES ${HEADER_FILES} DESTINATION include/MYGUI ) endfunction(mygui_plugin) # setup library build function(mygui_config_lib PROJECTNAME) mygui_config_common(${PROJECTNAME}) if (MYGUI_STATIC) # add static prefix, if compiling static version set_target_properties(${PROJECTNAME} PROPERTIES OUTPUT_NAME ${PROJECTNAME}Static) else (MYGUI_STATIC) if (CMAKE_COMPILER_IS_GNUCXX) # add GCC visibility flags to shared library build set_target_properties(${PROJECTNAME} PROPERTIES COMPILE_FLAGS "${MYGUI_GCC_VISIBILITY_FLAGS}") if (APPLE) # deal with Mac OS X's framework system set_target_properties(${PROJECTNAME} PROPERTIES FRAMEWORK TRUE) set_target_properties(${PROJECTNAME} PROPERTIES PUBLIC_HEADER "${${PROJECTNAME}_HEADERS}") set_target_properties(${PROJECTNAME} PROPERTIES OUTPUT_NAME ${PROJECTNAME}) set_target_properties(${PROJECTNAME} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) set_target_properties(${PROJECTNAME} PROPERTIES INSTALL_NAME_DIR "@executable_path/../Frameworks") endif (APPLE) endif (CMAKE_COMPILER_IS_GNUCXX) endif (MYGUI_STATIC) mygui_install_target(${PROJECTNAME} "") if (MYGUI_INSTALL_PDB) # install debug pdb files if (MYGUI_STATIC) install(FILES ${MYGUI_BINARY_DIR}/lib${MYGUI_LIB_DEBUG_PATH}/${PROJECTNAME}Static_d.pdb DESTINATION lib${MYGUI_LIB_DEBUG_PATH} CONFIGURATIONS Debug ) install(FILES ${MYGUI_BINARY_DIR}/lib${MYGUI_LIB_RELWDBG_PATH}/${PROJECTNAME}Static.pdb DESTINATION lib${MYGUI_LIB_RELWDBG_PATH} CONFIGURATIONS RelWithDebInfo ) else () install(FILES ${MYGUI_BINARY_DIR}/bin${MYGUI_DEBUG_PATH}/${PROJECTNAME}_d.pdb DESTINATION bin${MYGUI_DEBUG_PATH} CONFIGURATIONS Debug ) install(FILES ${MYGUI_BINARY_DIR}/bin${MYGUI_RELWDBG_PATH}/${PROJECTNAME}.pdb DESTINATION bin${MYGUI_RELWDBG_PATH} CONFIGURATIONS RelWithDebInfo ) endif () endif () endfunction(mygui_config_lib) # setup demo build function(mygui_config_sample PROJECTNAME) mygui_config_common(${PROJECTNAME}) # set install RPATH for Unix systems if (UNIX AND MYGUI_FULL_RPATH) set_property(TARGET ${PROJECTNAME} APPEND PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib) set_property(TARGET ${PROJECTNAME} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) endif () endfunction(mygui_config_sample)MyGUI_3.2.0/CMake/Utils/MyGUIFindFrameworks.cmake0000664000000000000000000000155011721331046020105 0ustar rootroot# - helper module to find OSX frameworks # Adapted from standard CMake version, but added dependencies # Standard finder does not look in any variable locations such as # CMAKE_FRAMEWORK_PATH (not sure why not) IF(NOT MYGUI_FIND_FRAMEWORKS_INCLUDED) SET(MYGUI_FIND_FRAMEWORKS_INCLUDED 1) MACRO(MYGUI_FIND_FRAMEWORKS fwk) IF(APPLE) SET(${fwk}_FRAMEWORKS) SET(MYGUI_FRAMEWORK_PATH ${MYGUI_DEPENDENCIES_DIR} ~/Library/Frameworks /Library/Frameworks /System/Library/Frameworks /Network/Library/Frameworks ) FOREACH(dir ${MYGUI_FRAMEWORK_PATH}) SET(fwkpath ${dir}/${fwk}.framework) IF(EXISTS ${fwkpath}) SET(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${fwkpath}) ENDIF(EXISTS ${fwkpath}) ENDFOREACH(dir) ENDIF(APPLE) ENDMACRO(MYGUI_FIND_FRAMEWORKS) ENDIF(NOT MYGUI_FIND_FRAMEWORKS_INCLUDED) MyGUI_3.2.0/CMake/Utils/MacroLogFeature.cmake0000664000000000000000000001215611721331046017334 0ustar rootroot# This file defines the Feature Logging macros. # # MACRO_LOG_FEATURE(VAR FEATURE DESCRIPTION URL [REQUIRED [MIN_VERSION [COMMENTS]]]) # Logs the information so that it can be displayed at the end # of the configure run # VAR : TRUE or FALSE, indicating whether the feature is supported # FEATURE: name of the feature, e.g. "libjpeg" # DESCRIPTION: description what this feature provides # URL: home page # REQUIRED: TRUE or FALSE, indicating whether the featue is required # MIN_VERSION: minimum version number. empty string if unneeded # COMMENTS: More info you may want to provide. empty string if unnecessary # # MACRO_DISPLAY_FEATURE_LOG() # Call this to display the collected results. # Exits CMake with a FATAL error message if a required feature is missing # # Example: # # INCLUDE(MacroLogFeature) # # FIND_PACKAGE(JPEG) # MACRO_LOG_FEATURE(JPEG_FOUND "libjpeg" "Support JPEG images" "http://www.ijg.org" TRUE "3.2a" "") # ... # MACRO_DISPLAY_FEATURE_LOG() # Copyright (c) 2006, Alexander Neundorf, # Copyright (c) 2006, Allen Winter, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. IF (NOT _macroLogFeatureAlreadyIncluded) SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt) IF (EXISTS ${_file}) FILE(REMOVE ${_file}) ENDIF (EXISTS ${_file}) SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt) IF (EXISTS ${_file}) FILE(REMOVE ${_file}) ENDIF (EXISTS ${_file}) SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt) IF (EXISTS ${_file}) FILE(REMOVE ${_file}) ENDIF (EXISTS ${_file}) SET(_macroLogFeatureAlreadyIncluded TRUE) ENDIF (NOT _macroLogFeatureAlreadyIncluded) MACRO(MACRO_LOG_FEATURE _var _package _description _url ) # _required _minvers _comments) SET(_required "${ARGV4}") SET(_minvers "${ARGV5}") SET(_comments "${ARGV6}") IF (${_var}) SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/EnabledFeatures.txt) ELSE (${_var}) IF (${_required} MATCHES "[Tt][Rr][Uu][Ee]") SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/MissingRequirements.txt) ELSE (${_required} MATCHES "[Tt][Rr][Uu][Ee]") SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/DisabledFeatures.txt) ENDIF (${_required} MATCHES "[Tt][Rr][Uu][Ee]") ENDIF (${_var}) SET(_logtext "+ ${_package}") IF (NOT ${_var}) IF (${_minvers} MATCHES ".*") SET(_logtext "${_logtext}, ${_minvers}") ENDIF (${_minvers} MATCHES ".*") SET(_logtext "${_logtext}: ${_description} <${_url}>") IF (${_comments} MATCHES ".*") SET(_logtext "${_logtext}\n${_comments}") ENDIF (${_comments} MATCHES ".*") # SET(_logtext "${_logtext}\n") #double-space missing features? ENDIF (NOT ${_var}) FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n") ENDMACRO(MACRO_LOG_FEATURE) MACRO(MACRO_DISPLAY_FEATURE_LOG) SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt) IF (EXISTS ${_file}) FILE(READ ${_file} _requirements) MESSAGE(FATAL_ERROR "\n-----------------------------------------------------------------------------\n-- The following REQUIRED packages could NOT be located on your system.\n-- Please install them before continuing this software installation.\n-- If you are in Windows, try passing -DMYGUI_DEPENDENCIES_DIR=\n-- Also check that you buildind with RenderSystem that you need or set another with -DMYGUI_RENDERSYSTEM=<1 2 or 3 for Direct3D_9 OGRE or OpenGL>\n-----------------------------------------------------------------------------\n${_requirements}-----------------------------------------------------------------------------") FILE(REMOVE ${_file}) MESSAGE(FATAL_ERROR "Exiting: Missing Requirements") ENDIF (EXISTS ${_file}) SET(_summary "\n") SET(_elist 0) SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt) IF (EXISTS ${_file}) SET(_elist 1) FILE(READ ${_file} _enabled) FILE(REMOVE ${_file}) SET(_summary "${_summary}-----------------------------------------------------------------------------\n-- The following external packages were located on your system.\n-- This installation will have the extra features provided by these packages.\n${_enabled}") ENDIF (EXISTS ${_file}) SET(_dlist 0) SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt) IF (EXISTS ${_file}) SET(_dlist 1) FILE(READ ${_file} _disabled) FILE(REMOVE ${_file}) SET(_summary "${_summary}-----------------------------------------------------------------------------\n-- The following OPTIONAL packages could NOT be located on your system.\n-- Consider installing them to enable more features from this software.\n${_disabled}") ELSE (EXISTS ${_file}) IF (${_elist}) SET(_summary "${_summary}Congratulations! All external packages have been found.\n") ENDIF (${_elist}) ENDIF (EXISTS ${_file}) IF (${_elist} OR ${_dlist}) SET(_summary "${_summary}-----------------------------------------------------------------------------\n") ENDIF (${_elist} OR ${_dlist}) MESSAGE(STATUS "${_summary}") ENDMACRO(MACRO_DISPLAY_FEATURE_LOG) MyGUI_3.2.0/CMake/Utils/FindPkgMacros.cmake0000664000000000000000000001172411721331046017004 0ustar rootroot################################################################## # Provides some common functionality for the FindPackage modules ################################################################## # Begin processing of package macro(findpkg_begin PREFIX) if (NOT ${PREFIX}_FIND_QUIETLY) message(STATUS "Looking for ${PREFIX}...") endif () endmacro(findpkg_begin) # Display a status message unless FIND_QUIETLY is set macro(pkg_message PREFIX) if (NOT ${PREFIX}_FIND_QUIETLY) message(STATUS ${ARGN}) endif () endmacro(pkg_message) # Get environment variable, define it as ENV_$var and make sure backslashes are converted to forward slashes macro(getenv_path VAR) set(ENV_${VAR} $ENV{${VAR}}) # replace won't work if var is blank if (ENV_${VAR}) string( REGEX REPLACE "\\\\" "/" ENV_${VAR} ${ENV_${VAR}} ) endif () endmacro(getenv_path) # Construct search paths for includes and libraries from a PREFIX_PATH macro(create_search_paths PREFIX) foreach(dir ${${PREFIX}_PREFIX_PATH}) set(${PREFIX}_INC_SEARCH_PATH ${${PREFIX}_INC_SEARCH_PATH} ${dir}/include ${dir}/include/${PREFIX} ${dir}/Headers) set(${PREFIX}_LIB_SEARCH_PATH ${${PREFIX}_LIB_SEARCH_PATH} ${dir}/lib ${dir}/lib/${PREFIX} ${dir}/Libs) endforeach(dir) set(${PREFIX}_FRAMEWORK_SEARCH_PATH ${${PREFIX}_PREFIX_PATH}) endmacro(create_search_paths) # clear cache variables if a certain variable changed macro(clear_if_changed TESTVAR) # test against internal check variable if (NOT "${${TESTVAR}}" STREQUAL "${${TESTVAR}_INT_CHECK}") message(STATUS "${TESTVAR} changed.") foreach(var ${ARGN}) set(${var} "NOTFOUND" CACHE STRING "x" FORCE) endforeach(var) endif () set(${TESTVAR}_INT_CHECK ${${TESTVAR}} CACHE INTERNAL "x" FORCE) endmacro(clear_if_changed) # Try to get some hints from pkg-config, if available macro(use_pkgconfig PREFIX PKGNAME) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(${PREFIX} ${PKGNAME}) endif () endmacro (use_pkgconfig) # Couple a set of release AND debug libraries (or frameworks) macro(make_library_set PREFIX) if (${PREFIX}_FWK) set(${PREFIX} ${${PREFIX}_FWK}) elseif (${PREFIX}_REL AND ${PREFIX}_DBG) set(${PREFIX} optimized ${${PREFIX}_REL} debug ${${PREFIX}_DBG}) elseif (${PREFIX}_REL) set(${PREFIX} ${${PREFIX}_REL}) elseif (${PREFIX}_DBG) set(${PREFIX} ${${PREFIX}_DBG}) endif () endmacro(make_library_set) # Generate debug names from given release names macro(get_debug_names PREFIX) foreach(i ${${PREFIX}}) set(${PREFIX}_DBG ${${PREFIX}_DBG} ${i}d ${i}D ${i}_d ${i}_D) endforeach(i) endmacro(get_debug_names) # Add the parent dir from DIR to VAR macro(add_parent_dir VAR DIR) get_filename_component(${DIR}_TEMP "${${DIR}}/.." ABSOLUTE) set(${VAR} ${${VAR}} ${${DIR}_TEMP}) endmacro(add_parent_dir) # Do the final processing for the package find. macro(findpkg_finish PREFIX) # skip if already processed during this run if (NOT ${PREFIX}_FOUND) if (${PREFIX}_INCLUDE_DIR AND ${PREFIX}_LIBRARY) set(${PREFIX}_FOUND TRUE) set(${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIR}) set(${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARY}) if (NOT ${PREFIX}_FIND_QUIETLY) message(STATUS "Found ${PREFIX}: ${${PREFIX}_LIBRARIES}") endif () else () if (NOT ${PREFIX}_FIND_QUIETLY) message(STATUS "Could not locate ${PREFIX}") endif () if (${PREFIX}_FIND_REQUIRED) message(FATAL_ERROR "Required library ${PREFIX} not found! Install the library (including dev packages) and try again. If the library is already installed, set the missing variables manually in cmake.") endif () endif () mark_as_advanced(${PREFIX}_INCLUDE_DIR ${PREFIX}_LIBRARY ${PREFIX}_LIBRARY_REL ${PREFIX}_LIBRARY_DBG ${PREFIX}_LIBRARY_FWK) endif () endmacro(findpkg_finish) # Simplified framework finder MACRO (find_framework fwk) find_library(${fwk}_LIBRARY ${fwk}) if (${fwk}_LIBRARY) set(${fwk}_FOUND TRUE) set(${fwk}_INCLUDE "${${fwk}_LIBRARY}/Headers") endif (${fwk}_LIBRARY) # Compatibility stuff set(${fwk}_INCLUDE_DIR ${${fwk}_INCLUDE}) set(${fwk}_INCLUDE_DIRS ${${fwk}_INCLUDE}) set(${fwk}_LIBRARIES ${${fwk}_LIBRARY}) ENDMACRO (find_framework) # Slightly customised framework finder MACRO(findpkg_framework fwk) IF(APPLE) SET(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_SEARCH_PATH} ${CMAKE_FRAMEWORK_PATH} ~/Library/Frameworks /Library/Frameworks /System/Library/Frameworks /Network/Library/Frameworks ) FOREACH(dir ${${fwk}_FRAMEWORK_PATH}) SET(fwkpath ${dir}/${fwk}.framework) IF(EXISTS ${fwkpath}) SET(${fwk}_FRAMEWORK_INCLUDES ${${fwk}_FRAMEWORK_INCLUDES} ${fwkpath}/Headers ${fwkpath}/PrivateHeaders) if (NOT ${fwk}_LIBRARY_FWK) SET(${fwk}_LIBRARY_FWK "-framework ${fwk}" CACHE STRING "${fwk} library") endif () ENDIF(EXISTS ${fwkpath}) ENDFOREACH(dir) ENDIF(APPLE) ENDMACRO(findpkg_framework) MyGUI_3.2.0/CMake/Utils/PrecompiledHeader.cmake0000664000000000000000000000510611721331046017666 0ustar rootroot#------------------------------------------------------------------- # This file is part of the CMake build system for OGRE # (Object-oriented Graphics Rendering Engine) # For the latest info, see http://www.ogre3d.org/ # # The contents of this file are placed in the public domain. Feel # free to make use of it in any way you like. #------------------------------------------------------------------- ################################################################## # Support macro to use a precompiled header # Usage: # use_precompiled_header(TARGET HEADER_FILE SRC_FILE) ################################################################## macro(use_precompiled_header TARGET HEADER_FILE SRC_FILE) get_filename_component(HEADER ${HEADER_FILE} NAME) if (MSVC) add_definitions(/Yu"${HEADER}") set_source_files_properties(${SRC_FILE} PROPERTIES COMPILE_FLAGS /Yc"${HEADER}" ) elseif (CMAKE_COMPILER_IS_GNUCXX) # disabled because it seems to increase compile time ## this is some serious hack... we definitely need native ## support in CMake for this! ## we will generate the precompiled header via a workaround ## first give the header a new name with the proper extension #set(PRECOMP_HEADER ${CMAKE_CURRENT_BINARY_DIR}/hacked/${HEADER}.gch) #configure_file(${HEADER_FILE} ${PRECOMP_HEADER} COPYONLY) ## retrieve some info about the target's build settings #get_target_property(${TARGET} PRECOMP_TYPE TYPE) #if (PRECOMP_TYPE STREQUAL "SHARED_LIBRARY") # set(PRECOMP_LIBTYPE "SHARED") #else () # set(PRECOMP_LIBTYPE "STATIC") #endif () #get_target_property(${TARGET} PRECOMP_DEFINITIONS COMPILE_DEFINITIONS) #get_target_property(${TARGET} PRECOMP_FLAGS COMPILE_FLAGS) # ## add a new target which compiles the header #add_library(__precomp_header ${PRECOMP_LIBTYPE} ${PRECOMP_HEADER}) #add_dependencies(${TARGET} __precomp_header) #set_target_properties(__precomp_header PROPERTIES # COMPILE_DEFINITIONS ${PRECOMP_DEFINITIONS} # COMPILE_FLAGS ${PRECOMP_FLAGS} # HAS_CXX TRUE #) #set_source_files_properties(${PRECOMP_HEADER} PROPERTIES # HEADER_FILE_ONLY FALSE # KEEP_EXTENSION TRUE # COMPILE_FLAGS "-x c++-header" # LANGUAGE CXX #) # ## finally, we need to ensure that gcc can find the precompiled header ## this is another dirty hack #include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/__precomp_header.dir/hacked") endif () endmacro(use_precompiled_header) MyGUI_3.2.0/CMake/Utils/MyGUIGetVersion.cmake0000664000000000000000000000116011721331046017246 0ustar rootrootinclude(PreprocessorUtils) macro(mygui_get_version HEADER) file(READ ${HEADER} TEMP_VAR_CONTENTS) get_preprocessor_entry(TEMP_VAR_CONTENTS MYGUI_VERSION_MAJOR MYGUI_VERSION_MAJOR) get_preprocessor_entry(TEMP_VAR_CONTENTS MYGUI_VERSION_MINOR MYGUI_VERSION_MINOR) get_preprocessor_entry(TEMP_VAR_CONTENTS MYGUI_VERSION_PATCH MYGUI_VERSION_PATCH) get_preprocessor_entry(TEMP_VAR_CONTENTS MYGUI_VERSION_NAME MYGUI_VERSION_NAME) get_preprocessor_entry(TEMP_VAR_CONTENTS MYGUI_VERSION_SUFFIX MYGUI_VERSION_SUFFIX) set(MYGUI_VERSION "${MYGUI_VERSION_MAJOR}.${MYGUI_VERSION_MINOR}.${MYGUI_VERSION_PATCH}") endmacro() MyGUI_3.2.0/CMake/Utils/PreprocessorUtils.cmake0000664000000000000000000000224311721331046020020 0ustar rootrootmacro(get_preprocessor_entry CONTENTS KEYWORD VARIABLE) string(REGEX MATCH "# *define +${KEYWORD} +((\"([^\n]*)\")|([^ \n]*))" PREPROC_TEMP_VAR ${${CONTENTS}} ) if (CMAKE_MATCH_3) set(${VARIABLE} ${CMAKE_MATCH_3}) else () set(${VARIABLE} ${CMAKE_MATCH_4}) endif () endmacro() macro(has_preprocessor_entry CONTENTS KEYWORD VARIABLE) string(REGEX MATCH "\n *# *define +(${KEYWORD})" PREPROC_TEMP_VAR ${${CONTENTS}} ) if (CMAKE_MATCH_1) set(${VARIABLE} TRUE) else () set(${VARIABLE} FALSE) endif () endmacro() macro(replace_preprocessor_entry VARIABLE KEYWORD NEW_VALUE) string(REGEX REPLACE "(// *)?# *define +${KEYWORD} +[^ \n]*" "#define ${KEYWORD} ${NEW_VALUE}" ${VARIABLE}_TEMP ${${VARIABLE}} ) set(${VARIABLE} ${${VARIABLE}_TEMP}) endmacro() macro(set_preprocessor_entry VARIABLE KEYWORD ENABLE) if (${ENABLE}) set(TMP_REPLACE_STR "#define ${KEYWORD}") else () set(TMP_REPLACE_STR "// #define ${KEYWORD}") endif () string(REGEX REPLACE "(// *)?# *define +${KEYWORD} *\n" ${TMP_REPLACE_STR} ${VARIABLE}_TEMP ${${VARIABLE}} ) set(${VARIABLE} ${${VARIABLE}_TEMP}) endmacro() MyGUI_3.2.0/CMake/Packages/0000775000000000000000000000000011723345154013733 5ustar rootrootMyGUI_3.2.0/CMake/Packages/FindDirectX.cmake0000664000000000000000000001242411721331046017074 0ustar rootroot# ----------------------------------------------------------------------------- # Find DirectX SDK # Define: # DirectX_FOUND # DirectX_INCLUDE_DIR # DirectX_LIBRARY if (MYGUI_STANDALONE_BUILD) SET(DirectX_INCLUDE_DIR "C:/MYGUIHACK DXSDK_DIR MYGUIBRACKETHACK/include" CACHE STRING "") SET(DirectX_LIBRARIES "d3d9.lib d3dx9.lib DxErr.lib dxguid.lib" CACHE STRING "") SET(DIRECTX_LIB_DIR "C:/MYGUIHACK DXSDK_DIR MYGUIBRACKETHACK/lib/x86" CACHE STRING "") SET(DirectX_FOUND TRUE) SET(DirectX11_INCLUDE_DIR "C:/MYGUIHACK DXSDK_DIR MYGUIBRACKETHACK/include" CACHE STRING "") SET(DirectX11_LIBRARIES "d3d11.lib d3dx11.lib DxErr.lib dxguid.lib dxgi.lib d3dcompiler.lib" CACHE STRING "") SET(DIRECTX11_LIB_DIR "C:/MYGUIHACK DXSDK_DIR MYGUIBRACKETHACK/lib/x86" CACHE STRING "") SET(DirectX11_FOUND TRUE) else() IF (NOT DIRECTX_DIR) set(DIRECTX_DIR "" CACHE PATH "Path to DirectX SDK (set it if you don't have DIrectX SDK properly installed or CMake can't find path to it)") ENDIF () if(WIN32) # The only platform it makes sense to check for DirectX SDK include(FindPkgMacros) findpkg_begin(DirectX) # Get path, convert backslashes as ${ENV_DXSDK_DIR} getenv_path(DXSDK_DIR) # construct search paths set(DirectX_PREFIX_PATH "${DIRECTX_DIR}" "${DXSDK_DIR}" "${ENV_DXSDK_DIR}" "C:/apps_x86/Microsoft DirectX SDK*" "C:/Program Files (x86)/Microsoft DirectX SDK*" "C:/apps/Microsoft DirectX SDK*" "C:/Program Files/Microsoft DirectX SDK*" "$ENV{ProgramFiles}/Microsoft DirectX SDK*" ) create_search_paths(DirectX) # redo search if prefix path changed clear_if_changed(DirectX_PREFIX_PATH DirectX_LIBRARY DirectX_INCLUDE_DIR ) find_path(DirectX_INCLUDE_DIR NAMES d3d9.h HINTS ${DirectX_INC_SEARCH_PATH}) # dlls are in DIRECTX_DIR/Developer Runtime/x64|x86 # lib files are in DIRECTX_DIR/Lib/x64|x86 if(CMAKE_CL_64) set(DirectX_LIBPATH_SUFFIX "x64") else(CMAKE_CL_64) set(DirectX_LIBPATH_SUFFIX "x86") endif(CMAKE_CL_64) find_library(DirectX_LIBRARY NAMES d3d9 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) find_library(DirectX_D3DX9_LIBRARY NAMES d3dx9 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) find_library(DirectX_DXERR9_LIBRARY NAMES dxerr HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) find_library(DirectX_DXGUID_LIBRARY NAMES dxguid HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) if(DirectX_INCLUDE_DIR) if (NOT DIRECTX_DIR) set(DIRECTX_DIR ${DirectX_INCLUDE_DIR}/.. CACHE PATH "Path to DirectX SDK (set it if you don't have DIrectX SDK properly installed or CMake can't find path to it)" FORCE) endif () endif(DirectX_INCLUDE_DIR) findpkg_finish(DirectX) set(DirectX_LIBRARIES ${DirectX_LIBRARIES} ${DirectX_D3DX9_LIBRARY} ${DirectX_DXERR9_LIBRARY} ${DirectX_DXGUID_LIBRARY} ) endif(WIN32) if(WIN32) # The only platform it makes sense to check for DirectX11 SDK include(FindPkgMacros) findpkg_begin(DirectX11) # Get path, convert backslashes as ${ENV_DXSDK_DIR} getenv_path(DXSDK_DIR) # construct search paths set(DirectX_PREFIX_PATH "${DIRECTX_DIR}" "${DXSDK_DIR}" "${ENV_DXSDK_DIR}" "C:/apps_x86/Microsoft DirectX SDK*" "C:/Program Files (x86)/Microsoft DirectX SDK*" "C:/apps/Microsoft DirectX SDK*" "C:/Program Files/Microsoft DirectX SDK*" "$ENV{ProgramFiles}/Microsoft DirectX SDK*" ) create_search_paths(DirectX) # redo search if prefix path changed clear_if_changed(DirectX_PREFIX_PATH DirectX11_LIBRARY DirectX11_INCLUDE_DIR ) find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS ${DirectX_INC_SEARCH_PATH}) # dlls are in DIRECTX_DIR/Developer Runtime/x64|x86 # lib files are in DIRECTX_DIR/Lib/x64|x86 if(CMAKE_CL_64) set(DirectX_LIBPATH_SUFFIX "x64") else(CMAKE_CL_64) set(DirectX_LIBPATH_SUFFIX "x86") endif(CMAKE_CL_64) find_library(DirectX11_D3D11_LIBRARY NAMES d3d11 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) find_library(DirectX11_D3DX11_LIBRARY NAMES d3dx11 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) find_library(DirectX11_DXGUID_LIBRARY NAMES dxguid HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) find_library(DirectX11_DXGI_LIBRARY NAMES dxgi HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) find_library(DirectX11_DXERR_LIBRARY NAMES dxerr HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) find_library(DirectX11_COMPILER_LIBRARY NAMES d3dcompiler HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) if(DirectX11_INCLUDE_DIR) if (NOT DIRECTX_DIR) set(DIRECTX_DIR ${DirectX11_INCLUDE_DIR}/.. CACHE PATH "Path to DirectX SDK (set it if you don't have DIrectX SDK properly installed or CMake can't find path to it)" FORCE) endif () endif(DirectX11_INCLUDE_DIR) findpkg_finish(DirectX11) set(DirectX11_LIBRARIES ${DirectX11_LIBRARIES} ${DirectX11_D3D11_LIBRARY} ${DirectX11_D3DX11_LIBRARY} ${DirectX11_DXGI_LIBRARY} ${DirectX11_DXGUID_LIBRARY} ${DirectX11_DXERR_LIBRARY} ${DirectX11_COMPILER_LIBRARY} ) endif(WIN32) endif ()MyGUI_3.2.0/CMake/Packages/FindOIS.cmake0000664000000000000000000000243711721331046016167 0ustar rootroot# - Try to find OIS # Once done, this will define # # OIS_FOUND - system has OIS # OIS_INCLUDE_DIRS - the OIS include directories # OIS_LIBRARIES - link these to use OIS include(FindPkgMacros) findpkg_begin(OIS) # Get path, convert backslashes as ${ENV_${var}} getenv_path(OIS_HOME) getenv_path(MYGUI_HOME) getenv_path(MYGUI_SOURCE) # construct search paths set(OIS_PREFIX_PATH ${OIS_HOME} ${ENV_OIS_HOME} ${MYGUI_SOURCE}/Dependencies ${ENV_MYGUI_SOURCE}/Dependencies ${MYGUI_HOME} ${ENV_MYGUI_HOME}) create_search_paths(OIS) # redo search if prefix path changed clear_if_changed(OIS_PREFIX_PATH OIS_LIBRARY_FWK OIS_LIBRARY_REL OIS_LIBRARY_DBG OIS_INCLUDE_DIR ) set(OIS_LIBRARY_NAMES OIS) get_debug_names(OIS_LIBRARY_NAMES) use_pkgconfig(OIS_PKGC OIS) findpkg_framework(OIS) find_path(OIS_INCLUDE_DIR NAMES OIS.h HINTS ${OIS_INC_SEARCH_PATH} ${OIS_PKGC_INCLUDE_DIRS} PATH_SUFFIXES OIS) find_library(OIS_LIBRARY_REL NAMES ${OIS_LIBRARY_NAMES} HINTS ${OIS_LIB_SEARCH_PATH} ${OIS_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel) find_library(OIS_LIBRARY_DBG NAMES ${OIS_LIBRARY_NAMES_DBG} HINTS ${OIS_LIB_SEARCH_PATH} ${OIS_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug) make_library_set(OIS_LIBRARY) findpkg_finish(OIS) add_parent_dir(OIS_INCLUDE_DIRS OIS_INCLUDE_DIR) MyGUI_3.2.0/CMake/Packages/FindIOKit.cmake0000664000000000000000000000215211721331046016506 0ustar rootroot# - Try to find IOKit # Once done, this will define # # IOKit_FOUND - system has IOKit # IOKit_INCLUDE_DIRS - the IOKit include directories # IOKit_LIBRARIES - link these to use IOKit include(FindPkgMacros) findpkg_begin(IOKit) # construct search paths set(IOKit_PREFIX_PATH ${IOKit_HOME} $ENV{IOKit_HOME} ${MYGUI_HOME} $ENV{MYGUI_HOME}) create_search_paths(IOKit) # redo search if prefix path changed clear_if_changed(IOKit_PREFIX_PATH IOKit_LIBRARY_FWK IOKit_LIBRARY_REL IOKit_LIBRARY_DBG IOKit_INCLUDE_DIR ) set(IOKit_LIBRARY_NAMES IOKit) get_debug_names(IOKit_LIBRARY_NAMES) use_pkgconfig(IOKit_PKGC IOKit) findpkg_framework(IOKit) find_path(IOKit_INCLUDE_DIR NAMES IOKitLib.h HINTS ${IOKit_INC_SEARCH_PATH} ${IOKit_PKGC_INCLUDE_DIRS} PATH_SUFFIXES IOKit) find_library(IOKit_LIBRARY_REL NAMES ${IOKit_LIBRARY_NAMES} HINTS ${IOKit_LIB_SEARCH_PATH} ${IOKit_PKGC_LIBRARY_DIRS}) find_library(IOKit_LIBRARY_DBG NAMES ${IOKit_LIBRARY_NAMES_DBG} HINTS ${IOKit_LIB_SEARCH_PATH} ${IOKit_PKGC_LIBRARY_DIRS}) make_library_set(IOKit_LIBRARY) findpkg_finish(IOKit) add_parent_dir(IOKit_INCLUDE_DIRS IOKit_INCLUDE_DIR) MyGUI_3.2.0/CMake/Packages/FindCocoa.cmake0000664000000000000000000000215011721331046016551 0ustar rootroot# - Try to find Cocoa # Once done, this will define # # Cocoa_FOUND - system has Cocoa # Cocoa_INCLUDE_DIRS - the Cocoa include directories # Cocoa_LIBRARIES - link these to use Cocoa include(FindPkgMacros) findpkg_begin(Cocoa) # construct search paths set(Cocoa_PREFIX_PATH ${Cocoa_HOME} $ENV{Cocoa_HOME} ${MYGUI_HOME} $ENV{MYGUI_HOME}) create_search_paths(Cocoa) # redo search if prefix path changed clear_if_changed(Cocoa_PREFIX_PATH Cocoa_LIBRARY_FWK Cocoa_LIBRARY_REL Cocoa_LIBRARY_DBG Cocoa_INCLUDE_DIR ) set(Cocoa_LIBRARY_NAMES Cocoa) get_debug_names(Cocoa_LIBRARY_NAMES) use_pkgconfig(Cocoa_PKGC Cocoa) findpkg_framework(Cocoa) find_path(Cocoa_INCLUDE_DIR NAMES Cocoa.h HINTS ${Cocoa_INC_SEARCH_PATH} ${Cocoa_PKGC_INCLUDE_DIRS} PATH_SUFFIXES Cocoa) find_library(Cocoa_LIBRARY_REL NAMES ${Cocoa_LIBRARY_NAMES} HINTS ${Cocoa_LIB_SEARCH_PATH} ${Cocoa_PKGC_LIBRARY_DIRS}) find_library(Cocoa_LIBRARY_DBG NAMES ${Cocoa_LIBRARY_NAMES_DBG} HINTS ${Cocoa_LIB_SEARCH_PATH} ${Cocoa_PKGC_LIBRARY_DIRS}) make_library_set(Cocoa_LIBRARY) findpkg_finish(Cocoa) add_parent_dir(Cocoa_INCLUDE_DIRS Cocoa_INCLUDE_DIR) MyGUI_3.2.0/CMake/Packages/FindCarbon.cmake0000664000000000000000000000222011721331046016727 0ustar rootroot# - Try to find Carbon # Once done, this will define # # Carbon_FOUND - system has Carbon # Carbon_INCLUDE_DIRS - the Carbon include directories # Carbon_LIBRARIES - link these to use Carbon include(FindPkgMacros) findpkg_begin(Carbon) # construct search paths set(Carbon_PREFIX_PATH ${Carbon_HOME} $ENV{Carbon_HOME} ${MYGUI_HOME} $ENV{MYGUI_HOME}) create_search_paths(Carbon) # redo search if prefix path changed clear_if_changed(Carbon_PREFIX_PATH Carbon_LIBRARY_FWK Carbon_LIBRARY_REL Carbon_LIBRARY_DBG Carbon_INCLUDE_DIR ) set(Carbon_LIBRARY_NAMES Carbon) get_debug_names(Carbon_LIBRARY_NAMES) use_pkgconfig(Carbon_PKGC Carbon) findpkg_framework(Carbon) find_path(Carbon_INCLUDE_DIR NAMES Carbon.h HINTS ${Carbon_INC_SEARCH_PATH} ${Carbon_PKGC_INCLUDE_DIRS} PATH_SUFFIXES Carbon) find_library(Carbon_LIBRARY_REL NAMES ${Carbon_LIBRARY_NAMES} HINTS ${Carbon_LIB_SEARCH_PATH} ${Carbon_PKGC_LIBRARY_DIRS}) find_library(Carbon_LIBRARY_DBG NAMES ${Carbon_LIBRARY_NAMES_DBG} HINTS ${Carbon_LIB_SEARCH_PATH} ${Carbon_PKGC_LIBRARY_DIRS}) make_library_set(Carbon_LIBRARY) findpkg_finish(Carbon) add_parent_dir(Carbon_INCLUDE_DIRS Carbon_INCLUDE_DIR) MyGUI_3.2.0/CMake/Packages/FindFreetype.cmake0000664000000000000000000000356311721331046017321 0ustar rootroot# - Try to find FreeType # Once done, this will define # # FREETYPE_FOUND - system has FreeType # FREETYPE_INCLUDE_DIRS - the FreeType include directories # FREETYPE_LIBRARIES - link these to use FreeType include(FindPkgMacros) findpkg_begin(FREETYPE) # Get path, convert backslashes as ${ENV_${var}} getenv_path(FREETYPE_HOME) # construct search paths set(FREETYPE_PREFIX_PATH ${FREETYPE_HOME} ${ENV_FREETYPE_HOME}) create_search_paths(FREETYPE) # redo search if prefix path changed clear_if_changed(FREETYPE_PREFIX_PATH FREETYPE_LIBRARY_FWK FREETYPE_LIBRARY_REL FREETYPE_LIBRARY_DBG FREETYPE_INCLUDE_DIR ) set(FREETYPE_LIBRARY_NAMES freetype2311 freetype239 freetype238 freetype235 freetype219 freetype) get_debug_names(FREETYPE_LIBRARY_NAMES) use_pkgconfig(FREETYPE_PKGC freetype2) # prefer static library over framework set(CMAKE_FIND_FRAMEWORK "LAST") findpkg_framework(FREETYPE) message(STATUS "CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}") find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES freetype2) find_path(FREETYPE_FT2BUILD_INCLUDE_DIR NAMES ft2build.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS}) find_library(FREETYPE_LIBRARY_REL NAMES ${FREETYPE_LIBRARY_NAMES} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel) find_library(FREETYPE_LIBRARY_DBG NAMES ${FREETYPE_LIBRARY_NAMES_DBG} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug) make_library_set(FREETYPE_LIBRARY) findpkg_finish(FREETYPE) mark_as_advanced(FREETYPE_FT2BUILD_INCLUDE_DIR) if (NOT FREETYPE_FT2BUILD_INCLUDE_DIR STREQUAL FREETYPE_INCLUDE_DIR) set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${FREETYPE_FT2BUILD_INCLUDE_DIR}) endif () # Reset framework finding set(CMAKE_FIND_FRAMEWORK "FIRST") MyGUI_3.2.0/CMake/Packages/FindDirectX11.cmake0000664000000000000000000000326111721331046017235 0ustar rootroot# ----------------------------------------------------------------------------- # Find DirectX11 SDK # Define: # DirectX11_FOUND # DirectX_INCLUDE_DIR # DirectX_LIBRARY if (MYGUI_STANDALONE_BUILD) SET(DirectX11_LIBRARIES "d3d11.lib d3dx11.lib DxErr.lib dxguid.lib dxgi.lib d3dcompiler.lib" CACHE STRING "") SET(DirectX11_FOUND TRUE) else() if(WIN32) # The only platform it makes sense to check for DirectX11 SDK include(FindPkgMacros) include(FindDirectX) findpkg_begin(DirectX11) if(CMAKE_CL_64) set(DirectX_LIBPATH_SUFFIX "x64") else(CMAKE_CL_64) set(DirectX_LIBPATH_SUFFIX "x86") endif(CMAKE_CL_64) find_library(DirectX11_D3D11_LIBRARY NAMES d3d11 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) find_library(DirectX11_D3DX11_LIBRARY NAMES d3dx11 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) find_library(DirectX11_DXGUID_LIBRARY NAMES dxguid HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) find_library(DirectX11_DXGI_LIBRARY NAMES dxgi HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) find_library(DirectX11_DXERR_LIBRARY NAMES dxerr HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) find_library(DirectX11_COMPILER_LIBRARY NAMES d3dcompiler HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX}) findpkg_finish(DirectX11) set(DirectX11_LIBRARIES ${DirectX11_LIBRARIES} ${DirectX11_D3D11_LIBRARY} ${DirectX11_D3DX11_LIBRARY} ${DirectX11_DXGI_LIBRARY} ${DirectX11_DXGUID_LIBRARY} ${DirectX11_DXERR_LIBRARY} ${DirectX11_COMPILER_LIBRARY} ) endif(WIN32) endif () MyGUI_3.2.0/CMake/Packages/FindCppUnit.cmake0000664000000000000000000000223211721331046017110 0ustar rootroot# - Try to find CppUnit # Once done, this will define # # CppUnit_FOUND - system has CppUnit # CppUnit_INCLUDE_DIRS - the CppUnit include directories # CppUnit_LIBRARIES - link these to use CppUnit include(FindPkgMacros) findpkg_begin(CppUnit) # Get path, convert backslashes as ${ENV_${var}} getenv_path(CPPUNIT_HOME) # construct search paths set(CppUnit_PREFIX_PATH ${CPPUNIT_HOME} ${ENV_CPPUNIT_HOME}) create_search_paths(CppUnit) # redo search if prefix path changed clear_if_changed(CppUnit_PREFIX_PATH CppUnit_LIBRARY_FWK CppUnit_LIBRARY_REL CppUnit_LIBRARY_DBG CppUnit_INCLUDE_DIR ) set(CppUnit_LIBRARY_NAMES cppunit) get_debug_names(CppUnit_LIBRARY_NAMES) use_pkgconfig(CppUnit_PKGC cppunit) findpkg_framework(CppUnit) find_path(CppUnit_INCLUDE_DIR NAMES cppunit/Test.h HINTS ${CppUnit_INC_SEARCH_PATH} ${CppUnit_PKGC_INCLUDE_DIRS}) find_library(CppUnit_LIBRARY_REL NAMES ${CppUnit_LIBRARY_NAMES} HINTS ${CppUnit_LIB_SEARCH_PATH} ${CppUnit_PKGC_LIBRARY_DIRS}) find_library(CppUnit_LIBRARY_DBG NAMES ${CppUnit_LIBRARY_NAMES_DBG} HINTS ${CppUnit_LIB_SEARCH_PATH} ${CppUnit_PKGC_LIBRARY_DIRS}) make_library_set(CppUnit_LIBRARY) findpkg_finish(CppUnit) MyGUI_3.2.0/CMake/Packages/FindOGRE_Old.cmake0000664000000000000000000001146411721331046017067 0ustar rootroot# Find OGRE includes and library # # This module defines # OGRE_INCLUDE_DIR # OGRE_LIBRARIES, the libraries to link against to use OGRE. # OGRE_LIB_DIR, the location of the libraries # OGRE_FOUND, If false, do not try to use OGRE include(FindPkgMacros) # Try to find framework first on Mac OS X if (APPLE) find_framework(OGRE) endif () if (NOT OGRE_FOUND) # Then try everything else if (MYGUI_STANDALONE_BUILD) CMAKE_POLICY(PUSH) SET(OGRE_INCLUDE_DIR "C:/MYGUIHACK OGRE_HOME MYGUIBRACKETHACK/include" "C:/MYGUIHACK OGRE_SRC MYGUIBRACKETHACK/OgreMain/include" "C:/MYGUIHACK OGRE_HOME MYGUIBRACKETHACK/include/OGRE" "C:/MYGUIHACK OGRE_HOME MYGUIBRACKETHACK/boost_1_42" CACHE STRING "") SET(OGRE_LIBRARIES "debug;OgreMain_d;optimized;OgreMain" CACHE STRING "") SET(OGRE_LIB_DIR "C:/MYGUIHACK OGRE_HOME MYGUIBRACKETHACK/lib" "C:/MYGUIHACK OGRE_SRC MYGUIBRACKETHACK/lib" "C:/MYGUIHACK OGRE_HOME MYGUIBRACKETHACK/boost_1_42/lib" CACHE STRING "") SET(OGRE_FOUND TRUE) CMAKE_POLICY(POP) else() if(WIN32 OR APPLE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OGRE_SOURCE}/CMake ${OGRE_SOURCE}/CMake/Packages) else() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} /usr/local/lib/OGRE/cmake) endif() IF (NOT OGRE_SOURCE) set(OGRE_SOURCE "" CACHE PATH "Path to Ogre sources (set it if you don't have OGRE_HOME or OGRE_SRC environment variables)") ENDIF () if (NOT OGRE_BUILD) set(OGRE_BUILD ${OGRE_SOURCE} CACHE PATH "Path to Ogre build directory (same as OGRE_SOURCE by default)") endif () if (EXISTS ${OGRE_SOURCE}/CMake) MESSAGE(STATUS "Original FindOGRE.cmake found, trying to use it") set (OGRE_HOME ${OGRE_SOURCE}) FIND_PACKAGE(OGRE) endif() if (OGRE_FOUND) MESSAGE(STATUS "Ogre was found with it's own CMake script") set(BOOST_ROOT ${BOOST_ROOT} CACHE PATH "Path to Boost (required if Ogre was built with boost)") FIND_PACKAGE(Boost) #message("Threads!" ${OGRE_CONFIG_THREADS}) if (Boost_FOUND) set (OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} ${Boost_INCLUDE_DIR}) set (OGRE_LIB_DIR ${OGRE_LIB_DIR} ${Boost_LIBRARY_DIRS}) endif() return() endif () # now trying to find it by our script CMAKE_POLICY(PUSH) IF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR) SET(OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent ENDIF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR) IF (WIN32) #Windows MESSAGE(STATUS "Looking for OGRE") SET(OGRESDK $ENV{OGRE_HOME}) SET(OGRESOURCE $ENV{OGRE_SRC}) IF (OGRE_SOURCE) MESSAGE(STATUS "Using OGRE built from source (from specified path)") SET(OGRE_INCLUDE_DIR ${OGRE_SOURCE}/OgreMain/include ${OGRE_SOURCE}/include) SET(OGRE_LIB_DIR ${OGRE_SOURCE}/lib) ELSEIF (OGRESDK) MESSAGE(STATUS "Using OGRE SDK") STRING(REGEX REPLACE "[\\]" "/" OGRESDK "${OGRESDK}") SET(OGRE_INCLUDE_DIR ${OGRESDK}/include/OGRE ${OGRESDK}/include) SET(OGRE_LIB_DIR ${OGRESDK}/lib) IF (NOT OGRE_SOURCE) set(OGRE_SOURCE $ENV{OGRE_HOME} CACHE PATH "Path to Ogre sources (set it if you don't have OGRE_HOME or OGRE_SRC environment variables)") ENDIF () ELSEIF (OGRESOURCE) MESSAGE(STATUS "Using OGRE built from source") SET(OGRE_INCLUDE_DIR $ENV{OGRE_SRC}/OgreMain/include ${OGRE_SOURCE}/include) SET(OGRE_LIB_DIR $ENV{OGRE_SRC}/lib) IF (NOT OGRE_SOURCE) set(OGRE_SOURCE $ENV{OGRE_SRC} CACHE PATH "Path to Ogre sources (set it if you don't have OGRE_HOME or OGRE_SRC environment variables)") ENDIF () ENDIF () IF (OGRESDK OR OGRESOURCE OR OGRE_SOURCE) SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain) SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "") SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "") SET(OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "") ENDIF () ELSE (WIN32) #Unix IF (OGRE_SOURCE) MESSAGE(STATUS "Using OGRE built from source (from specified path)") SET(OGRE_INCLUDE_DIR ${OGRE_SOURCE}/OgreMain/include) SET(OGRE_LIB_DIR ${OGRE_SOURCE}/lib) ELSE () CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR) FIND_PACKAGE(PkgConfig) PKG_SEARCH_MODULE(OGRE OGRE) SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS}) SET(OGRE_LIB_DIR ${OGRE_LIBDIR}) ENDIF () SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "") SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "") SET(OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "") ENDIF (WIN32) IF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES) SET(OGRE_FOUND TRUE) ENDIF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES) IF (OGRE_FOUND) IF (NOT OGRE_FIND_QUIETLY) MESSAGE(STATUS " libraries : ${OGRE_LIBRARIES} from ${OGRE_LIB_DIR}") MESSAGE(STATUS " includes : ${OGRE_INCLUDE_DIR}") ENDIF (NOT OGRE_FIND_QUIETLY) ELSE (OGRE_FOUND) IF (OGRE_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Could not find OGRE") ENDIF (OGRE_FIND_REQUIRED) ENDIF (OGRE_FOUND) CMAKE_POLICY(POP) endif() endif() MyGUI_3.2.0/CMake/Packages/FindBerkelium.cmake0000664000000000000000000000333211721331046017447 0ustar rootrootset(BERKELIUM_ROOT "" CACHE PATH "Path to Berklium sources") SET(BERKELIUM_FOUND FALSE) IF(EXISTS ${BERKELIUM_ROOT}/include AND EXISTS ${BERKELIUM_ROOT}/lib) SET(BERKELIUM_INCLUDE_DIRS ${BERKELIUM_ROOT}/include) SET(BERKELIUM_LIBRARY_DIRS ${BERKELIUM_ROOT}/lib) ELSE() IF(WIN32) IF(EXISTS ${BERKELIUM_ROOT}/win32/berkelium.lib AND EXISTS ${BERKELIUM_ROOT}/win32/berkelium.exe) SET(BERKELIUM_INCLUDE_DIRS ${BERKELIUM_ROOT}/include) SET(BERKELIUM_LIBRARY_DIRS ${BERKELIUM_ROOT}/win32) ENDIF() ENDIF() ENDIF() IF(BERKELIUM_INCLUDE_DIRS AND BERKELIUM_LIBRARY_DIRS) IF(WIN32) # Windows FIND_LIBRARY(BERKELIUM_DEBUG_LIBRARY NAMES berkelium_d PATH_SUFFIXES "" Debug PATHS ${BERKELIUM_LIBRARY_DIRS} NO_DEFAULT_PATH) FIND_LIBRARY(BERKELIUM_RELEASE_LIBRARY NAMES berkelium PATH_SUFFIXES "" Release PATHS ${BERKELIUM_LIBRARY_DIRS} NO_DEFAULT_PATH) SET(BERKELIUM_LIBRARIES) IF(BERKELIUM_DEBUG_LIBRARY AND BERKELIUM_RELEASE_LIBRARY) SET(BERKELIUM_LIBRARIES debug ${BERKELIUM_DEBUG_LIBRARY} optimized ${BERKELIUM_RELEASE_LIBRARY}) ELSEIF(BERKELIUM_DEBUG_LIBRARY) SET(BERKELIUM_LIBRARIES ${BERKELIUM_DEBUG_LIBRARY}) ELSEIF(BERKELIUM_RELEASE_LIBRARY) SET(BERKELIUM_LIBRARIES ${BERKELIUM_RELEASE_LIBRARY}) ENDIF(BERKELIUM_DEBUG_LIBRARY AND BERKELIUM_RELEASE_LIBRARY) ELSE(WIN32) # Linux etc FIND_LIBRARY(BERKELIUM_LIBRARIES NAMES berkelium PATHS ${BERKELIUM_LIBRARY_DIRS} NO_DEFAULT_PATH) ENDIF(WIN32) IF(BERKELIUM_LIBRARIES) SET(BERKELIUM_FOUND TRUE) ENDIF() ENDIF() IF(BERKELIUM_FOUND) MESSAGE(STATUS "Found Berkelium: headers at ${BERKELIUM_INCLUDE_DIRS}, libraries at ${BERKELIUM_LIBRARIES}") ENDIF(BERKELIUM_FOUND) MyGUI_3.2.0/MyGUIEngine/0000775000000000000000000000000011723345156013317 5ustar rootrootMyGUI_3.2.0/MyGUIEngine/include/0000775000000000000000000000000011723345156014742 5ustar rootrootMyGUI_3.2.0/MyGUIEngine/include/MyGUI_VertexData.h0000664000000000000000000000445411721331056020173 0ustar rootroot/*! @file @author Albert Semenov @date 05/2009 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ControllerPosition.h0000664000000000000000000000536211721331056021773 0ustar rootroot/*! @file @author Evmenov Georgiy @date 03/2008 */ /* 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); /** @param _value Delegate applied to widget every frame (see ControllerPosition::eventFrameAction) */ void setAction(FrameAction::IDelegate* _value); virtual void setProperty(const std::string& _key, const std::string& _value); private: bool addTime(Widget* _widget, float _time); void prepareItem(Widget* _widget); 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; }; } // namespace MyGUI #endif // __MYGUI_CONTROLLER_POSITION_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_MaskPickInfo.h0000664000000000000000000000231111721331056020430 0ustar rootroot/*! @file @author Albert Semenov @date 12/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_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(); bool load(const std::string& _file); bool pick(const IntPoint& _point, const IntCoord& _coord) const; bool empty() const; private: std::vector data; int width, height; }; } // namespace MyGUI #endif // __MYGUI_MASK_PICK_INFO_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_DDContainer.h0000664000000000000000000001327411721331056020256 0ustar rootroot/*! @file @author Albert Semenov @date 10/2008 */ /* 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::CMultiDelegate3 EventHandle_DDContainerPtrCDDItemInfoRefBoolRef; typedef delegates::CMultiDelegate3 EventHandle_DDContainerPtrCDDItemInfoRefBool; typedef delegates::CMultiDelegate2 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); /** Get drag'n'drop mode flag */ bool getNeedDragDrop() const; void resetDrag(); /*events:*/ /** Event : Request for start drag.\n 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 drop (moving mouse over container, but not dropped yet).\n 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).\n 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.\n 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.\n 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); /** Event : [Internal event] невалидна информация для контейнера.\n signature : void method(MyGUI::DDContainer* _sender) @param _sender widget that called this event */ delegates::CMultiDelegate1 _eventInvalideContainer; /** Event : [Internal event] !!обновить виджеты дропа DD_FIXME наверное internal.\n 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::CMultiDelegate3 eventUpdateDropState; protected: 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, MouseButton _id); virtual void notifyInvalideDrop(DDContainer* _sender); virtual void removeDropItems(); virtual void updateDropItems(); virtual void updateDropItemsState(const DDWidgetState& _state); void mouseDrag(MouseButton _id); void mouseButtonReleased(MouseButton _id); void mouseButtonPressed(MouseButton _id); void endDrop(bool _reset); virtual void setPropertyOverride(const std::string& _key, const std::string& _value); 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ActionController.h0000664000000000000000000000556511721331056021411 0ustar rootroot/*! @file @author Albert Semenov @date 01/2008 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_LogManager.h0000664000000000000000000000516011721331056020133 0ustar rootroot/*! @file @author Albert Semenov @date 01/2008 */ /* 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 "MyGUI_LogSource.h" #include "MyGUI_Diagnostic.h" #include namespace MyGUI { #define MYGUI_LOGGING(section, level, text) \ MyGUI::LogManager::getInstance().log(section, MyGUI::LogLevel::level, MyGUI::LogStream() << text << MyGUI::LogStream::End(), __FILE__, __LINE__) class ConsoleLogListener; class FileLogListener; class LevelLogFilter; class MYGUI_EXPORT LogManager { public: LogManager(); ~LogManager(); static LogManager& getInstance(); static LogManager* getInstancePtr(); /** Call LogSource::flush() for all log sources. */ void flush(); /** Call LogSource::log for all log sources. */ void log(const std::string& _section, LogLevel _level, const std::string& _message, const char* _file, int _line); /** Create default LevelLogFilter, FileLogListener and ConsoleLogListener. */ void createDefaultSource(const std::string& _logname); /** Enable or disable default ConsoleLogListener that writes log into std::cout.\n Enabled (true) by default. */ void setSTDOutputEnabled(bool _value); /** Is disable ConsoleLogListener enabled. */ bool getSTDOutputEnabled() const; /** Set default LevelLogFilter level. */ void setLoggingLevel(LogLevel _value); /** Get default LevelLogFilter level. */ LogLevel getLoggingLevel() const; /** Add log source. */ void addLogSource(LogSource* _source); private: void close(); private: static LogManager* msInstance; typedef std::vector VectorLogSource; VectorLogSource mSources; ConsoleLogListener* mConsole; FileLogListener* mFile; LevelLogFilter* mFilter; LogSource* mDefaultSource; LogLevel mLevel; bool mConsoleEnable; }; } // namespace MyGUI #endif // __MYGUI_LOG_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_IUnlinkWidget.h0000664000000000000000000000220511721331060020624 0ustar rootroot/*! @file @author Albert Semenov @date 01/2008 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Platform.h0000664000000000000000000000771411721331060017705 0ustar rootroot/*! @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__ // Definition 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 # // 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_TabItem.h0000664000000000000000000000271411721331054017444 0ustar rootroot/*! @file @author Albert Semenov @date 01/2008 */ /* 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_TextBox.h" #include "MyGUI_TabControl.h" namespace MyGUI { class MYGUI_EXPORT TabItem : public TextBox { 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); protected: virtual void initialiseOverride(); virtual void shutdownOverride(); virtual void setPropertyOverride(const std::string& _key, const std::string& _value); }; } // namespace MyGUI #endif // __MYGUI_TAB_ITEM_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_RenderFormat.h0000664000000000000000000000622011721331056020505 0ustar rootroot/*! @file @author Albert Semenov @date 04/2009 */ /* 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 { public: 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) const { return 0 != (value & _value); } private: Enum value; }; } // namespace MyGUI #endif // __MYGUI_RENDER_FORMAT_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_InputManager.h0000664000000000000000000001336511721331056020517 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_INPUT_MANAGER_H__ #define __MYGUI_INPUT_MANAGER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Macros.h" #include "MyGUI_Singleton.h" #include "MyGUI_WidgetDefines.h" #include "MyGUI_IUnlinkWidget.h" #include "MyGUI_WidgetDefines.h" #include "MyGUI_XmlDocument.h" #include "MyGUI_MouseButton.h" #include "MyGUI_KeyCode.h" #include "MyGUI_Timer.h" #include "MyGUI_ILayer.h" #include "MyGUI_Delegate.h" #include "MyGUI_BackwardCompatibility.h" namespace MyGUI { class MYGUI_EXPORT InputManager : public Singleton, public IUnlinkWidget, public MemberObsolete { public: InputManager(); 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() const; /** Is any widget have key focus (any widget might have it, not only EditBox or something similar) */ bool isFocusKey() const; /** Is any widget captured mouse */ bool isCaptureMouse() const; /** Set key focus for _widget */ void setKeyFocusWidget(Widget* _widget); /** Drop key focus for _widget */ void resetKeyFocusWidget(Widget* _widget); /** Drop any key focus */ void resetKeyFocusWidget(); /** Get mouse focused widget */ Widget* getMouseFocusWidget() const; /** Get key focused widget */ Widget* getKeyFocusWidget() const; /** Get position of last mouse button press. Position calculated on specific layer where mouse was pressed. */ const IntPoint& getLastPressedPosition(MouseButton _id) const; /** Get current mouse position on screen */ const IntPoint& getMousePosition() const; /** Get mouse position on current layer. This position might different from getMousePosition() if mouse is over non-2d layer. */ IntPoint getMousePositionByLayer(); // работа с модальными окнами /** 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() const; /** Is control button pressed */ bool isControlPressed() const; /** Is shift button pressed */ bool isShiftPressed() const; /** Reset mouse capture. For example when we dragging and application lost focus you should call this. */ void resetMouseCaptureWidget(); /** Unlink widget from input manager. */ void unlinkWidget(Widget* _widget); /** Event : MultiDelegate. Mouse focus was changed.\n signature : void method(MyGUI::Widget* _widget)\n @param _widget */ delegates::CMultiDelegate1 eventChangeMouseFocus; /** Event : MultiDelegate. Key focus was changed.\n signature : void method(MyGUI::Widget* _widget)\n @param _widget */ delegates::CMultiDelegate1 eventChangeKeyFocus; /*internal:*/ void _resetMouseFocusWidget(); 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; // таймер для двойного клика Timer mTimer; //used for double click timing // нажат ли шифт bool mIsShiftPressed; // нажат ли контрол bool mIsControlPressed; IntPoint mMousePosition; // last mouse press position IntPoint mLastPressed[MouseButton::MAX]; // is mouse button captured by active widget bool mMouseCapture[MouseButton::MAX]; // клавиша для повтора KeyCode mHoldKey; Char mHoldChar; bool mFirstPressKey; float mTimerKey; int mOldAbsZ; // список виджетов с модальным режимом VectorWidgetPtr mVectorModalRootWidget; bool mIsInitialise; }; } // namespace MyGUI #endif // __MYGUI_INPUT_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ImageBox.h0000664000000000000000000001610111721331056017607 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_IMAGE_BOX_H__ #define __MYGUI_IMAGE_BOX_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Widget.h" #include "MyGUI_ResourceImageSet.h" #include "MyGUI_ImageInfo.h" namespace MyGUI { class MYGUI_EXPORT ImageBox : public Widget { MYGUI_RTTI_DERIVED( ImageBox ) public: ImageBox(); //------------------------------------------------------------------------------// // 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 For example:\n
				+---+---+---+
				| 0 | 1 | 2 |
				+---+---+---+
				| 3 | 4 | 5 |
				+---+---+---+
			
*/ void setImageIndex(size_t _index); /** Get current tile index */ size_t getImageIndex() const; //------------------------------------------------------------------------------// // The expanded interface //------------------------------------------------------------------------------// //! Get number of items size_t getItemCount() const; //! Select specified _index void setItemSelect(size_t _index); //! Get index of selected item (ITEM_NONE if none selected) size_t getItemSelect() const; //! Reset item selection void resetItemSelect(); //! 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); //! 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 ImageBox::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 ImageBox::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 ImageBox @param _name 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 ImageBox @param _resource Resource pointer */ void setItemResourcePtr(ResourceImageSetPtr _resource); /** Set current item */ void setItemResourceInfo(const ImageIndexInfo& _info); /** Get current items resource used in ImageBox */ ResourceImageSetPtr getItemResource() const; /** Select current item resource, group and name */ void setItemResourceInfo(ResourceImageSetPtr _resource, const std::string& _group, const std::string& _name); protected: virtual void shutdownOverride(); virtual void setPropertyOverride(const std::string& _key, const std::string& _value); private: void frameEntered(float _frame); void recalcIndexes(); void updateSelectIndex(size_t _index); void frameAdvise(bool _advise); void _setUVSet(const FloatRect& _rect); 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_IMAGE_BOX_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_CustomAllocator.h0000664000000000000000000000527011721331056021234 0ustar rootroot/*! @file @author Albert Semenov @date 05/2009 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_LevelLogFilter.h0000664000000000000000000000327411721331056021002 0ustar rootroot/*! @file @author Albert Semenov @date 05/2010 */ /* 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_LEVEL_LOG_FILTER_H__ #define __MYGUI_LEVEL_LOG_FILTER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_ILogFilter.h" namespace MyGUI { class MYGUI_EXPORT LevelLogFilter : public ILogFilter { public: LevelLogFilter(); virtual ~LevelLogFilter(); //! @copydoc ILogFilter::shouldLog(const std::string& _section, LogLevel _level, const struct tm* _time, const std::string& _message, const char* _file, int _line) virtual bool shouldLog(const std::string& _section, LogLevel _level, const struct tm* _time, const std::string& _message, const char* _file, int _line); /** Set logging level. @param _value messages with this or higher level will be logged. */ void setLoggingLevel(LogLevel _value); /** Get logging level. @return Messages with this or higher level are logged. */ LogLevel getLoggingLevel() const; private: LogLevel mLevel; }; } // namespace MyGUI #endif // __MYGUI_LEVEL_LOG_FILTER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_WidgetInput.h0000664000000000000000000002477311721331056020375 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_WIDGET_INPUT_H__ #define __MYGUI_WIDGET_INPUT_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Macros.h" #include "MyGUI_WidgetDefines.h" #include "MyGUI_WidgetToolTip.h" #include "MyGUI_MouseButton.h" #include "MyGUI_KeyCode.h" #include "MyGUI_MaskPickInfo.h" #include "MyGUI_Delegate.h" #include "MyGUI_EventPair.h" namespace MyGUI { /** 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 */ // делегаты для событий виджета typedef delegates::CMultiDelegate1 EventHandle_WidgetVoid; typedef delegates::CMultiDelegate2 EventHandle_WidgetWidget; typedef delegates::CMultiDelegate2 EventHandle_WidgetBool; typedef delegates::CMultiDelegate2 EventHandle_WidgetInt; typedef delegates::CMultiDelegate2 EventHandle_WidgetSizeT; typedef delegates::CMultiDelegate3 EventHandle_WidgetIntInt; typedef delegates::CMultiDelegate4 EventHandle_WidgetIntIntButton; typedef delegates::CMultiDelegate2 EventHandle_WidgetKeyCode; typedef delegates::CMultiDelegate3 EventHandle_WidgetKeyCodeChar; typedef delegates::CMultiDelegate2 EventHandle_WidgetToolTip; class MYGUI_EXPORT WidgetInput { public: WidgetInput(); virtual ~WidgetInput(); /** 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() const; /** Set mouse pointer for this widget */ void setPointer(const std::string& _value); /** Get mouse pointer name for this widget */ const std::string& getPointer() const; /** Set need key focus flag */ void setNeedKeyFocus(bool _value); /** Is need key focus If disable this widget won't be reacting on keyboard at all.\n Enabled (true) by default. */ bool getNeedKeyFocus() const; /** Set need mouse focus flag */ void setNeedMouseFocus(bool _value); /** Is need mouse focus If disable this widget won't be reacting on mouse at all.\n Enabled (true) by default. */ bool getNeedMouseFocus() const; /** 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); /** Get inherits mode flag */ bool getInheritsPick() const; /** Set picking mask for widget */ void setMaskPick(const std::string& _filename); /** Set picking mask for widget */ void setMaskPick(const MaskPickInfo& _info); bool isMaskPickInside(const IntPoint& _point, const IntCoord& _coord) const; bool getRootMouseFocus() const; bool getRootKeyFocus() const; /** 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, MyGUI::MouseButton _id)\n @param _sender widget that called this event @param _left - pointer position @param _top - pointer position */ EventPair3to4 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; /*internal:*/ void _riseMouseLostFocus(Widget* _new); void _riseMouseSetFocus(Widget* _old); void _riseMouseDrag(int _left, int _top, MouseButton _id); void _riseMouseMove(int _left, int _top); void _riseMouseWheel(int _rel); void _riseMouseButtonPressed(int _left, int _top, MouseButton _id); void _riseMouseButtonReleased(int _left, int _top, MouseButton _id); void _riseMouseButtonClick(); void _riseMouseButtonDoubleClick(); void _riseKeyLostFocus(Widget* _new); void _riseKeySetFocus(Widget* _old); void _riseKeyButtonPressed(KeyCode _key, Char _char); void _riseKeyButtonReleased(KeyCode _key); void _riseMouseChangeRootFocus(bool _focus); void _riseKeyChangeRootFocus(bool _focus); void _setRootMouseFocus(bool _value); void _setRootKeyFocus(bool _value); protected: virtual void onMouseLostFocus(Widget* _new); virtual void onMouseSetFocus(Widget* _old); virtual void onMouseDrag(int _left, int _top, MouseButton _id); virtual void onMouseMove(int _left, int _top); virtual void onMouseWheel(int _rel); virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id); virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id); virtual void onMouseButtonClick(); virtual void onMouseButtonDoubleClick(); virtual void onKeyLostFocus(Widget* _new); virtual void onKeySetFocus(Widget* _old); virtual void onKeyButtonPressed(KeyCode _key, Char _char); virtual void onKeyButtonReleased(KeyCode _key); virtual void onMouseChangeRootFocus(bool _focus); virtual void onKeyChangeRootFocus(bool _focus); private: std::string mPointer; MaskPickInfo mOwnMaskPickInfo; bool mNeedToolTip; bool mInheritsPick; bool mNeedKeyFocus; bool mNeedMouseFocus; bool mRootMouseFocus; bool mRootKeyFocus; }; } // namespace MyGUI #endif // __MYGUI_WIDGET_INPUT_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_TCoord.h0000664000000000000000000001331711721331056017314 0ustar rootroot/*! @file @author Albert Semenov @date 12/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_TCOORD_H__ #define __MyGUI_TCOORD_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_TPoint.h" #include "MyGUI_TSize.h" namespace MyGUI { namespace types { template struct TCoord { T left; T top; T width; T 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_TileRect.h0000664000000000000000000000424411721331056017634 0ustar rootroot/*! @file @author Albert Semenov @date 05/2008 */ /* 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" #include "MyGUI_RenderFormat.h" namespace MyGUI { class RenderItem; class MYGUI_EXPORT TileRect : public ISubWidgetRect { MYGUI_RTTI_DERIVED( TileRect ) public: TileRect(); virtual ~TileRect(); virtual 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:*/ virtual void _updateView(); virtual void _correctView(); virtual void _setAlign(const IntSize& _oldsize); virtual void _setUVSet(const FloatRect& _rect); virtual void _setColour(const Colour& _value); protected: bool mEmptyView; VertexColourType mVertexFormat; 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Common.h0000664000000000000000000000353511721331054017351 0ustar rootroot/*! @file @author Albert Semenov @author baho_is @date 11/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_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 // этот дефайн для того чтобы в самом гуе показывалось имя файла где вызывается new #if MYGUI_COMPILER == MYGUI_COMPILER_MSVC # ifdef MYGUI_CHECK_MEMORY_LEAKS # define DEBUG_NEW new (_NORMAL_BLOCK, __FILE__, __LINE__) # define new DEBUG_NEW # endif #endif #include "MyGUI_Macros.h" #include "MyGUI_Diagnostic.h" #include "MyGUI_LogManager.h" #include "MyGUI_Singleton.h" #include "MyGUI_Types.h" #include "MyGUI_StringUtility.h" #include "MyGUI_MouseButton.h" #include "MyGUI_KeyCode.h" #include "MyGUI_Version.h" #include "MyGUI_WidgetStyle.h" #include "MyGUI_UString.h" #include "MyGUI_Delegate.h" #endif // __MYGUI_COMMON_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Bitwise.h0000664000000000000000000000347511721331056017534 0ustar rootroot/*! @file @author Albert Semenov @date 06/2009 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ResourceManager.h0000664000000000000000000000617311721331056021206 0ustar rootroot/*! @file @author Albert Semenov @date 09/2008 */ /* 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_Singleton.h" #include "MyGUI_Enumerator.h" #include "MyGUI_XmlDocument.h" #include "MyGUI_IResource.h" #include "MyGUI_Delegate.h" #include "MyGUI_BackwardCompatibility.h" namespace MyGUI { class MYGUI_EXPORT ResourceManager : public Singleton, public MemberObsolete { public: ResourceManager(); void initialise(); void shutdown(); public: /** Load additional MyGUI *_resource.xml file */ bool load(const std::string& _file); void loadFromXmlNode(xml::ElementPtr _node, const std::string& _file, Version _version); /** Add resource item to resources */ void addResource(IResourcePtr _item); /** Remove resource item from resources */ void removeResource(IResourcePtr _item); typedef delegates::CDelegate3 LoadXmlDelegate; /** Register delegate that parse XML node with specified tag (_key) */ LoadXmlDelegate& registerLoadXmlDelegate(const std::string& _key); /** Unregister delegate that parse XML node with specified tag (_key) */ void unregisterLoadXmlDelegate(const std::string& _key); /** Check is resource exist */ bool isExist(const std::string& _name) const; /** Find resource by name*/ IResource* findByName(const std::string& _name) const; /** Get resource by name*/ IResource* getByName(const std::string& _name, bool _throw = true) const; bool removeByName(const std::string& _name); void clear(); typedef std::map MapResource; typedef Enumerator EnumeratorPtr; EnumeratorPtr getEnumerator() const; size_t getCount() const; private: void _loadList(xml::ElementPtr _node, const std::string& _file, Version _version); bool _loadImplement(const std::string& _file, bool _match, const std::string& _type, const std::string& _instance); private: // карта с делегатами для парсинга хмл блоков typedef std::map MapLoadXmlDelegate; MapLoadXmlDelegate mMapLoadXmlDelegate; MapResource mResources; typedef std::vector VectorResource; VectorResource mRemovedResoures; bool mIsInitialise; }; } // namespace MyGUI #endif // __MYGUI_RESOURCE_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_PluginManager.h0000664000000000000000000000420711721331056020651 0ustar rootroot/*! @file @author Denis Koronchik @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_PLUGIN_MANAGER_H__ #define __MYGUI_PLUGIN_MANAGER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Singleton.h" #include "MyGUI_Plugin.h" #include "MyGUI_XmlDocument.h" #include "MyGUI_Version.h" #include "MyGUI_DynLib.h" #include #include "MyGUI_BackwardCompatibility.h" namespace MyGUI { /*! \brief Plugin manager. Load/unload and register plugins. */ class MYGUI_EXPORT PluginManager : public Singleton, public MemberObsolete { public: PluginManager(); void initialise(); void shutdown(); //! Load plugin bool loadPlugin(const std::string& _file); //! Unload plugin void unloadPlugin(const std::string& _file); /*! 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: void _load(xml::ElementPtr _node, const std::string& _file, Version _version); private: //! List of dynamic libraries typedef std::map DynLibList; //! List of plugins typedef std::set PluginList; //! Loaded libraries DynLibList mLibs; //! Installed plugins PluginList mPlugins; bool mIsInitialise; }; } // namespace MyGUI #endif // __MYGUI_PLUGIN_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_RenderTargetInfo.h0000664000000000000000000000267311721331056021327 0ustar rootroot/*! @file @author Albert Semenov @date 05/2008 */ /* 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 { public: 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; } public: 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_MouseButton.h0000664000000000000000000000300711721331056020401 0ustar rootroot/*! @file @author Albert Semenov @date 03/2008 */ /* 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_MOUSE_BUTTON_H__ #define __MYGUI_MOUSE_BUTTON_H__ #include "MyGUI_Prerequest.h" namespace MyGUI { struct MYGUI_EXPORT MouseButton { enum Enum { None = -1, Left = 0, Right, Middle, Button0 = 0, Button1, Button2, Button3, Button4, Button5, Button6, Button7, MAX }; 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; }; } // namespace MyGUI #endif // __MYGUI_MOUSE_BUTTON_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ScrollView.h0000664000000000000000000000745211721331056020216 0ustar rootroot/*! @file @author Albert Semenov @date 08/2008 */ /* 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, public MemberObsolete { 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); /** @copydoc Widget::setSize(int _width, int _height) */ void setSize(int _width, int _height); /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ void setCoord(int _left, int _top, int _width, int _height); /** Show VScroll when text size larger than Edit */ void setVisibleVScroll(bool _value); /** Get Show VScroll flag */ bool isVisibleVScroll() const; /** Show HScroll when text size larger than Edit */ void setVisibleHScroll(bool _value); /** Get Show HScroll flag */ bool isVisibleHScroll() const; /** Set canvas align */ void setCanvasAlign(Align _value); /** Get canvas align */ Align getCanvasAlign() const; /** Set canvas size */ void setCanvasSize(const IntSize& _value); /** Set canvas size */ void setCanvasSize(int _width, int _height); /** Get canvas size */ IntSize getCanvasSize(); /** Get view area coordinates. */ IntCoord getViewCoord() const; /** Set view area offset. */ void setViewOffset(const IntPoint& _value); /** Get view area offset. */ IntPoint getViewOffset() const; protected: virtual void initialiseOverride(); virtual void shutdownOverride(); void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id); void notifyMouseReleased(Widget* _sender, int _left, int _top, MouseButton _id); void notifyScrollChangePosition(ScrollBar* _sender, size_t _position); void notifyMouseWheel(Widget* _sender, int _rel); void updateView(); virtual void setPropertyOverride(const std::string& _key, const std::string& _value); ScrollBar* getVScroll(); private: // размер данных virtual IntSize getContentSize(); // смещение данных virtual IntPoint getContentPosition(); // размер окна, через которые видно данные virtual IntSize getViewSize(); virtual void setContentPosition(const IntPoint& _point); // размер на который прокручиваются данные при щелчке по скролу virtual size_t getVScrollPage(); virtual size_t getHScrollPage(); virtual Align getContentAlign(); protected: Align mContentAlign; Widget* mRealClient; }; } // namespace MyGUI #endif // __MYGUI_SCROLL_VIEW_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_GenericFactory.h0000664000000000000000000000120511721331056021017 0ustar rootroot/*! @file @author Albert Semenov @date 06/2009 */ #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(); } }; } // namespace MyGUI #endif // __MYGUI_GENERIC_FACTORY_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Diagnostic.h0000664000000000000000000000704211721331056020204 0ustar rootroot/*! @file @author Albert Semenov @author baho_is @date 11/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_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 #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 < 310 // gcc 3.1 #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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_SubSkin.h0000664000000000000000000000405411721331056017476 0ustar rootroot/*! @file @author Albert Semenov @date 02/2008 */ /* 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_RenderFormat.h" #include "MyGUI_IStateInfo.h" namespace MyGUI { class RenderItem; class MYGUI_EXPORT SubSkin : public ISubWidgetRect { MYGUI_RTTI_DERIVED( SubSkin ) public: SubSkin(); virtual ~SubSkin(); virtual 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:*/ virtual void _updateView(); virtual void _correctView(); virtual void _setAlign(const IntSize& _oldsize); virtual void _setUVSet(const FloatRect& _rect); virtual void _setColour(const Colour& _value); protected: FloatRect mRectTexture; bool mEmptyView; VertexColourType mVertexFormat; uint32 mCurrentColour; FloatRect mCurrentTexture; IntCoord mCurrentCoord; ILayerNode* mNode; RenderItem* mRenderItem; bool mSeparate; }; } // namespace MyGUI #endif // __MYGUI_SUB_SKIN_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_TabControl.h0000664000000000000000000002404111721331056020165 0ustar rootroot/*! @file @author Albert Semenov @date 01/2008 */ /* 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_CONTROL_H__ #define __MYGUI_TAB_CONTROL_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Widget.h" #include "MyGUI_Any.h" #include "MyGUI_EventPair.h" #include "MyGUI_ControllerFadeAlpha.h" #include "MyGUI_IItem.h" #include "MyGUI_IItemContainer.h" namespace MyGUI { typedef delegates::CMultiDelegate2 EventHandle_TabPtrSizeT; class MYGUI_EXPORT TabControl : public Widget, public IItemContainer, public MemberObsolete { // для уведобления об удалении //FIXME friend class TabItem; MYGUI_RTTI_DERIVED( TabControl ) public: TabControl(); 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); /** @copydoc Widget::setSize(int _width, int _height) */ void setSize(int _width, int _height); /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ void setCoord(int _left, int _top, int _width, int _height); //------------------------------------------------------------------------------// // манипуляции айтемами //! Get number of items size_t getItemCount() const; //! 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); //! Add an item to the end of a array TabItem* addItem(const UString& _name, Any _data = Any::Null); //! Remove item at a specified position void removeItemAt(size_t _index); //! Remove item void removeItem(TabItem* _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); void swapItems(size_t _index1, size_t _index2); //------------------------------------------------------------------------------// // манипуляции выделениями //! Get index of selected item (ITEM_NONE if none selected) size_t getIndexSelected() const; //! Get selected item (nullptr if none selected) TabItem* getItemSelected(); //! Select specified _index void setIndexSelected(size_t _index); //! Select item void setItemSelected(TabItem* _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); //! Clear an item data at a specified position void clearItemDataAt(size_t _index); //! Clear an item data void clearItemData(TabItem* _item); //! Get item data from specified position template ValueType* getItemDataAt(size_t _index, bool _throw = true) { MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "TabControl::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); //! Get item name from specified position const UString& getItemNameAt(size_t _index); //! Get item name const UString& getItemName(TabItem* _item); //------------------------------------------------------------------------------// // манипуляции выдимостью //! Move all elements so specified becomes visible void beginToItemAt(size_t _index); //! Move all elements so specified becomes visible void beginToItem(TabItem* _item); //! Move all elements so first becomes visible void beginToItemFirst(); //! Move all elements so last becomes visible void beginToItemLast(); //! Move all elements so selected becomes visible void beginToItemSelected(); //------------------------------------------------------------------------------// // остальные манипуляции //! 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); //! Get button width at a specified position int getButtonWidthAt(size_t _index); //! Get button width int getButtonWidth(TabItem* _item); //------------------------------------------------------------------------------// /** Set default button width and disable autowidth mode */ void setButtonDefaultWidth(int _value); /** Get default button width */ int getButtonDefaultWidth() const; /** Enable or disable button auto width */ void setButtonAutoWidth(bool _value); /** Get button auto width flag */ bool getButtonAutoWidth() const; /** Enable or disable smooth sheets showing */ void setSmoothShow(bool _value); /** Get smooth sheets showing flag */ bool getSmoothShow() const; /*events:*/ /** Event : Active TabControl sheet changed \n signature : void method(MyGUI::TabControl* _sender, size_t _index)\n @param _sender widget that called this event @param _index Index of selected sheet */ EventPair eventTabChangeSelect; /*internal:*/ // IItemContainer impl virtual size_t _getItemCount(); virtual void _addItem(const MyGUI::UString& _name); virtual void _removeItemAt(size_t _index); virtual Widget* _getItemAt(size_t _index); virtual void _setItemNameAt(size_t _index, const UString& _name); virtual const UString& _getItemNameAt(size_t _index); protected: virtual void initialiseOverride(); virtual void shutdownOverride(); 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); virtual void onWidgetCreated(Widget* _widget); virtual void setPropertyOverride(const std::string& _key, const std::string& _value); private: void actionWidgetHide(Widget* _widget); ControllerFadeAlpha* createControllerFadeAlpha(float _alpha, float _coef, bool _enable); Widget* _getWidgetTemplate(); Widget* _getWidgetBar(); Button* createButton(); void updateBarOld(); void updateBarNew(); private: int mOffsetTab; // смещение бара при показе кнопок bool mButtonShow; int mWidthBar; // ширина в которую помещаються все кнопки std::vector mItemButton; // список кнопок, не должно равно списку страниц std::string mButtonSkinName; std::string mEmptySkinName; Widget* mWidgetBar; Button* mButtonLeft; Button* mButtonRight; Widget* mButtonDecor; VectorWidgetPtr mWidgetsPatch; // список виджетов которые нужно показать при показе кнопки Widget* mEmptyBarWidget; Widget* mItemTemplate; // информация о вкладках VectorTabItemInfo mItemsInfo; size_t mStartIndex; size_t mIndexSelect; int mButtonDefaultWidth; bool mSmoothShow; bool mButtonAutoWidth; // флаг, чтобы отсеч уведомления от вкладок, при общем шутдауне виджета bool mShutdown; Widget* mHeaderPlace; Widget* mControls; Widget* mEmpty; }; } // namespace MyGUI #endif // __MYGUI_TAB_CONTROL_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_FileLogListener.h0000664000000000000000000000357011721331056021151 0ustar rootroot/*! @file @author Albert Semenov @date 04/2010 */ /* 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_FILE_LOG_LISTENER_H__ #define __MYGUI_FILE_LOG_LISTENER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_ILogListener.h" #include #include namespace MyGUI { class MYGUI_EXPORT FileLogListener : public ILogListener { public: FileLogListener(); virtual ~FileLogListener(); //! @copydoc ILogListener::open() virtual void open(); //! @copydoc ILogListener::close() virtual void close(); //! @copydoc ILogListener::flush() virtual void flush(); //! @copydoc ILogListener::log(const std::string& _section, LogLevel _level, const struct tm* _time, const std::string& _message, const char* _file, int _line) virtual void log(const std::string& _section, LogLevel _level, const struct tm* _time, const std::string& _message, const char* _file, int _line); /** Set listener's file name where it wirte log. */ void setFileName(const std::string& _value); /** Get listener's file name where it wirte log. */ const std::string& getFileName() const; private: std::ofstream mStream; std::string mFileName; }; } // namespace MyGUI #endif // __MYGUI_FILE_LOG_LISTENER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_LanguageManager.h0000664000000000000000000000626011721331060021132 0ustar rootroot/*! @file @author Albert Semenov @date 09/2008 */ /* 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_Singleton.h" #include "MyGUI_XmlDocument.h" #include "MyGUI_Delegate.h" #include "MyGUI_Types.h" #include "MyGUI_BackwardCompatibility.h" namespace MyGUI { class MYGUI_EXPORT LanguageManager : public Singleton, public MemberObsolete { public: LanguageManager(); void initialise(); void shutdown(); /** Set current language for replacing #{} tags */ void setCurrentLanguage(const std::string& _name); /** Get current language */ const std::string& getCurrentLanguage() const; /** 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(); /** Load user tags */ 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; /** Event : Request tag.\n signature : void method(const MyGUI::UString& _tag, MyGUI::UString& _result); @param _tag Tag than should be translated. @param _result String that should be placed instead specified tag. @note If this event is empty and _tag not found - "#{_tag}" used by default. */ delegates::CDelegate2 eventRequestTag; private: void _load(xml::ElementPtr _node, const std::string& _file, Version _version); bool loadLanguage(const std::string& _file, bool _user = false); void _loadLanguage(IDataStream* _stream, bool _user); void _loadLanguageXML(IDataStream* _stream, bool _user); UString replaceTagsPass(const UString& _line, bool& _replaceResult); private: typedef std::map MapLanguageString; MapLanguageString mMapLanguage; MapLanguageString mUserMapLanguage; std::string mCurrentLanguageName; typedef std::map MapListString; MapListString mMapFile; bool mIsInitialise; }; } // namespace MyGUI #endif // __MYGUI_LANGUAGE_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_LogSource.h0000664000000000000000000000352211721331056020021 0ustar rootroot/*! @file @author Albert Semenov @date 04/2010 */ /* 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_SOURCE_H__ #define __MYGUI_LOG_SOURCE_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_ILogFilter.h" #include "MyGUI_ILogListener.h" #include namespace MyGUI { class MYGUI_EXPORT LogSource { public: LogSource(); ~LogSource(); /** Set log messages filter. */ void setLogFilter(ILogFilter* _filter); /** Set log messages filter. */ void addLogListener(ILogListener* _lestener); /** Call ILogListener::open() for all listeners. */ void open(); /** Call ILogListener::close() for all listeners. */ void close(); /** Call ILogListener::flush() for all listeners. */ void flush(); /** Call ILogListener::log for all listeners for messages that match LogSource filter (@see void setLogFilter(ILogFilter* _filter)). */ void log(const std::string& _section, LogLevel _level, const struct tm* _time, const std::string& _message, const char* _file, int _line); private: typedef std::vector VectorLogListeners; VectorLogListeners mListeners; ILogFilter* mFilter; }; } // namespace MyGUI #endif // __MYGUI_LOG_SOURCE_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ILayerNode.h0000664000000000000000000000530711721331056020115 0ustar rootroot/*! @file @author Albert Semenov @date 02/2008 */ /* 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; typedef std::vector VectorILayerNode; typedef Enumerator EnumeratorILayerNode; class MYGUI_EXPORT ILayerNode : public IObject { MYGUI_RTTI_DERIVED( ILayerNode ) public: virtual ~ILayerNode() { } // леер, которому мы принадлежим virtual ILayer* getLayer() const = 0; // возвращает отца или nullptr virtual ILayerNode* getParent() const = 0; // создаем дочерний нод virtual ILayerNode* createChildItemNode() = 0; // удаляем дочерний нод virtual void destroyChildItemNode(ILayerNode* _node) = 0; // поднимаем дочерний нод virtual void upChildItemNode(ILayerNode* _node) = 0; // список детей virtual EnumeratorILayerNode getEnumerator() const = 0; // добавляем айтем к ноду virtual void attachLayerItem(ILayerItem* _item) = 0; // удаляем айтем из нода virtual void detachLayerItem(ILayerItem* _root) = 0; // добавляет саб айтем и возвращает рендер айтем virtual RenderItem* addToRenderItem(ITexture* _texture, bool _firstQueue, bool _separate) = 0; // необходимо обновление нода virtual void outOfDate(RenderItem* _item) = 0; // возвращает виджет по позиции virtual ILayerItem* getLayerItemByPoint(int _left, int _top) const = 0; // рисует леер virtual void renderToTarget(IRenderTarget* _target, bool _update) = 0; virtual void resizeView(const IntSize& _viewSize) = 0; }; } // namespace MyGUI #endif // __MYGUI_I_LAYER_NODE_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_SkinManager.h0000664000000000000000000000376711721331054020327 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_SKIN_MANAGER_H__ #define __MYGUI_SKIN_MANAGER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Singleton.h" #include "MyGUI_Enumerator.h" #include "MyGUI_ResourceSkin.h" #include "MyGUI_XmlDocument.h" #include "MyGUI_ResourceManager.h" #include "MyGUI_BackwardCompatibility.h" namespace MyGUI { class MYGUI_EXPORT SkinManager : public Singleton, public MemberObsolete { public: SkinManager(); void initialise(); void shutdown(); /** Get ResourceSkin by name */ ResourceSkin* getByName(const std::string& _name) const; /** Check if skin with specified name exist */ bool isExist(const std::string& _name) const; /** Get default skin name. Default skin used when creating widget with skin that doesn't exist. */ const std::string getDefaultSkin() const; /** Set default skin name. Default skin used when creating widget with skin that doesn't exist. */ void setDefaultSkin(const std::string& _value); private: void createDefault(const std::string& _value); void _load(xml::ElementPtr _node, const std::string& _file, Version _version); private: std::string mDefaultName; bool mIsInitialise; }; } // namespace MyGUI #endif // __MYGUI_SKIN_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_IStateInfo.h0000664000000000000000000000240111721331056020117 0ustar rootroot/*! @file @author Albert Semenov @date 06/2009 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ImageInfo.h0000664000000000000000000000275311721331056017762 0ustar rootroot/*! @file @author Albert Semenov @date 09/2008 */ /* 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 { public: ImageItem() : frame_rate(0) { } public: float frame_rate; std::vector images; }; typedef std::vector VectorImages; struct MYGUI_EXPORT ImageIndexInfo { public: ImageIndexInfo(const std::string& _texture, const IntSize& _size, const float _rate, const std::vector& _frames) : texture(_texture), size(_size), rate(_rate), frames(_frames) { } public: const std::string& texture; const IntSize& size; const float rate; const std::vector& frames; }; } // namespace MyGUI #endif // __MYGUI_IMAGE_INFO_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_IResource.h0000664000000000000000000000337111721331056020021 0ustar rootroot/*! @file @author Albert Semenov @date 09/2008 */ /* 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_Version.h" #include "MyGUI_ISerializable.h" namespace MyGUI { class IResource; typedef IResource* IResourcePtr; class ResourceManager; class MYGUI_EXPORT IResource : public ISerializable { // для серелизации и удаления friend class ResourceManager; MYGUI_RTTI_DERIVED( IResource ) public: const std::string& getResourceName() const { return mResourceName; } private: // constructors and operator =, without implementation, just for private IResource(IResource const&); IResource& operator = (IResource const&); protected: IResource() { } virtual ~IResource() { } virtual void deserialization(xml::ElementPtr _node, Version _version) { _node->findAttribute("name", mResourceName); } protected: std::string mResourceName; }; } // namespace MyGUI #endif // __MYGUI_I_RESOURCE_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ChildSkinInfo.h0000664000000000000000000000273011721331056020603 0ustar rootroot/*! @file @author Albert Semenov @date 12/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_CHILD_SKIN_INFO_H__ #define __MYGUI_CHILD_SKIN_INFO_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_WidgetStyle.h" namespace MyGUI { struct MYGUI_EXPORT ChildSkinInfo { public: ChildSkinInfo(); 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); void addParam(const std::string& _key, const std::string& _value); public: 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ControllerItem.h0000664000000000000000000000401311721331060021050 0ustar rootroot/*! @file @author Albert Semenov @date 01/2008 */ /* 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::CMultiDelegate1 eventPreAction; /** Event : Controller updated (called every frame).\n signature : void method(MyGUI::Widget* _sender)\n @param _sender widget under control */ delegates::CMultiDelegate1 eventUpdateAction; /** Event : After controller finished working.\n signature : void method(MyGUI::Widget* _sender)\n @param _sender widget under control */ delegates::CMultiDelegate1 eventPostAction; }; } // namespace MyGUI #endif // __MYGUI_CONTROLLER_ITEM_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ControllerFadeAlpha.h0000664000000000000000000000360711721331056021774 0ustar rootroot/*! @file @author Albert Semenov @date 01/2008 */ /* 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 _value Alpha that will be as result of changing */ void setAlpha(float _value); /** @param _value Coefficient of alpha changing speed (1. mean that alpha will change from 0 to 1 at 1 second) */ void setCoef(float _value); /** @param _value If true then widget will be inactive after start of alpha changing */ void setEnabled(bool _value); virtual void setProperty(const std::string& _key, const std::string& _value); private: bool addTime(Widget* _widget, float _time); void prepareItem(Widget* _widget); private: float mAlpha; float mCoef; bool mEnabled; }; } // namespace MyGUI #endif // __MYGUI_CONTROLLER_FADE_ALPHA_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_IRenderTarget.h0000664000000000000000000000247511721331054020622 0ustar rootroot/*! @file @author Albert Semenov @date 02/2008 */ /* 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" #include 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_RenderItem.h0000664000000000000000000000456411721331056020164 0ustar rootroot/*! @file @author Albert Semenov @date 02/2008 */ /* 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 setManualRender(bool _value); bool getManualRender() const; void addDrawItem(ISubWidget* _item, size_t _count); void removeDrawItem(ISubWidget* _item); void reallockDrawItem(ISubWidget* _item, size_t _count); void outOfDate(); bool isOutOfDate() const; size_t getNeedVertexCount() const; size_t getVertexCount() const; bool getCurrentUpdate() const; Vertex* getCurrentVertexBuffer() const; void setLastVertexCount(size_t _count); IRenderTarget* getRenderTarget(); bool getCompression(); private: #if MYGUI_DEBUG_MODE == 1 std::string mTextureName; #endif ITexture* mTexture; size_t mNeedVertexCount; bool mOutOfDate; VectorDrawItem mDrawItems; // колличество отрендренных реально вершин size_t mCountVertex; bool mCurrentUpdate; Vertex* mCurrentVertex; size_t mLastVertexCount; IVertexBuffer* mVertexBuffer; IRenderTarget* mRenderTarget; bool mCompression; bool mManualRender; }; } // namespace MyGUI #endif // __MYGUI_RENDER_ITEM_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_MainSkin.h0000664000000000000000000000220211721331056017622 0ustar rootroot/*! @file @author Albert Semenov @date 02/2008 */ /* 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:*/ virtual void _setAlign(const IntSize& _oldsize); }; } // namespace MyGUI #endif // __MYGUI_SUB_SKIN_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ILayer.h0000664000000000000000000000434511721331056017310 0ustar rootroot/*! @file @author Albert Semenov @date 02/2008 */ /* 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() const = 0; // возвращает виджет по позиции virtual ILayerItem* getLayerItemByPoint(int _left, int _top) const = 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 resizeView(const IntSize& _viewSize) = 0; protected: std::string mName; }; } // namespace MyGUI #endif // __MYGUI_I_LAYER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_DynLib.h0000664000000000000000000000563711721331056017311 0ustar rootroot/*! @file @author Denis Koronchik @author Georgiy Evmenov @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_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; /** 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() const; protected: //! Name of library std::string mName; //! Handle to the loaded library. MYGUI_DYNLIB_HANDLE mInstance; }; } // namespace MyGUI #endif // __MYGUI_DYNLIB_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ILogFilter.h0000664000000000000000000000250711721331060020114 0ustar rootroot/*! @file @author Albert Semenov @date 04/2010 */ /* 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_LOG_FILTER_H__ #define __MYGUI_I_LOG_FILTER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_LogLevel.h" namespace MyGUI { class MYGUI_EXPORT ILogFilter { public: virtual ~ILogFilter() { } /** Check if specific log message should be logged.\n For example some log listeners use only messages with high log level. */ virtual bool shouldLog(const std::string& _section, LogLevel _level, const struct tm* _time, const std::string& _message, const char* _file, int _line) { return true; } }; } // namespace MyGUI #endif // __MYGUI_I_LOG_FILTER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_IItem.h0000664000000000000000000000210511721331054017120 0ustar rootroot/*! @file @author Albert Semenov @date 11/2010 */ /* 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_ITEM_H__ #define __MYGUI_I_ITEM_H__ #include "MyGUI_Prerequest.h" namespace MyGUI { class IItemContainer; class MYGUI_EXPORT IItem { public: IItem() { } virtual ~IItem() { } virtual IItemContainer* _getItemContainer() { return nullptr; } }; } // namespace MyGUI #endif // __MYGUI_I_ITEM_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Prerequest.h0000664000000000000000000000554211721331056020262 0ustar rootroot/*! @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 # ifdef MYGUI_CHECK_MEMORY_LEAKS # define _CRTDBG_MAP_ALLOC # include # 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 #ifndef _NATIVE_NULLPTR_SUPPORTED #define nullptr 0 #endif #endif #else #define nullptr 0 #endif #endif namespace MyGUI { class Gui; 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 ToolTipManager; class Widget; class Button; class Window; class ListBox; class EditBox; class ComboBox; class TextBox; class TabControl; class TabItem; class ProgressBar; class ItemBox; class MultiListBox; class MultiListItem; class ImageBox; class MenuControl; class MenuItem; class PopupMenu; class MenuBar; class ScrollBar; class ScrollView; class DDContainer; class Canvas; // Define version #define MYGUI_VERSION_MAJOR 3 #define MYGUI_VERSION_MINOR 2 #define MYGUI_VERSION_PATCH 0 #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 // 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) // also some warnings are disabled in CMake #endif } // namespace MyGUI #include "MyGUI_DeprecatedTypes.h" #endif // __MYGUI_PREREQUEST_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_WidgetToolTip.h0000664000000000000000000000252111721331056020653 0ustar rootroot/*! @file @author Albert Semenov @date 07/2008 */ /* 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" namespace MyGUI { /** Info about tootip state */ struct ToolTipInfo { enum ToolTipType { Hide, Show, Move }; 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ToolTipManager.h0000664000000000000000000000351211721331056021003 0ustar rootroot/*! @file @author Albert Semenov @date 03/2010 */ /* 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_TOOL_TIP_MANAGER_H__ #define __MYGUI_TOOL_TIP_MANAGER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_IUnlinkWidget.h" #include "MyGUI_Singleton.h" namespace MyGUI { class MYGUI_EXPORT ToolTipManager : public Singleton, public IUnlinkWidget { public: ToolTipManager(); void initialise(); void shutdown(); void setDelayVisible(float _value); float getDelayVisible() const; /*internal:*/ void _unlinkWidget(Widget* _widget); private: void notifyEventFrameStart(float _time); void hideToolTip(Widget* _widget); void showToolTip(Widget* _widget, size_t _index, const IntPoint& _point); void moveToolTip(Widget* _widget, size_t _index, const IntPoint& _point); bool isNeedToolTip(Widget* _widget); size_t getToolTipIndex(Widget* _widget) const; private: float mDelayVisible; Widget* mOldFocusWidget; IntPoint mOldMousePoint; bool mToolTipVisible; float mCurrentTime; size_t mOldIndex; bool mNeedToolTip; bool mIsInitialise; }; } // namespace MyGUI #endif // __MYGUI_TOOL_TIP_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Version.h0000664000000000000000000000576711721331056017561 0ustar rootroot/*! @file @author Albert Semenov @date 12/2008 */ /* 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_StringUtility.h" namespace MyGUI { class MYGUI_EXPORT Version { public: Version(unsigned int _major = 0, unsigned int _minor = 0, unsigned int _patch = 0) : mMajor(_major), mMinor(_minor), mPatch(_patch) { } friend bool operator < (Version const& a, Version const& b) { return (a.mMajor < b.mMajor) ? true : (a.mMinor < b.mMinor); } 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 = parse(value); return _stream; } unsigned int getMajor() const { return mMajor; } unsigned int getMinor() const { return mMinor; } unsigned int getPatch() const { return mPatch; } std::string print() const { if (mPatch == 0) return utility::toString(mMajor, ".", mMinor); return utility::toString(mMajor, ".", mMinor, ".", mPatch); } static Version parse(const std::string& _value) { const std::vector& vec = utility::split(_value, "."); if (vec.empty()) return Version(); unsigned int major = utility::parseValue(vec[0]); unsigned int minor = vec.size() > 1 ? utility::parseValue(vec[1]) : 0; unsigned int patch = vec.size() > 2 ? utility::parseValue(vec[2]) : 0; return Version(major, minor, patch); } private: unsigned mMajor : 8; unsigned mMinor : 8; unsigned mPatch : 16; }; } // namespace MyGUI #endif // __MYGUI_VERSION_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ControllerManager.h0000664000000000000000000000455311721331056021542 0ustar rootroot/*! @file @author Albert Semenov @date 01/2008 */ /* 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_Singleton.h" #include "MyGUI_ControllerItem.h" #include "MyGUI_IUnlinkWidget.h" #include "MyGUI_WidgetDefines.h" #include "MyGUI_ActionController.h" namespace MyGUI { class MYGUI_EXPORT ControllerManager : public Singleton, public IUnlinkWidget { public: ControllerManager(); void initialise(); void shutdown(); /** Create controller. @param _type Controller type name. Should be on of internal controllers or registered by user. */ ControllerItem* createItem(const std::string& _type); /** Add controller over widget. If specified widget already have controller with same type previous controller removed. @param _widget to be controlled @param _item controller created through createItem(const std::string& _type) @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 and remove all controllers over specified widget. @param _widget Pointer to widget for removing control from. */ 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; bool mIsInitialise; }; } // namespace MyGUI #endif // __MYGUI_CONTROLLER_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Timer.h0000664000000000000000000000212711721331056017177 0ustar rootroot/*! @file @author Albert Semenov @date 04/2009 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_EditText.h0000664000000000000000000001213011721331056017644 0ustar rootroot/*! @file @author Albert Semenov @date 09/2009 */ /* 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" #include "MyGUI_VertexData.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() const; void setTextColour(const Colour& _value); const Colour& getTextColour() const; void setAlpha(float _value); float getAlpha() const; virtual void setFontName(const std::string& _value); virtual const std::string& getFontName() const; virtual void setFontHeight(int _value); virtual int getFontHeight() const; virtual void createDrawItem(ITexture* _texture, ILayerNode* _node); virtual void destroyDrawItem(); virtual void setTextAlign(Align _value); virtual Align getTextAlign() const; virtual size_t getTextSelectionStart() const; virtual size_t getTextSelectionEnd() const; virtual void setTextSelection(size_t _start, size_t _end); virtual bool getSelectBackground() const; virtual void setSelectBackground(bool _normal); virtual bool isVisibleCursor() const; virtual void setVisibleCursor(bool _value); /** Get invert selected text color property. */ virtual bool getInvertSelected() const; /** Enable or disable inverting color of selected text.\n Enabled (true) by default. */ virtual void setInvertSelected(bool _value); virtual size_t getCursorPosition() const; virtual void setCursorPosition(size_t _index); virtual IntSize getTextSize(); // устанавливает смещение текста в пикселях virtual void setViewOffset(const IntPoint& _point); virtual IntPoint getViewOffset() const; // возвращает положение курсора по произвольному положению virtual size_t getCursorPosition(const IntPoint& _point); // возвращает положение курсора в обсолютных координатах virtual IntCoord getCursorCoord(size_t _position); virtual bool getShadow() const; virtual void setShadow(bool _value); virtual void setShiftText(bool _shift); virtual void setWordWrap(bool _value); virtual void setStateData(IStateInfo* _data); virtual void setShadowColour(const Colour& _value); virtual const Colour& getShadowColour() const; /*internal:*/ virtual void _updateView(); virtual void _correctView(); virtual void _setAlign(const IntSize& _oldsize); private: void _setTextColour(const Colour& _value); void checkVertexSize(); void drawQuad( Vertex*& _vertex, size_t& _vertexCount, const FloatRect& _vertexRect, float _vertexZ, const FloatRect& _textureRect, uint32 _colour) const; void drawGlyph( const RenderTargetInfo& renderTargetInfo, Vertex*& _vertex, size_t& _vertexCount, FloatRect _vertexRect, FloatRect _textureRect, uint32 _colour) const; protected: bool mEmptyView; uint32 mCurrentColourNative; uint32 mInverseColourNative; uint32 mCurrentAlphaNative; uint32 mShadowColourNative; IntCoord mCurrentCoord; UString mCaption; bool mTextOutDate; Align mTextAlign; Colour mColour; Colour mShadowColour; 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; bool mShadow; IntPoint mViewOffset; // смещение текста ILayerNode* mNode; RenderItem* mRenderItem; size_t mCountVertex; bool mIsAddCursorWidth; bool mShiftText; bool mWordWrap; bool mManualColour; int mOldWidth; TextView mTextView; }; } // namespace MyGUI #endif // __MYGUI_EDIT_TEXT_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_MultiListBox.h0000664000000000000000000003204611721331056020521 0ustar rootroot/*! @file @author Albert Semenov @date 04/2008 */ /* 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_BOX_H__ #define __MYGUI_MULTI_LIST_BOX_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Widget.h" #include "MyGUI_ListBox.h" #include "MyGUI_Any.h" #include "MyGUI_BiIndexBase.h" #include "MyGUI_EventPair.h" #include "MyGUI_IItem.h" #include "MyGUI_IItemContainer.h" #include "MyGUI_ResizingPolicy.h" namespace MyGUI { //OBSOLETE typedef delegates::CMultiDelegate5 EventHandle_WidgetIntUTFStringUTFStringBool; typedef delegates::CDelegate5 EventHandle_MultiListPtrSizeTCUTFStringRefCUTFStringRefBoolRef; typedef delegates::CMultiDelegate2 EventHandle_MultiListPtrSizeT; class MYGUI_EXPORT MultiListBox : public Widget, public BiIndexBase, public IItemContainer, public MemberObsolete { MYGUI_RTTI_DERIVED( MultiListBox ) public: MultiListBox(); //! @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); /** @copydoc Widget::setSize(int _width, int _height) */ void setSize(int _width, int _height); /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ void setCoord(int _left, int _top, int _width, int _height); //------------------------------------------------------------------------------// // Methods for work with columns (RU:методы для работы со столбцами) //------------------------------------------------------------------------------// // манипуляции айтемами //! Get number of columns size_t getColumnCount() const; /** Insert new column @param _column New column will be inserted before _column @param _name Name of new column @param _width Width of new column @param _data Any data associated with new column */ void insertColumnAt(size_t _column, const UString& _name, int _width = 0, Any _data = Any::Null); /** Add new column at last position @param _width Width of new column @param _name Name of new column @param _data Any data associated with new column */ void addColumn(const UString& _name, int _width = 0, Any _data = Any::Null); /** Delete column */ void removeColumnAt(size_t _column); /** Delete all columns */ void removeAllColumns(); //! Swap columns at a specified positions void swapColumnsAt(size_t _index1, size_t _index2); //------------------------------------------------------------------------------// // манипуляции отображением /** Set column name @param _column Index of column @param _name New name of column */ void setColumnNameAt(size_t _column, const UString& _name); /** Set column name @param _item column @param _name New name of column */ void setColumnName(MultiListItem* _item, const UString& _name); /** Set column width @param _column Index of column @param _width New width of column */ void setColumnWidthAt(size_t _column, int _width); /** Set column width @param _item column @param _width New width of column */ void setColumnWidth(MultiListItem* _item, int _width); /** Get _column name */ const UString& getColumnNameAt(size_t _column); /** Get _column name */ const UString& getColumnName(MultiListItem* _item); /** Get _column width */ int getColumnWidthAt(size_t _column); /** Sort multilist by column */ void sortByColumn(size_t _column, bool _backward = false); //! Get column index size_t getColumnIndex(MultiListItem* _item); /** Set resizing policy of column. \sa ResizingPolicy @param _item Pointer to column @param _value New resizing policy for column */ void setColumnResizingPolicy(MultiListItem* _item, ResizingPolicy _value); /** Set resizing policy of column. \sa ResizingPolicy @param _index Index of column @param _value New resizing policy for column */ void setColumnResizingPolicyAt(size_t _index, ResizingPolicy _value); //------------------------------------------------------------------------------// // манипуляции данными //! 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); //! Get item data from specified position template ValueType* getColumnDataAt(size_t _index, bool _throw = true) { MYGUI_ASSERT_RANGE(_index, mVectorColumnInfo.size(), "MultiListBox::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); //! 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); //! Get item name from specified position const UString& getItemNameAt(size_t _index); //------------------------------------------------------------------------------// // манипуляции выделениями /** Get index of selected item (ITEM_NONE if none selected) */ size_t getIndexSelected() const; /** Select specified _index */ void setIndexSelected(size_t _index); /** Clear item selection */ void clearIndexSelected(); //------------------------------------------------------------------------------// // манипуляции данными //! 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); //! 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); //! Get item data from specified position template ValueType* getSubItemDataAt(size_t _column, size_t _index, bool _throw = true) { MYGUI_ASSERT_RANGE(_index, mVectorColumnInfo.begin()->list->getItemCount(), "MultiListBox::getSubItemDataAt"); size_t index = BiIndexBase::convertToBack(_index); return getSubItemAt(_column)->getItemDataAt(index, _throw); } /*events:*/ /** Event : Enter pressed or double click.\n signature : void method(MyGUI::MultiListBox* _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::MultiListBox* _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::MultiListBox* _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; /*internal:*/ // IItemContainer impl virtual size_t _getItemCount(); virtual void _addItem(const MyGUI::UString& _name); virtual void _removeItemAt(size_t _index); virtual Widget* _getItemAt(size_t _index); virtual void _setItemNameAt(size_t _index, const UString& _name); virtual const UString& _getItemNameAt(size_t _index); protected: virtual void initialiseOverride(); virtual void shutdownOverride(); virtual void onWidgetCreated(Widget* _widget); virtual void onWidgetDestroy(Widget* _widget); private: void notifyListChangePosition(ListBox* _sender, size_t _position); void notifyListChangeFocus(ListBox* _sender, size_t _position); void notifyListChangeScrollPosition(ListBox* _sender, size_t _position); void notifyButtonClick(Widget* _sender); void notifyListSelectAccept(ListBox* _sender, size_t _position); void updateColumns(); void redrawButtons(); void updateOnlyEmpty(); bool compare(ListBox* _list, size_t _left, size_t _right); void sortList(); void flipList(); Widget* getSeparator(size_t _index); void updateBackSelected(size_t _index); struct ColumnInfo { MultiListItem* item; ListBox* list; Button* button; int width; int realWidth; UString name; Any data; ResizingPolicy sizeType; }; typedef std::vector VectorColumnInfo; void frameEntered(float _frame); void frameAdvise(bool _advise); ListBox* getSubItemAt(size_t _column); int getButtonHeight() const; void _wrapItem(MultiListItem* _item); void _unwrapItem(MultiListItem* _item); void _swapColumnsAt(size_t _index1, size_t _index2); int getColumnWidth(size_t _index, int _freeSpace, size_t _countStars, size_t _lastIndexStar, int _starWidth) const; bool getUpdateByResize(); int updateWidthColumns(size_t& _countStars, size_t& _lastIndexStar); private: int mHeightButton; int mWidthBar; std::string mSkinButton; std::string mSkinList; Widget* mWidgetEmpty; 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; Widget* mHeaderPlace; }; } // namespace MyGUI #endif // __MYGUI_MULTI_LIST_BOX_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_IFont.h0000664000000000000000000000241611721331060017132 0ustar rootroot/*! @file @author Albert Semenov @date 06/2009 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_TextIterator.h0000664000000000000000000000614311721331056020557 0ustar rootroot/*! @file @author Albert Semenov @date 12/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_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(); // возвращает цвет bool getTagColour(UString& _colour) const; // удаляет цвет void clearTagColour(); bool setTagColour(const Colour& _colour); bool setTagColour(UString _colour); // сохраняет текущий итератор bool saveStartPoint(); // возвращает строку от сохраненного итератора до текущего UString getFromStart(); // удаляет от запомненной точки до текущей bool eraseFromStart(); // возвращает текущую псевдо позицию size_t getPosition() const; const UString& getText() const; void insertText(const UString& _insert, bool _multiLine); void clearNewLine(UString& _text); //очищает весь текст void clearText(); // возвращает размер строки 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(); 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) const; 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_LayoutData.h0000664000000000000000000000334211721331060020161 0ustar rootroot/*! @file @author George Evmenov @date 07/2010 */ /* 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_DATA_H__ #define __MYGUI_LAYOUT_DATA_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Common.h" namespace MyGUI { struct MYGUI_EXPORT ControllerInfo { std::string type; MapString properties; }; struct MYGUI_EXPORT WidgetInfo { public: WidgetInfo() : align(Align::Default), style(WidgetStyle::Child), positionType(None) { } public: std::vector childWidgetsInfo; // not map because there might be several properties with same name (for example List items) VectorStringPairs properties; MapString userStrings; std::vector controllers; std::string type; std::string skin; Align align; WidgetStyle style; std::string name; std::string layer; enum PositionType { Pixels, Relative, None }; PositionType positionType; IntCoord intCoord; FloatCoord floatCoord; }; typedef std::vector VectorWidgetInfo; } // namespace MyGUI #endif // __MYGUI_LAYOUT_DATA_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_StringUtility.h0000664000000000000000000002530411721331056020753 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_STRING_UTILITY_H__ #define __MYGUI_STRING_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 == "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 Type& _source, const Type& _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 == "true") || (value == "1")) { _p1 = true; return true; } else if ((value == "False") || (value == "false") || (value == "0")) { _p1 = false; return true; } return false; } inline bool startWith(const std::string& _source, const std::string& _value) { size_t count = _value.size(); if (_source.size() < count) return false; for (size_t index = 0; index < count; ++ index) { if (_source[index] != _value[index]) return false; } return true; } inline bool endWith(const std::string& _source, const std::string& _value) { size_t count = _value.size(); if (_source.size() < count) return false; size_t offset = _source.size() - count; for (size_t index = 0; index < count; ++ index) { if (_source[index + offset] != _value[index]) return false; } return true; } } // namespace utility } // namespace MyGUI #endif // __MYGUI_STRING_UTILITY_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Plugin.h0000664000000000000000000000323011721331060017344 0ustar rootroot/*! @file @author Denis Koronchik @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_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; }; } // namespace MyGUI #endif // __MYGUI_PLUGIN_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_SimpleText.h0000664000000000000000000000240011721331056020207 0ustar rootroot/*! @file @author Albert Semenov @date 02/2008 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_MenuControl.h0000664000000000000000000002642711721331060020370 0ustar rootroot/*! @file @author Albert Semenov @date 11/2008 */ /* 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_CONTROL_H__ #define __MYGUI_MENU_CONTROL_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" #include "MyGUI_IItem.h" #include "MyGUI_IItemContainer.h" namespace MyGUI { typedef delegates::CMultiDelegate2 EventHandle_MenuCtrlPtrMenuItemPtr; typedef delegates::CMultiDelegate1 EventHandle_MenuCtrlPtr; class MYGUI_EXPORT MenuControl : public Widget, public IItemContainer, public MemberObsolete { MYGUI_RTTI_DERIVED( MenuControl ) public: MenuControl(); struct ItemInfo { ItemInfo(MenuItem* _item, const UString& _name, MenuItemType _type, MenuControl* _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) */ MenuControl* 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; //! 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); //! Clear an item data at a specified position void clearItemDataAt(size_t _index); //! Clear an item data void clearItemData(MenuItem* _item); //! Get item data from specified position template ValueType* getItemDataAt(size_t _index, bool _throw = true) { MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::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); //! Get item id from specified position const std::string& getItemIdAt(size_t _index); //! Get item id const std::string& getItemId(MenuItem* _item); /** Get item by id */ MenuItem* getItemById(const std::string& _id); /** Find item by id */ MenuItem* findItemById(const std::string& _id, bool _recursive = false); /** 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); //! Get item from specified position const UString& getItemNameAt(size_t _index); //! Get item from specified position const UString& getItemName(MenuItem* _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); //------------------------------------------------------------------------------// // остальные манипуляции /** 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 */ MenuControl* getItemChildAt(size_t _index); /** Get child item (submenu) from item */ MenuControl* getItemChild(MenuItem* _item); /** Create child item (submenu) for item by index */ MenuControl* createItemChildAt(size_t _index); /** Create child item (submenu) for item */ MenuControl* createItemChild(MenuItem* _item); /** Remove child item (submenu) for item by index */ void removeItemChildAt(size_t _index); /** Remove child item (submenu) for item */ void removeItemChild(MenuItem* _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); /** 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); /** Set mode when clicking on item with submenu generate eventMenuCtrlAccept and closes menu */ void setPopupAccept(bool _value); /** Get mode when clicking on item with submenu generate eventMenuCtrlAccept and closes menu */ bool getPopupAccept() const; /** Get parent menu item or nullptr if no item */ MenuItem* getMenuItemParent(); /** Set vertical alignment mode */ void setVerticalAlignment(bool _value); /** Get vertical alignment mode flag */ bool getVerticalAlignment() const; /*events:*/ /** Event : Enter pressed or mouse clicked.\n signature : void method(MyGUI::MenuControl* _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::MenuControl* _sender)\n @param _sender widget that called this event */ EventHandle_MenuCtrlPtr eventMenuCtrlClose; /*internal:*/ void _notifyDeleteItem(MenuItem* _item); void _notifyDeletePopup(MenuItem* _item); void _notifyUpdateName(MenuItem* _item); void _wrapItemChild(MenuItem* _item, MenuControl* _widget); // IItemContainer impl virtual size_t _getItemCount(); virtual void _addItem(const MyGUI::UString& _name); virtual void _removeItemAt(size_t _index); virtual Widget* _getItemAt(size_t _index); virtual void _setItemNameAt(size_t _index, const UString& _name); virtual const UString& _getItemNameAt(size_t _index); virtual void _setItemSelected(IItem* _item); void _updateItems(size_t _index); void _updateSizeForEmpty(); protected: virtual void initialiseOverride(); virtual void shutdownOverride(); virtual void onKeyChangeRootFocus(bool _focus); virtual void onWidgetCreated(Widget* _widget); virtual void setPropertyOverride(const std::string& _key, const std::string& _value); private: void notifyRootKeyChangeFocus(Widget* _sender, bool _focus); void notifyMouseButtonClick(Widget* _sender); void notifyMouseSetFocus(Widget* _sender, Widget* _new); const std::string& getSkinByType(MenuItemType _type) const; std::string getIconIndexByType(MenuItemType _type) const; void update(); MenuItemType getItemType(bool _submenu, bool _separator) const; 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(); void _setItemChildVisibleAt(size_t _index, bool _visible, bool _smooth); protected: bool mHideByAccept; // нужно ли выбрасывать по нажатию bool mMenuDropMode; bool mIsMenuDrop; bool mHideByLostKey; bool mResizeToContent; private: VectorMenuItemInfo mItemsInfo; std::string mItemNormalSkin; std::string mItemPopupSkin; std::string mItemSeparatorSkin; std::string mSubMenuSkin; std::string mSubMenuLayer; // флаг, чтобы отсеч уведомления от айтемов, при общем шутдауне виджета bool mShutdown; bool mVerticalAlignment; int mDistanceButton; bool mPopupAccept; MenuItem* mOwner; bool mAnimateSmooth; bool mChangeChildSkin; Widget* mClient; }; } // namespace MyGUI #endif // __MYGUI_MENU_CONTROL_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_PopupMenu.h0000664000000000000000000000206211721331056020045 0ustar rootroot/*! @file @author Albert Semenov @date 02/2008 */ /* 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_MenuControl.h" namespace MyGUI { class MYGUI_EXPORT PopupMenu : public MenuControl { MYGUI_RTTI_DERIVED( PopupMenu ) public: PopupMenu(); }; } // namespace MyGUI #endif // __MYGUI_POPUP_MENU_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_MenuBar.h0000664000000000000000000000204611721331056017450 0ustar rootroot/*! @file @author Albert Semenov @date 05/2008 */ /* 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_MenuControl.h" namespace MyGUI { class MYGUI_EXPORT MenuBar : public MenuControl { MYGUI_RTTI_DERIVED( MenuBar ) public: MenuBar(); }; } // namespace MyGUI #endif // __MYGUI_MENU_BAR_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ILogListener.h0000664000000000000000000000264711721331056020466 0ustar rootroot/*! @file @author Albert Semenov @date 04/2010 */ /* 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_LOG_LISTENER_H__ #define __MYGUI_I_LOG_LISTENER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_LogLevel.h" namespace MyGUI { class MYGUI_EXPORT ILogListener { public: virtual ~ILogListener() { } /** Opens log listener. (for example open file) */ virtual void open() { } /** Opens log listener. (for example close file) */ virtual void close() { } /** Flush log listener messages.*/ virtual void flush() { } /** Log message.*/ virtual void log(const std::string& _section, LogLevel _level, const struct tm* _time, const std::string& _message, const char* _file, int _line) { } }; } // namespace MyGUI #endif // __MYGUI_I_LOG_LISTENER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ISubWidgetText.h0000664000000000000000000001133611721331056020774 0ustar rootroot/*! @file @author Albert Semenov @date 12/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_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() const { return 0; } /** Get index of end of selection */ virtual size_t getTextSelectionEnd() const { return 0; } /** Set text selection */ virtual void setTextSelection(size_t _start, size_t _end) { } // интенсивность выделенного текста virtual bool getSelectBackground() const { return true; } virtual void setSelectBackground(bool _normal) { } // нужно ли инвертировать выделение virtual bool getInvertSelected() const { return true; } virtual void setInvertSelected(bool _value) { } // нужно ли показывать тень virtual bool getShadow() const { return false; } virtual void setShadow(bool _value) { } // управление видимостью курсора virtual bool isVisibleCursor() const { return false; } virtual void setVisibleCursor(bool _value) { } // управление положением курсора virtual size_t getCursorPosition() const { return 0; } virtual void setCursorPosition(size_t _index) { } virtual void setWordWrap(bool _value) { } // возвращает положение курсора по произвольному положению // позиция абсолютная, без учета смещений virtual size_t getCursorPosition(const IntPoint& _point) /*const*/ { return 0; } // возвращает положение курсора в обсолютных координатах virtual IntCoord getCursorCoord(size_t _position) /*const*/ { return IntCoord(); } // возвращает положение курсора в обсолютных координатах IntPoint getCursorPoint(size_t _position) /*const*/ { const IntCoord& coord = getCursorCoord(_position); return IntPoint(coord.left + coord.width / 2, coord.top + coord.height / 2); } // возвращает положение курсора в обсолютных координатах IntRect getCursorRect(size_t _position) /*const*/ { const IntCoord& coord = getCursorCoord(_position); return IntRect(coord.left, coord.top, coord.left + coord.width, coord.top + coord.height); } // возвращает размер текста в пикселях virtual IntSize getTextSize() /*const*/ { return IntSize(); } // устанавливает смещение текста в пикселях virtual void setViewOffset(const IntPoint& _point) { } virtual IntPoint getViewOffset() const { return IntPoint(); } virtual void setCaption(const UString& _value) { } virtual const UString& getCaption() const { static UString caption; return caption; } virtual void setTextColour(const Colour& _value) { } virtual const Colour& getTextColour() const { return Colour::Zero; } virtual void setFontName(const std::string& _value) { } virtual const std::string& getFontName() const { static std::string name; return name; } virtual void setFontHeight(int _value) { } virtual int getFontHeight() const { return 0; } virtual void setTextAlign(Align _value) { } virtual Align getTextAlign() const { return Align::Default; } virtual void setShiftText(bool _value) { } virtual void setShadowColour(const Colour& _value) { } virtual const Colour& getShadowColour() const { return Colour::Zero; } }; } // namespace MyGUI #endif // __MYGUI_I_SUB_WIDGET_TEXT_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Precompiled.h0000664000000000000000000000267311721331060020363 0ustar rootroot/*! @file @author Alexander Ptakhin @date 01/2009 */ /* 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_LogManager.h" #include "MyGUI_Singleton.h" #include "MyGUI_Types.h" #include "MyGUI_Any.h" #include "MyGUI_IResource.h" #include "MyGUI_StringUtility.h" #include "MyGUI_MouseButton.h" #include "MyGUI_KeyCode.h" #include "MyGUI_Version.h" #include "MyGUI_WidgetStyle.h" #include "MyGUI_ActionController.h" #include "MyGUI_ControllerFadeAlpha.h" #include "MyGUI_ControllerPosition.h" #include "MyGUI_XmlDocument.h" #include "MyGUI_IObject.h" #include "MyGUI_ISerializable.h" #include "MyGUI_GenericFactory.h" #endif // __MYGUI_PRECOMPILED_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ClipboardManager.h0000664000000000000000000000371511721331054021313 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_CLIPBOARD_MANAGER_H__ #define __MYGUI_CLIPBOARD_MANAGER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Singleton.h" #include "MyGUI_Types.h" #include "MyGUI_UString.h" namespace MyGUI { class MYGUI_EXPORT ClipboardManager : public Singleton { public: ClipboardManager(); 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 bool mIsInitialise; }; } // namespace MyGUI #endif // __MYGUI_CLIPBOARD_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ComboBox.h0000664000000000000000000001567711721331056017645 0ustar rootroot/*! @file @author Albert Semenov @date 12/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_COMBO_BOX_H__ #define __MYGUI_COMBO_BOX_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_EditBox.h" #include "MyGUI_ListBox.h" #include "MyGUI_Any.h" #include "MyGUI_EventPair.h" #include "MyGUI_ControllerFadeAlpha.h" #include "MyGUI_FlowDirection.h" #include "MyGUI_IItem.h" #include "MyGUI_IItemContainer.h" namespace MyGUI { typedef delegates::CMultiDelegate2 EventHandle_ComboBoxPtrSizeT; class MYGUI_EXPORT ComboBox : public EditBox, public IItemContainer, public MemberObsolete { MYGUI_RTTI_DERIVED( ComboBox ) public: ComboBox(); //------------------------------------------------------------------------------// // манипуляции айтемами //! Get number of items size_t getItemCount() const; //! 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); //! 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() const; //! Select specified _index void setIndexSelected(size_t _index); //! Clear item selection void clearIndexSelected(); //------------------------------------------------------------------------------// // манипуляции данными //! 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); //! 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); //------------------------------------------------------------------------------// // манипуляции выдимостью //! Move all elements so specified becomes visible void beginToItemAt(size_t _index); //! Move all elements so first becomes visible void beginToItemFirst(); //! Move all elements so last becomes visible void beginToItemLast(); //! Move all elements so selected becomes visible void beginToItemSelected(); //------------------------------------------------------------------------------------// // методы для управления отображением //! Set drop list mode (text can not be edited) void setComboModeDrop(bool _value); //! Get drop list mode flag bool getComboModeDrop() const; //! Set smooth show of list void setSmoothShow(bool _value); //! Get smooth show of list flag bool getSmoothShow() const; //! Get max list length void setMaxListLength(int _value); //! Set max list length int getMaxListLength() const; // RENAME //! Set direction, where drop down list appears (TopToBottom by default). void setFlowDirection(FlowDirection _value); //! Get direction, where drop down list appears. FlowDirection getFlowDirection() const; /*events:*/ /** Event : Enter pressed in combo mode or item selected in drop down list and combo mode drop enabled (see void ComboBox::setComboModeDrop(bool _value)).\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:*/ // IItemContainer impl virtual size_t _getItemCount(); virtual void _addItem(const MyGUI::UString& _name); virtual void _removeItemAt(size_t _index); virtual void _setItemNameAt(size_t _index, const UString& _name); virtual const UString& _getItemNameAt(size_t _index); virtual void _resetContainer(bool _update); protected: virtual void initialiseOverride(); virtual void shutdownOverride(); virtual void onKeyButtonPressed(KeyCode _key, Char _char); virtual void setPropertyOverride(const std::string& _key, const std::string& _value); private: void notifyButtonPressed(Widget* _sender, int _left, int _top, MouseButton _id); void notifyListLostFocus(Widget* _sender, MyGUI::Widget* _new); void notifyListSelectAccept(ListBox* _widget, size_t _position); void notifyListMouseItemActivate(ListBox* _widget, size_t _position); void notifyListChangePosition(ListBox* _widget, size_t _position); void notifyMouseWheel(Widget* _sender, int _rel); void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id); void notifyEditTextChange(EditBox* _sender); void notifyToolTip(Widget* _sender, const ToolTipInfo& _info); void showList(); void hideList(); void actionWidgetHide(Widget* _widget); ControllerFadeAlpha* createControllerFadeAlpha(float _alpha, float _coef, bool _enable); IntCoord calculateListPosition(); private: Button* mButton; ListBox* mList; bool mListShow; int mMaxListLength; size_t mItemIndex; bool mModeDrop; bool mDropMouse; bool mShowSmooth; FlowDirection mFlowDirection; }; } // namespace MyGUI #endif // __MYGUI_COMBO_BOX_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_UString.h0000664000000000000000000015670711721331056017530 0ustar rootroot// 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 MyGUI 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 MyGUI is or will be distributed. // // MyGUI 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. // // MyGUI 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" // these are explained later #include #include #include #if MYGUI_COMPILER == MYGUI_COMPILER_MSVC // disable: warning C4275: non dll-interface class '***' used as base for dll-interface clas '***' # pragma warning (disable : 4275) #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 MYGUI_COMPILER != MYGUI_COMPILER_GCCE #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 #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_t or uint32_t. #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_t. # if defined(_NATIVE_WCHAR_T_DEFINED) # define MYGUI_IS_NATIVE_WCHAR_T 1 # else # define MYGUI_IS_NATIVE_WCHAR_T 0 # endif #elif MYGUI_PLATFORM == MYGUI_PLATFORM_SYMBIAN # define MYGUI_IS_NATIVE_WCHAR_T 0 #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 MYGUI_EXPORT 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 = static_cast(~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 MYGUI_EXPORT 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 MYGUI_EXPORT _base_iterator: public std::iterator { /* i don't know why the beautifier is freaking out on this line */ friend class UString; protected: _base_iterator(); void _seekFwd( size_type c ); void _seekRev( size_type c ); void _become( const _base_iterator& i ); bool _test_begin() const; bool _test_end() const; size_type _get_index() const; void _jump_to( size_type index ); unicode_char _getCharacter() const; int _setCharacter( unicode_char uc ); void _moveNext(); void _movePrev(); dstring::iterator mIter; UString* mString; }; //######################################################################### // FORWARD ITERATORS //######################################################################### class _const_fwd_iterator; // forward declaration //! forward iterator for UString class MYGUI_EXPORT _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 ); //! pre-increment _fwd_iterator& operator++(); //! post-increment _fwd_iterator operator++( int ); //! pre-decrement _fwd_iterator& operator--(); //! post-decrement _fwd_iterator operator--( int ); //! addition operator _fwd_iterator operator+( difference_type n ); //! subtraction operator _fwd_iterator operator-( difference_type n ); //! addition assignment operator _fwd_iterator& operator+=( difference_type n ); //! subtraction assignment operator _fwd_iterator& operator-=( difference_type n ); //! dereference operator value_type& operator*() const; //! dereference at offset operator value_type& operator[]( difference_type n ) const; //! advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream _fwd_iterator& moveNext(); //! rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream _fwd_iterator& movePrev(); //! Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed) unicode_char getCharacter() const; //! 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 ); }; //######################################################################### //! const forward iterator for UString class MYGUI_EXPORT _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 ); _const_fwd_iterator( const _fwd_iterator& i ); //! pre-increment _const_fwd_iterator& operator++(); //! post-increment _const_fwd_iterator operator++( int ); //! pre-decrement _const_fwd_iterator& operator--(); //! post-decrement _const_fwd_iterator operator--( int ); //! addition operator _const_fwd_iterator operator+( difference_type n ); //! subtraction operator _const_fwd_iterator operator-( difference_type n ); //! addition assignment operator _const_fwd_iterator& operator+=( difference_type n ); //! subtraction assignment operator _const_fwd_iterator& operator-=( difference_type n ); //! dereference operator const value_type& operator*() const; //! dereference at offset operator const value_type& operator[]( difference_type n ) const; //! advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream _const_fwd_iterator& moveNext(); //! rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream _const_fwd_iterator& movePrev(); //! Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed) unicode_char getCharacter() const; //! 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 MYGUI_EXPORT _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 ); //! pre-increment _rev_iterator& operator++(); //! post-increment _rev_iterator operator++( int ); //! pre-decrement _rev_iterator& operator--(); //! post-decrement _rev_iterator operator--( int ); //! addition operator _rev_iterator operator+( difference_type n ); //! subtraction operator _rev_iterator operator-( difference_type n ); //! addition assignment operator _rev_iterator& operator+=( difference_type n ); //! subtraction assignment operator _rev_iterator& operator-=( difference_type n ); //! dereference operator value_type& operator*() const; //! dereference at offset operator value_type& operator[]( difference_type n ) const; }; //######################################################################### //! const reverse iterator for UString class MYGUI_EXPORT _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 ); _const_rev_iterator( const _rev_iterator& i ); //! pre-increment _const_rev_iterator& operator++(); //! post-increment _const_rev_iterator operator++( int ); //! pre-decrement _const_rev_iterator& operator--(); //! post-decrement _const_rev_iterator operator--( int ); //! addition operator _const_rev_iterator operator+( difference_type n ); //! subtraction operator _const_rev_iterator operator-( difference_type n ); //! addition assignment operator _const_rev_iterator& operator+=( difference_type n ); //! subtraction assignment operator _const_rev_iterator& operator-=( difference_type n ); //! dereference operator const value_type& operator*() const; //! dereference at offset operator const value_type& operator[]( difference_type n ) const; //! 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(); //! copy constructor UString( const UString& copy ); //! \a length copies of \a ch UString( size_type length, const code_point& ch ); //! duplicate of nul-terminated sequence \a str UString( const code_point* str ); //! duplicate of \a str, \a length code points long UString( const code_point* str, size_type 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 ); #if MYGUI_IS_NATIVE_WCHAR_T //! duplicate of nul-terminated \c wchar_t array UString( const wchar_t* w_str ); //! duplicate of \a w_str, \a length characters long UString( const wchar_t* w_str, size_type length ); #endif //! duplicate of \a wstr UString( const std::wstring& wstr ); //! duplicate of nul-terminated C-string \a c_str (UTF-8 encoding) UString( const char* c_str ); //! duplicate of \a c_str, \a length characters long (UTF-8 encoding) UString( const char* c_str, size_type length ); //! duplicate of \a str (UTF-8 encoding) UString( const std::string& str ); //! destructor ~UString(); //@} ////////////////////////////////////////////////////////////////////////// //!\name Utility functions //@{ //! Returns the number of code points in the current string size_type size() const; //! Returns the number of code points in the current string size_type length() const; //! Returns the number of Unicode characters in the string /*! Executes in linear time. */ size_type length_Characters() const; //! returns the maximum number of UTF-16 code points that the string can hold size_type max_size() const; //! sets the capacity of the string to at least \a size code points void reserve( size_type 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 ); //! exchanges the elements of the current string with those of \a from void swap( UString& from ); //! returns \c true if the string has no elements, \c false otherwise bool empty() const; //! returns a pointer to the first character in the current string const code_point* c_str() const; //! returns a pointer to the first character in the current string const code_point* data() const; //! returns the number of elements that the string can hold before it will need to allocate more space size_type capacity() const; //! deletes all of the elements in the string void 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; //! appends \a val to the end of the string void push_back( unicode_char val ); #if MYGUI_IS_NATIVE_WCHAR_T //! appends \a val to the end of the string void push_back( wchar_t 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 ); //! appends \a val to the end of the string /*! Limited to characters under the 127 value barrier. */ void push_back( char val ); //! returns \c true if the given Unicode character \a ch is in this string bool inString( unicode_char ch ) const; //@} ////////////////////////////////////////////////////////////////////////// //!\name Stream variations //@{ //! returns the current string in UTF-8 form within a std::string const std::string& asUTF8() const; //! returns the current string in UTF-8 form as a nul-terminated char array const char* asUTF8_c_str() const; //! returns the current string in UTF-32 form within a utf32string const utf32string& asUTF32() const; //! returns the current string in UTF-32 form as a nul-terminated unicode_char array const unicode_char* asUTF32_c_str() const; //! returns the current string in the native form of std::wstring const std::wstring& asWStr() const; //! returns the current string in the native form of a nul-terminated wchar_t array const wchar_t* asWStr_c_str() const; //@} ////////////////////////////////////////////////////////////////////////// //!\name Single Character Access //@{ //! returns a reference to the element in the string at index \c loc code_point& at( size_type loc ); //! returns a reference to the element in the string at index \c loc const code_point& at( size_type loc ) const; //! 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; //! 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 ); //@} ////////////////////////////////////////////////////////////////////////// //!\name iterator acquisition //@{ //! returns an iterator to the first element of the string iterator begin(); //! returns an iterator to the first element of the string const_iterator begin() const; //! returns an iterator just past the end of the string iterator end(); //! returns an iterator just past the end of the string const_iterator end() const; //! returns a reverse iterator to the last element of the string reverse_iterator rbegin(); //! returns a reverse iterator to the last element of the string const_reverse_iterator rbegin() const; //! returns a reverse iterator just past the beginning of the string reverse_iterator rend(); //! returns a reverse iterator just past the beginning of the string const_reverse_iterator rend() const; //@} ////////////////////////////////////////////////////////////////////////// //!\name assign //@{ //! gives the current string the values from \a start to \a end UString& assign( iterator start, iterator end ); //! assign \a str to the current string UString& assign( const UString& str ); //! assign the nul-terminated \a str to the current string UString& assign( const code_point* str ); //! assign the first \a num characters of \a str to the current string UString& assign( const code_point* str, size_type num ); //! 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 ); //! assign \a num copies of \a ch to the current string UString& assign( size_type num, const code_point& ch ); //! assign \a wstr to the current string (\a wstr is treated as a UTF-16 stream) UString& assign( const std::wstring& wstr ); #if MYGUI_IS_NATIVE_WCHAR_T //! assign \a w_str to the current string UString& assign( const wchar_t* w_str ); //! assign the first \a num characters of \a w_str to the current string UString& assign( const wchar_t* w_str, size_type num ); #endif //! assign \a str to the current string (\a str is treated as a UTF-8 stream) UString& assign( const std::string& str ); //! assign \a c_str to the current string (\a c_str is treated as a UTF-8 stream) UString& assign( const char* c_str ); //! 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 ); //@} ////////////////////////////////////////////////////////////////////////// //!\name append //@{ //! appends \a str on to the end of the current string UString& append( const UString& str ); //! appends \a str on to the end of the current string UString& append( const code_point* str ); //! 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 ); //! appends \a num characters of \a str on to the end of the current string UString& append( const code_point* str, size_type num ); //! appends \a num repetitions of \a ch on to the end of the current string UString& append( size_type num, code_point ch ); //! appends the sequence denoted by \a start and \a end on to the end of the current string UString& append( iterator start, iterator end ); #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 ); //! appends \a num repetitions of \a ch on to the end of the current string UString& append( size_type num, wchar_t 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 ); //! 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 ); //! 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 ); //@} ////////////////////////////////////////////////////////////////////////// //!\name insert //@{ //! inserts \a ch before the code point denoted by \a i iterator insert( iterator i, const code_point& ch ); //! inserts \a str into the current string, at location \a index UString& insert( size_type index, const UString& str ); //! 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 ); //! 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 ); //! 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 ); #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 ); #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 ); //! 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 ); #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 ); #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 ); //! 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 ); //! 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 ); #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 ); #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 ); //! 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 ); //@} ////////////////////////////////////////////////////////////////////////// //!\name erase //@{ //! removes the code point pointed to by \a loc, returning an iterator to the next character iterator erase( iterator loc ); //! 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 ); //! removes \a num code points from the current string, starting at \a index UString& erase( size_type index = 0, size_type num = npos ); //@} ////////////////////////////////////////////////////////////////////////// //!\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 ); //! 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 ); //! 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 ); //! 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 ); //! 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 ); //! 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 ); //@} ////////////////////////////////////////////////////////////////////////// //!\name compare //@{ //! compare \a str to the current string int compare( const UString& str ) const; //! compare \a str to the current string int compare( const code_point* str ) const; //! 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; //! 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; //! 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; #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; #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; //@} ////////////////////////////////////////////////////////////////////////// //!\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; //! 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; //! 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; #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; #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; //! 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; #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; #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; //! 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; //! 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; //! 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; #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; #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; //! 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; #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; #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; //@} ////////////////////////////////////////////////////////////////////////// //!\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; //! 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; //! 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; #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; #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; //! 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; //! 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; //! 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; #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; #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; //! 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; //! 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; //! 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; #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; //! 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; //! 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; //! 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; #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; #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; //@} ////////////////////////////////////////////////////////////////////////// //!\name Operators //@{ //! less than operator bool operator<( const UString& right ) const; //! less than or equal operator bool operator<=( const UString& right ) const; //! greater than operator bool operator>( const UString& right ) const; //! greater than or equal operator bool operator>=( const UString& right ) const; //! equality operator bool operator==( const UString& right ) const; //! inequality operator bool operator!=( const UString& right ) const; //! assignment operator, implicitly casts all compatible types UString& operator=( const UString& s ); //! assignment operator UString& operator=( code_point ch ); //! assignment operator UString& operator=( char ch ); #if MYGUI_IS_NATIVE_WCHAR_T //! assignment operator UString& operator=( wchar_t ch ); #endif //! assignment operator UString& operator=( unicode_char ch ); //! code point dereference operator code_point& operator[]( size_type index ); //! code point dereference operator const code_point& operator[]( size_type index ) const; //@} ////////////////////////////////////////////////////////////////////////// //!\name Implicit Cast Operators //@{ //! implicit cast to std::string operator std::string() const; //! implicit cast to std::wstring operator std::wstring() const; //@} ////////////////////////////////////////////////////////////////////////// //!\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 ); //! returns \c true if \a cp matches the signature of a surrogate pair lead character static bool _utf16_surrogate_lead( code_point cp ); //! returns \c true if \a cp matches the signature of a surrogate pair following character static bool _utf16_surrogate_follow( code_point cp ); //! estimates the number of UTF-16 code points in the sequence starting with \a cp static size_t _utf16_char_length( code_point cp ); //! 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 ); //! 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 ); //! 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] ); //@} ////////////////////////////////////////////////////////////////////////// //!\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 ); //! estimates the number of UTF-8 code points in the sequence starting with \a cp static size_t _utf8_char_length( unsigned char cp ); //! 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 ); //! 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 ); //! 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] ); //! verifies a UTF-8 stream, returning the total number of Unicode characters found static size_type _verifyUTF8( const unsigned char* c_str ); //! verifies a UTF-8 stream, returning the total number of Unicode characters found static size_type _verifyUTF8( const std::string& str ); //@} 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(); /////////////////////////////////////////////////////////////////////// // Scratch buffer //! auto cleans the scratch buffer using the proper delete for the stored type void _cleanBuffer() const; //! create a std::string in the scratch buffer area void _getBufferStr() const; //! create a std::wstring in the scratch buffer area void _getBufferWStr() const; //! create a utf32string in the scratch buffer area void _getBufferUTF32Str() const; void _load_buffer_UTF8() const; void _load_buffer_WStr() const; void _load_buffer_UTF32() const; 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 { 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(); } } // namespace MyGUI #if MYGUI_COMPILER == MYGUI_COMPILER_MSVC # pragma warning (default : 4275) #endif #endif // __MYGUI_U_STRING_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ResourceImageSetData.h0000664000000000000000000000247311721331060022116 0ustar rootroot/*! @file @author Albert Semenov @date 09/2010 */ /* 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_DATA_H__ #define __MYGUI_RESOURCE_IMAGE_SET_DATA_H__ #include "MyGUI_Prerequest.h" namespace MyGUI { 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; } // namespace MyGUI #endif // __MYGUI_RESOURCE_IMAGE_SET_DATA_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_LogLevel.h0000664000000000000000000000562011721331056017631 0ustar rootroot/*! @file @author Albert Semenov @date 04/2010 */ /* 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_LEVEL_H__ #define __MYGUI_LOG_LEVEL_H__ #include "MyGUI_Prerequest.h" namespace MyGUI { struct MYGUI_EXPORT LogLevel { enum Enum { Info, // Информационное сообщение. Warning, // Несущественная проблема. Error, // Устранимая ошибка. Critical, // Неустранимая ошибка или сбой в работе приложения. MAX }; LogLevel() : value(Info) { } LogLevel(Enum _value) : value(_value) { } static LogLevel parse(const std::string& _value) { LogLevel 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; } friend bool operator < (LogLevel const& a, LogLevel const& b) { return a.value < b.value; } friend bool operator >= (LogLevel const& a, LogLevel const& b) { return !(a < b); } friend bool operator > (LogLevel const& a, LogLevel const& b) { return (b < a); } friend bool operator <= (LogLevel const& a, LogLevel const& b) { return !(a > b); } friend bool operator == (LogLevel const& a, LogLevel const& b) { return !(a < b) && !(a > b); } friend bool operator != (LogLevel const& a, LogLevel const& b) { return !(a == b); } friend std::ostream& operator << (std::ostream& _stream, const LogLevel& _value) { _stream << _value.getValueName(_value.value); return _stream; } friend std::istream& operator >> (std::istream& _stream, LogLevel& _value) { std::string value; _stream >> value; _value = parse(value); return _stream; } std::string print() const { return getValueName(value); } private: const char* getValueName(int _index) const { static const char* values[MAX + 1] = { "Info", "Warning", "Error", "Critical", "" }; return values[(_index < MAX && _index >= 0) ? _index : MAX]; } private: Enum value; }; } // namespace MyGUI #endif // __MYGUI_LOG_LEVEL_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_IBItemInfo.h0000664000000000000000000000615311721331056020047 0ustar rootroot/*! @file @author Albert Semenov @date 11/2008 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_FontData.h0000664000000000000000000000457311721331056017626 0ustar rootroot/*! @file @author Albert Semenov @date 06/2009 */ /* 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 { namespace FontCodeType { enum Enum { Tab = 0x0009, LF = 0x000A, CR = 0x000D, Space = 0x0020, NEL = 0x0085, // The following are special code points. These are used represent displayable text elements that do not correspond to // any actual Unicode code point. To prevent collisions, they must be defined with values higher than that of the // highest valid Unicode code point (0x10FFFF as of Unicode 6.1). Selected = 0xFFFFFFFC, // Used for rendering text selections when they have input focus. SelectedBack = 0xFFFFFFFD, // Used for rendering text selections when they don't have input focus. Cursor = 0xFFFFFFFE, // Used for rendering the blinking text cursor. NotDefined = 0xFFFFFFFF // Used to render substitute glyphs for characters that aren't supported by the current font. }; } // информация об одном символе struct GlyphInfo { GlyphInfo( Char _codePoint = 0U, float _width = 0.0f, float _height = 0.0f, float _advance = 0.0f, float _bearingX = 0.0f, float _bearingY = 0.0f, const FloatRect& _uvRect = FloatRect()) : codePoint(_codePoint), width(_width), height(_height), advance(_advance), bearingX(_bearingX), bearingY(_bearingY), uvRect(_uvRect) { } Char codePoint; float width; float height; float advance; float bearingX; float bearingY; FloatRect uvRect; }; typedef std::vector VectorGlyphInfo; } // namespace MyGUI #endif // __MYGUI_FONT_DATA_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Delegate.h0000664000000000000000000001276011721331060017630 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_DELEGATE_H__ #define __MYGUI_DELEGATE_H__ #include "MyGUI_Diagnostic.h" #include #ifndef MYGUI_RTTI_DISABLE_TYPE_INFO #include #endif // 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" // пять параметров #define MYGUI_SUFFIX 6 #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, TP6 p6 #define MYGUI_ARGS p1, p2, p3, p4, p5, p6 #define MYGUI_TYPENAME typename #include "MyGUI_DelegateImplement.h" } // namespace MyGUI #endif // __MYGUI_DELEGATE_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_EventPair.h0000664000000000000000000001231711721331060020011 0ustar rootroot/*! @file @author Albert Semenov @date 10/2008 */ /* 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; } MYGUI_OBSOLETE("use : operator += ") void operator = (typename Event::IDelegate* _delegate) { m_eventObsolete = nullptr; m_event = _delegate; } template MYGUI_OBSOLETE("use : signature : Event::IDelegate * _delegate") void operator += (T* _delegate) { m_eventObsolete += _delegate; m_event.clear(); } void operator += (typename Event::IDelegate* _delegate) { m_eventObsolete.clear(); m_event += _delegate; } template MYGUI_OBSOLETE("use : signature : Event::IDelegate * _delegate") void operator -= (T* _delegate) { m_eventObsolete -= _delegate; m_event.clear(); } void operator -= (typename Event::IDelegate* _delegate) { m_eventObsolete.clear(); 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; }; template class EventPair3to4 { public: template MYGUI_OBSOLETE("use : signature : Event::IDelegate * _delegate") void operator = (T* _delegate) { m_eventObsolete = _delegate; m_event = nullptr; } MYGUI_OBSOLETE("use : operator += ") void operator = (typename Event::IDelegate* _delegate) { m_eventObsolete = nullptr; m_event = _delegate; } template MYGUI_OBSOLETE("use : signature : Event::IDelegate * _delegate") void operator += (T* _delegate) { m_eventObsolete += _delegate; m_event.clear(); } void operator += (typename Event::IDelegate* _delegate) { m_eventObsolete.clear(); m_event += _delegate; } template MYGUI_OBSOLETE("use : signature : Event::IDelegate * _delegate") void operator -= (T* _delegate) { m_eventObsolete -= _delegate; m_event.clear(); } void operator -= (typename Event::IDelegate* _delegate) { m_eventObsolete.clear(); m_event -= _delegate; } template void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4 ) { m_eventObsolete(p1, p2, p3); m_event(p1, p2, p3, p4); } bool empty() const { return m_eventObsolete.empty() && m_event.empty(); } public: EventObsolete m_eventObsolete; Event m_event; }; } // namespace MyGUI #endif // __MYGUI_EVENT_PAIR_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_OverlappedLayer.h0000664000000000000000000000415011721331060021206 0ustar rootroot/*! @file @author Albert Semenov @date 02/2008 */ /* 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() const; // возвращает виджет по позиции virtual ILayerItem* getLayerItemByPoint(int _left, int _top) const; virtual IntPoint getPosition(int _left, int _top) const; virtual const IntSize& getSize() const; // рисует леер virtual void renderToTarget(IRenderTarget* _target, bool _update); virtual void resizeView(const IntSize& _viewSize); bool isOutOfDate() const; protected: bool mIsPick; VectorILayerNode mChildItems; bool mOutOfDate; IntSize mViewSize; }; } // namespace MyGUI #endif // __MYGUI_OVERLAPPED_LAYER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_WidgetTranslate.h0000664000000000000000000000374111721331054021221 0ustar rootroot/*! @file @author Albert Semenov @date 05/2008 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_WidgetStyle.h0000664000000000000000000000514111721331060020355 0ustar rootroot/*! @file @author Albert Semenov @date 12/2008 */ /* 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_STYLE_H__ #define __MYGUI_WIDGET_STYLE_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 }; WidgetStyle() : value(MAX) { } WidgetStyle(Enum _value) : value(_value) { } 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; } 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 = 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_STYLE_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ILayerItem.h0000664000000000000000000000261011721331060020113 0ustar rootroot/*! @file @author Albert Semenov @date 02/2008 */ /* 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) const = 0; virtual const IntCoord& getLayerItemCoord() const = 0; virtual void resizeLayerItemView(const IntSize& _oldView, const IntSize& _newView) = 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_SubWidgetInfo.h0000664000000000000000000000243711721331056020634 0ustar rootroot/*! @file @author Albert Semenov @date 26/2009 */ /* 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 { public: SubWidgetInfo(const std::string& _type, const IntCoord& _coord, Align _align) : coord(_coord), align(_align), type(_type) { } public: IntCoord coord; Align align; std::string type; }; typedef std::vector VectorSubWidgetInfo; } // namespace MyGUI #endif // __MYGUI_SUB_WIDGET_INFO_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_XmlDocument.h0000664000000000000000000002406411721331056020362 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_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; ElementPtr 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 = "", ElementType _type = ElementType::Normal); void removeChild(ElementPtr _child); template void addAttribute(const std::string& _key, const T& _value) { addAttribute(_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) { addContent(utility::toString(_content)); } void addContent(const std::string& _content); template void setContent(const T& _content) { setContent(utility::toString(_content)); } void setContent(const std::string& _content); void clear(); bool findAttribute(const std::string& _name, std::string& _value); std::string findAttribute(const std::string& _name); const std::string& getName() const; const std::string& getContent() const; const VectorAttributes& getAttributes() const; ElementPtr getParent() const; ElementEnumerator getElementEnumerator(); ElementType getType() const; 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() const { 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); 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); void clear(); std::string getLastError(); void clearLastError(); ElementPtr createDeclaration(const std::string& _version = "1.0", const std::string& _encoding = "UTF-8"); ElementPtr createRoot(const std::string& _name); ElementPtr getRoot() const; /*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); void setLastFileError(const std::wstring& _filename); 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_DDItemInfo.h0000664000000000000000000000631611721331054020043 0ustar rootroot/*! @file @author Albert Semenov @date 01/2008 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ResourceImageSetPointer.h0000664000000000000000000000275011721331060022663 0ustar rootroot/*! @file @author Albert Semenov @date 06/2009 */ /* 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(ImageBox* _image); virtual void setPosition(ImageBox* _image, const IntPoint& _point); private: IntPoint mPoint; IntSize mSize; ResourceImageSetPtr mImageSet; }; } // namespace MyGUI #endif // __MYGUI_RESOURCE_IMAGE_SET_POINTER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ISubWidgetRect.h0000664000000000000000000000235011721331056020741 0ustar rootroot/*! @file @author Albert Semenov @date 09/2008 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ISubWidget.h0000664000000000000000000000401011721331056020116 0ustar rootroot/*! @file @author Albert Semenov @date 09/2008 */ /* 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: ISubWidget() : mVisible(true) { } 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; virtual void setAlign(Align _value) { mAlign = _value; } virtual void setVisible(bool _value) { mVisible = _value; } virtual void _updateView() { } virtual void _correctView() { } virtual void _setAlign(const IntSize& _oldsize) { } virtual void doManualRender(IVertexBuffer* _buffer, ITexture* _texture, size_t _count) { } protected: Align mAlign; bool mVisible; }; } // namespace MyGUI #endif // __MYGUI_I_SUB_WIDGET_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Canvas.h0000664000000000000000000001655611721331056017345 0ustar rootroot/*! @file @author Alexander Ptakhin @date 01/2009 */ /* 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 loosing 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::CMultiDelegate1 EventHandle_CanvasPtr; typedef delegates::CDelegate2 EventHandle_CanvasPtrEvent; //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; /// Returns real width of texture. int getTextureRealWidth() const; /// Returns real height of texture. int getTextureRealHeight() const; /// Returns real _size of texture. IntSize getTextureRealSize() const; /// Returns needed width while creating texture. int getTextureSrcWidth() const; /// Returns needed height while creating texture. int getTextureSrcHeight() const; /// Returns needed sizes while creating texture. IntSize getTextureSrcSize() const; /// Returns needed sizes while creating texture. PixelFormat getTextureFormat() const; /// Returns name of the current texture. const std::string& getTextureName() const; //! @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); /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ void setCoord(int _left, int _top, int _width, int _height); /// Returns resize mode TextureResizeMode getResizeMode() const; /// Sets resize mode of texture \sa TextureResizeMode void setResizeMode(TextureResizeMode _value); /// 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; /// Returns true if we own the texture, otherwise false. \sa mManaged bool isTextureManaged() const; /// Reurns interface texture. ITexture* getTexture() const; /// 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); /// Returns default GUI texture usage static TextureUsage getDefaultTextureUsage(); /// Returns default GUI texture format static PixelFormat getDefaultTextureFormat(); /*events:*/ /** Event : Notify user texture instance will be changed \sa requestUpdateCanvas.\n signature : void method(MyGUI::Canvas* _canvas)\n @param _canvas, which will be updated */ EventHandle_CanvasPtr 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 */ EventHandle_CanvasPtrEvent requestUpdateCanvas; protected: virtual void shutdownOverride(); virtual void initialiseOverride(); /// 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(); /// For updating once per frame. void frameAdvise(bool _advise); /// For updating once per frame. void frameEntered(float _time); virtual void textureInvalidate(ITexture* _texture); void _setUVSet(const FloatRect& _rect); 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; bool mInvalidateData; }; } // namespace MyGUI #endif // __MYGUI_CANVAS_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_PointerManager.h0000664000000000000000000000653111721331056021035 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_POINTER_MANAGER_H__ #define __MYGUI_POINTER_MANAGER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Singleton.h" #include "MyGUI_IUnlinkWidget.h" #include "MyGUI_ImageBox.h" #include "MyGUI_IPointer.h" #include "MyGUI_BackwardCompatibility.h" namespace MyGUI { class MYGUI_EXPORT PointerManager : public Singleton, public IUnlinkWidget, public MemberObsolete { public: PointerManager(); void initialise(); void shutdown(); /** Show or hide mouse pointer */ void setVisible(bool _visible); /** Is mouse pointer visible */ bool isVisible() const; /** 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() const; /** Set default pointer */ void setDefaultPointer(const std::string& _value); /** Get layer name where pointer rendered */ const std::string& getLayerName() const; /** Set layer where pointer rendered */ void setLayerName(const std::string& _value); /** Get pointer resource */ IPointer* getByName(const std::string& _name) const; /*events:*/ /** 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; private: void _unlinkWidget(Widget* _widget); void _load(xml::ElementPtr _node, const std::string& _file, Version _version); // создает виджет 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(); 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; ImageBox* mMousePointer; IPointer* mPointer; std::string mCurrentMousePointer; bool mIsInitialise; }; } // namespace MyGUI #endif // __MYGUI_POINTER_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_IVertexBuffer.h0000664000000000000000000000226311721331060020633 0ustar rootroot/*! @file @author Albert Semenov @date 04/2009 */ /* 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 setVertexCount(size_t _value) = 0; virtual size_t getVertexCount() = 0; virtual Vertex* lock() = 0; virtual void unlock() = 0; }; } // namespace MyGUI #endif // __MYGUI_I_VERTEX_BUFFER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ResourceManualPointer.h0000664000000000000000000000270411721331060022401 0ustar rootroot/*! @file @author Albert Semenov @date 06/2009 */ /* 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(ImageBox* _image); virtual void setPosition(ImageBox* _image, const IntPoint& _point); private: IntPoint mPoint; IntSize mSize; IntCoord mTextureCoord; std::string mTexture; }; } // namespace MyGUI #endif // __MYGUI_RESOURCE_MANUAL_POINTER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ResourceTrueTypeFont.h0000664000000000000000000001670011721331056022241 0ustar rootroot/*! @file @author Albert Semenov @date 06/2009 */ /* 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" #ifdef MYGUI_USE_FREETYPE #include #include FT_FREETYPE_H #endif // MYGUI_USE_FREETYPE namespace MyGUI { class MYGUI_EXPORT ResourceTrueTypeFont : public IFont { MYGUI_RTTI_DERIVED( ResourceTrueTypeFont ) public: ResourceTrueTypeFont(); virtual ~ResourceTrueTypeFont(); virtual void deserialization(xml::ElementPtr _node, Version _version); // Returns the glyph info for the specified code point, or the glyph info for a substitute glyph if the code point does not // exist in this font. Returns nullptr if there is a problem with the font. virtual GlyphInfo* getGlyphInfo(Char _id); virtual ITexture* getTextureFont(); // получившаяся высота при генерации в пикселях virtual int getDefaultHeight(); // Returns a collection of code-point ranges that are supported by this font. Each range is specified as [first, second]; // for example, a range containing a single code point will have the same value for both first and second. std::vector > getCodePointRanges() const; // Returns the code point that is used as a substitute for code points that don't exist in the font. The default substitute // code point is FontCodeType::NotDefined, but it can be customized in the font definition file. Char getSubstituteCodePoint() const; private: void addCodePoint(Char _codePoint); void removeCodePoint(Char _codePoint); void addCodePointRange(Char _first, Char _second); void removeCodePointRange(Char _first, Char _second); void clearCodePoints(); void initialise(); // The following variables are set directly from values specified by the user. std::string mSource; // Source (filename) of the font. float mSize; // Size of the font, in points (there are 72 points per inch). uint mResolution; // Resolution of the font, in pixels per inch. bool mAntialias; // Whether or not to anti-alias the font by copying its alpha channel to its luminance channel. float mSpaceWidth; // The width of a "Space" character, in pixels. If zero, the default width is used. float mTabWidth; // The width of the "Tab" special character, in pixels. int mOffsetHeight; // How far up to nudge text rendered in this font, in pixels. May be negative to nudge text down. Char mSubstituteCodePoint; // The code point to use as a substitute for code points that don't exist in the font. // The following variables are calculated automatically. int mDefaultHeight; // The nominal height of the font in pixels. GlyphInfo* mSubstituteGlyphInfo; // The glyph info to use as a substitute for code points that don't exist in the font. MyGUI::ITexture* mTexture; // The texture that contains all of the rendered glyphs in the font. // The following constants used to be mutable, but they no longer need to be. Do not modify their values! static const int mGlyphSpacing; // How far apart the glyphs are placed from each other in the font texture, in pixels. static const float mSelectedWidth; // The width of the "Selected" and "SelectedBack" special characters, in pixels. static const float mCursorWidth; // The width of the "Cursor" special character, in pixels. #ifdef MYGUI_USE_FREETYPE private: // A map of code points to glyph indices. typedef std::map CharMap; // A map of glyph indices to glyph info objects. typedef std::map GlyphMap; // A map of glyph heights to the set of paired glyph indices and glyph info objects that are of that height. typedef std::map > GlyphHeightMap; template void initialiseFreeType(); // Loads the font face as specified by mSource, mSize, and mResolution. Automatically adjusts code-point ranges according // to the capabilities of the font face. // Returns a handle to the FreeType face object for the face, or nullptr if the face could not be loaded. // Keeps the font file loaded in memory and stores its location in _fontBuffer. The caller is responsible for freeing this // buffer when it is done using the face by calling delete[] on the buffer after calling FT_Done_Face() on the face itself. FT_Face loadFace(const FT_Library& _ftLibrary, uint8*& _fontBuffer); // Wraps the current texture coordinates _texX and _texY to the beginning of the next line if the specified glyph width // doesn't fit at the end of the current line. Automatically takes the glyph spacing into account. void autoWrapGlyphPos(int _glyphWidth, int _texWidth, int _lineHeight, int& _texX, int& _texY); // Creates a GlyphInfo object using the specified information. GlyphInfo createFaceGlyphInfo(Char _codePoint, int _fontAscent, FT_GlyphSlot _glyph); // Creates a glyph with the specified glyph index and assigns it to the specified code point. // Automatically updates _glyphHeightMap, mCharMap, and mGlyphMap with data from the new glyph.. int createGlyph(FT_UInt _glyphIndex, const GlyphInfo& _glyphInfo, GlyphHeightMap& _glyphHeightMap); // Creates a glyph with the specified index from the specified font face and assigns it to the specified code point. // Automatically updates _glyphHeightMap with data from the newly created glyph. int createFaceGlyph(FT_UInt _glyphIndex, Char _codePoint, int _fontAscent, const FT_Face& _face, GlyphHeightMap& _glyphHeightMap); // Renders all of the glyphs in _glyphHeightMap into the specified texture buffer using data from the specified font face. template void renderGlyphs(const GlyphHeightMap& _glyphHeightMap, const FT_Library& _ftLibrary, const FT_Face& _face, uint8* _texBuffer, int _texWidth, int _texHeight); // Renders the glyph described by the specified glyph info according to the specified parameters. // Supports two types of rendering, depending on the value of UseBuffer: Texture block transfer and rectangular color fill. // The _luminance0 value is used for even-numbered columns (from zero), while _luminance1 is used for odd-numbered ones. template void renderGlyph(GlyphInfo& _info, uint8 _luminance0, uint8 _luminance1, uint8 _alpha, int _lineHeight, uint8* _texBuffer, int _texWidth, int _texHeight, int& _texX, int& _texY, uint8* _glyphBuffer = nullptr); CharMap mCharMap; // A map of code points to glyph indices. GlyphMap mGlyphMap; // A map of glyph indices to glyph info objects. #endif // MYGUI_USE_FREETYPE }; } // namespace MyGUI #endif // __MYGUI_RESOURCE_TRUE_TYPE_FONT_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_IItemContainer.h0000664000000000000000000000304611721331056020772 0ustar rootroot/*! @file @author Albert Semenov @date 11/2010 */ /* 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_ITEM_CONTAINER_H__ #define __MYGUI_I_ITEM_CONTAINER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Constants.h" namespace MyGUI { class IItem; class MYGUI_EXPORT IItemContainer { public: IItemContainer() { } virtual ~IItemContainer() { } virtual size_t _getItemCount() { return 0; } virtual void _addItem(const MyGUI::UString& _name) { } virtual void _removeItemAt(size_t _index) { } virtual Widget* _getItemAt(size_t _index) { return nullptr; } virtual void _setItemNameAt(size_t _index, const UString& _name) { } virtual const UString& _getItemNameAt(size_t _index) { return Constants::getEmptyUString(); } virtual void _setItemSelected(IItem* _item) { } }; } // namespace MyGUI #endif // __MYGUI_I_ITEM_CONTAINER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_IDataStream.h0000664000000000000000000000270611721331056020260 0ustar rootroot/*! @file @author Albert Semenov @date 08/2009 */ /* 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; }; class DataStreamHolder { public: DataStreamHolder(IDataStream* _data) : mData(_data) { } ~DataStreamHolder() { delete mData; } IDataStream* getData() { return mData; } private: IDataStream* mData; }; } // namespace MyGUI #endif // __MYGUI_I_DATA_STREAM_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_SubWidgetBinding.h0000664000000000000000000000312511721331056021306 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_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(); SubWidgetBinding(const IntCoord& _coord, Align _aligin, const std::string& _type); void create(const IntCoord& _coord, Align _aligin, const std::string& _type); void clear(); void add(const std::string& _name, IStateInfo* _data, const std::string& _skin); private: IntCoord mOffset; Align mAlign; std::string mType; MapStateInfo mStates; }; } // namespace MyGUI #endif // __MYGUI_SUB_WIDGET_BINDING_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_TextChangeHistory.h0000664000000000000000000000407511721331056021537 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Types.h0000664000000000000000000000354311721331054017224 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_TYPES_H__ #define __MYGUI_TYPES_H__ #include "MyGUI_Prerequest.h" #include #include #include #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 std::pair PairString; typedef std::vector VectorStringPairs; 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_WidgetDefines.h0000664000000000000000000000222311721331056020635 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_DataManager.h0000664000000000000000000000356211721331056020267 0ustar rootroot/*! @file @author Albert Semenov @date 05/2009 */ /* 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_Singleton.h" #include "MyGUI_IDataStream.h" #include "MyGUI_Types.h" namespace MyGUI { class MYGUI_EXPORT DataManager : public Singleton { public: /** Get data stream from specified resource name. @param _name Resource name (usually file name). */ virtual IDataStream* getData(const std::string& _name) = 0; /** Is data with specified name exist. @param _name Resource name. */ virtual bool isDataExist(const std::string& _name) = 0; /** Get all data names with names that matches pattern. @param _pattern Pattern to match (for example "*.layout"). */ virtual const VectorString& getDataListNames(const std::string& _pattern) = 0; /** Get full path to data. @param _name Resource name. @return Return full path to specified data. For example getDataPath("My.layout") might return "C:\path\to\project\data\My.layout" */ virtual const std::string& getDataPath(const std::string& _name) = 0; }; } // namespace MyGUI #endif // __MYGUI_DATA_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ItemBox.h0000664000000000000000000002574411721331060017473 0ustar rootroot/*! @file @author Albert Semenov @date 01/2008 */ /* 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::CMultiDelegate2 EventHandle_ItemBoxPtrSizeT; typedef delegates::CMultiDelegate2 EventHandle_ItemBoxPtrCIBNotifyCellDataRef; class MYGUI_EXPORT ItemBox : public DDContainer, protected ScrollViewBase, public MemberObsolete { MYGUI_RTTI_DERIVED( ItemBox ) public: ItemBox(); //------------------------------------------------------------------------------// // манипуляции айтемами //! Get number of items size_t getItemCount() const; //! 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); //! 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() const; //! Select specified _index void setIndexSelected(size_t _index); //! Clear item selection void clearIndexSelected(); //------------------------------------------------------------------------------// // манипуляции данными //! 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); //! 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 setVerticalAlignment(bool _value); /** Get vertical alignment grid mode flag */ bool getVerticalAlignment() const; /** Get item index by item Widget pointer */ size_t getIndexByWidget(Widget* _widget); /** Get widget created for drop */ Widget* getWidgetDrag(); /** 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); /** @copydoc Widget::setSize(int _width, int _height) */ void setSize(int _width, int _height); /** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */ void setCoord(int _left, int _top, int _width, int _height); /*events:*/ /** Event : Request for creating new item.\n 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.\n 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.\n 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.\n 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.\n 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.\n 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.\n 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 _resetContainer(bool _update); protected: virtual void initialiseOverride(); virtual void shutdownOverride(); struct ItemDataInfo { ItemDataInfo(Any _data) : data(_data) { } Any data; }; typedef std::vector VectorItemInfo; 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, MouseButton _id); 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(ScrollBar* _sender, size_t _index); void notifyMouseWheel(Widget* _sender, int _rel); void notifyRootMouseChangeFocus(Widget* _sender, bool _focus); void notifyMouseButtonDoubleClick(Widget* _sender); virtual size_t _getItemIndex(Widget* _item); void notifyMouseDrag(Widget* _sender, int _left, int _top, MouseButton _id); 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 setPropertyOverride(const std::string& _key, const std::string& _value); private: size_t calcIndexByWidget(Widget* _widget); void requestItemSize(); virtual IntSize getContentSize(); virtual IntPoint getContentPosition(); virtual IntSize getViewSize(); virtual void eraseContent(); virtual size_t getHScrollPage(); virtual size_t getVScrollPage(); virtual Align getContentAlign(); virtual void setContentPosition(const IntPoint& _point); IntRect _getClientAbsoluteRect(); Widget* _getClientWidget(); 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_TextBox.h0000664000000000000000000000513411721331056017515 0ustar rootroot/*! @file @author Albert Semenov @date 12/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_TEXT_BOX_H__ #define __MYGUI_TEXT_BOX_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Widget.h" namespace MyGUI { class MYGUI_EXPORT TextBox : public Widget { MYGUI_RTTI_DERIVED( TextBox ) public: TextBox(); /** Get text region coordinate */ virtual IntCoord getTextRegion(); /** Get text region size */ virtual IntSize getTextSize(); /** Set widget caption */ virtual void setCaption(const UString& _value); /** Get widget caption */ virtual const UString& getCaption(); /** 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(); /** Set TextBox caption and replace special sequences.\n "\\n" will be replaced with new line character;\n "#{Keyword}" replaced with string from LanguageManager or left as it is if kayword wasn't found. */ void setCaptionWithReplacing(const std::string& _value); /** Set widget text shadow colour */ virtual void setTextShadowColour(const Colour& _value); /** Get widget text shadow colour */ const Colour& getTextShadowColour(); /** Set widget text shadow */ virtual void setTextShadow(bool _value); /** Get widget text shadow */ bool getTextShadow(); protected: virtual void setPropertyOverride(const std::string& _key, const std::string& _value); }; } // namespace MyGUI #endif // __MYGUI_TEXT_BOX_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_DeprecatedTypes.h0000664000000000000000000000414111721331054021200 0ustar rootroot/*! @file @author Albert Semenov @date 08/2010 */ /* 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_DEPRECATED_TYPES_H__ #define __MYGUI_DEPRECATED_TYPES_H__ namespace MyGUI { template class MemberObsolete { public: }; #ifndef MYGUI_DONT_USE_OBSOLETE typedef Widget* WidgetPtr; typedef Button* ButtonPtr; typedef Window* WindowPtr; typedef ComboBox* ComboBoxPtr; typedef TabItem* TabItemPtr; typedef ItemBox* ItemBoxPtr; typedef MenuItem* MenuItemPtr; typedef PopupMenu* PopupMenuPtr; typedef MenuBar* MenuBarPtr; typedef ScrollView* ScrollViewPtr; typedef DDContainer* DDContainerPtr; typedef Canvas* CanvasPtr; class HScroll; typedef HScroll* HScrollPtr; class VScroll; typedef VScroll* VScrollPtr; typedef TabItem Sheet; typedef TabItem* SheetPtr; typedef Canvas RenderBox; typedef Canvas* RenderBoxPtr; typedef ImageBox StaticImage; typedef StaticImage* StaticImagePtr; typedef TextBox StaticText; typedef StaticText* StaticTextPtr; typedef ProgressBar Progress; typedef Progress* ProgressPtr; typedef ListBox List; typedef List* ListPtr; typedef EditBox Edit; typedef Edit* EditPtr; typedef TabControl Tab; typedef Tab* TabPtr; typedef MultiListBox MultiList; typedef MultiList* MultiListPtr; typedef MenuControl MenuCtrl; typedef MenuCtrl* MenuCtrlPtr; #endif // MYGUI_DONT_USE_OBSOLETE } // namespace MyGUI #endif // __MYGUI_DEPRECATED_TYPES_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_ResizingPolicy.h0000664000000000000000000000444211721331060021066 0ustar rootroot/*! @file @author Albert Semenov @date 12/2010 */ /* 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_RESIZING_POLICY_H__ #define __MYGUI_RESIZING_POLICY_H__ #include "MyGUI_Prerequest.h" namespace MyGUI { struct MYGUI_EXPORT ResizingPolicy { enum Enum { Auto, Fixed, Fill, MAX }; ResizingPolicy(Enum _value = MAX) : value(_value) { } static ResizingPolicy parse(const std::string& _value) { ResizingPolicy 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; } friend bool operator == (ResizingPolicy const& a, ResizingPolicy const& b) { return a.value == b.value; } friend bool operator != (ResizingPolicy const& a, ResizingPolicy const& b) { return a.value != b.value; } friend std::ostream& operator << (std::ostream& _stream, const ResizingPolicy& _value) { _stream << _value.getValueName(_value.value); return _stream; } friend std::istream& operator >> (std::istream& _stream, ResizingPolicy& _value) { std::string value; _stream >> value; _value = parse(value); return _stream; } std::string print() const { return getValueName(value); } private: const char* getValueName(int _index) const { static const char* values[MAX + 1] = { "Auto", "Fixed", "Fill", "" }; return values[(_index < MAX && _index >= 0) ? _index : MAX]; } private: Enum value; }; } // namespace MyGUI #endif // __MYGUI_RESIZING_POLICY_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_WidgetUserData.h0000664000000000000000000000452111721331056020773 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_WIDGET_USER_DATA_H__ #define __MYGUI_WIDGET_USER_DATA_H__ #include "MyGUI_Prerequest.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); /** Get user string or "" if not found */ const std::string& getUserString(const std::string& _key) const; /** Get map of all user strings */ const MapString& getUserStrings() const; /** Delete user string */ bool clearUserString(const std::string& _key); /** Return true if user string with such key exist */ bool isUserString(const std::string& _key) const; /** Delete all user strings */ void clearUserStrings(); /** Set any user data to store inside widget */ void setUserData(Any _data); /** Get user data and cast it to ValueType */ template ValueType* getUserData(bool _throw = true) { return mUserData.castType(_throw); } /*internal:*/ void _setInternalData(Any _data); template ValueType* _getInternalData(bool _throw = true) { return mInternalData.castType(_throw); } private: // пользовательские данные MapString mMapUserString; Any mUserData; // для внутренниего использования Any mInternalData; }; } // namespace MyGUI #endif // __MYGUI_WIDGET_USER_DATA_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_WidgetManager.h0000664000000000000000000000505411721331060020632 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_WIDGET_MANAGER_H__ #define __MYGUI_WIDGET_MANAGER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Singleton.h" #include "MyGUI_IUnlinkWidget.h" #include "MyGUI_ICroppedRectangle.h" #include "MyGUI_Widget.h" #include #include "MyGUI_BackwardCompatibility.h" namespace MyGUI { class MYGUI_EXPORT WidgetManager : public Singleton, public MemberObsolete { public: WidgetManager(); void initialise(); void shutdown(); Widget* createWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Widget* _parent, ICroppedRectangle* _cropeedParent, 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); /** Check if factory with specified widget type exist */ bool isFactoryExist(const std::string& _type); /*internal:*/ void _deleteWidget(Widget* _widget); void _deleteDelayWidgets(); private: void notifyEventFrameStart(float _time); private: bool mIsInitialise; // список менеджеров для отписки при удалении VectorIUnlinkWidget mVectorIUnlinkWidget; // список виджетов для удаления VectorWidgetPtr mDestroyWidgets; }; } // namespace MyGUI #endif // __MYGUI_WIDGET_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_LayoutManager.h0000664000000000000000000000537411721331056020676 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_LAYOUT_MANAGER_H__ #define __MYGUI_LAYOUT_MANAGER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Singleton.h" #include "MyGUI_XmlDocument.h" #include "MyGUI_WidgetDefines.h" #include "MyGUI_ResourceLayout.h" #include "MyGUI_BackwardCompatibility.h" namespace MyGUI { typedef delegates::CMultiDelegate3 EventHandle_AddUserStringDelegate; class MYGUI_EXPORT LayoutManager : public Singleton, public MemberObsolete { public: LayoutManager(); void initialise(); void shutdown(); /** 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 (actually deletes vector of widgets returned by loadLayout) */ void unloadLayout(VectorWidgetPtr& _widgets); /** Get ResourceLayout by name */ ResourceLayout* getByName(const std::string& _name, bool _throw = true) const; /** Check if skin with specified name exist */ bool isExist(const std::string& _name) const; /** Event : Multidelegate. UserString was added from layout.\n signature : void method(MyGUI::Widget* _widget, const std::string& _key, const std::string& _value) @param _widget Widget that got new UserString. @param _key UserString key. @param _key UserString value. @note Happens only when UserString was loaded from layout, but not when it was added in code. */ EventHandle_AddUserStringDelegate eventAddUserString; const std::string& getCurrentLayout() const; private: void _load(xml::ElementPtr _node, const std::string& _file, Version _version); private: bool mIsInitialise; std::string mCurrentLayoutName; }; } // namespace MyGUI #endif // __MYGUI_LAYOUT_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Widget.h0000664000000000000000000003704411721331056017350 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_WIDGET_H__ #define __MYGUI_WIDGET_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Any.h" #include "MyGUI_ICroppedRectangle.h" #include "MyGUI_WidgetUserData.h" #include "MyGUI_WidgetInput.h" #include "MyGUI_ResourceSkin.h" #include "MyGUI_ResourceLayout.h" #include "MyGUI_IObject.h" #include "MyGUI_SkinItem.h" #include "MyGUI_BackwardCompatibility.h" namespace MyGUI { typedef delegates::CMultiDelegate3 EventHandle_WidgetStringString; class MYGUI_EXPORT Widget : public IObject, public ICroppedRectangle, public UserData, public WidgetInput, public delegates::IDelegateUnlink, public SkinItem, public MemberObsolete { // для вызова закрытых деструкторов friend class WidgetManager; MYGUI_RTTI_DERIVED( 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 _layer layer where widget will be created (all layers usually defined in core_layer.xml file). @param _name optional widget name (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)); } /** 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); /** See Widget::setSize(const IntSize& _size) */ void setSize(int _width, int _height); /** See Widget::setCoord(const IntCoord& _coord) */ void setCoord(int _left, int _top, int _width, int _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); /** See Widget::setRealSize(const FloatSize& _size) */ void setRealSize(float _width, float _height); /** See Widget::setRealPosition(const FloatCoord& _coord) */ void setRealCoord(float _left, float _top, float _width, float _height); //! Get name of widget const std::string& getName() const; /** Hide or show widget */ virtual void setVisible(bool _value); /** Return true if visible */ bool getVisible() const; /** Return widget's visibility based on it's and parents visibility. */ bool getInheritedVisible() const; /** Set align */ virtual void setAlign(Align _value); /** Get align */ Align getAlign() const; /** Set widget opacity */ void setAlpha(float _value); /** Get widget opacity */ float getAlpha() const; /** Enable or disable inherits alpha mode.\n Inherits alpha mode: when enabled widget alpha is it's own alpha value multiplied by parent's real alpha (that depend on parent's parent and so on).\n When disabled widget's alpha doesn't depend on parent's alpha. So this is used when you need things like semi-transparent window with non-transparent text on it and window's alpha changes.\n Enabled (true) by default. */ void setInheritsAlpha(bool _value); /** Get inherits alpha mode flag */ bool getInheritsAlpha() const; void setColour(const Colour& _value); // являемся ли мы рутовым виджетом /** Is this widget is root widget (root == without parents) */ bool isRootWidget() const; /** Get parent widget or nullptr if no parent */ Widget* getParent() const; IntSize getParentSize() const; /** Get child widgets Enumerator */ EnumeratorWidgetPtr getEnumerator() const; /** 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. @return Return first found widget with given name */ Widget* findWidget(const std::string& _name); /** Find all widgets with given name and add them into _result. Search recursively through all childs starting from this widget. */ void findWidgets(const std::string& _name, VectorWidgetPtr& _result); /** Enable or disable widget */ virtual void setEnabled(bool _value); /** Enable or disable widget without changing widget's state */ void setEnabledSilent(bool _value); /** Is widget enabled */ bool getEnabled() const; /** Is widget enabled and all it's parents in hierarchy is enabled. */ bool getInheritedEnabled() const; /** Get rectangle where child widgets placed */ IntCoord getClientCoord(); /** Get client area widget or nullptr if widget don't have client */ Widget* getClientWidget(); /** Detach widget from widgets hierarchy @param _layer Attach to specified layer (if any) */ void detachFromWidget(const std::string& _layer = ""); /** Attach widget to parent @param _parent New parent @param _style New widget style (see WidgetStyle::Enum) @param _layer Attach to specified layer (if any) */ 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 _style New widget style (see WidgetStyle::Enum) @param _layer Attach to specified layer (if any) @note When choosing WidgetStyle::Popup style you also need attach widget to layer */ void setWidgetStyle(WidgetStyle _style, const std::string& _layer = ""); /** Get widget style */ WidgetStyle getWidgetStyle() const; /** Set any widget property @param _key Property name (for example Alpha or Enabled) @param _value Value converted to string */ void setProperty(const std::string& _key, const std::string& _value); /** 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; /*internal:*/ // метод для запроса номера айтема и контейнера virtual size_t _getItemIndex(Widget* _item); // дает приоритет виджету при пиккинге void _forcePick(Widget* _widget); void _initialise(WidgetStyle _style, const IntCoord& _coord, const std::string& _skinName, Widget* _parent, ICroppedRectangle* _croppedParent, const std::string& _name); void _shutdown(); // удяляет неудачника void _destroyChildWidget(Widget* _widget); void _setContainer(Widget* _value); Widget* _getContainer(); void _setAlign(const IntSize& _oldsize, const IntSize& _newSize); bool _checkPoint(int _left, int _top) const; Widget* _createSkinWidget(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 _resetContainer(bool _update); bool _setWidgetState(const std::string& _value); protected: // все создание только через фабрику virtual ~Widget(); virtual void shutdownOverride(); virtual void initialiseOverride(); void _updateView(); // обновления себя и детей // создает виджет 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, bool _template); // удаляет всех детей void _destroyAllChildWidget(); // запрашиваем у конейтера айтем по позиции мыши virtual size_t _getContainerIndex(const IntPoint& _point); virtual void baseUpdateEnable(); // наследуемся он LayerInfo virtual ILayerItem* getLayerItemByPoint(int _left, int _top) const; virtual const IntCoord& getLayerItemCoord() const; template void assignWidget(T * & _widget, const std::string& _name) { _widget = nullptr; for (VectorWidgetPtr::iterator iter = mWidgetChildSkin.begin(); iter != mWidgetChildSkin.end(); ++iter) { Widget* find = (*iter)->findWidget(_name); if (nullptr != find) { _widget = find->castType(false); break; } } } VectorWidgetPtr getSkinWidgetsByName(const std::string& _name); void destroySkinWidget(Widget* _widget); virtual void onWidgetCreated(Widget* _widget); virtual void onWidgetDestroy(Widget* _widget); void setWidgetClient(Widget* _widget); virtual void setPropertyOverride(const std::string& _key, const std::string& _value); private: void frameEntered(float _frame); const WidgetInfo* initialiseWidgetSkinBase(ResourceSkin* _info, ResourceLayout* _templateInfo); void shutdownWidgetSkinBase(); void _updateAlpha(); void _updateAbsolutePoint(); // для внутреннего использования void _updateVisible(); void _updateEnabled(); float _getRealAlpha() const; void _createChildSkinWidget(ResourceSkin* _info); void _destroyChildSkinWidget(); void _parseSkinProperties(ResourceSkin* _info); void _checkInheristProperties(); void _linkChildWidget(Widget* _widget); void _unlinkChildWidget(Widget* _widget); void setSkinProperty(ResourceSkin* _info); virtual void resizeLayerItemView(const IntSize& _oldView, const IntSize& _newView); private: // клиентская зона окна // если виджет имеет пользовательские окна не в себе // то обязательно проинициализировать Client Widget* mWidgetClient; // вектор всех детей виджетов VectorWidgetPtr mWidgetChild; // вектор детей скина VectorWidgetPtr mWidgetChildSkin; // доступен ли на виджет bool mEnabled; bool mInheritsEnabled; // для иерархического скрытия bool mInheritsVisible; // прозрачность и флаг наследования альфы нашего оверлея float mAlpha; float mRealAlpha; bool mInheritsAlpha; // имя виджета std::string mName; // наш отец в иерархии виджетов Widget* mParent; // поведение виджета, перекрывающийся дочерний или всплывающий WidgetStyle mWidgetStyle; Widget* mContainer; Align mAlign; bool mVisible; }; } // namespace MyGUI #endif // __MYGUI_WIDGET_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI.h0000664000000000000000000000521711721331054016040 0ustar rootroot/*! @file @author Georgiy Evmenov @date 01/2008 */ /* 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_EditBox.h" #include "MyGUI_ListBox.h" #include "MyGUI_TextBox.h" #include "MyGUI_ImageBox.h" #include "MyGUI_TabControl.h" #include "MyGUI_TabItem.h" #include "MyGUI_Window.h" #include "MyGUI_ProgressBar.h" #include "MyGUI_ItemBox.h" #include "MyGUI_MultiListBox.h" #include "MyGUI_MenuControl.h" #include "MyGUI_MenuItem.h" #include "MyGUI_PopupMenu.h" #include "MyGUI_MenuBar.h" #include "MyGUI_ScrollBar.h" #include "MyGUI_ScrollView.h" #include "MyGUI_DDContainer.h" #include "MyGUI_Canvas.h" #include "MyGUI_MultiListItem.h" #include "MyGUI_DeprecatedWidgets.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_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_PolygonalSkin.h" #include "MyGUI_RotatingSkin.h" #include "MyGUI_TextureUtility.h" #include "MyGUI_Constants.h" #include "MyGUI_Bitwise.h" #endif // __MYGUI_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_LayerNode.h0000664000000000000000000000641011721331056020000 0ustar rootroot/*! @file @author Albert Semenov @date 02/2008 */ /* 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() const; // возвращает отца или nullptr virtual ILayerNode* getParent() const; // создаем дочерний нод virtual ILayerNode* createChildItemNode(); // удаляем дочерний нод virtual void destroyChildItemNode(ILayerNode* _node); // поднимаем дочерний нод virtual void upChildItemNode(ILayerNode* _node); // список детей virtual EnumeratorILayerNode getEnumerator() const; // добавляем айтем к ноду virtual void attachLayerItem(ILayerItem* _item); // удаляем айтем из нода virtual void detachLayerItem(ILayerItem* _item); // добавляет саб айтем и возвращает рендер айтем virtual RenderItem* addToRenderItem(ITexture* _texture, bool _firstQueue, bool _manualRender); // необходимо обновление нода virtual void outOfDate(RenderItem* _item); // возвращает виджет по позиции virtual ILayerItem* getLayerItemByPoint(int _left, int _top) const; // рисует леер virtual void renderToTarget(IRenderTarget* _target, bool _update); virtual void resizeView(const IntSize& _viewSize); bool isOutOfDate() const; 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_TextView.h0000664000000000000000000000150411721331056017674 0ustar rootroot/*! @file @author Albert Semenov @date 09/2009 */ #ifndef __MYGUI_TEXT_VIEW_H__ #define __MYGUI_TEXT_VIEW_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_TextureUtility.h" #include "MyGUI_TextViewData.h" #include "MyGUI_IFont.h" namespace MyGUI { class TextView { public: TextView(); void update(const UString& _text, IFont* _font, int _height, Align _align, VertexColourType _format, int _maxWidth = -1); size_t getCursorPosition(const IntPoint& _value); IntPoint getCursorPoint(size_t _position); const IntSize& getViewSize() const; size_t getTextLength() const; const VectorLineInfo& getData() const; private: IntSize mViewSize; size_t mLength; VectorLineInfo mLineInfo; int mFontHeight; }; } // namespace MyGUI #endif // __MYGUI_TEXT_VIEW_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_DataStream.h0000664000000000000000000000245711721331056020152 0ustar rootroot/*! @file @author Albert Semenov @date 05/2009 */ /* 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__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_FontManager.h0000664000000000000000000000352611721331054020322 0ustar rootroot/*! @file @author Albert Semenov @date 11/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_FONT_MANAGER_H__ #define __MYGUI_FONT_MANAGER_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Enumerator.h" #include "MyGUI_IFont.h" #include "MyGUI_Singleton.h" #include "MyGUI_XmlDocument.h" #include "MyGUI_ResourceManager.h" #include "MyGUI_BackwardCompatibility.h" namespace MyGUI { class MYGUI_EXPORT FontManager : public Singleton, public MemberObsolete { public: FontManager(); void initialise(); void shutdown(); /** Get default font name. Default skin also used when creating widget with skin that doesn't exist. */ const std::string& getDefaultFont() const; /** Get default font name. Default skin also used when creating widget with skin that doesn't exist. */ void setDefaultFont(const std::string& _value); /** Get font resource */ IFont* getByName(const std::string& _name) const; private: void _load(xml::ElementPtr _node, const std::string& _file, Version _version); private: std::string mDefaultName; bool mIsInitialise; }; } // namespace MyGUI #endif // __MYGUI_FONT_MANAGER_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_Exception.h0000664000000000000000000000335311721331056020057 0ustar rootroot/*! @file @author Albert Semenov @date 05/2009 */ /* 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 { 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; virtual const std::string& getFile() const; virtual long getLine() const; virtual const std::string& getDescription() const; // Override std::exception::what const char* what() const throw(); protected: std::string mDescription; std::string mSource; std::string mFile; long mLine; mutable std::string mFullDesc; }; } // namespace MyGUI #endif // __MYGUI_EXCEPTION_H__ MyGUI_3.2.0/MyGUIEngine/include/MyGUI_BackwardCompatibility.h0000664000000000000000000006445711721331056022405 0ustar rootroot/*! @file @author Albert Semenov @date 08/2010 */ /* 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_BACKWARD_COMPATIBILITY_H__ #define __MYGUI_BACKWARD_COMPATIBILITY_H__ #include "MyGUI_Prerequest.h" #include "MyGUI_Colour.h" #include "MyGUI_ResourceSkin.h" #include "MyGUI_Any.h" #include "MyGUI_MouseButton.h" #include "MyGUI_KeyCode.h" #include "MyGUI_Macros.h" #include "MyGUI_WidgetDefines.h" #include "MyGUI_IResource.h" #include #include namespace MyGUI { #ifndef MYGUI_DONT_USE_OBSOLETE template <> class MYGUI_EXPORT MemberObsolete