diff options
author | Zaba999 <zaba.marcin@gmail.com> | 2012-09-10 23:29:38 +0200 |
---|---|---|
committer | Zaba999 <zaba.marcin@gmail.com> | 2012-09-10 23:29:38 +0200 |
commit | 479a67a731be5a5e8035ea7acce0344c7c605814 (patch) | |
tree | fc0448b4095ce03aeca2a1be98418aae78751d84 /src/ui/interface.h | |
parent | cf2295d08d0b2d0ba63e316f5e5e3615c5c978ac (diff) | |
download | colobot-479a67a731be5a5e8035ea7acce0344c7c605814.tar.gz colobot-479a67a731be5a5e8035ea7acce0344c7c605814.tar.bz2 colobot-479a67a731be5a5e8035ea7acce0344c7c605814.zip |
Merge with changes from Zaba999 fork.
Diffstat (limited to 'src/ui/interface.h')
-rw-r--r-- | src/ui/interface.h | 125 |
1 files changed, 67 insertions, 58 deletions
diff --git a/src/ui/interface.h b/src/ui/interface.h index 8aa7f44..02966ff 100644 --- a/src/ui/interface.h +++ b/src/ui/interface.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -19,77 +20,85 @@ #pragma once -#include "common/event.h" -#include "math/point.h" +#include <common/event.h> +#include <common/struct.h> +#include <common/misc.h> +#include <common/iman.h> +#include <math/point.h> -class CInstanceManager; -class CD3DEngine; -class CControl; -class CWindow; +#include <graphics/engine/camera.h> +#include <graphics/engine/engine.h> + +namespace Ui { + +const int MAXCONTROL = 100; + +//Forward declaration class CButton; -class CColor; class CCheck; -class CKey; +class CColor; +class CCompass; +class CControl; +class CEdit; +class CEditValue; class CGroup; class CImage; +class CKey; class CLabel; -class CEdit; -class CEditValue; -class CScroll; -class CSlider; class CList; -class CShortcut; class CMap; -class CGauge; -class CCompass; +class CScroll; +class CShortcut; +class CSlider; class CTarget; -class CCamera; - - -const int MAXCONTROL = 100; - +class CWindow; class CInterface { -public: - CInterface(CInstanceManager* iMan); - ~CInterface(); - - bool EventProcess(const Event &event); - bool GetTooltip(Math::Point pos, char* name); - - void Flush(); - CWindow* CreateWindows(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CButton* CreateButton(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CColor* CreateColor(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CCheck* CreateCheck(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CKey* CreateKey(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CGroup* CreateGroup(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CImage* CreateImage(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CLabel* CreateLabel(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg, char *name); - CEdit* CreateEdit(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CEditValue* CreateEditValue(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CScroll* CreateScroll(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CSlider* CreateSlider(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CList* CreateList(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg, float expand=1.2f); - CShortcut* CreateShortcut(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CCompass* CreateCompass(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CTarget* CreateTarget(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - CMap* CreateMap(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg); - bool DeleteControl(EventMsg eventMsg); - CControl* SearchControl(EventMsg eventMsg); - - void Draw(); - -protected: - -protected: - CInstanceManager* m_iMan; - CD3DEngine* m_engine; - CCamera* m_camera; - - CControl* m_table[MAXCONTROL]; + public: + CInterface(); + ~CInterface(); + + bool EventProcess(const Event &event); + bool GetTooltip(Math::Point pos, const char* name); + + void Flush(); + CButton* CreateButton(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CColor* CreateColor(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CCheck* CreateCheck(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CKey* CreateKey(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CGroup* CreateGroup(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CImage* CreateImage(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CEdit* CreateEdit(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CEditValue* CreateEditValue(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CScroll* CreateScroll(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CSlider* CreateSlider(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CShortcut* CreateShortcut(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CCompass* CreateCompass(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CTarget* CreateTarget(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CMap* CreateMap(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + + CWindow* CreateWindows(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + CList* CreateList(Math::Point pos, Math::Point dim, int icon, EventType eventMsg, float expand=1.2f); + CLabel* CreateLabel(Math::Point pos, Math::Point dim, int icon, EventType eventMsg, const char *name); + + bool DeleteControl(EventType eventMsg); + CControl* SearchControl(EventType eventMsg); + + void Draw(); + + protected: + int GetNextFreeControl(); + template <typename T> inline T* CreateControl(Math::Point pos, Math::Point dim, int icon, EventType eventMsg); + + CInstanceManager* m_iMan; + CEventQueue* m_event; + Gfx::CEngine* m_engine; + Gfx::CCamera* m_camera; + + CControl* m_table[MAXCONTROL]; }; +} |