-
Notifications
You must be signed in to change notification settings - Fork 1
/
GCP_Constants.h
167 lines (151 loc) · 3.55 KB
/
GCP_Constants.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#ifndef GCP_ConstantsH
#define GCP_ConstantsH
#include "SDL.h"
#include "GCP_Math.h"
namespace gcp
{
const int PS_ALIGN_LEFT = 1;
const int PS_ALIGN_CENTER = 2;
const int PS_ALIGN_RIGHT = 4;
const int PS_CREATE_SURFACE = 8;
const int PS_TRANSPARENT_BG = 16;
const int PS_BLENDED = 32;
const int GCP_BUTTON_ROUNDRECT = 1;
const int GCP_BUTTON_SHARPRECT = 2;
const int GCP_MENU_MVERTICAL = 3;
const int GCP_MENU_MHORIZONTAL = 4;
const int GCP_COLLISIONBOX_RECTANGLE = 5;
const int GCP_COLLISIONBOX_ROUNDCIRCLE = 6;
//Êîíñòàíòû
const int GCP_SORTBY_DRAWORDER = 1;
const int GCP_SORTBY_EVENTORDER = 2;
struct GCP_Color;
//When entry point function is defined in linker
//global static structures does not work, WTF?
extern GCP_Color c_white;
extern GCP_Color c_black;
extern GCP_Color c_aquadark;
extern GCP_Color c_yellow;
extern GCP_Color c_red;
extern GCP_Color c_dkred;
extern GCP_Color c_blue;
extern GCP_Color c_lime;
extern GCP_Color c_green;
extern GCP_Color c_aqua;
extern GCP_Color c_orange;
extern GCP_Color c_grey;
extern GCP_Color c_dkgrey;
//Ñòðóêòóðà äëÿ ñîðòèðîâêè êîìïîíåòíîâ
struct SComponent
{
int draw_order;
};
//ñîáûòèå âíóòðè ôîðìû. âîçâðàùàåò ñîñòîÿíèå ñàìîé ôîðìû
struct gcp_formEvent
{
gcp_formEvent() :isEventInsideForm(false), isEventOnFormHead(false), isFormDragged(false){}
bool isFormDragged;
bool isEventInsideForm;
bool isEventOnFormHead;
};
//
struct GCP_DrawData
{
GCP_Vector<SDL_Texture*> texture;
GCP_Vector<int> twidth;
GCP_Vector<int> theight;
GCP_Vector<string> text;
GCP_Vector<GCP_Color> color;
};
//Ñäëíûå ñîáûòèÿ
//event - ãëîáàëüíîå ñîáûòèå event+1 - ëîêàëüíîå ñîáûòèå
enum GCPE_Events
{
GCP_EVENT_NONE,
GCP_ON_GLEFT_CLICK,
GCP_ON_LEFT_CLICK,
GCP_ON_GRIGHT_CLICK,
GCP_ON_RIGHT_CLICK,
GCP_ON_WHELL_GUP,
GCP_ON_WHELL_UP,
GCP_ON_WHELL_GDOWN,
GCP_ON_WHELL_DOWN,
GCP_ON_MOUSE_GDOWN,
GCP_ON_MOUSE_DOWN,
GCP_ON_MOUSE_GLDOWN,
GCP_ON_MOUSE_LDOWN,
GCP_ON_MOUSE_GUP,
GCP_ON_MOUSE_UP,
GCP_ON_MOUSE_GMOTION,
GCP_ON_MOUSE_MOTION,
GCP_ON_GKEYDOWN,
GCP_ON_KEYDOWN,
GCP_ON_GTEXTINPUT,
GCP_ON_TEXTINPUT,
GCP_ON_GDRAG,
GCP_ON_DRAG,
GCP_ON_MOUSE_GLHMOTION,
GCP_ON_MOUSE_LHMOTION,
GCP_ON_GDRAW,
GCP_ON_DRAW,
GCP_EVENT_GNONE,
GCP_MAX_FUNC_NUM,
};
struct GCP_Event
{
int eventType;
int mousex, iMouseXRel;
int mousey, iMouseYRel;
int keycode;
string sTextInput;
bool isPassingOnlyGlobalEvent;
GCP_Rect<int> drawRect;
};
enum GCPE_InputType
{
DIGITONLY,
TEXTONLY,
DOUBLEDIGIT,
ALL
};
enum GCPE_FontType
{
E_ARIAL
};
enum GCPE_TextAlign
{
E_CENTER,
E_LEFT,
E_RIGHT
};
struct GCP_Font
{
GCP_Font() :type(E_ARIAL), size(15), align(E_LEFT) {}
GCPE_FontType type;
GCPE_TextAlign align;
short size;
};
typedef unsigned short gcpUint8;
struct GCP_Color
{
gcpUint8 r;
gcpUint8 g;
gcpUint8 b;
gcpUint8 a;
GCP_Color(gcpUint8 R, gcpUint8 G, gcpUint8 B, gcpUint8 A) :r(R), g(G), b(B), a(A) {}
GCP_Color(gcpUint8 R, gcpUint8 G, gcpUint8 B) :r(R), g(G), b(B) { a = 255; }
GCP_Color(int R, int G, int B) :r(R), g(G), b(B) { a = 255; }
GCP_Color(){}
bool operator==(const GCP_Color &X){
if (r == X.r && g == X.g && b == X.b && a == X.a)
return true;
return false;
}
bool operator!=(const GCP_Color &X){
if (r == X.r && g == X.g && b == X.b && a == X.a)
return false;
return true;
}
};
}
#endif