GlistEngine
Loading...
Searching...
No Matches
gGUIManager.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016 Nitra Games Ltd.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef CORE_GGUIMANAGER_H_
18#define CORE_GGUIMANAGER_H_
19
20#include "gGUIFrame.h"
21#include "gGUISizer.h"
22#include "gGUIDialogue.h"
23#include <deque>
24
25class gBaseApp;
26
38public:
40 static const int fontnum = 1;
41 static const int fonttypenum = 4;
42
43 enum {
48 };
49
50 enum {
52 };
53
54 gGUIManager(gBaseApp* root, int width, int height);
55 virtual ~gGUIManager();
56
57 void setTheme(int guiTheme);
58 int getTheme();
59
60 gFont* getFont(int fontNo, int fontType = FONTTYPE_REGULAR);
61
62 void setCurrentFrame(gGUIFrame* currentFrame);
63 void setCurrentFrame(gGUIFrame* currentFrame, int width, int height);
64 void setupDialogue(gGUIDialogue* dialogue);
66
67 bool showDialogue(gGUIDialogue* dialogue);
68 bool hideDialogue(gGUIDialogue* dialogue);
69
70 void keyPressed(int key);
71 void keyReleased(int key);
72 void charPressed(unsigned int key);
73 void mouseMoved(int x, int y);
74 void mousePressed(int x, int y, int button);
75 void mouseDragged(int x, int y, int button);
76 void mouseReleased(int x, int y, int button);
77 void mouseScrolled(int x, int y);
80 void windowResized(int w, int h);
81
82 void update();
83 void draw();
84
86
90
91private:
92 gBaseApp* root;
93 gGUIFrame* currentframe;
94 gGUIFrame emptyframe;
95 gGUISizer emptysizer;
96 int guitheme;
97
98 static const int themenum = 4;
99 gColor themebackgroundcolor[themenum];
100 gColor thememiddlegroundcolor[themenum];
101 gColor themeforegroundcolor[themenum];
102 gColor themebuttoncolor[themenum];
103 gColor themepressedbuttoncolor[themenum];
104 gColor themedisabledbuttoncolor[themenum];
105 gColor themebuttonfontcolor[themenum];
106 gColor themepressedbuttonfontcolor[themenum];
107 gColor themedisabledbuttonfontcolor[themenum];
108 gColor themetextbackgroundcolor[themenum];
109 gColor themenavigationbackgroundcolor[themenum];
110 gColor themefontcolor[themenum];
111 gColor themenavigationfontcolor[themenum];
112 gFont themefonts[fontnum][fonttypenum];
113 void loadThemes();
114 void resetTheme(int guiTheme);
115
116 gGUISizer defdialoguesizer;
117
118 std::deque<gGUIDialogue*> dialogues;
119 std::deque<gGUIDialogue*> dialoguesshown;
120 gGUIDialogue* selecteddialogue;
121
122 std::deque<gGUIFrame*> registeredframesforresizing;
123};
124
125#endif /* CORE_GGUIMANAGER_H_ */
Definition gBaseApp.h:16
Definition gColor.h:17
Definition gFont.h:47
Definition gGUIDialogue.h:33
Definition gGUIFrame.h:14
Definition gGUIManager.h:37
void setCurrentFrame(gGUIFrame *currentFrame)
static const int fontnum
Definition gGUIManager.h:40
static const int GUITHEME_DARK
Definition gGUIManager.h:39
@ FONTTYPE_ITALIC
Definition gGUIManager.h:46
@ FONTTYPE_BOLDITALIC
Definition gGUIManager.h:47
@ FONTTYPE_BOLD
Definition gGUIManager.h:45
@ FONTTYPE_REGULAR
Definition gGUIManager.h:44
@ FONT_FREESANS
Definition gGUIManager.h:51
static const int fonttypenum
Definition gGUIManager.h:41
static const int GUITHEME_LIGHT
Definition gGUIManager.h:39
void mouseEntered()
void mouseMoved(int x, int y)
bool isRegisteredFrameForResizing(gGUIFrame *frame)
void keyReleased(int key)
bool isframeset
Definition gGUIManager.h:85
void windowResized(int w, int h)
void mouseDragged(int x, int y, int button)
gGUIManager(gBaseApp *root, int width, int height)
void unregisterFrameForResizing(gGUIFrame *frame)
static const int GUITHEME_DARKBLUE
Definition gGUIManager.h:39
void update()
virtual ~gGUIManager()
void setupDialogue(gGUIDialogue *dialogue)
void mouseScrolled(int x, int y)
int getTheme()
void mousePressed(int x, int y, int button)
void setCurrentFrame(gGUIFrame *currentFrame, int width, int height)
void registerFrameForResizing(gGUIFrame *frame)
void setTheme(int guiTheme)
void charPressed(unsigned int key)
bool showDialogue(gGUIDialogue *dialogue)
static const int GUITHEME_LIGHTBLUE
Definition gGUIManager.h:39
void keyPressed(int key)
gGUIFrame * getCurrentFrame()
bool hideDialogue(gGUIDialogue *dialogue)
void mouseReleased(int x, int y, int button)
gFont * getFont(int fontNo, int fontType=FONTTYPE_REGULAR)
void mouseExited()
Definition gGUISizer.h:14