forked from mirror/openmw-tes3mp
Merge branch 'next' into minimap
Conflicts: files/mygui/openmw_map_window_layout.xmlactorid
commit
ab9aa1ba74
@ -0,0 +1,39 @@
|
||||
|
||||
#include "ptr.hpp"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "containerstore.hpp"
|
||||
|
||||
ESM::CellRef& MWWorld::Ptr::getCellRef() const
|
||||
{
|
||||
assert (mCellRef);
|
||||
|
||||
if (mContainerStore)
|
||||
mContainerStore->flagAsModified();
|
||||
|
||||
return *mCellRef;
|
||||
}
|
||||
|
||||
MWWorld::RefData& MWWorld::Ptr::getRefData() const
|
||||
{
|
||||
assert (mRefData);
|
||||
|
||||
if (mContainerStore)
|
||||
mContainerStore->flagAsModified();
|
||||
|
||||
return *mRefData;
|
||||
}
|
||||
|
||||
void MWWorld::Ptr::setContainerStore (ContainerStore *store)
|
||||
{
|
||||
assert (store);
|
||||
assert (!mCell);
|
||||
|
||||
mContainerStore = store;
|
||||
}
|
||||
|
||||
MWWorld::ContainerStore *MWWorld::Ptr::getContainerStore() const
|
||||
{
|
||||
return mContainerStore;
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
#-------------------------------------------------------------------
|
||||
# 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.
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# - Try to find Cg
|
||||
# Once done, this will define
|
||||
#
|
||||
# Cg_FOUND - system has Cg
|
||||
# Cg_INCLUDE_DIRS - the Cg include directories
|
||||
# Cg_LIBRARIES - link these to use Cg
|
||||
|
||||
include(FindPkgMacros)
|
||||
findpkg_begin(Cg)
|
||||
|
||||
# Get path, convert backslashes as ${ENV_${var}}
|
||||
getenv_path(Cg_HOME)
|
||||
getenv_path(OGRE_SOURCE)
|
||||
getenv_path(OGRE_HOME)
|
||||
|
||||
# construct search paths
|
||||
set(Cg_PREFIX_PATH ${Cg_HOME} ${ENV_Cg_HOME}
|
||||
${OGRE_SOURCE}/Dependencies
|
||||
${ENV_OGRE_SOURCE}/Dependencies
|
||||
${OGRE_HOME} ${ENV_OGRE_HOME}
|
||||
/opt/nvidia-cg-toolkit)
|
||||
create_search_paths(Cg)
|
||||
# redo search if prefix path changed
|
||||
clear_if_changed(Cg_PREFIX_PATH
|
||||
Cg_LIBRARY_FWK
|
||||
Cg_LIBRARY_REL
|
||||
Cg_LIBRARY_DBG
|
||||
Cg_INCLUDE_DIR
|
||||
)
|
||||
|
||||
set(Cg_LIBRARY_NAMES Cg)
|
||||
get_debug_names(Cg_LIBRARY_NAMES)
|
||||
|
||||
use_pkgconfig(Cg_PKGC Cg)
|
||||
|
||||
findpkg_framework(Cg)
|
||||
|
||||
find_path(Cg_INCLUDE_DIR NAMES cg.h HINTS ${Cg_FRAMEWORK_INCLUDES} ${Cg_INC_SEARCH_PATH} ${Cg_PKGC_INCLUDE_DIRS} PATH_SUFFIXES Cg)
|
||||
find_library(Cg_LIBRARY_REL NAMES ${Cg_LIBRARY_NAMES} HINTS ${Cg_LIB_SEARCH_PATH} ${Cg_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel)
|
||||
find_library(Cg_LIBRARY_DBG NAMES ${Cg_LIBRARY_NAMES_DBG} HINTS ${Cg_LIB_SEARCH_PATH} ${Cg_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug)
|
||||
make_library_set(Cg_LIBRARY)
|
||||
|
||||
findpkg_finish(Cg)
|
||||
add_parent_dir(Cg_INCLUDE_DIRS Cg_INCLUDE_DIR)
|
@ -0,0 +1,47 @@
|
||||
#-------------------------------------------------------------------
|
||||
# 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.
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# - Try to find FreeImage
|
||||
# Once done, this will define
|
||||
#
|
||||
# FreeImage_FOUND - system has FreeImage
|
||||
# FreeImage_INCLUDE_DIRS - the FreeImage include directories
|
||||
# FreeImage_LIBRARIES - link these to use FreeImage
|
||||
|
||||
include(FindPkgMacros)
|
||||
findpkg_begin(FreeImage)
|
||||
|
||||
# Get path, convert backslashes as ${ENV_${var}}
|
||||
getenv_path(FREEIMAGE_HOME)
|
||||
|
||||
# construct search paths
|
||||
set(FreeImage_PREFIX_PATH ${FREEIMAGE_HOME} ${ENV_FREEIMAGE_HOME})
|
||||
create_search_paths(FreeImage)
|
||||
# redo search if prefix path changed
|
||||
clear_if_changed(FreeImage_PREFIX_PATH
|
||||
FreeImage_LIBRARY_FWK
|
||||
FreeImage_LIBRARY_REL
|
||||
FreeImage_LIBRARY_DBG
|
||||
FreeImage_INCLUDE_DIR
|
||||
)
|
||||
|
||||
set(FreeImage_LIBRARY_NAMES freeimage)
|
||||
get_debug_names(FreeImage_LIBRARY_NAMES)
|
||||
|
||||
use_pkgconfig(FreeImage_PKGC freeimage)
|
||||
|
||||
findpkg_framework(FreeImage)
|
||||
|
||||
find_path(FreeImage_INCLUDE_DIR NAMES FreeImage.h HINTS ${FreeImage_INC_SEARCH_PATH} ${FreeImage_PKGC_INCLUDE_DIRS})
|
||||
find_library(FreeImage_LIBRARY_REL NAMES ${FreeImage_LIBRARY_NAMES} HINTS ${FreeImage_LIB_SEARCH_PATH} ${FreeImage_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel)
|
||||
find_library(FreeImage_LIBRARY_DBG NAMES ${FreeImage_LIBRARY_NAMES_DBG} HINTS ${FreeImage_LIB_SEARCH_PATH} ${FreeImage_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug)
|
||||
make_library_set(FreeImage_LIBRARY)
|
||||
|
||||
findpkg_finish(FreeImage)
|
||||
|
@ -0,0 +1,125 @@
|
||||
# - Find MyGUI includes and library
|
||||
#
|
||||
# This module defines
|
||||
# MYGUI_INCLUDE_DIRS
|
||||
# MYGUI_LIBRARIES, the libraries to link against to use MYGUI.
|
||||
# MYGUI_LIB_DIR, the location of the libraries
|
||||
# MYGUI_FOUND, If false, do not try to use MYGUI
|
||||
#
|
||||
# Copyright © 2007, Matt Williams
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
CMAKE_POLICY(PUSH)
|
||||
include(FindPkgMacros)
|
||||
|
||||
# IF (MYGUI_LIBRARIES AND MYGUI_INCLUDE_DIRS)
|
||||
# SET(MYGUI_FIND_QUIETLY TRUE)
|
||||
# ENDIF (MYGUI_LIBRARIES AND MYGUI_INCLUDE_DIRS)
|
||||
|
||||
IF (WIN32) #Windows
|
||||
MESSAGE(STATUS "Looking for MyGUI")
|
||||
SET(MYGUISDK $ENV{MYGUI_HOME})
|
||||
IF (MYGUISDK)
|
||||
findpkg_begin ( "MYGUI" )
|
||||
MESSAGE(STATUS "Using MyGUI in OGRE SDK")
|
||||
STRING(REGEX REPLACE "[\\]" "/" MYGUISDK "${MYGUISDK}" )
|
||||
|
||||
find_path ( MYGUI_INCLUDE_DIRS
|
||||
MyGUI.h
|
||||
"${MYGUISDK}/MyGUIEngine/include"
|
||||
NO_DEFAULT_PATH )
|
||||
|
||||
find_path ( MYGUI_PLATFORM_INCLUDE_DIRS
|
||||
MyGUI_OgrePlatform.h
|
||||
"${MYGUISDK}/Platforms/Ogre/OgrePlatform/include"
|
||||
NO_DEFAULT_PATH )
|
||||
|
||||
SET ( MYGUI_LIB_DIR ${MYGUISDK}/*/lib )
|
||||
|
||||
find_library ( MYGUI_LIBRARIES_REL NAMES
|
||||
MyGUIEngine.lib
|
||||
MyGUI.OgrePlatform.lib
|
||||
HINTS
|
||||
${MYGUI_LIB_DIR}
|
||||
PATH_SUFFIXES "" release relwithdebinfo minsizerel )
|
||||
|
||||
find_library ( MYGUI_LIBRARIES_DBG NAMES
|
||||
MyGUIEngine_d.lib
|
||||
MyGUI.OgrePlatform_d.lib
|
||||
HINTS
|
||||
${MYGUI_LIB_DIR}
|
||||
PATH_SUFFIXES "" debug )
|
||||
|
||||
find_library ( MYGUI_PLATFORM_LIBRARIES_REL NAMES
|
||||
MyGUI.OgrePlatform.lib
|
||||
HINTS
|
||||
${MYGUI_LIB_DIR}
|
||||
PATH_SUFFIXES "" release relwithdebinfo minsizerel )
|
||||
|
||||
find_library ( MYGUI_PLATFORM_LIBRARIES_DBG NAMES
|
||||
MyGUI.OgrePlatform_d.lib
|
||||
HINTS
|
||||
${MYGUI_LIB_DIR}
|
||||
PATH_SUFFIXES "" debug )
|
||||
|
||||
make_library_set ( MYGUI_LIBRARIES )
|
||||
make_library_set ( MYGUI_PLATFORM_LIBRARIES )
|
||||
|
||||
MESSAGE ("${MYGUI_LIBRARIES}")
|
||||
MESSAGE ("${MYGUI_PLATFORM_LIBRARIES}")
|
||||
|
||||
findpkg_finish ( "MYGUI" )
|
||||
|
||||
ENDIF (MYGUISDK)
|
||||
IF (OGRESOURCE)
|
||||
MESSAGE(STATUS "Using MyGUI in OGRE dependencies")
|
||||
STRING(REGEX REPLACE "[\\]" "/" OGRESDK "${OGRESOURCE}" )
|
||||
SET(MYGUI_INCLUDE_DIRS ${OGRESOURCE}/OgreMain/include/MYGUI)
|
||||
SET(MYGUI_LIB_DIR ${OGRESOURCE}/lib)
|
||||
SET(MYGUI_LIBRARIES debug Debug/MyGUIEngine_d optimized Release/MyGUIEngine)
|
||||
ENDIF (OGRESOURCE)
|
||||
ELSE (WIN32) #Unix
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
PKG_SEARCH_MODULE(MYGUI MYGUI MyGUI)
|
||||
IF (MYGUI_INCLUDE_DIRS)
|
||||
SET(MYGUI_INCLUDE_DIRS ${MYGUI_INCLUDE_DIRS})
|
||||
SET(MYGUI_LIB_DIR ${MYGUI_LIBDIR})
|
||||
SET(MYGUI_LIBRARIES ${MYGUI_LIBRARIES} CACHE STRING "")
|
||||
ELSE (MYGUI_INCLUDE_DIRS)
|
||||
FIND_PATH(MYGUI_INCLUDE_DIRS MyGUI.h PATHS /usr/local/include /usr/include PATH_SUFFIXES MyGUI MYGUI)
|
||||
FIND_LIBRARY(MYGUI_LIBRARIES mygui PATHS /usr/lib /usr/local/lib)
|
||||
SET(MYGUI_LIB_DIR ${MYGUI_LIBRARIES})
|
||||
STRING(REGEX REPLACE "(.*)/.*" "\\1" MYGUI_LIB_DIR "${MYGUI_LIB_DIR}")
|
||||
STRING(REGEX REPLACE ".*/" "" MYGUI_LIBRARIES "${MYGUI_LIBRARIES}")
|
||||
ENDIF (MYGUI_INCLUDE_DIRS)
|
||||
ENDIF (WIN32)
|
||||
|
||||
#Do some preparation
|
||||
SEPARATE_ARGUMENTS(MYGUI_INCLUDE_DIRS)
|
||||
SEPARATE_ARGUMENTS(MYGUI_LIBRARIES)
|
||||
SEPARATE_ARGUMENTS(MYGUI_PLATFORM_LIBRARIES)
|
||||
|
||||
SET(MYGUI_INCLUDE_DIRS ${MYGUI_INCLUDE_DIRS} CACHE PATH "")
|
||||
SET(MYGUI_LIBRARIES ${MYGUI_LIBRARIES} CACHE STRING "")
|
||||
SET(MYGUI_LIBRARIES ${MYGUI_PLATFORM_LIBRARIES} CACHE STRING "")
|
||||
SET(MYGUI_LIB_DIR ${MYGUI_LIB_DIR} CACHE PATH "")
|
||||
|
||||
IF (MYGUI_INCLUDE_DIRS AND MYGUI_LIBRARIES)
|
||||
SET(MYGUI_FOUND TRUE)
|
||||
ENDIF (MYGUI_INCLUDE_DIRS AND MYGUI_LIBRARIES)
|
||||
|
||||
IF (MYGUI_FOUND)
|
||||
MARK_AS_ADVANCED(MYGUI_LIB_DIR)
|
||||
IF (NOT MYGUI_FIND_QUIETLY)
|
||||
MESSAGE(STATUS " libraries : ${MYGUI_LIBRARIES} from ${MYGUI_LIB_DIR}")
|
||||
MESSAGE(STATUS " includes : ${MYGUI_INCLUDE_DIRS}")
|
||||
ENDIF (NOT MYGUI_FIND_QUIETLY)
|
||||
ELSE (MYGUI_FOUND)
|
||||
IF (MYGUI_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find MYGUI")
|
||||
ENDIF (MYGUI_FIND_REQUIRED)
|
||||
ENDIF (MYGUI_FOUND)
|
||||
|
||||
CMAKE_POLICY(POP)
|
@ -0,0 +1,48 @@
|
||||
#-------------------------------------------------------------------
|
||||
# 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.
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# - Try to find zziplib
|
||||
# Once done, this will define
|
||||
#
|
||||
# ZZip_FOUND - system has ZZip
|
||||
# ZZip_INCLUDE_DIRS - the ZZip include directories
|
||||
# ZZip_LIBRARIES - link these to use ZZip
|
||||
|
||||
include(FindPkgMacros)
|
||||
findpkg_begin(ZZip)
|
||||
|
||||
# Get path, convert backslashes as ${ENV_${var}}
|
||||
getenv_path(ZZIP_HOME)
|
||||
|
||||
|
||||
# construct search paths
|
||||
set(ZZip_PREFIX_PATH ${ZZIP_HOME} ${ENV_ZZIP_HOME})
|
||||
create_search_paths(ZZip)
|
||||
# redo search if prefix path changed
|
||||
clear_if_changed(ZZip_PREFIX_PATH
|
||||
ZZip_LIBRARY_FWK
|
||||
ZZip_LIBRARY_REL
|
||||
ZZip_LIBRARY_DBG
|
||||
ZZip_INCLUDE_DIR
|
||||
)
|
||||
|
||||
set(ZZip_LIBRARY_NAMES zzip zziplib)
|
||||
get_debug_names(ZZip_LIBRARY_NAMES)
|
||||
|
||||
use_pkgconfig(ZZip_PKGC zziplib)
|
||||
|
||||
findpkg_framework(ZZip)
|
||||
|
||||
find_path(ZZip_INCLUDE_DIR NAMES zzip/zzip.h HINTS ${ZZip_INC_SEARCH_PATH} ${ZZip_PKGC_INCLUDE_DIRS})
|
||||
find_library(ZZip_LIBRARY_REL NAMES ${ZZip_LIBRARY_NAMES} HINTS ${ZZip_LIB_SEARCH_PATH} ${ZZip_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel)
|
||||
find_library(ZZip_LIBRARY_DBG NAMES ${ZZip_LIBRARY_NAMES_DBG} HINTS ${ZZip_LIB_SEARCH_PATH} ${ZZip_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug)
|
||||
make_library_set(ZZip_LIBRARY)
|
||||
|
||||
findpkg_finish(ZZip)
|
||||
|
@ -1,165 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
@ -1,35 +0,0 @@
|
||||
set (PROJECT_NAME MyGUIEngine)
|
||||
|
||||
project( ${PROJECT_NAME} )
|
||||
|
||||
include(${PROJECT_NAME}.list)
|
||||
|
||||
include_directories(include)
|
||||
if (MYGUI_USE_FREETYPE)
|
||||
include_directories(
|
||||
${FREETYPE_INCLUDE_DIRS}
|
||||
)
|
||||
add_definitions(-DMYGUI_USE_FREETYPE)
|
||||
endif ()
|
||||
|
||||
add_definitions(-DMYGUI_BUILD)
|
||||
|
||||
if (WIN32)
|
||||
add_definitions(-DNOMINMAX)
|
||||
endif ()
|
||||
|
||||
add_library(${PROJECT_NAME} ${MYGUI_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES})
|
||||
if (MYGUI_USE_FREETYPE)
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
${FREETYPE_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
|
||||
# We don't need this lib in OS X. uuid functions is in libc here.
|
||||
if (NOT APPLE)
|
||||
target_link_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS} uuid)
|
||||
endif(NOT APPLE)
|
||||
|
||||
if (MINGW)
|
||||
target_link_libraries(${PROJECT_NAME} libwinmm.a)
|
||||
endif (MINGW)
|
@ -1,561 +0,0 @@
|
||||
set (HEADER_FILES
|
||||
include/MyGUI_Allocator.h
|
||||
include/MyGUI_CustomAllocator.h
|
||||
include/MyGUI_DDItemInfo.h
|
||||
include/MyGUI_IBItemInfo.h
|
||||
include/MyGUI_MenuItemType.h
|
||||
include/MyGUI_MessageStyle.h
|
||||
include/MyGUI_WidgetToolTip.h
|
||||
include/MyGUI_Button.h
|
||||
include/MyGUI_Canvas.h
|
||||
include/MyGUI_ComboBox.h
|
||||
include/MyGUI_DDContainer.h
|
||||
include/MyGUI_Edit.h
|
||||
include/MyGUI_HScroll.h
|
||||
include/MyGUI_ItemBox.h
|
||||
include/MyGUI_List.h
|
||||
include/MyGUI_ListBox.h
|
||||
include/MyGUI_ListCtrl.h
|
||||
include/MyGUI_MenuBar.h
|
||||
include/MyGUI_MenuCtrl.h
|
||||
include/MyGUI_MenuItem.h
|
||||
include/MyGUI_Message.h
|
||||
include/MyGUI_MultiList.h
|
||||
include/MyGUI_PopupMenu.h
|
||||
include/MyGUI_Progress.h
|
||||
include/MyGUI_ScrollView.h
|
||||
include/MyGUI_StaticImage.h
|
||||
include/MyGUI_StaticText.h
|
||||
include/MyGUI_Tab.h
|
||||
include/MyGUI_TabItem.h
|
||||
include/MyGUI_VScroll.h
|
||||
include/MyGUI_Widget.h
|
||||
include/MyGUI_Window.h
|
||||
include/MyGUI_IWidgetFactory.h
|
||||
include/MyGUI_Bitwise.h
|
||||
include/MyGUI_CoordConverter.h
|
||||
include/MyGUI_DataFileStream.h
|
||||
include/MyGUI_DataStream.h
|
||||
include/MyGUI_Delegate.h
|
||||
include/MyGUI_DelegateImplement.h
|
||||
include/MyGUI_DynLib.h
|
||||
include/MyGUI_Enumerator.h
|
||||
include/MyGUI_EventPair.h
|
||||
include/MyGUI_Guid.h
|
||||
include/MyGUI_RenderOut.h
|
||||
include/MyGUI_TextChangeHistory.h
|
||||
include/MyGUI_TextIterator.h
|
||||
include/MyGUI_TextureUtility.h
|
||||
include/MyGUI_TextView.h
|
||||
include/MyGUI_Timer.h
|
||||
include/MyGUI_UString.h
|
||||
include/MyGUI_Utility.h
|
||||
include/MyGUI_WidgetTranslate.h
|
||||
include/MyGUI_XmlDocument.h
|
||||
include/MyGUI_LogManager.h
|
||||
include/MyGUI_LogStream.h
|
||||
include/MyGUI.h
|
||||
include/MyGUI_CastWidget.h
|
||||
include/MyGUI_Common.h
|
||||
include/MyGUI_Diagnostic.h
|
||||
include/MyGUI_Exception.h
|
||||
include/MyGUI_GenericFactory.h
|
||||
include/MyGUI_Macros.h
|
||||
include/MyGUI_Platform.h
|
||||
include/MyGUI_Precompiled.h
|
||||
include/MyGUI_Prerequest.h
|
||||
include/MyGUI_RenderFormat.h
|
||||
include/MyGUI_ResourceHolder.h
|
||||
include/MyGUI_WidgetDefines.h
|
||||
include/MyGUI_ICroppedRectangle.h
|
||||
include/MyGUI_IDataStream.h
|
||||
include/MyGUI_Instance.h
|
||||
include/MyGUI_IObject.h
|
||||
include/MyGUI_ISerializable.h
|
||||
include/MyGUI_ITexture.h
|
||||
include/MyGUI_IUnlinkWidget.h
|
||||
include/MyGUI_IVertexBuffer.h
|
||||
include/MyGUI_IWidgetCreator.h
|
||||
include/MyGUI_Plugin.h
|
||||
include/MyGUI_RTTI.h
|
||||
include/MyGUI_BiIndexBase.h
|
||||
include/MyGUI_ScrollViewBase.h
|
||||
include/MyGUI_WidgetEvent.h
|
||||
include/MyGUI_WidgetUserData.h
|
||||
include/MyGUI_EditText.h
|
||||
include/MyGUI_MainSkin.h
|
||||
include/MyGUI_RawRect.h
|
||||
include/MyGUI_RotatingSkin.h
|
||||
include/MyGUI_SimpleText.h
|
||||
include/MyGUI_SubSkin.h
|
||||
include/MyGUI_TileRect.h
|
||||
include/MyGUI_IStateInfo.h
|
||||
include/MyGUI_ISubWidget.h
|
||||
include/MyGUI_ISubWidgetRect.h
|
||||
include/MyGUI_ISubWidgetText.h
|
||||
include/MyGUI_LayerItem.h
|
||||
include/MyGUI_LayerNode.h
|
||||
include/MyGUI_OverlappedLayer.h
|
||||
include/MyGUI_RenderItem.h
|
||||
include/MyGUI_SharedLayer.h
|
||||
include/MyGUI_SharedLayerNode.h
|
||||
include/MyGUI_ILayer.h
|
||||
include/MyGUI_ILayerItem.h
|
||||
include/MyGUI_ILayerNode.h
|
||||
include/MyGUI_IRenderTarget.h
|
||||
include/MyGUI_ActionController.h
|
||||
include/MyGUI_ControllerEdgeHide.h
|
||||
include/MyGUI_ControllerFadeAlpha.h
|
||||
include/MyGUI_ControllerItem.h
|
||||
include/MyGUI_ControllerPosition.h
|
||||
include/MyGUI_ResourceImageSet.h
|
||||
include/MyGUI_ResourceImageSetPointer.h
|
||||
include/MyGUI_ResourceManualFont.h
|
||||
include/MyGUI_ResourceManualPointer.h
|
||||
include/MyGUI_ResourceSkin.h
|
||||
include/MyGUI_ResourceTrueTypeFont.h
|
||||
include/MyGUI_IFont.h
|
||||
include/MyGUI_IPointer.h
|
||||
include/MyGUI_IResource.h
|
||||
include/MyGUI_ChildSkinInfo.h
|
||||
include/MyGUI_FontData.h
|
||||
include/MyGUI_MaskPickInfo.h
|
||||
include/MyGUI_SubWidgetBinding.h
|
||||
include/MyGUI_SubWidgetInfo.h
|
||||
include/MyGUI_Align.h
|
||||
include/MyGUI_Any.h
|
||||
include/MyGUI_Colour.h
|
||||
include/MyGUI_CommonStateInfo.h
|
||||
include/MyGUI_ImageInfo.h
|
||||
include/MyGUI_InputDefine.h
|
||||
include/MyGUI_RenderTargetInfo.h
|
||||
include/MyGUI_TCoord.h
|
||||
include/MyGUI_TPoint.h
|
||||
include/MyGUI_TRect.h
|
||||
include/MyGUI_TSize.h
|
||||
include/MyGUI_Types.h
|
||||
include/MyGUI_Version.h
|
||||
include/MyGUI_VertexData.h
|
||||
include/MyGUI_WidgetStyle.h
|
||||
include/MyGUI_ClipboardManager.h
|
||||
include/MyGUI_ControllerManager.h
|
||||
include/MyGUI_DataManager.h
|
||||
include/MyGUI_DynLibManager.h
|
||||
include/MyGUI_FactoryManager.h
|
||||
include/MyGUI_FontManager.h
|
||||
include/MyGUI_Gui.h
|
||||
include/MyGUI_InputManager.h
|
||||
include/MyGUI_LanguageManager.h
|
||||
include/MyGUI_LayerManager.h
|
||||
include/MyGUI_LayoutManager.h
|
||||
include/MyGUI_PluginManager.h
|
||||
include/MyGUI_PointerManager.h
|
||||
include/MyGUI_RenderManager.h
|
||||
include/MyGUI_ResourceManager.h
|
||||
include/MyGUI_SkinManager.h
|
||||
include/MyGUI_SubWidgetManager.h
|
||||
include/MyGUI_WidgetManager.h
|
||||
)
|
||||
set (SOURCE_FILES
|
||||
src/MyGUI_Button.cpp
|
||||
src/MyGUI_Canvas.cpp
|
||||
src/MyGUI_ComboBox.cpp
|
||||
src/MyGUI_DDContainer.cpp
|
||||
src/MyGUI_Edit.cpp
|
||||
src/MyGUI_HScroll.cpp
|
||||
src/MyGUI_ItemBox.cpp
|
||||
src/MyGUI_List.cpp
|
||||
src/MyGUI_ListBox.cpp
|
||||
src/MyGUI_ListCtrl.cpp
|
||||
src/MyGUI_MenuBar.cpp
|
||||
src/MyGUI_MenuCtrl.cpp
|
||||
src/MyGUI_MenuItem.cpp
|
||||
src/MyGUI_Message.cpp
|
||||
src/MyGUI_MultiList.cpp
|
||||
src/MyGUI_PopupMenu.cpp
|
||||
src/MyGUI_Progress.cpp
|
||||
src/MyGUI_ScrollView.cpp
|
||||
src/MyGUI_StaticImage.cpp
|
||||
src/MyGUI_StaticText.cpp
|
||||
src/MyGUI_Tab.cpp
|
||||
src/MyGUI_TabItem.cpp
|
||||
src/MyGUI_VScroll.cpp
|
||||
src/MyGUI_Widget.cpp
|
||||
src/MyGUI_Window.cpp
|
||||
src/MyGUI_EditText.cpp
|
||||
src/MyGUI_MainSkin.cpp
|
||||
src/MyGUI_RawRect.cpp
|
||||
src/MyGUI_RotatingSkin.cpp
|
||||
src/MyGUI_SimpleText.cpp
|
||||
src/MyGUI_SubSkin.cpp
|
||||
src/MyGUI_TileRect.cpp
|
||||
src/MyGUI_LayerItem.cpp
|
||||
src/MyGUI_LayerNode.cpp
|
||||
src/MyGUI_OverlappedLayer.cpp
|
||||
src/MyGUI_RenderItem.cpp
|
||||
src/MyGUI_SharedLayer.cpp
|
||||
src/MyGUI_SharedLayerNode.cpp
|
||||
src/MyGUI_ActionController.cpp
|
||||
src/MyGUI_ControllerEdgeHide.cpp
|
||||
src/MyGUI_ControllerFadeAlpha.cpp
|
||||
src/MyGUI_ControllerPosition.cpp
|
||||
src/MyGUI_Exception.cpp
|
||||
src/MyGUI_Precompiled.cpp
|
||||
src/MyGUI_IWidgetCreator.cpp
|
||||
src/MyGUI_ScrollViewBase.cpp
|
||||
src/MyGUI_ResourceImageSet.cpp
|
||||
src/MyGUI_ResourceImageSetPointer.cpp
|
||||
src/MyGUI_ResourceManualFont.cpp
|
||||
src/MyGUI_ResourceManualPointer.cpp
|
||||
src/MyGUI_ResourceSkin.cpp
|
||||
src/MyGUI_ResourceTrueTypeFont.cpp
|
||||
src/MyGUI_MaskPickInfo.cpp
|
||||
src/MyGUI_Any.cpp
|
||||
src/MyGUI_Colour.cpp
|
||||
src/MyGUI_ClipboardManager.cpp
|
||||
src/MyGUI_ControllerManager.cpp
|
||||
src/MyGUI_DataManager.cpp
|
||||
src/MyGUI_DynLibManager.cpp
|
||||
src/MyGUI_FactoryManager.cpp
|
||||
src/MyGUI_FontManager.cpp
|
||||
src/MyGUI_Gui.cpp
|
||||
src/MyGUI_InputManager.cpp
|
||||
src/MyGUI_LanguageManager.cpp
|
||||
src/MyGUI_LayerManager.cpp
|
||||
src/MyGUI_LayoutManager.cpp
|
||||
src/MyGUI_PluginManager.cpp
|
||||
src/MyGUI_PointerManager.cpp
|
||||
src/MyGUI_RenderManager.cpp
|
||||
src/MyGUI_ResourceManager.cpp
|
||||
src/MyGUI_SkinManager.cpp
|
||||
src/MyGUI_SubWidgetManager.cpp
|
||||
src/MyGUI_WidgetManager.cpp
|
||||
src/MyGUI_DataFileStream.cpp
|
||||
src/MyGUI_DataStream.cpp
|
||||
src/MyGUI_DynLib.cpp
|
||||
src/MyGUI_Guid.cpp
|
||||
src/MyGUI_RenderOut.cpp
|
||||
src/MyGUI_TextIterator.cpp
|
||||
src/MyGUI_TextureUtility.cpp
|
||||
src/MyGUI_Timer.cpp
|
||||
src/MyGUI_XmlDocument.cpp
|
||||
src/MyGUI_LogManager.cpp
|
||||
src/MyGUI_LogStream.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Widget\\Widget" FILES
|
||||
src/MyGUI_Button.cpp
|
||||
src/MyGUI_Canvas.cpp
|
||||
src/MyGUI_ComboBox.cpp
|
||||
src/MyGUI_DDContainer.cpp
|
||||
src/MyGUI_Edit.cpp
|
||||
src/MyGUI_HScroll.cpp
|
||||
src/MyGUI_ItemBox.cpp
|
||||
src/MyGUI_List.cpp
|
||||
src/MyGUI_ListBox.cpp
|
||||
src/MyGUI_ListCtrl.cpp
|
||||
src/MyGUI_MenuBar.cpp
|
||||
src/MyGUI_MenuCtrl.cpp
|
||||
src/MyGUI_MenuItem.cpp
|
||||
src/MyGUI_Message.cpp
|
||||
src/MyGUI_MultiList.cpp
|
||||
src/MyGUI_PopupMenu.cpp
|
||||
src/MyGUI_Progress.cpp
|
||||
src/MyGUI_ScrollView.cpp
|
||||
src/MyGUI_StaticImage.cpp
|
||||
src/MyGUI_StaticText.cpp
|
||||
src/MyGUI_Tab.cpp
|
||||
src/MyGUI_TabItem.cpp
|
||||
src/MyGUI_VScroll.cpp
|
||||
src/MyGUI_Widget.cpp
|
||||
src/MyGUI_Window.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Widget" FILES
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Core\\SubWidget" FILES
|
||||
src/MyGUI_EditText.cpp
|
||||
src/MyGUI_MainSkin.cpp
|
||||
src/MyGUI_RawRect.cpp
|
||||
src/MyGUI_RotatingSkin.cpp
|
||||
src/MyGUI_SimpleText.cpp
|
||||
src/MyGUI_SubSkin.cpp
|
||||
src/MyGUI_TileRect.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Core\\LayerItem" FILES
|
||||
src/MyGUI_LayerItem.cpp
|
||||
src/MyGUI_LayerNode.cpp
|
||||
src/MyGUI_OverlappedLayer.cpp
|
||||
src/MyGUI_RenderItem.cpp
|
||||
src/MyGUI_SharedLayer.cpp
|
||||
src/MyGUI_SharedLayerNode.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Core\\Controller" FILES
|
||||
src/MyGUI_ActionController.cpp
|
||||
src/MyGUI_ControllerEdgeHide.cpp
|
||||
src/MyGUI_ControllerFadeAlpha.cpp
|
||||
src/MyGUI_ControllerPosition.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Core\\Common\\Interfaces" FILES
|
||||
src/MyGUI_IWidgetCreator.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Core\\Common\\Base" FILES
|
||||
src/MyGUI_ScrollViewBase.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Core\\Common" FILES
|
||||
src/MyGUI_Exception.cpp
|
||||
src/MyGUI_Precompiled.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Core\\Resource\\Data" FILES
|
||||
src/MyGUI_MaskPickInfo.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Core\\Resource" FILES
|
||||
src/MyGUI_ResourceImageSet.cpp
|
||||
src/MyGUI_ResourceImageSetPointer.cpp
|
||||
src/MyGUI_ResourceManualFont.cpp
|
||||
src/MyGUI_ResourceManualPointer.cpp
|
||||
src/MyGUI_ResourceSkin.cpp
|
||||
src/MyGUI_ResourceTrueTypeFont.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Core\\Types" FILES
|
||||
src/MyGUI_Any.cpp
|
||||
src/MyGUI_Colour.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Core\\Manager" FILES
|
||||
src/MyGUI_ClipboardManager.cpp
|
||||
src/MyGUI_ControllerManager.cpp
|
||||
src/MyGUI_DataManager.cpp
|
||||
src/MyGUI_DynLibManager.cpp
|
||||
src/MyGUI_FactoryManager.cpp
|
||||
src/MyGUI_FontManager.cpp
|
||||
src/MyGUI_Gui.cpp
|
||||
src/MyGUI_InputManager.cpp
|
||||
src/MyGUI_LanguageManager.cpp
|
||||
src/MyGUI_LayerManager.cpp
|
||||
src/MyGUI_LayoutManager.cpp
|
||||
src/MyGUI_PluginManager.cpp
|
||||
src/MyGUI_PointerManager.cpp
|
||||
src/MyGUI_RenderManager.cpp
|
||||
src/MyGUI_ResourceManager.cpp
|
||||
src/MyGUI_SkinManager.cpp
|
||||
src/MyGUI_SubWidgetManager.cpp
|
||||
src/MyGUI_WidgetManager.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Core" FILES
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Utility\\Logging" FILES
|
||||
src/MyGUI_LogManager.cpp
|
||||
src/MyGUI_LogStream.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files\\Utility" FILES
|
||||
src/MyGUI_DataFileStream.cpp
|
||||
src/MyGUI_DataStream.cpp
|
||||
src/MyGUI_DynLib.cpp
|
||||
src/MyGUI_Guid.cpp
|
||||
src/MyGUI_RenderOut.cpp
|
||||
src/MyGUI_TextIterator.cpp
|
||||
src/MyGUI_TextureUtility.cpp
|
||||
src/MyGUI_Timer.cpp
|
||||
src/MyGUI_XmlDocument.cpp
|
||||
)
|
||||
SOURCE_GROUP("Source Files" FILES
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Widget\\Types" FILES
|
||||
include/MyGUI_DDItemInfo.h
|
||||
include/MyGUI_IBItemInfo.h
|
||||
include/MyGUI_MenuItemType.h
|
||||
include/MyGUI_MessageStyle.h
|
||||
include/MyGUI_WidgetToolTip.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Widget\\Widget" FILES
|
||||
include/MyGUI_Button.h
|
||||
include/MyGUI_Canvas.h
|
||||
include/MyGUI_ComboBox.h
|
||||
include/MyGUI_DDContainer.h
|
||||
include/MyGUI_Edit.h
|
||||
include/MyGUI_HScroll.h
|
||||
include/MyGUI_ItemBox.h
|
||||
include/MyGUI_List.h
|
||||
include/MyGUI_ListBox.h
|
||||
include/MyGUI_ListCtrl.h
|
||||
include/MyGUI_MenuBar.h
|
||||
include/MyGUI_MenuCtrl.h
|
||||
include/MyGUI_MenuItem.h
|
||||
include/MyGUI_Message.h
|
||||
include/MyGUI_MultiList.h
|
||||
include/MyGUI_PopupMenu.h
|
||||
include/MyGUI_Progress.h
|
||||
include/MyGUI_ScrollView.h
|
||||
include/MyGUI_StaticImage.h
|
||||
include/MyGUI_StaticText.h
|
||||
include/MyGUI_Tab.h
|
||||
include/MyGUI_TabItem.h
|
||||
include/MyGUI_VScroll.h
|
||||
include/MyGUI_Widget.h
|
||||
include/MyGUI_Window.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Widget\\Interfaces" FILES
|
||||
include/MyGUI_IWidgetFactory.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Widget" FILES
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Utility\\Logging" FILES
|
||||
include/MyGUI_LogManager.h
|
||||
include/MyGUI_LogStream.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Utility" FILES
|
||||
include/MyGUI_Bitwise.h
|
||||
include/MyGUI_CoordConverter.h
|
||||
include/MyGUI_DataFileStream.h
|
||||
include/MyGUI_DataStream.h
|
||||
include/MyGUI_Delegate.h
|
||||
include/MyGUI_DelegateImplement.h
|
||||
include/MyGUI_DynLib.h
|
||||
include/MyGUI_Enumerator.h
|
||||
include/MyGUI_EventPair.h
|
||||
include/MyGUI_Guid.h
|
||||
include/MyGUI_RenderOut.h
|
||||
include/MyGUI_TextChangeHistory.h
|
||||
include/MyGUI_TextIterator.h
|
||||
include/MyGUI_TextureUtility.h
|
||||
include/MyGUI_TextView.h
|
||||
include/MyGUI_Timer.h
|
||||
include/MyGUI_UString.h
|
||||
include/MyGUI_Utility.h
|
||||
include/MyGUI_WidgetTranslate.h
|
||||
include/MyGUI_XmlDocument.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core\\Common\\Interfaces" FILES
|
||||
include/MyGUI_ICroppedRectangle.h
|
||||
include/MyGUI_IDataStream.h
|
||||
include/MyGUI_Instance.h
|
||||
include/MyGUI_IObject.h
|
||||
include/MyGUI_ISerializable.h
|
||||
include/MyGUI_ITexture.h
|
||||
include/MyGUI_IUnlinkWidget.h
|
||||
include/MyGUI_IVertexBuffer.h
|
||||
include/MyGUI_IWidgetCreator.h
|
||||
include/MyGUI_Plugin.h
|
||||
include/MyGUI_RTTI.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core\\Common\\Base" FILES
|
||||
include/MyGUI_BiIndexBase.h
|
||||
include/MyGUI_ScrollViewBase.h
|
||||
include/MyGUI_WidgetEvent.h
|
||||
include/MyGUI_WidgetUserData.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core\\Common" FILES
|
||||
include/MyGUI.h
|
||||
include/MyGUI_CastWidget.h
|
||||
include/MyGUI_Common.h
|
||||
include/MyGUI_Diagnostic.h
|
||||
include/MyGUI_Exception.h
|
||||
include/MyGUI_GenericFactory.h
|
||||
include/MyGUI_Macros.h
|
||||
include/MyGUI_Platform.h
|
||||
include/MyGUI_Precompiled.h
|
||||
include/MyGUI_Prerequest.h
|
||||
include/MyGUI_RenderFormat.h
|
||||
include/MyGUI_ResourceHolder.h
|
||||
include/MyGUI_WidgetDefines.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core\\SubWidget\\Interfaces" FILES
|
||||
include/MyGUI_IStateInfo.h
|
||||
include/MyGUI_ISubWidget.h
|
||||
include/MyGUI_ISubWidgetRect.h
|
||||
include/MyGUI_ISubWidgetText.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core\\SubWidget" FILES
|
||||
include/MyGUI_EditText.h
|
||||
include/MyGUI_MainSkin.h
|
||||
include/MyGUI_RawRect.h
|
||||
include/MyGUI_RotatingSkin.h
|
||||
include/MyGUI_SimpleText.h
|
||||
include/MyGUI_SubSkin.h
|
||||
include/MyGUI_TileRect.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core\\LayerItem\\Interfaces" FILES
|
||||
include/MyGUI_ILayer.h
|
||||
include/MyGUI_ILayerItem.h
|
||||
include/MyGUI_ILayerNode.h
|
||||
include/MyGUI_IRenderTarget.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core\\LayerItem" FILES
|
||||
include/MyGUI_LayerItem.h
|
||||
include/MyGUI_LayerNode.h
|
||||
include/MyGUI_OverlappedLayer.h
|
||||
include/MyGUI_RenderItem.h
|
||||
include/MyGUI_SharedLayer.h
|
||||
include/MyGUI_SharedLayerNode.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core\\Controller" FILES
|
||||
include/MyGUI_ActionController.h
|
||||
include/MyGUI_ControllerEdgeHide.h
|
||||
include/MyGUI_ControllerFadeAlpha.h
|
||||
include/MyGUI_ControllerItem.h
|
||||
include/MyGUI_ControllerPosition.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core\\Resource\\Interface" FILES
|
||||
include/MyGUI_IFont.h
|
||||
include/MyGUI_IPointer.h
|
||||
include/MyGUI_IResource.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core\\Resource\\Data" FILES
|
||||
include/MyGUI_ChildSkinInfo.h
|
||||
include/MyGUI_FontData.h
|
||||
include/MyGUI_MaskPickInfo.h
|
||||
include/MyGUI_SubWidgetBinding.h
|
||||
include/MyGUI_SubWidgetInfo.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core\\Resource" FILES
|
||||
include/MyGUI_ResourceImageSet.h
|
||||
include/MyGUI_ResourceImageSetPointer.h
|
||||
include/MyGUI_ResourceManualFont.h
|
||||
include/MyGUI_ResourceManualPointer.h
|
||||
include/MyGUI_ResourceSkin.h
|
||||
include/MyGUI_ResourceTrueTypeFont.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core\\Types" FILES
|
||||
include/MyGUI_Align.h
|
||||
include/MyGUI_Any.h
|
||||
include/MyGUI_Colour.h
|
||||
include/MyGUI_CommonStateInfo.h
|
||||
include/MyGUI_ImageInfo.h
|
||||
include/MyGUI_InputDefine.h
|
||||
include/MyGUI_RenderTargetInfo.h
|
||||
include/MyGUI_TCoord.h
|
||||
include/MyGUI_TPoint.h
|
||||
include/MyGUI_TRect.h
|
||||
include/MyGUI_TSize.h
|
||||
include/MyGUI_Types.h
|
||||
include/MyGUI_Version.h
|
||||
include/MyGUI_VertexData.h
|
||||
include/MyGUI_WidgetStyle.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core\\Manager" FILES
|
||||
include/MyGUI_ClipboardManager.h
|
||||
include/MyGUI_ControllerManager.h
|
||||
include/MyGUI_DataManager.h
|
||||
include/MyGUI_DynLibManager.h
|
||||
include/MyGUI_FactoryManager.h
|
||||
include/MyGUI_FontManager.h
|
||||
include/MyGUI_Gui.h
|
||||
include/MyGUI_InputManager.h
|
||||
include/MyGUI_LanguageManager.h
|
||||
include/MyGUI_LayerManager.h
|
||||
include/MyGUI_LayoutManager.h
|
||||
include/MyGUI_PluginManager.h
|
||||
include/MyGUI_PointerManager.h
|
||||
include/MyGUI_RenderManager.h
|
||||
include/MyGUI_ResourceManager.h
|
||||
include/MyGUI_SkinManager.h
|
||||
include/MyGUI_SubWidgetManager.h
|
||||
include/MyGUI_WidgetManager.h
|
||||
)
|
||||
SOURCE_GROUP("Header Files\\Core" FILES
|
||||
)
|
||||
SOURCE_GROUP("Header Files" FILES
|
||||
include/MyGUI_Allocator.h
|
||||
include/MyGUI_CustomAllocator.h
|
||||
)
|
||||
SOURCE_GROUP("" FILES
|
||||
CMakeLists.txt
|
||||
)
|
@ -1,92 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Georgiy Evmenov
|
||||
@date 01/2008
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_H__
|
||||
#define __MYGUI_H__
|
||||
|
||||
#include "MyGUI_Gui.h"
|
||||
|
||||
#include "MyGUI_Button.h"
|
||||
#include "MyGUI_ComboBox.h"
|
||||
#include "MyGUI_Edit.h"
|
||||
#include "MyGUI_HScroll.h"
|
||||
#include "MyGUI_List.h"
|
||||
#include "MyGUI_StaticText.h"
|
||||
#include "MyGUI_StaticImage.h"
|
||||
#include "MyGUI_Tab.h"
|
||||
#include "MyGUI_TabItem.h"
|
||||
#include "MyGUI_VScroll.h"
|
||||
#include "MyGUI_Window.h"
|
||||
#include "MyGUI_Progress.h"
|
||||
#include "MyGUI_Message.h"
|
||||
#include "MyGUI_ItemBox.h"
|
||||
#include "MyGUI_MultiList.h"
|
||||
#include "MyGUI_MenuCtrl.h"
|
||||
#include "MyGUI_MenuItem.h"
|
||||
#include "MyGUI_PopupMenu.h"
|
||||
#include "MyGUI_MenuBar.h"
|
||||
#include "MyGUI_ScrollView.h"
|
||||
#include "MyGUI_DDContainer.h"
|
||||
#include "MyGUI_Canvas.h"
|
||||
#include "MyGUI_ListCtrl.h"
|
||||
#include "MyGUI_ListBox.h"
|
||||
|
||||
#include "MyGUI_InputManager.h"
|
||||
#include "MyGUI_SubWidgetManager.h"
|
||||
#include "MyGUI_ClipboardManager.h"
|
||||
#include "MyGUI_LayerManager.h"
|
||||
#include "MyGUI_LogManager.h"
|
||||
#include "MyGUI_SkinManager.h"
|
||||
#include "MyGUI_WidgetManager.h"
|
||||
#include "MyGUI_LayoutManager.h"
|
||||
#include "MyGUI_FontManager.h"
|
||||
#include "MyGUI_PointerManager.h"
|
||||
#include "MyGUI_PluginManager.h"
|
||||
#include "MyGUI_DynLibManager.h"
|
||||
#include "MyGUI_ControllerManager.h"
|
||||
#include "MyGUI_LanguageManager.h"
|
||||
#include "MyGUI_ResourceManager.h"
|
||||
#include "MyGUI_RenderManager.h"
|
||||
#include "MyGUI_DataManager.h"
|
||||
#include "MyGUI_FactoryManager.h"
|
||||
|
||||
#include "MyGUI_ActionController.h"
|
||||
#include "MyGUI_ControllerEdgeHide.h"
|
||||
#include "MyGUI_ControllerFadeAlpha.h"
|
||||
#include "MyGUI_ControllerPosition.h"
|
||||
#include "MyGUI_CoordConverter.h"
|
||||
#include "MyGUI_IResource.h"
|
||||
#include "MyGUI_CastWidget.h"
|
||||
#include "MyGUI_Any.h"
|
||||
#include "MyGUI_MenuItemType.h"
|
||||
#include "MyGUI_Version.h"
|
||||
#include "MyGUI_XmlDocument.h"
|
||||
#include "MyGUI_WidgetStyle.h"
|
||||
#include "MyGUI_IObject.h"
|
||||
#include "MyGUI_ISerializable.h"
|
||||
#include "MyGUI_RenderOut.h"
|
||||
|
||||
#include "MyGUI_RawRect.h"
|
||||
#include "MyGUI_RotatingSkin.h"
|
||||
#include "MyGUI_TextureUtility.h"
|
||||
|
||||
#endif // __MYGUI_H__
|
@ -1,75 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 01/2008
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_ACTION_CONTROLLER_H__
|
||||
#define __MYGUI_ACTION_CONTROLLER_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_Types.h"
|
||||
#include <math.h>
|
||||
|
||||
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 <int N>
|
||||
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 <int N>
|
||||
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__
|
@ -1,202 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 08/2008
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_ALIGN_H__
|
||||
#define __MYGUI_ALIGN_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_Macros.h"
|
||||
#include "MyGUI_Diagnostic.h"
|
||||
#include <map>
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
struct MYGUI_EXPORT Align
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
HCenter = MYGUI_FLAG_NONE, /**< center horizontally */
|
||||
VCenter = MYGUI_FLAG_NONE, /**< center vertically */
|
||||
Center = HCenter | VCenter, /**< center in the dead center */
|
||||
|
||||
Left = MYGUI_FLAG(1), /**< value from the left (and center vertically) */
|
||||
Right = MYGUI_FLAG(2), /**< value from the right (and center vertically) */
|
||||
HStretch = Left | Right, /**< stretch horizontally proportionate to parent window (and center vertically) */
|
||||
|
||||
Top = MYGUI_FLAG(3), /**< value from the top (and center horizontally) */
|
||||
Bottom = MYGUI_FLAG(4), /**< value from the bottom (and center horizontally) */
|
||||
VStretch = Top | Bottom, /**< stretch vertically proportionate to parent window (and center horizontally) */
|
||||
|
||||
Stretch = HStretch | VStretch, /**< stretch proportionate to parent window */
|
||||
Default = Left | Top, /**< default value (value from left and top) */
|
||||
|
||||
HRelative = MYGUI_FLAG(5),
|
||||
VRelative = MYGUI_FLAG(6),
|
||||
Relative = HRelative | VRelative
|
||||
};
|
||||
|
||||
Align(Enum _value = Default) : value(_value) { }
|
||||
|
||||
bool isHCenter() const { return HCenter == (value & ((int)HStretch | (int)HRelative)); }
|
||||
bool isVCenter() const { return VCenter == (value & ((int)VStretch | (int)VRelative)); }
|
||||
bool isCenter() const { return Center == (value & ((int)Stretch | (int)Relative)); }
|
||||
|
||||
bool isLeft() const { return Left == (value & ((int)HStretch | (int)HRelative)); }
|
||||
bool isRight() const { return Right == (value & ((int)HStretch | (int)HRelative)); }
|
||||
bool isHStretch() const { return HStretch == (value & ((int)HStretch | (int)HRelative)); }
|
||||
|
||||
bool isTop() const { return Top == (value & ((int)VStretch | (int)VRelative)); }
|
||||
bool isBottom() const { return (Bottom == (value & ((int)VStretch | (int)VRelative))); }
|
||||
bool isVStretch() const { return (VStretch == (value & ((int)VStretch | (int)VRelative))); }
|
||||
|
||||
bool isStretch() const { return (Stretch == (value & ((int)Stretch | (int)Relative))); }
|
||||
bool isDefault() const { return (Default == (value & ((int)Stretch | (int)Relative))); }
|
||||
|
||||
bool isHRelative() const { return HRelative == (value & (int)HRelative); }
|
||||
bool isVRelative() const { return VRelative == (value & (int)VRelative); }
|
||||
bool isRelative() const { return Relative == (value & (int)Relative); }
|
||||
|
||||
Align& operator |= (Align const& _other) { value = Enum(int(value) | int(_other.value)); return *this; }
|
||||
friend Align operator | (Enum const& a, Enum const& b) { return Align(Enum(int(a) | int(b))); }
|
||||
friend Align operator | (Align const& a, Align const& b) { return Align(Enum(int(a.value) | int(b.value))); }
|
||||
|
||||
friend bool operator == (Align const& a, Align const& b) { return a.value == b.value; }
|
||||
friend bool operator != (Align const& a, Align const& b) { return a.value != b.value; }
|
||||
|
||||
typedef std::map<std::string, int> MapAlign;
|
||||
|
||||
static Align parse(const std::string& _value)
|
||||
{
|
||||
Align result(Enum(0));
|
||||
const MapAlign& map_names = result.getValueNames();
|
||||
const std::vector<std::string>& vec = utility::split(_value);
|
||||
for (size_t pos=0; pos<vec.size(); pos++)
|
||||
{
|
||||
MapAlign::const_iterator iter = map_names.find(vec[pos]);
|
||||
if (iter != map_names.end())
|
||||
{
|
||||
result.value = Enum(int(result.value) | int(iter->second));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string print() const
|
||||
{
|
||||
std::string result;
|
||||
|
||||
if (value & Left)
|
||||
{
|
||||
if (value & Right) result = "HStretch";
|
||||
else result = "Left";
|
||||
}
|
||||
else if (value & Right) result = "Right";
|
||||
else result = "HCenter";
|
||||
|
||||
if (value & Top)
|
||||
{
|
||||
if (value & Bottom) result += " VStretch";
|
||||
else result += " Top";
|
||||
}
|
||||
else if (value & Bottom) result += " Bottom";
|
||||
else result += " VCenter";
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
friend std::ostream& operator << ( std::ostream& _stream, const Align& _value )
|
||||
{
|
||||
_stream << _value.print();
|
||||
return _stream;
|
||||
}
|
||||
|
||||
friend std::istream& operator >> ( std::istream& _stream, Align& _value )
|
||||
{
|
||||
_value.value = Enum(0);
|
||||
std::string value;
|
||||
_stream >> value;
|
||||
|
||||
const MapAlign& map_names = _value.getValueNames();
|
||||
MapAlign::const_iterator iter = map_names.find(value);
|
||||
if (iter != map_names.end())
|
||||
_value.value = Enum(int(_value.value) | int(iter->second));
|
||||
|
||||
|
||||
if (!_stream.eof())
|
||||
{
|
||||
std::string value2;
|
||||
_stream >> value2;
|
||||
iter = map_names.find(value2);
|
||||
if (iter != map_names.end())
|
||||
_value.value = Enum(int(_value.value) | int(iter->second));
|
||||
}
|
||||
|
||||
return _stream;
|
||||
}
|
||||
|
||||
private:
|
||||
const MapAlign& getValueNames() const
|
||||
{
|
||||
static MapAlign map_names;
|
||||
|
||||
if (map_names.empty())
|
||||
{
|
||||
// OBSOLETE
|
||||
map_names["ALIGN_HCENTER"] = HCenter;
|
||||
map_names["ALIGN_VCENTER"] = VCenter;
|
||||
map_names["ALIGN_CENTER"] = Center;
|
||||
map_names["ALIGN_LEFT"] = Left;
|
||||
map_names["ALIGN_RIGHT"] = Right;
|
||||
map_names["ALIGN_HSTRETCH"] = HStretch;
|
||||
map_names["ALIGN_TOP"] = Top;
|
||||
map_names["ALIGN_BOTTOM"] = Bottom;
|
||||
map_names["ALIGN_VSTRETCH"] = VStretch;
|
||||
map_names["ALIGN_STRETCH"] = Stretch;
|
||||
map_names["ALIGN_DEFAULT"] = Default;
|
||||
|
||||
MYGUI_REGISTER_VALUE(map_names, HCenter);
|
||||
MYGUI_REGISTER_VALUE(map_names, VCenter);
|
||||
MYGUI_REGISTER_VALUE(map_names, Center);
|
||||
MYGUI_REGISTER_VALUE(map_names, Left);
|
||||
MYGUI_REGISTER_VALUE(map_names, Right);
|
||||
MYGUI_REGISTER_VALUE(map_names, HStretch);
|
||||
MYGUI_REGISTER_VALUE(map_names, Top);
|
||||
MYGUI_REGISTER_VALUE(map_names, Bottom);
|
||||
MYGUI_REGISTER_VALUE(map_names, VStretch);
|
||||
MYGUI_REGISTER_VALUE(map_names, Stretch);
|
||||
MYGUI_REGISTER_VALUE(map_names, Default);
|
||||
MYGUI_REGISTER_VALUE(map_names, HRelative);
|
||||
MYGUI_REGISTER_VALUE(map_names, VRelative);
|
||||
MYGUI_REGISTER_VALUE(map_names, Relative);
|
||||
}
|
||||
|
||||
return map_names;
|
||||
}
|
||||
|
||||
private:
|
||||
Enum value;
|
||||
};
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_ALIGN_H__
|
@ -1,89 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 05/2009
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_ALLOCATOR_H__
|
||||
#define __MYGUI_ALLOCATOR_H__
|
||||
|
||||
#include <memory>
|
||||
#include <limits>
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
template<typename T>
|
||||
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<T> to allocator<U>
|
||||
template<typename U>
|
||||
struct rebind
|
||||
{
|
||||
typedef Allocator<U> other;
|
||||
};
|
||||
|
||||
public:
|
||||
inline explicit Allocator() { }
|
||||
inline ~Allocator() { }
|
||||
template<typename U>
|
||||
inline explicit Allocator(Allocator<U> 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<void>::const_pointer = 0)
|
||||
{
|
||||
return reinterpret_cast<pointer>(::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<size_type>::max() / sizeof(T);
|
||||
}
|
||||
|
||||
// construction/destruction
|
||||
inline void construct(pointer p, const T& t) { new (p) T(t); }
|
||||
inline void destroy(pointer p) { p->~T(); }
|
||||
|
||||
inline bool operator==(Allocator const&) { return true; }
|
||||
inline bool operator!=(Allocator const& a) { return !operator==(a); }
|
||||
};
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_ALLOCATOR_H__
|
@ -1,78 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 06/2009
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#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<typename Type>
|
||||
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<typename Type>
|
||||
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<typename Type>
|
||||
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__
|
@ -1,111 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 11/2007
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_BUTTON_H__
|
||||
#define __MYGUI_BUTTON_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_StaticText.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
class MYGUI_EXPORT Button :
|
||||
public StaticText
|
||||
{
|
||||
MYGUI_RTTI_DERIVED( Button )
|
||||
|
||||
public:
|
||||
Button();
|
||||
|
||||
//! OLD Set button check state
|
||||
void setButtonPressed(bool _value) { setStateCheck(_value); }
|
||||
//! OLD Get buton check
|
||||
bool getButtonPressed() { return getStateCheck(); }
|
||||
|
||||
//! Set button check state
|
||||
void setStateCheck(bool _value);
|
||||
|
||||
//! Get buton check
|
||||
bool getStateCheck() { return mIsStateCheck; }
|
||||
|
||||
//! Set image index (image should be defined in skin)
|
||||
void setImageIndex(size_t _value);
|
||||
//! Get image index
|
||||
size_t getImageIndex();
|
||||
|
||||
/** Enable or disable Image mode\n
|
||||
Image mode: when button state changed Image on button also change it's picture.\n
|
||||
Disabled (false) by default.
|
||||
*/
|
||||
void setModeImage(bool _value);
|
||||
/** Get Image mode flag */
|
||||
bool getModeImage() { return mModeImage; }
|
||||
|
||||
/** Get pointer to glyph image for this button (if it exist in button skin) */
|
||||
StaticImage* getStaticImage() { return mImage; }
|
||||
|
||||
/** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */
|
||||
virtual void setProperty(const std::string& _key, const std::string& _value);
|
||||
|
||||
/*internal:*/
|
||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
||||
|
||||
void _setMouseFocus(bool _focus);
|
||||
|
||||
protected:
|
||||
virtual ~Button();
|
||||
|
||||
virtual void baseChangeWidgetSkin(ResourceSkin* _info);
|
||||
|
||||
virtual void onMouseLostFocus(Widget* _new);
|
||||
virtual void onMouseSetFocus(Widget* _old);
|
||||
virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id);
|
||||
virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id);
|
||||
|
||||
virtual void baseUpdateEnable();
|
||||
|
||||
bool _setState(const std::string& _value);
|
||||
void setImageResource(const std::string& _name);
|
||||
|
||||
private:
|
||||
void updateButtonState();
|
||||
|
||||
void shutdownWidgetSkin();
|
||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
||||
|
||||
private:
|
||||
// нажата ли кнопка
|
||||
bool mIsMousePressed;
|
||||
// в фокусе ли кнопка
|
||||
bool mIsMouseFocus;
|
||||
// статус кнопки нажата или нет
|
||||
bool mIsStateCheck;
|
||||
|
||||
StaticImage* mImage;
|
||||
bool mModeImage;
|
||||
|
||||
};
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_BUTTON_H__
|
@ -1,246 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Alexander Ptakhin
|
||||
@date 01/2009
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_CANVAS_H__
|
||||
#define __MYGUI_CANVAS_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_Widget.h"
|
||||
#include "MyGUI_ITexture.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
/**
|
||||
* Widget wrapper over Texture - shows the texture.
|
||||
* Implemented: resizing of texture (see TextureResizeMode); recovery after lossing device;
|
||||
*/
|
||||
class MYGUI_EXPORT Canvas :
|
||||
public Widget,
|
||||
public ITextureInvalidateListener
|
||||
{
|
||||
MYGUI_RTTI_DERIVED( Canvas )
|
||||
|
||||
public:
|
||||
Canvas();
|
||||
|
||||
struct Event
|
||||
{
|
||||
Event( bool _textureChanged, bool _widgetResized, bool _requested ) :
|
||||
textureChanged( _textureChanged ),
|
||||
widgetResized( _widgetResized ),
|
||||
requested( _requested )
|
||||
{
|
||||
}
|
||||
|
||||
bool textureChanged;
|
||||
bool widgetResized;
|
||||
|
||||
/// This update was caused by calling updateTexture();
|
||||
bool requested;
|
||||
};
|
||||
|
||||
typedef delegates::CDelegate1<Canvas*> EventInfo_Canvas;
|
||||
typedef delegates::CDelegate2<Canvas*, Event> EventInfo_CanvasEvent;
|
||||
|
||||
//FIXME
|
||||
/**
|
||||
Available resize and view modes of texture
|
||||
@remarks PT - Power of Two (size)
|
||||
*/
|
||||
enum TextureResizeMode
|
||||
{
|
||||
//
|
||||
TRM_PT_CONST_SIZE, /// Texture doesn't resizes and fills all widget space
|
||||
TRM_PT_VIEW_REQUESTED, /// You can view all pixels of texture, texture cropped by sizes of widget
|
||||
TRM_PT_VIEW_ALL /// Texture resizes and fills all widget space
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
/// Creates texture
|
||||
void createTexture( TextureResizeMode _resizeMode, TextureUsage _usage = getDefaultTextureUsage(), PixelFormat _format = getDefaultTextureFormat() );
|
||||
|
||||
/// Creates texture
|
||||
void createTexture( int _width, int _height, TextureResizeMode _resizeMode, TextureUsage _usage = getDefaultTextureUsage(), PixelFormat _format = getDefaultTextureFormat() );
|
||||
|
||||
/// Creates texture
|
||||
void createTexture( const IntSize& _size, TextureResizeMode _resizeMode, TextureUsage _usage = getDefaultTextureUsage(), PixelFormat _format = getDefaultTextureFormat() );
|
||||
|
||||
/// Destroys texture
|
||||
void destroyTexture();
|
||||
|
||||
/// Call user delegate update and removes old texture if it isn't original.
|
||||
void updateTexture();
|
||||
|
||||
/// Locks hardware pixel buffer.
|
||||
void* lock(TextureUsage _usage = TextureUsage::Write);
|
||||
|
||||
/// Unlocks hardware pixel buffer.
|
||||
void unlock();
|
||||
|
||||
/// Checks lockness of hardware _pixel buffer.
|
||||
bool isLocked() const { return mTexture->isLocked(); }
|
||||
|
||||
/// Returns real width of texture.
|
||||
int getTextureRealWidth() const { return (int) mTexture->getWidth(); }
|
||||
|
||||
/// Returns real height of texture.
|
||||
int getTextureRealHeight() const { return (int) mTexture->getHeight(); }
|
||||
|
||||
/// Returns real _size of texture.
|
||||
IntSize getTextureRealSize() const { return IntSize( getTextureRealWidth(), getTextureRealHeight() ); }
|
||||
|
||||
/// Returns needed width while creating texture.
|
||||
int getTextureSrcWidth() const { return mReqTexSize.width; }
|
||||
|
||||
/// Returns needed height while creating texture.
|
||||
int getTextureSrcHeight() const { return mReqTexSize.height; }
|
||||
|
||||
/// Returns needed sizes while creating texture.
|
||||
IntSize getTextureSrcSize() const { return mReqTexSize; }
|
||||
|
||||
/// Returns needed sizes while creating texture.
|
||||
PixelFormat getTextureFormat() const { return mTexture->getFormat(); }
|
||||
|
||||
/// Returns name of the current texture.
|
||||
const std::string& getTextureName() const { return mTexture->getName(); }
|
||||
|
||||
//! @copydoc Widget::setSize(const IntSize& _value)
|
||||
virtual void setSize(const IntSize& _value);
|
||||
//! @copydoc Widget::setCoord(const IntCoord& _value)
|
||||
virtual void setCoord(const IntCoord& _value);
|
||||
|
||||
/** @copydoc Widget::setSize(int _width, int _height) */
|
||||
void setSize(int _width, int _height) { setSize(IntSize(_width, _height)); }
|
||||
/** @copydoc Widget::setCoord(int _left, int _top, int _width, int _height) */
|
||||
void setCoord(int _left, int _top, int _width, int _height) { setCoord(IntCoord(_left, _top, _width, _height)); }
|
||||
|
||||
/// Returns resize mode
|
||||
TextureResizeMode getResizeMode() const { return mTexResizeMode; }
|
||||
|
||||
/// Sets resize mode of texture \sa TextureResizeMode
|
||||
void setResizeMode( TextureResizeMode _set ) { mTexResizeMode = _set; }
|
||||
|
||||
/// Checks if the texture has the source (required by user) size, otherwise real texture size are bigger.
|
||||
bool isTextureSrcSize() const;
|
||||
|
||||
/// Returns true if the texture was created (and exists), otherwise false
|
||||
bool isTextureCreated() const { return mTexture != nullptr; }
|
||||
|
||||
/// Returns true if we own the texture, otherwise false. \sa mManaged
|
||||
bool isTextureManaged() const { return mTexManaged; }
|
||||
|
||||
/// Reurns interface texture.
|
||||
ITexture* getTexture() { return mTexture; }
|
||||
|
||||
/// Sets the texture managed @remarks Be careful with assigning managed status to texture, which wasn't created in Canvas! \sa mManaged
|
||||
void setTextureManaged( bool _value ) { mTexManaged = _value; }
|
||||
|
||||
/// Returns default GUI texture usage
|
||||
static TextureUsage getDefaultTextureUsage() { return TextureUsage::Stream | TextureUsage::Write; }
|
||||
|
||||
/// Returns default GUI texture format
|
||||
static PixelFormat getDefaultTextureFormat() { return PixelFormat::R8G8B8A8; }
|
||||
|
||||
/*event:*/
|
||||
/** Event : Notify user texture instance will be changed \sa requestUpdateCanvas\n
|
||||
signature : void method(MyGUI::Canvas* _canvas)\n
|
||||
@param _canvas, which will be updated
|
||||
*/
|
||||
EventInfo_Canvas eventPreTextureChanges;
|
||||
|
||||
/** Event : Texture instance was changed (May be caused by resizing texture or lossing device). User have to update all references to new instance of texture.\n
|
||||
signature : void method(MyGUI::Canvas* _canvas, MyGUI::Canvas::Event _event)\n
|
||||
@param _canvas, which needs to update
|
||||
@param _event
|
||||
*/
|
||||
EventInfo_CanvasEvent requestUpdateCanvas;
|
||||
|
||||
/*internal:*/
|
||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
||||
|
||||
protected:
|
||||
virtual ~Canvas();
|
||||
|
||||
/// Destroys texture
|
||||
void _destroyTexture( bool _sendEvent );
|
||||
|
||||
/// Update entered parameters according to current texture resize mode(size) and restore (if can) parameters of usage and format from texture
|
||||
void validate( int& _width, int& _height, TextureUsage& _usage, PixelFormat& _format ) const;
|
||||
|
||||
/// Creates the texture itself
|
||||
void createExactTexture( int _width, int _height, TextureUsage _usage, PixelFormat _format );
|
||||
|
||||
/// Checks if we need to create a texture with such sizes.
|
||||
bool checkCreate( int _width, int _height ) const;
|
||||
|
||||
/// Calls when resize widget
|
||||
void resize( const IntSize& _size );
|
||||
|
||||
/// Correct texture uv-coordinates
|
||||
void correctUV();
|
||||
|
||||
//! @copydoc Widget::baseChangeWidgetSkin(ResourceSkin* _info)
|
||||
void baseChangeWidgetSkin( ResourceSkin* _info );
|
||||
|
||||
//! @copydoc Widget::initialiseWidgetSkin(ResourceSkin* _info)
|
||||
void initialiseWidgetSkin( ResourceSkin* _info );
|
||||
|
||||
//! @copydoc Widget::shutdownWidgetSkin()
|
||||
void shutdownWidgetSkin();
|
||||
|
||||
/// For updating once per frame.
|
||||
void frameAdvise( bool _advise );
|
||||
|
||||
/// For updating once per frame.
|
||||
void frameEntered( float _time );
|
||||
|
||||
virtual void textureInvalidate(ITexture* _texture);
|
||||
|
||||
protected:
|
||||
/// Current texture
|
||||
ITexture* mTexture;
|
||||
|
||||
/// Requested bu user sizes
|
||||
IntSize mReqTexSize;
|
||||
|
||||
/// Generated texture name
|
||||
std::string mGenTexName;
|
||||
|
||||
/// Texture resize mode \sa TextureResizeMode
|
||||
TextureResizeMode mTexResizeMode;
|
||||
|
||||
/// Saved pointer from last calling lock. \sa lock
|
||||
uint8* mTexData;
|
||||
|
||||
/// true if we own the texture (can delete it or replace by another instance), otherwise false
|
||||
bool mTexManaged;
|
||||
|
||||
/// For updating once per frame. True state means updating before next frame starts.
|
||||
bool mFrameAdvise;
|
||||
|
||||
};
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_CANVAS_H__
|
@ -1,47 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 12/2007
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_CAST_WIDGET_H__
|
||||
#define __MYGUI_CAST_WIDGET_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_Widget.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
#ifndef MYGUI_DONT_USE_OBSOLETE
|
||||
|
||||
// шаблонный класс для проверки типа виджета
|
||||
template <typename T>
|
||||
MYGUI_OBSOLETE("use : template<typename Type> Type* Widget::castType(bool _throw)")
|
||||
T* castWidget(Widget * _widget)
|
||||
{
|
||||
MYGUI_DEBUG_ASSERT(nullptr != _widget, "Error static cast, widget == nullptr");
|
||||
return _widget->castType<T>();
|
||||
}
|
||||
|
||||
#endif // MYGUI_DONT_USE_OBSOLETE
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_CAST_WIDGET_H__
|
@ -1,73 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 12/2007
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_CHILD_SKIN_INFO_H__
|
||||
#define __MYGUI_CHILD_SKIN_INFO_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_WidgetStyle.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
struct MYGUI_EXPORT ChildSkinInfo
|
||||
{
|
||||
ChildSkinInfo() : style(WidgetStyle::Child), align(Align::Default) { }
|
||||
|
||||
ChildSkinInfo(const std::string& _type, const WidgetStyle& _style, const std::string& _skin, const IntCoord& _coord, const Align& _align, const std::string& _layer, const std::string& _name) :
|
||||
type(_type),
|
||||
skin(_skin),
|
||||
name(_name),
|
||||
layer(_layer),
|
||||
style(_style),
|
||||
coord(_coord),
|
||||
align(_align)
|
||||
{
|
||||
// set Child style by default
|
||||
if (style == WidgetStyle::MAX) style = WidgetStyle::Child;
|
||||
}
|
||||
|
||||
void addParam(const std::string& _key, const std::string& _value)
|
||||
{
|
||||
params[_key] = _value;
|
||||
}
|
||||
|
||||
std::string findValue(const std::string& _key) const
|
||||
{
|
||||
MapString::const_iterator iter = params.find(_key);
|
||||
if (iter != params.end()) return iter->second;
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string type, skin, name, layer;
|
||||
WidgetStyle style;
|
||||
IntCoord coord;
|
||||
Align align;
|
||||
MapString params;
|
||||
};
|
||||
|
||||
typedef std::vector<ChildSkinInfo> VectorChildSkinInfo;
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
|
||||
#endif // __MYGUI_CHILD_SKIN_INFO_H__
|
@ -1,70 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 11/2007
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_CLIPBOARD_MANAGER_H__
|
||||
#define __MYGUI_CLIPBOARD_MANAGER_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_Instance.h"
|
||||
#include "MyGUI_Types.h"
|
||||
#include "MyGUI_UString.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
class MYGUI_EXPORT ClipboardManager
|
||||
{
|
||||
MYGUI_INSTANCE_HEADER( ClipboardManager )
|
||||
|
||||
public:
|
||||
void initialise();
|
||||
void shutdown();
|
||||
|
||||
/** Set current data in clipboard
|
||||
@param _type of data (for example "Text")
|
||||
@param _data
|
||||
*/
|
||||
void setClipboardData(const std::string& _type, const std::string& _data);
|
||||
/** Clear specific type data
|
||||
@param _type of data to delete (for example "Text")
|
||||
*/
|
||||
void clearClipboardData(const std::string& _type);
|
||||
/** Get specific type data
|
||||
@param _type of data to get (for example "Text")
|
||||
*/
|
||||
std::string getClipboardData(const std::string& _type);
|
||||
|
||||
private:
|
||||
MapString mClipboardData;
|
||||
|
||||
#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
|
||||
// дискриптор нашего главного окна
|
||||
size_t mHwnd;
|
||||
// строка, которую мы положили в буфер обмена винды
|
||||
UString mPutTextInClipboard;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __MYGUI_CLIPBOARD_MANAGER_H__
|
@ -1,163 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 12/2008
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_COLOUR_H__
|
||||
#define __MYGUI_COLOUR_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_Types.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
struct MYGUI_EXPORT Colour
|
||||
{
|
||||
float red, green, blue, alpha;
|
||||
|
||||
static const Colour Zero;
|
||||
static const Colour Black;
|
||||
static const Colour White;
|
||||
static const Colour Red;
|
||||
static const Colour Green;
|
||||
static const Colour Blue;
|
||||
|
||||
Colour() : red( 1 ), green( 1 ), blue( 1 ), alpha( 1 ) { }
|
||||
Colour( float _red, float _green, float _blue, float _alpha = 1 ) : red( _red ), green( _green ), blue( _blue ), alpha( _alpha ) { }
|
||||
explicit Colour(const std::string& _value) { *this = parse(_value); }
|
||||
|
||||
|
||||
Colour& operator=( Colour const& _value )
|
||||
{
|
||||
red = _value.red;
|
||||
green = _value.green;
|
||||
blue = _value.blue;
|
||||
alpha = _value.alpha;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==( Colour const& _value ) const
|
||||
{
|
||||
return ((red == _value.red) && (green == _value.green) && (blue == _value.blue) && (alpha == _value.alpha));
|
||||
}
|
||||
|
||||
bool operator!=( Colour const& _value ) const
|
||||
{
|
||||
return ! (*this == _value);
|
||||
}
|
||||
|
||||
void set( float _red, float _green, float _blue, float _alpha = 1 )
|
||||
{
|
||||
red = _red;
|
||||
green = _green;
|
||||
blue = _blue;
|
||||
alpha = _alpha;
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
red = green = blue = alpha = 0;
|
||||
}
|
||||
|
||||
std::string print() const
|
||||
{
|
||||
std::ostringstream stream;
|
||||
stream << *this;
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
static Colour parse(const std::string& _value)
|
||||
{
|
||||
if (!_value.empty())
|
||||
{
|
||||
if (_value[0] == '#')
|
||||
{
|
||||
std::istringstream stream(_value.substr(1));
|
||||
int result = 0;
|
||||
stream >> std::hex >> result;
|
||||
if (!stream.fail())
|
||||
{
|
||||
return Colour( (unsigned char)( result >> 16 ) / 256.0f, (unsigned char)( result >> 8 ) / 256.0f, (unsigned char)( result ) / 256.0f );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
float red, green, blue, alpha = 1;
|
||||
std::istringstream stream(_value);
|
||||
stream >> red >> green >> blue;
|
||||
if (!stream.fail())
|
||||
{
|
||||
if (!stream.eof())
|
||||
stream >> alpha;
|
||||
return Colour(red, green, blue, alpha);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Colour::Zero;
|
||||
}
|
||||
|
||||
friend std::ostream& operator << ( std::ostream& _stream, const Colour& _value )
|
||||
{
|
||||
_stream << _value.red << " " << _value.green << " " << _value.blue << " " << _value.alpha;
|
||||
return _stream;
|
||||
}
|
||||
|
||||
friend std::istream& operator >> ( std::istream& _stream, Colour& _value )
|
||||
{
|
||||
_value.clear();
|
||||
|
||||
std::string value;
|
||||
_stream >> value;
|
||||
|
||||
if (value.empty())
|
||||
return _stream;
|
||||
|
||||
if (value[0] == '#')
|
||||
{
|
||||
_value = Colour::parse(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::istringstream stream(value);
|
||||
stream >> _value.red;
|
||||
if (stream.fail())
|
||||
_value.clear();
|
||||
else
|
||||
{
|
||||
_stream >> _value.green >> _value.blue;
|
||||
if (!_stream.eof())
|
||||
_stream >> _value.alpha;
|
||||
else
|
||||
_value.alpha = 1;
|
||||
|
||||
if (_stream.fail())
|
||||
_value.clear();
|
||||
}
|
||||
}
|
||||
|
||||
return _stream;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_COLOUR_H__
|
@ -1,237 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 12/2007
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_COMBO_BOX_H__
|
||||
#define __MYGUI_COMBO_BOX_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_Edit.h"
|
||||
#include "MyGUI_List.h"
|
||||
#include "MyGUI_Any.h"
|
||||
#include "MyGUI_EventPair.h"
|
||||
#include "MyGUI_ControllerFadeAlpha.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
typedef delegates::CDelegate2<ComboBox*, size_t> EventHandle_ComboBoxPtrSizeT;
|
||||
|
||||
class MYGUI_EXPORT ComboBox :
|
||||
public Edit
|
||||
{
|
||||
MYGUI_RTTI_DERIVED( ComboBox )
|
||||
|
||||
public:
|
||||
ComboBox();
|
||||
|
||||
//------------------------------------------------------------------------------//
|
||||
// манипуляции айтемами
|
||||
|
||||
//! Get number of items
|
||||
size_t getItemCount() const { return mList->getItemCount(); }
|
||||
|
||||
//! Insert an item into a array at a specified position
|
||||
void insertItemAt(size_t _index, const UString& _name, Any _data = Any::Null);
|
||||
|
||||
//! Add an item to the end of a array
|
||||
void addItem(const UString& _name, Any _data = Any::Null) { return insertItemAt(ITEM_NONE, _name, _data); }
|
||||
|
||||
//! Remove item at a specified position
|
||||
void removeItemAt(size_t _index);
|
||||
|
||||
//! Remove all items
|
||||
void removeAllItems();
|
||||
|
||||
|
||||
//! Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found
|
||||
size_t findItemIndexWith(const UString& _name);
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------//
|
||||
// манипуляции выделениями
|
||||
|
||||
//! Get index of selected item (ITEM_NONE if none selected)
|
||||
size_t getIndexSelected() { return mItemIndex; }
|
||||
|
||||
//! Select specified _index
|
||||
void setIndexSelected(size_t _index);
|
||||
|
||||
//! Clear item selection
|
||||
void clearIndexSelected() { setIndexSelected(ITEM_NONE); }
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------//
|
||||
// манипуляции данными
|
||||
|
||||
//! Replace an item data at a specified position
|
||||
void setItemDataAt(size_t _index, Any _data);
|
||||
|
||||
//! Clear an item data at a specified position
|
||||
void clearItemDataAt(size_t _index) { setItemDataAt(_index, Any::Null); }
|
||||
|
||||
//! Get item data from specified position
|
||||
template <typename ValueType>
|
||||
ValueType * getItemDataAt(size_t _index, bool _throw = true)
|
||||
{
|
||||
return mList->getItemDataAt<ValueType>(_index, _throw);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------//
|
||||
// манипуляции отображением
|
||||
|
||||
//! Replace an item name at a specified position
|
||||
void setItemNameAt(size_t _index, const UString& _name);
|
||||
|
||||
//! Get item name from specified position
|
||||
const UString& getItemNameAt(size_t _index) { return mList->getItemNameAt(_index); }
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------//
|
||||
// манипуляции выдимостью
|
||||
|
||||
//! Move all elements so specified becomes visible
|
||||
void beginToItemAt(size_t _index) { mList->beginToItemAt(_index); }
|
||||
|
||||
//! Move all elements so first becomes visible
|
||||
void beginToItemFirst() { if (getItemCount()) beginToItemAt(0); }
|
||||
|
||||
//! Move all elements so last becomes visible
|
||||
void beginToItemLast() { if (getItemCount()) beginToItemAt(getItemCount() - 1); }
|
||||
|
||||
//! Move all elements so selected becomes visible
|
||||
void beginToItemSelected() { if (getIndexSelected() != ITEM_NONE) beginToItemAt(getIndexSelected()); }
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------//
|
||||
// методы для управления отображением
|
||||
|
||||
//! Set drop list mode (text can not be edited)
|
||||
void setComboModeDrop(bool _value);
|
||||
//! Get drop list mode flag
|
||||
bool getComboModeDrop() { return mModeDrop; }
|
||||
|
||||
//! Set smooth show of list
|
||||
void setSmoothShow(bool _value) { mShowSmooth = _value; }
|
||||
//! Get smooth show of list flag
|
||||
bool getSmoothShow() { return mShowSmooth; }
|
||||
|
||||
//! Get max list height
|
||||
void setMaxListHeight(int _value) { mMaxHeight = _value; }
|
||||
//! Set max list height
|
||||
int getMaxListHeight() { return mMaxHeight; }
|
||||
|
||||
/** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */
|
||||
virtual void setProperty(const std::string& _key, const std::string& _value);
|
||||
|
||||
/*event:*/
|
||||
/** Event : Enter pressed in combo mode or item selected in drop.\n
|
||||
signature : void method(MyGUI::ComboBox* _sender, size_t _index)
|
||||
@param _sender widget that called this event
|
||||
@param _index item
|
||||
*/
|
||||
EventPair<EventHandle_WidgetVoid, EventHandle_ComboBoxPtrSizeT> 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<EventHandle_WidgetSizeT, EventHandle_ComboBoxPtrSizeT> eventComboChangePosition;
|
||||
|
||||
|
||||
/*internal:*/
|
||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
||||
|
||||
/*obsolete:*/
|
||||
#ifndef MYGUI_DONT_USE_OBSOLETE
|
||||
|
||||
MYGUI_OBSOLETE("use : size_t ComboBox::getIndexSelected()")
|
||||
size_t getItemIndexSelected() { return getIndexSelected(); }
|
||||
MYGUI_OBSOLETE("use : void ComboBox::setIndexSelected(size_t _index)")
|
||||
void setItemSelectedAt(size_t _index) { setIndexSelected(_index); }
|
||||
MYGUI_OBSOLETE("use : void ComboBox::clearIndexSelected()")
|
||||
void clearItemSelected() { clearIndexSelected(); }
|
||||
|
||||
MYGUI_OBSOLETE("use : void ComboBox::insertItemAt(size_t _index, const UString& _name)")
|
||||
void insertItem(size_t _index, const UString& _name) { insertItemAt(_index, _name); }
|
||||
MYGUI_OBSOLETE("use : void ComboBox::setItemNameAt(size_t _index, const UString& _name)")
|
||||
void setItem(size_t _index, const UString& _item) { setItemNameAt(_index, _item); }
|
||||
MYGUI_OBSOLETE("use : const UString& ComboBox::getItemNameAt(size_t _index)")
|
||||
const UString& getItem(size_t _index) { return getItemNameAt(_index); }
|
||||
MYGUI_OBSOLETE("use : void ComboBox::removeItemAt(size_t _index)")
|
||||
void deleteItem(size_t _index) { removeItemAt(_index); }
|
||||
MYGUI_OBSOLETE("use : void ComboBox::removeAllItems()")
|
||||
void deleteAllItems() { removeAllItems(); }
|
||||
MYGUI_OBSOLETE("use : size_t ComboBox::getIndexSelected()")
|
||||
size_t getItemSelect() { return getIndexSelected(); }
|
||||
MYGUI_OBSOLETE("use : void void ComboBox::clearIndexSelected()")
|
||||
void resetItemSelect() { clearIndexSelected(); }
|
||||
MYGUI_OBSOLETE("use : void ComboBox::setIndexSelected(size_t _index)")
|
||||
void setItemSelect(size_t _index) { setIndexSelected(_index); }
|
||||
|
||||
#endif // MYGUI_DONT_USE_OBSOLETE
|
||||
|
||||
protected:
|
||||
virtual ~ComboBox();
|
||||
|
||||
virtual void onKeyButtonPressed(KeyCode _key, Char _char);
|
||||
|
||||
virtual void baseChangeWidgetSkin(ResourceSkin* _info);
|
||||
|
||||
private:
|
||||
void notifyButtonPressed(Widget* _sender, int _left, int _top, MouseButton _id);
|
||||
void notifyListLostFocus(Widget* _sender, MyGUI::Widget* _new);
|
||||
void notifyListSelectAccept(List* _widget, size_t _position);
|
||||
void notifyListMouseItemActivate(List* _widget, size_t _position);
|
||||
void notifyListChangePosition(List* _widget, size_t _position);
|
||||
void notifyMouseWheel(Widget* _sender, int _rel);
|
||||
void notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id);
|
||||
void notifyEditTextChange(Edit* _sender);
|
||||
|
||||
void showList();
|
||||
void hideList();
|
||||
|
||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
||||
void shutdownWidgetSkin();
|
||||
|
||||
void actionWidgetHide(Widget* _widget);
|
||||
|
||||
ControllerFadeAlpha* createControllerFadeAlpha(float _alpha, float _coef, bool _enable);
|
||||
|
||||
private:
|
||||
Button* mButton;
|
||||
List* mList;
|
||||
|
||||
bool mListShow;
|
||||
int mMaxHeight;
|
||||
size_t mItemIndex;
|
||||
bool mModeDrop;
|
||||
bool mDropMouse;
|
||||
bool mShowSmooth;
|
||||
bool mManualList;
|
||||
|
||||
};
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_COMBO_BOX_H__
|
@ -1,57 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@author baho_is
|
||||
@date 11/2007
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_COMMON_H__
|
||||
#define __MYGUI_COMMON_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <exception>
|
||||
#include <math.h>
|
||||
|
||||
#ifdef MYGUI_CUSTOM_ALLOCATOR
|
||||
# include "MyGUI_CustomAllocator.h"
|
||||
#else // MYGUI_CUSTOM_ALLOCATOR
|
||||
# include "MyGUI_Allocator.h"
|
||||
#endif // MYGUI_CUSTOM_ALLOCATOR
|
||||
|
||||
#include "MyGUI_Macros.h"
|
||||
#include "MyGUI_Diagnostic.h"
|
||||
#include "MyGUI_LogManager.h"
|
||||
#include "MyGUI_Instance.h"
|
||||
#include "MyGUI_Types.h"
|
||||
#include "MyGUI_RenderOut.h"
|
||||
#include "MyGUI_Utility.h"
|
||||
#include "MyGUI_InputDefine.h"
|
||||
#include "MyGUI_Version.h"
|
||||
#include "MyGUI_WidgetStyle.h"
|
||||
#include "MyGUI_UString.h"
|
||||
#include "MyGUI_Delegate.h"
|
||||
|
||||
#endif // __MYGUI_COMMON_H__
|
@ -1,145 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 06/2009
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_COMMON_STATE_INFO_H__
|
||||
#define __MYGUI_COMMON_STATE_INFO_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_IStateInfo.h"
|
||||
#include "MyGUI_CoordConverter.h"
|
||||
#include "MyGUI_LanguageManager.h"
|
||||
#include "MyGUI_TextureUtility.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
class MYGUI_EXPORT SubSkinStateInfo :
|
||||
public IStateInfo
|
||||
{
|
||||
MYGUI_RTTI_DERIVED( SubSkinStateInfo )
|
||||
|
||||
public:
|
||||
virtual ~SubSkinStateInfo() { }
|
||||
|
||||
const FloatRect& getRect() { return mRect; }
|
||||
|
||||
private:
|
||||
virtual void deserialization(xml::ElementPtr _node, Version _version)
|
||||
{
|
||||
std::string texture = _node->getParent()->getParent()->findAttribute("texture");
|
||||
|
||||
// ïîääåðæêà çàìåíû òåãîâ â ñêèíàõ
|
||||
if (_version >= Version(1, 1))
|
||||
{
|
||||
texture = LanguageManager::getInstance().replaceTags(texture);
|
||||
}
|
||||
|
||||
const IntSize& size = texture_utility::getTextureSize(texture);
|
||||
const IntCoord& coord = IntCoord::parse(_node->findAttribute("offset"));
|
||||
mRect = CoordConverter::convertTextureCoord(coord, size);
|
||||
}
|
||||
|
||||
private:
|
||||
FloatRect mRect;
|
||||
};
|
||||
|
||||
class MYGUI_EXPORT TileRectStateInfo :
|
||||
public IStateInfo
|
||||
{
|
||||
MYGUI_RTTI_DERIVED( TileRectStateInfo )
|
||||
|
||||
public:
|
||||
TileRectStateInfo() : mTileH(true), mTileV(true) { }
|
||||
virtual ~TileRectStateInfo() { }
|
||||
|
||||
const FloatRect& getRect() { return mRect; }
|
||||
const IntSize& getTileSize() { return mTileSize; }
|
||||
bool getTileH() { return mTileH; }
|
||||
bool getTileV() { return mTileV; }
|
||||
|
||||
private:
|
||||
virtual void deserialization(xml::ElementPtr _node, Version _version)
|
||||
{
|
||||
std::string texture = _node->getParent()->getParent()->findAttribute("texture");
|
||||
|
||||
// ïîääåðæêà çàìåíû òåãîâ â ñêèíàõ
|
||||
if (_version >= Version(1, 1))
|
||||
{
|
||||
texture = LanguageManager::getInstance().replaceTags(texture);
|
||||
}
|
||||
|
||||
const IntSize& size = texture_utility::getTextureSize(texture);
|
||||
const IntCoord& coord = IntCoord::parse(_node->findAttribute("offset"));
|
||||
mRect = CoordConverter::convertTextureCoord(coord, size);
|
||||
|
||||
xml::ElementEnumerator prop = _node->getElementEnumerator();
|
||||
while (prop.next("Property"))
|
||||
{
|
||||
const std::string& key = prop->findAttribute("key");
|
||||
const std::string& value = prop->findAttribute("value");
|
||||
if (key == "TileH") mTileH = utility::parseBool(value);
|
||||
else if (key == "TileV") mTileV = utility::parseBool(value);
|
||||
else if (key == "TileSize") mTileSize = IntSize::parse(value);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
FloatRect mRect;
|
||||
IntSize mTileSize;
|
||||
bool mTileH;
|
||||
bool mTileV;
|
||||
};
|
||||
|
||||
class MYGUI_EXPORT EditTextStateInfo :
|
||||
public IStateInfo
|
||||
{
|
||||
MYGUI_RTTI_DERIVED( EditTextStateInfo )
|
||||
|
||||
public:
|
||||
EditTextStateInfo() : mColour(Colour::White), mShift(false) { }
|
||||
virtual ~EditTextStateInfo() { }
|
||||
|
||||
const Colour& getColour() { return mColour; }
|
||||
bool getShift() { return mShift; }
|
||||
|
||||
private:
|
||||
virtual void deserialization(xml::ElementPtr _node, Version _version)
|
||||
{
|
||||
mShift = utility::parseBool(_node->findAttribute("shift"));
|
||||
|
||||
std::string colour = _node->findAttribute("colour");
|
||||
if (_version >= Version(1, 1))
|
||||
{
|
||||
colour = LanguageManager::getInstance().replaceTags(colour);
|
||||
}
|
||||
|
||||
mColour = Colour::parse(colour);
|
||||
}
|
||||
|
||||
private:
|
||||
Colour mColour;
|
||||
bool mShift;
|
||||
};
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_COMMON_STATE_INFO_H__
|
@ -1,84 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Evmenov Georgiy
|
||||
@date 04/2008
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_CONTROLLER_EDGE_HIDE_H__
|
||||
#define __MYGUI_CONTROLLER_EDGE_HIDE_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_WidgetDefines.h"
|
||||
#include "MyGUI_ControllerItem.h"
|
||||
#include "MyGUI_Types.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
/** This controller used for hiding widgets near screen edges.
|
||||
Widget will start hiding(move out of screen) if it's near
|
||||
border and it and it's childrens don't have any focus. Hiding
|
||||
till only small part of widget be visible. Widget will move
|
||||
inside screen if it have any focus.
|
||||
*/
|
||||
class MYGUI_EXPORT ControllerEdgeHide :
|
||||
public ControllerItem
|
||||
{
|
||||
MYGUI_RTTI_DERIVED( ControllerEdgeHide )
|
||||
|
||||
public:
|
||||
ControllerEdgeHide();
|
||||
virtual ~ControllerEdgeHide() { }
|
||||
|
||||
/**
|
||||
@param _value in which widget will be hidden or shown
|
||||
*/
|
||||
void setTime(float _value) { mTime = _value; }
|
||||
|
||||
/**
|
||||
@param _remainPixels how many pixels you will see afterr full hide
|
||||
*/
|
||||
void setRemainPixels(int _value) { mRemainPixels = _value; }
|
||||
|
||||
/**
|
||||
@param _shadowSize adds to _remainPixels when hiding left or top (for example used for windows with shadows)
|
||||
*/
|
||||
void setShadowSize(int _value) { mShadowSize = _value; }
|
||||
|
||||
virtual void setProperty(const std::string& _key, const std::string& _value);
|
||||
|
||||
private:
|
||||
bool addTime(Widget* _widget, float _time);
|
||||
void prepareItem(Widget* _widget);
|
||||
|
||||
void recalculateTime(Widget* _widget);
|
||||
|
||||
delegates::CDelegate1<Widget*> eventPostAction;
|
||||
|
||||
float mTime;
|
||||
int mRemainPixels;
|
||||
int mShadowSize;
|
||||
float mElapsedTime;
|
||||
// for checking if widget was moved
|
||||
MyGUI::IntCoord mLastCoord;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __MYGUI_CONTROLLER_EDGE_HIDE_H__
|
@ -1,78 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 01/2008
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_CONTROLLER_FADE_ALPHA_H__
|
||||
#define __MYGUI_CONTROLLER_FADE_ALPHA_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_WidgetDefines.h"
|
||||
#include "MyGUI_ControllerItem.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
/** This controller used for smooth changing alpha of widget in time */
|
||||
class MYGUI_EXPORT ControllerFadeAlpha :
|
||||
public ControllerItem
|
||||
{
|
||||
MYGUI_RTTI_DERIVED( ControllerFadeAlpha )
|
||||
|
||||
public:
|
||||
ControllerFadeAlpha();
|
||||
virtual ~ControllerFadeAlpha() { }
|
||||
|
||||
/**
|
||||
@param _alpha that will be as result of changing
|
||||
*/
|
||||
void setAlpha(float _value) { mAlpha = _value; }
|
||||
|
||||
/**
|
||||
@param _coef of alpha changing speed (1. mean that alpha will change from 0 to 1 at 1 second)
|
||||
*/
|
||||
void setCoef(float _value) { mCoef = _value; }
|
||||
|
||||
/**
|
||||
@param _enabled if true then widget will be inactive after start of alpha changing
|
||||
*/
|
||||
void setEnabled(bool _value) { mEnabled = _value; }
|
||||
|
||||
|
||||
virtual void setProperty(const std::string& _key, const std::string& _value);
|
||||
|
||||
private:
|
||||
bool addTime(Widget* _widget, float _time);
|
||||
void prepareItem(Widget* _widget);
|
||||
|
||||
bool getEnabled() { return mEnabled; }
|
||||
float getAlpha() { return mAlpha; }
|
||||
float getCoef() { return mCoef; }
|
||||
|
||||
private:
|
||||
float mAlpha;
|
||||
float mCoef;
|
||||
bool mEnabled;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __MYGUI_CONTROLLER_FADE_ALPHA_H__
|
@ -1,73 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 01/2008
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_CONTROLLER_ITEM_H__
|
||||
#define __MYGUI_CONTROLLER_ITEM_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_WidgetDefines.h"
|
||||
#include "MyGUI_IObject.h"
|
||||
#include "MyGUI_Delegate.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
/** Base interface for controllers */
|
||||
class MYGUI_EXPORT ControllerItem :
|
||||
public IObject
|
||||
{
|
||||
MYGUI_RTTI_DERIVED( ControllerItem )
|
||||
|
||||
public:
|
||||
virtual ~ControllerItem() { }
|
||||
|
||||
virtual void prepareItem(Widget* _widget) = 0;
|
||||
virtual bool addTime(Widget* _widget, float _time) = 0;
|
||||
|
||||
virtual void setProperty(const std::string& _key, const std::string& _value) { }
|
||||
|
||||
/** Event : Before controller started working.\n
|
||||
signature : void method(MyGUI::Widget* _sender)\n
|
||||
@param _sender widget under control
|
||||
*/
|
||||
delegates::CDelegate1<Widget*>
|
||||
eventPreAction;
|
||||
|
||||
/** Event : Controller updated (called every frame).\n
|
||||
signature : void method(MyGUI::Widget* _sender)\n
|
||||
@param _sender widget under control
|
||||
*/
|
||||
delegates::CDelegate1<Widget*>
|
||||
eventUpdateAction;
|
||||
|
||||
/** Event : After controller finished working.\n
|
||||
signature : void method(MyGUI::Widget* _sender)\n
|
||||
@param _sender widget under control
|
||||
*/
|
||||
delegates::CDelegate1<Widget*>
|
||||
eventPostAction;
|
||||
|
||||
};
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_CONTROLLER_ITEM_H__
|
@ -1,74 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 01/2008
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_CONTROLLER_MANAGER_H__
|
||||
#define __MYGUI_CONTROLLER_MANAGER_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_Instance.h"
|
||||
#include "MyGUI_ControllerItem.h"
|
||||
#include "MyGUI_IUnlinkWidget.h"
|
||||
#include "MyGUI_WidgetDefines.h"
|
||||
#include "MyGUI_ActionController.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
class MYGUI_EXPORT ControllerManager : public IUnlinkWidget
|
||||
{
|
||||
MYGUI_INSTANCE_HEADER( ControllerManager )
|
||||
|
||||
public:
|
||||
void initialise();
|
||||
void shutdown();
|
||||
|
||||
// ñîçäàåò êîíòðîëëåð
|
||||
ControllerItem* createItem(const std::string& _type);
|
||||
|
||||
/** Add controlled widget
|
||||
@param _widget to be controlled
|
||||
@param _item controller with some actions (for example ControllerFadeAlpha or your own)
|
||||
@note _item will be deleted automatically at end of controller lifetime
|
||||
(if not removed by removeItem(Widget* _widget) before)
|
||||
*/
|
||||
void addItem(Widget* _widget, ControllerItem * _item);
|
||||
|
||||
/** Stop the control over a widget
|
||||
@param _widget to be removed
|
||||
*/
|
||||
void removeItem(Widget* _widget);
|
||||
|
||||
private:
|
||||
void _unlinkWidget(Widget* _widget);
|
||||
void frameEntered(float _time);
|
||||
void clear();
|
||||
|
||||
private:
|
||||
typedef std::pair<Widget*, ControllerItem *> PairControllerItem;
|
||||
typedef std::list<PairControllerItem> ListControllerItem;
|
||||
ListControllerItem mListItem;
|
||||
|
||||
};
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_CONTROLLER_MANAGER_H__
|
@ -1,95 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Evmenov Georgiy
|
||||
@date 03/2008
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#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<const IntCoord&, const IntCoord&, IntCoord&, float> FrameAction;
|
||||
|
||||
ControllerPosition();
|
||||
virtual ~ControllerPosition() { }
|
||||
|
||||
void setCoord(const IntCoord& _value);
|
||||
|
||||
void setSize(const IntSize& _value);
|
||||
|
||||
void setPosition(const IntPoint& _value);
|
||||
|
||||
void setFunction(const std::string& _value);
|
||||
|
||||
/**
|
||||
@param _value seconds in which widget planned to reach destination coordinate
|
||||
*/
|
||||
void setTime(float _value) { mTime = _value; }
|
||||
|
||||
/**
|
||||
@param _action applied to widget every frame (see ControllerPosition::eventFrameAction)
|
||||
*/
|
||||
void setAction(FrameAction::IDelegate* _value) { eventFrameAction = _value; }
|
||||
|
||||
virtual void setProperty(const std::string& _key, const std::string& _value);
|
||||
|
||||
private:
|
||||
bool addTime(Widget* _widget, float _time);
|
||||
void prepareItem(Widget* _widget);
|
||||
|
||||
float getElapsedTime() { return mElapsedTime; }
|
||||
|
||||
IntCoord mStartCoord;
|
||||
IntCoord mDestCoord;
|
||||
float mTime;
|
||||
float mElapsedTime;
|
||||
|
||||
// controller changing position
|
||||
bool mCalcPosition;
|
||||
// controller changing size
|
||||
bool mCalcSize;
|
||||
|
||||
/** Event : Every frame action while controller exist.\n
|
||||
signature : void method(const IntRect& _startRect, const IntRect& _destRect, IntRect& _result, float _current_time)\n
|
||||
@param _startRect start coordinate of widget
|
||||
@param _destRect destination coordinate
|
||||
@param _result resultRect
|
||||
@param _current_time elapsed time (_current_time is real elapsed time divided by _time(see constructor) so _current_time == 1 mean that _time seconds elapsed)
|
||||
*/
|
||||
FrameAction eventFrameAction;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __MYGUI_CONTROLLER_POSITION_H__
|
@ -1,92 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 06/2009
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_COORD_CONVERTER_H__
|
||||
#define __MYGUI_COORD_CONVERTER_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_Types.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
class MYGUI_EXPORT CoordConverter
|
||||
{
|
||||
public:
|
||||
/** Convert pixel coordinates to texture UV coordinates */
|
||||
static FloatRect convertTextureCoord(const IntCoord& _coord, const IntSize& _textureSize)
|
||||
{
|
||||
if (!_textureSize.width || !_textureSize.height) return FloatRect();
|
||||
return FloatRect(
|
||||
(float)_coord.left / (float)_textureSize.width,
|
||||
(float)_coord.top / (float)_textureSize.height,
|
||||
(float)_coord.right() / (float)_textureSize.width,
|
||||
(float)_coord.bottom() / (float)_textureSize.height);
|
||||
}
|
||||
|
||||
/* Convert from relative to pixel coordinates.
|
||||
@param _coord relative coordinates.
|
||||
*/
|
||||
static IntCoord convertFromRelative(const FloatCoord& _coord, const IntSize& _view)
|
||||
{
|
||||
return IntCoord(int(_coord.left * _view.width), int(_coord.top * _view.height), int(_coord.width * _view.width), int(_coord.height * _view.height));
|
||||
}
|
||||
|
||||
/* Convert from relative to pixel coordinates.
|
||||
@param _coord relative coordinates.
|
||||
*/
|
||||
static IntSize convertFromRelative(const FloatSize& _size, const IntSize& _view)
|
||||
{
|
||||
return IntSize(int(_size.width * _view.width), int(_size.height * _view.height));
|
||||
}
|
||||
|
||||
/* Convert from relative to pixel coordinates.
|
||||
@param _coord relative coordinates.
|
||||
*/
|
||||
static IntPoint convertFromRelative(const FloatPoint& _point, const IntSize& _view)
|
||||
{
|
||||
return IntPoint(int(_point.left * _view.width), int(_point.top * _view.height));
|
||||
}
|
||||
|
||||
/* Convert from pixel to relative coordinates.
|
||||
@param _coord pixel coordinates.
|
||||
*/
|
||||
static FloatCoord convertToRelative(const IntCoord& _coord, const IntSize& _view)
|
||||
{
|
||||
return FloatCoord(_coord.left / (float)_view.width, _coord.top / (float)_view.height, _coord.width / (float)_view.width, _coord.height / (float)_view.height);
|
||||
}
|
||||
|
||||
static FloatSize convertToRelative(const IntSize& _size, const IntSize& _view)
|
||||
{
|
||||
return FloatSize(_size.width / (float)_view.width, _size.height / (float)_view.height);
|
||||
}
|
||||
|
||||
static FloatPoint convertToRelative(const IntPoint& _point, const IntSize& _view)
|
||||
{
|
||||
return FloatPoint(_point.left / (float)_view.width, _point.top / (float)_view.height);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_COORD_CONVERTER_H__
|
@ -1,101 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 05/2009
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_CUSTOM_ALLOCATOR_H__
|
||||
#define __MYGUI_CUSTOM_ALLOCATOR_H__
|
||||
|
||||
#include <memory>
|
||||
#include <limits>
|
||||
|
||||
// for Ogre version
|
||||
#include <OgrePrerequisites.h>
|
||||
|
||||
#if OGRE_VERSION < MYGUI_DEFINE_VERSION(1, 6, 0)
|
||||
#include <OgreMemoryManager.h>
|
||||
#include <OgreNoMemoryMacros.h>
|
||||
#endif
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
template<typename T>
|
||||
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<T> to allocator<U>
|
||||
template<typename U>
|
||||
struct rebind
|
||||
{
|
||||
typedef Allocator<U> other;
|
||||
};
|
||||
|
||||
public:
|
||||
inline explicit Allocator() { }
|
||||
inline ~Allocator() { }
|
||||
template<typename U>
|
||||
inline explicit Allocator(Allocator<U> 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<void>::const_pointer = 0)
|
||||
{
|
||||
return reinterpret_cast<pointer>(::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<size_type>::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 <OgreMemoryMacros.h>
|
||||
#endif
|
||||
|
||||
#endif // __MYGUI_CUSTOM_ALLOCATOR_H__
|
@ -1,175 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 10/2008
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_DDCONTAINER_H__
|
||||
#define __MYGUI_DDCONTAINER_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_Widget.h"
|
||||
#include "MyGUI_DDItemInfo.h"
|
||||
#include "MyGUI_EventPair.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
typedef delegates::CDelegate3<DDContainer*, const DDItemInfo&, bool&> EventHandle_DDContainerPtrCDDItemInfoRefBoolRef;
|
||||
typedef delegates::CDelegate3<DDContainer*, const DDItemInfo&, bool> EventHandle_DDContainerPtrCDDItemInfoRefBool;
|
||||
typedef delegates::CDelegate2<DDContainer*, DDItemState> EventHandle_EventHandle_DDContainerPtrDDItemState;
|
||||
typedef delegates::CDelegate3<DDContainer*, WidgetPtr&, IntCoord&> EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef;
|
||||
|
||||
|
||||
class MYGUI_EXPORT DDContainer :
|
||||
public Widget
|
||||
{
|
||||
MYGUI_RTTI_DERIVED( DDContainer )
|
||||
|
||||
public:
|
||||
DDContainer();
|
||||
|
||||
/** Set drag'n'drop mode flag.
|
||||
Disabled (false) by default.
|
||||
*/
|
||||
void setNeedDragDrop(bool _value) { mNeedDragDrop = _value; }
|
||||
/** Get drag'n'drop mode flag */
|
||||
bool getNeedDragDrop() { return mNeedDragDrop; }
|
||||
|
||||
/** @copydoc Widget::setProperty(const std::string& _key, const std::string& _value) */
|
||||
virtual void setProperty(const std::string& _key, const std::string& _value);
|
||||
|
||||
/*event:*/
|
||||
/** Event : request for start drag
|
||||
signature : void method(MyGUI::DDContainer* _sender, const MyGUI::DDItemInfo& _info, bool& _result)
|
||||
@param _sender widget that called this event
|
||||
@param _info information about DDContainers
|
||||
@param _result write here true if container can be draggedor false if it can't
|
||||
*/
|
||||
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventStartDrag;
|
||||
|
||||
/** Event : request for start drag (moving mouse over container, but not dropped yet)
|
||||
signature : void method(MyGUI::DDContainer* _sender, const MyGUI::DDItemInfo& _info, bool& _result)
|
||||
@param _sender widget that called this event
|
||||
@param _info information about DDContainers
|
||||
@param _result write here true if container accept dragged widget or false if it isn't
|
||||
*/
|
||||
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventRequestDrop;
|
||||
|
||||
/** Event : end drag (drop)
|
||||
signature : void method(MyGUI::DDContainer* _sender, const MyGUI::DDItemInfo& _info, bool _result)
|
||||
@param _sender widget that called this event
|
||||
@param _info information about DDContainers
|
||||
@param _result if true then drop was successfull
|
||||
*/
|
||||
EventHandle_DDContainerPtrCDDItemInfoRefBool eventDropResult;
|
||||
|
||||
/** Event : drag'n'drop state changed
|
||||
signature : void method(MyGUI::DDContainer* _sender, MyGUI::DDItemState _state)
|
||||
@param _sender widget that called this event
|
||||
@param _state new state
|
||||
*/
|
||||
EventHandle_EventHandle_DDContainerPtrDDItemState eventChangeDDState;
|
||||
|
||||
/** Event : [not used] request widget for dragging
|
||||
signature : void method(MyGUI::DDContainer* _sender, MyGUI::Widget*& _item, MyGUI::IntCoord& _dimension)
|
||||
@param _sender widget that called this event
|
||||
@param _item write widget pointer here
|
||||
@param _dimension write widget coordinate here
|
||||
*/
|
||||
EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef requestDragWidgetInfo;
|
||||
|
||||
|
||||
/*internal:*/
|
||||
// метод для установления стейта айтема
|
||||
virtual void _setContainerItemInfo(size_t _index, bool _set, bool _accept) { }
|
||||
|
||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
||||
|
||||
/** Event : внутреннее событие, невалидна информация для контейнера
|
||||
signature : void method(MyGUI::DDContainer* _sender)
|
||||
@param _sender widget that called this event
|
||||
*/
|
||||
EventPair<EventHandle_WidgetVoid, delegates::CDelegate1<DDContainer*> >
|
||||
_eventInvalideContainer;
|
||||
|
||||
/** Event : !!обновить виджеты дропа DD_FIXME наверное internal
|
||||
signature : void method(MyGUI::DDContainer* _sender, MyGUI::Widget* _item, const MyGUI::DDWidgetState& _state)
|
||||
@param _sender widget that called this event
|
||||
@param _items
|
||||
@param _state
|
||||
*/
|
||||
delegates::CDelegate3<DDContainer*, Widget*, const DDWidgetState&>
|
||||
eventUpdateDropState;
|
||||
|
||||
protected:
|
||||
virtual ~DDContainer();
|
||||
|
||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
||||
|
||||
virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id);
|
||||
virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id);
|
||||
virtual void onMouseDrag(int _left, int _top);
|
||||
|
||||
virtual void notifyInvalideDrop(DDContainer* _sender);
|
||||
|
||||
virtual void _getContainer(Widget*& _container, size_t& _index);
|
||||
|
||||
virtual void removeDropItems();
|
||||
virtual void updateDropItems();
|
||||
virtual void updateDropItemsState(const DDWidgetState& _state);
|
||||
|
||||
void mouseDrag();
|
||||
void mouseButtonReleased(MouseButton _id);
|
||||
void mouseButtonPressed(MouseButton _id);
|
||||
|
||||
void endDrop(bool _reset);
|
||||
|
||||
private:
|
||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
||||
void shutdownWidgetSkin();
|
||||
|
||||
|
||||
protected:
|
||||
bool mDropResult;
|
||||
bool mNeedDrop;
|
||||
bool mStartDrop;
|
||||
|
||||
Widget* mOldDrop;
|
||||
Widget* mCurrentSender;
|
||||
|
||||
DDItemInfo mDropInfo;
|
||||
|
||||
size_t mDropSenderIndex;
|
||||
|
||||
// список виджетов для дропа
|
||||
Widget* mDropItem;
|
||||
IntCoord mDropDimension;
|
||||
|
||||
IntPoint mClickInWidget;
|
||||
|
||||
// нужно и виджету поддержка драг энд дропа
|
||||
bool mNeedDragDrop;
|
||||
|
||||
DDContainer* mReseiverContainer;
|
||||
};
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_DDCONTAINER_H__
|
@ -1,45 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 05/2009
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_DATA_FILE_STREAM_H__
|
||||
#define __MYGUI_DATA_FILE_STREAM_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_DataStream.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
class MYGUI_EXPORT DataFileStream : public DataStream
|
||||
{
|
||||
public:
|
||||
DataFileStream();
|
||||
DataFileStream(std::ifstream* _stream);
|
||||
~DataFileStream();
|
||||
|
||||
private:
|
||||
std::ifstream* mFileStream;
|
||||
};
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_DATA_STREAM_H__
|
@ -1,56 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 05/2009
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_DATA_MANAGER_H__
|
||||
#define __MYGUI_DATA_MANAGER_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_IDataStream.h"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
class MYGUI_EXPORT DataManager
|
||||
{
|
||||
public:
|
||||
DataManager();
|
||||
virtual ~DataManager() = 0;
|
||||
|
||||
static DataManager& getInstance();
|
||||
static DataManager* getInstancePtr();
|
||||
|
||||
virtual IDataStream* getData(const std::string& _name) = 0;
|
||||
|
||||
virtual bool isDataExist(const std::string& _name) = 0;
|
||||
|
||||
virtual const VectorString& getDataListNames(const std::string& _pattern) = 0;
|
||||
|
||||
virtual const std::string& getDataPath(const std::string& _name) = 0;
|
||||
|
||||
private:
|
||||
static DataManager* msInstance;
|
||||
bool mIsInitialise;
|
||||
};
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_DATA_MANAGER_H__
|
@ -1,51 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 05/2009
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#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__
|
@ -1,137 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@date 11/2007
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_DELEGATE_H__
|
||||
#define __MYGUI_DELEGATE_H__
|
||||
|
||||
#include "MyGUI_Diagnostic.h"
|
||||
#include <typeinfo>
|
||||
#include <list>
|
||||
|
||||
// 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 <typename T>
|
||||
#define MYGUI_T_TEMPLATE_ARGS <T>
|
||||
#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 <typename TP1>
|
||||
#define MYGUI_TEMPLATE_ARGS <TP1>
|
||||
#define MYGUI_T_TEMPLATE_PARAMS <typename T, typename TP1>
|
||||
#define MYGUI_T_TEMPLATE_ARGS <T, TP1>
|
||||
#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 <typename TP1, typename TP2>
|
||||
#define MYGUI_TEMPLATE_ARGS <TP1, TP2>
|
||||
#define MYGUI_T_TEMPLATE_PARAMS <typename T, typename TP1, typename TP2>
|
||||
#define MYGUI_T_TEMPLATE_ARGS <T, TP1, TP2>
|
||||
#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 <typename TP1, typename TP2, typename TP3>
|
||||
#define MYGUI_TEMPLATE_ARGS <TP1, TP2, TP3>
|
||||
#define MYGUI_T_TEMPLATE_PARAMS <typename T, typename TP1, typename TP2, typename TP3>
|
||||
#define MYGUI_T_TEMPLATE_ARGS <T, TP1, TP2, TP3>
|
||||
#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 <typename TP1, typename TP2, typename TP3, typename TP4>
|
||||
#define MYGUI_TEMPLATE_ARGS <TP1, TP2, TP3, TP4>
|
||||
#define MYGUI_T_TEMPLATE_PARAMS <typename T, typename TP1, typename TP2, typename TP3, typename TP4>
|
||||
#define MYGUI_T_TEMPLATE_ARGS <T, TP1, TP2, TP3, TP4>
|
||||
#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 <typename TP1, typename TP2, typename TP3, typename TP4, typename TP5>
|
||||
#define MYGUI_TEMPLATE_ARGS <TP1, TP2, TP3, TP4, TP5>
|
||||
#define MYGUI_T_TEMPLATE_PARAMS <typename T, typename TP1, typename TP2, typename TP3, typename TP4, typename TP5>
|
||||
#define MYGUI_T_TEMPLATE_ARGS <T, TP1, TP2, TP3, TP4, TP5>
|
||||
#define MYGUI_PARAMS TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5
|
||||
#define MYGUI_ARGS p1, p2, p3, p4, p5
|
||||
#define MYGUI_TYPENAME typename
|
||||
|
||||
#include "MyGUI_DelegateImplement.h"
|
||||
|
||||
|
||||
} // namespace MyGUI
|
||||
|
||||
#endif // __MYGUI_DELEGATE_H__
|
@ -1,115 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Albert Semenov
|
||||
@author baho_is
|
||||
@date 11/2007
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_DIAGNOSTIC_H__
|
||||
#define __MYGUI_DIAGNOSTIC_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_Exception.h"
|
||||
#include "MyGUI_LogManager.h"
|
||||
#include <sstream>
|
||||
|
||||
// for debugging
|
||||
#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC
|
||||
#include <crtdbg.h>
|
||||
#endif
|
||||
|
||||
#define MYGUI_LOG_SECTION "Core"
|
||||
#define MYGUI_LOG_FILENAME "MyGUI.log"
|
||||
#define MYGUI_LOG(level, text) MYGUI_LOGGING(MYGUI_LOG_SECTION, level, text)
|
||||
|
||||
#define MYGUI_BASE_EXCEPT(desc, src) throw MyGUI::Exception(desc, src, __FILE__, __LINE__);
|
||||
|
||||
// MSVC specific: sets the breakpoint
|
||||
#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC
|
||||
#define MYGUI_DBG_BREAK _CrtDbgBreak();
|
||||
#else
|
||||
#define MYGUI_DBG_BREAK
|
||||
#endif
|
||||
|
||||
#define MYGUI_EXCEPT(dest) \
|
||||
{ \
|
||||
MYGUI_LOG(Critical, dest); \
|
||||
MYGUI_DBG_BREAK;\
|
||||
std::ostringstream stream; \
|
||||
stream << dest << "\n"; \
|
||||
MYGUI_BASE_EXCEPT(stream.str().c_str(), "MyGUI"); \
|
||||
}
|
||||
|
||||
#define MYGUI_ASSERT(exp, dest) \
|
||||
{ \
|
||||
if ( ! (exp) ) \
|
||||
{ \
|
||||
MYGUI_LOG(Critical, dest); \
|
||||
MYGUI_DBG_BREAK;\
|
||||
std::ostringstream stream; \
|
||||
stream << dest << "\n"; \
|
||||
MYGUI_BASE_EXCEPT(stream.str().c_str(), "MyGUI"); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define MYGUI_ASSERT_RANGE(index, size, owner) MYGUI_ASSERT(index < size, owner << " : index number " << index << " out of range [" << size << "]");
|
||||
#define MYGUI_ASSERT_RANGE_AND_NONE(index, size, owner) MYGUI_ASSERT(index < size || index == ITEM_NONE, owner << " : index number " << index << " out of range [" << size << "]");
|
||||
#define MYGUI_ASSERT_RANGE_INSERT(index, size, owner) MYGUI_ASSERT((index <= size) || (index == MyGUI::ITEM_NONE), owner << " : insert index number " << index << " out of range [" << size << "] or not ITEM_NONE");
|
||||
|
||||
#if MYGUI_DEBUG_MODE == 1
|
||||
#define MYGUI_REGISTER_VALUE(map, value) \
|
||||
{ \
|
||||
MYGUI_LOG(Info, "Register value : '" << #value << "' = " << (int)value); \
|
||||
map[#value] = value; \
|
||||
}
|
||||
#define MYGUI_DEBUG_ASSERT(exp, dest) MYGUI_ASSERT(exp, dest)
|
||||
#else
|
||||
#define MYGUI_REGISTER_VALUE(map, value) map[#value] = value;
|
||||
#define MYGUI_DEBUG_ASSERT(exp, dest) ((void)0)
|
||||
#endif
|
||||
|
||||
|
||||
// for more info see: http://mdf-i.blogspot.com/2008/09/deprecated-gcc-vs-vs-vs-vs.html
|
||||
#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC
|
||||
#if MYGUI_COMP_VER == 1310 // VC++ 7.1
|
||||
#define MYGUI_OBSOLETE_START(text)
|
||||
#define MYGUI_OBSOLETE_END
|
||||
#else
|
||||
#define MYGUI_OBSOLETE_START(text) __declspec(deprecated(text))
|
||||
#define MYGUI_OBSOLETE_END
|
||||
#endif
|
||||
|
||||
#elif MYGUI_COMPILER == MYGUI_COMPILER_GNUC
|
||||
#if MYGUI_PLATFORM == MYGUI_PLATFORM_LINUX && MYGUI_COMP_VER == 412
|
||||
#define MYGUI_OBSOLETE_START(text)
|
||||
#define MYGUI_OBSOLETE_END
|
||||
#else
|
||||
#define MYGUI_OBSOLETE_START(text)
|
||||
#define MYGUI_OBSOLETE_END __attribute__((deprecated))
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define MYGUI_OBSOLETE_START(text)
|
||||
#define MYGUI_OBSOLETE_END
|
||||
|
||||
#endif
|
||||
|
||||
#define MYGUI_OBSOLETE(text) /*! \deprecated text */ MYGUI_OBSOLETE_START(text)MYGUI_OBSOLETE_END
|
||||
|
||||
#endif // __MYGUI_DIAGNOSTIC_H__
|
@ -1,111 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Denis Koronchik
|
||||
@author Georgiy Evmenov
|
||||
@date 09/2007
|
||||
@module
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __MYGUI_DYNLIB_H__
|
||||
#define __MYGUI_DYNLIB_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include <string>
|
||||
|
||||
|
||||
#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 <CoreFoundation/CFBundle.h>
|
||||
# define MYGUI_DYNLIB_HANDLE CFBundleRef
|
||||
# define MYGUI_DYNLIB_LOAD( a ) mac_loadExeBundle( a )
|
||||
# define MYGUI_DYNLIB_GETSYM( a, b ) mac_getBundleSym( a, b )
|
||||
# define MYGUI_DYNLIB_UNLOAD( a ) mac_unloadExeBundle( a )
|
||||
#endif
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
/*! @brief Resource holding data about a dynamic library.
|
||||
|
||||
@remarks
|
||||
This class holds the data required to get symbols from
|
||||
libraries loaded at run-time (i.e. from DLL's for so's)
|
||||
*/
|
||||
class MYGUI_EXPORT DynLib
|
||||
{
|
||||
friend class DynLibManager;
|
||||
|
||||
protected:
|
||||
DynLib(const std::string &name);
|
||||
|
||||
~DynLib();
|
||||
|
||||
public:
|
||||
|
||||
/*! Load the library
|
||||
*/
|
||||
bool load();
|
||||
|
||||
/*! Unload the library
|
||||
*/
|
||||
void unload();
|
||||
|
||||
//! Get the name of the library
|
||||
std::string getName(void) const { return mName; }
|
||||
|
||||
/**
|
||||
Returns the address of the given symbol from the loaded library.
|
||||
@param
|
||||
strName The name of the symbol to search for
|
||||
@returns
|
||||
If the function succeeds, the returned value is a handle to the symbol.
|
||||
If the function fails, the returned value is <b>nullptr</b>.
|
||||
*/
|
||||
void* getSymbol( const std::string& strName ) const throw();
|
||||
|
||||
protected:
|
||||
//! Gets the last loading error
|
||||
std::string dynlibError(void);
|
||||
|
||||
|
||||
protected:
|
||||
//! Name of library
|
||||
std::string mName;
|
||||
|
||||
//! Handle to the loaded library.
|
||||
MYGUI_DYNLIB_HANDLE mInstance;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __MYGUI_DYNLIB_H__
|
@ -1,58 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
@author Denis Koronchik
|
||||
@date 08/2007
|
||||
@module libEngine
|
||||
*/
|
||||
/*
|
||||
This file is part of MyGUI.
|
||||
|
||||
MyGUI is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
MyGUI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __MYGUI_DYN_LIB_MANAGER_H__
|
||||
#define __MYGUI_DYN_LIB_MANAGER_H__
|
||||
|
||||
#include "MyGUI_Prerequest.h"
|
||||
#include "MyGUI_Instance.h"
|
||||
#include "MyGUI_DynLib.h"
|
||||
#include <map>
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
|
||||
/*! \brief Manager of dynamic libraries
|
||||
*/
|
||||
class MYGUI_EXPORT DynLibManager
|
||||
{
|
||||
MYGUI_INSTANCE_HEADER( DynLibManager )
|
||||
|
||||
public:
|
||||
void initialise();
|
||||
void shutdown();
|
||||
|
||||
//! Load library
|
||||
DynLib* load(const std::string &fileName);
|
||||
//! Unload library
|
||||
void unload(DynLib *library);
|
||||
|
||||
private:
|
||||
//! Dynamic libraries map
|
||||
typedef std::map <std::string, DynLib*> StringDynLibMap;
|
||||
//! Loaded libraries
|
||||
StringDynLibMap mLibsMap;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __MYGUI_DYN_LIB_MANAGER_H__
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue