Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/GUIbase.h
Show All 12 Lines | |||||
* | * | ||||
* You should have received a copy of the GNU General Public License | * You should have received a copy of the GNU General Public License | ||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | ||||
*/ | */ | ||||
/* | /* | ||||
GUI Core, stuff that the whole GUI uses | GUI Core, stuff that the whole GUI uses | ||||
--Overview-- | |||||
Contains defines, includes, types etc that the whole | Contains defines, includes, types etc that the whole | ||||
GUI should have included. | GUI should have included. | ||||
--More info-- | |||||
Check GUI.h | |||||
*/ | */ | ||||
#ifndef INCLUDED_GUIBASE | #ifndef INCLUDED_GUIBASE | ||||
#define INCLUDED_GUIBASE | #define INCLUDED_GUIBASE | ||||
#include <map> | |||||
#include <vector> | |||||
#include "gui/CGUIColor.h" | #include "gui/CGUIColor.h" | ||||
#include "ps/CStr.h" | #include "ps/CStr.h" | ||||
#include "ps/Errors.h" | #include "ps/Errors.h" | ||||
// I would like to just forward declare CSize, but it doesn't | |||||
// seem to be defined anywhere in the predefined header. | |||||
#include "ps/Shapes.h" | #include "ps/Shapes.h" | ||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
#include <map> | |||||
#include <vector> | |||||
class IGUIObject; | class IGUIObject; | ||||
// Object settings setups | |||||
// Setup an object's ConstructObject function | |||||
#define GUI_OBJECT(obj) \ | #define GUI_OBJECT(obj) \ | ||||
public: \ | public: \ | ||||
static IGUIObject* ConstructObject(CGUI& pGUI) \ | static IGUIObject* ConstructObject(CGUI& pGUI) \ | ||||
{ return new obj(pGUI); } | { return new obj(pGUI); } | ||||
/** | /** | ||||
* Message types. | * Message types. | ||||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | struct SGUIMessage | ||||
bool skipped; | bool skipped; | ||||
}; | }; | ||||
// Text alignments | // Text alignments | ||||
enum EAlign { EAlign_Left, EAlign_Right, EAlign_Center }; | enum EAlign { EAlign_Left, EAlign_Right, EAlign_Center }; | ||||
enum EVAlign { EVAlign_Top, EVAlign_Bottom, EVAlign_Center }; | enum EVAlign { EVAlign_Top, EVAlign_Bottom, EVAlign_Center }; | ||||
// Typedefs | // Typedefs | ||||
typedef std::map<CStr, IGUIObject*> map_pObjects; | using map_pObjects = std::map<CStr, IGUIObject*>; | ||||
typedef std::vector<IGUIObject*> vector_pObjects; | using vector_pObjects = std::vector<IGUIObject*>; | ||||
// Icon, you create them in the XML file with root element <setup> | // Icon, you create them in the XML file with root element <setup> | ||||
// you use them in text owned by different objects... Such as CText. | // you use them in text owned by different objects... Such as CText. | ||||
struct SGUIIcon | struct SGUIIcon | ||||
{ | { | ||||
// This struct represents an immutable type, so ensure to avoid copying the strings. | // This struct represents an immutable type, so ensure to avoid copying the strings. | ||||
NONCOPYABLE(SGUIIcon); | NONCOPYABLE(SGUIIcon); | ||||
MOVABLE(SGUIIcon); | MOVABLE(SGUIIcon); | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator