-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui_elem.h
87 lines (58 loc) · 1.52 KB
/
ui_elem.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
#ifndef UI_ELEM_H
#define UI_ELEM_H
#include "geometry.h"
#include "list.h"
#define WINDOW_TOP_RIGHT 0xBB
#define WINDOW_BOT_RIGHT 0xBC
#define WINDOW_BOT_LEFT 0xC8
#define WINDOW_TOP_LEFT 0xC9
#define WINDOW_HOR 0xCD
#define WINDOW_VER 0xBA
#define BLOCK 0xDB
#define BLINK_RATE 1.0f
typedef struct WINDOW_
{
RECT bounds;
int border_color_fore;
int border_color_back;
int fill_color;
LIST * textbox_list;
LIST * button_list;
LIST * hotkey_list;
}
WINDOW;
typedef struct TEXTBOX_
{
RECT text_area;
char * text;
}
TEXTBOX;
typedef struct BUTTON_
{
WINDOW * parent_window;
char * text;
int button_color;
int button_color_hover;
int button_color_click;
RECT on_click_area;
void (* on_click)();
int close_window;
}
BUTTON;
LIST * get_active_windows();
int get_active_windows_amount();
WINDOW * window(RECT rect, int border_color_fore, int border_color_back, int fill_color);
void add_button_to_window(BUTTON * button, WINDOW * window);
void add_textbox_to_window(TEXTBOX * textbox, WINDOW * window);
BUTTON * button(RECT on_click_area, int button_color, int button_color_hover, int button_color_click,
char * text,
void (* on_click)(),
int close_window);
TEXTBOX * textbox(RECT text_area, char * text, int alignment);
void show_dialog_yn(RECT bounds, char * text, void (* yes_button_action)(), void (* no_button_action)());
void draw_shadow(int screen_pos_x, int screen_pos_y);
void draw_window(WINDOW * window);
void draw_window_shadowed(WINDOW * window);
void blink_cursor();
void init_ui();
#endif