-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwindow.h
96 lines (81 loc) · 2.27 KB
/
window.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
#ifndef WINDOW_H
#define WINDOW_H
#include <sparrow3d.h>
typedef struct sWindowElement *pWindowElement;
typedef struct sWindowElement
{
int type;
int reference;
char text[512];
int width;
struct
{
int x;
int y;
int w;
int h;
int type;
} button;
pWindowElement next;
} tWindowElement;
typedef struct sWindow *pWindow;
typedef struct sWindow
{
int width,height;
int selection;
int ( *feedback )( pWindow window, pWindowElement elem, int action );
char title[512];
spFontPointer font;
pWindowElement firstElement;
int do_flip;
int main_menu;
SDL_Surface* oldScreen;
int only_ok;
int count;
int show_selection;
int *sprite_count;
int insult_button;
char* text_box_char;
int text_box_len;
void ( *resize )( Uint16 w, Uint16 h );
int cancel_to_no;
int zig_zag;
Sint32 sizeFactor;
struct
{
int x;
int y;
int w;
int h;
} button[ SP_MAPPING_MAX + 4 ];
int was_pressed;
} tWindow;
typedef enum
{
LEFT,
MIDDLE,
RIGHT
} window_text_positon;
#define WN_ACT_UPDATE 0
#define WN_ACT_LEFT 1
#define WN_ACT_RIGHT 2
#define WN_ACT_START_POLL 3
#define WN_ACT_END_POLL 4
pWindow create_window(int ( *feedback )( pWindow window, pWindowElement elem, int action ),spFontPointer font,char* title);
pWindowElement add_window_element(pWindow window,int type,int reference);
int modal_window(pWindow window, void ( *resize )( Uint16 w, Uint16 h ));
pWindow create_text_box(spFontPointer font, void ( *resize )( Uint16 w, Uint16 h ), char* caption, char* text,int len,int show_selection,int* sprite_count,int insult_button);
void delete_window(pWindow window);
void draw_edgy_rectangle(int x, int y, int * width, int * height, int B1, int B2);
int message_box(spFontPointer font, void ( *resize )( Uint16 w, Uint16 h ), char* caption);
int text_box(spFontPointer font, void ( *resize )( Uint16 w, Uint16 h ), char* caption, char* text,int len,int show_selection,int* sprite_count,int insult_button);
int sprite_box(spFontPointer font, void ( *resize )( Uint16 w, Uint16 h ), char* caption,int show_selection,int* sprite_count);
int set_message(spFontPointer font, char* caption);
void draw_message(void);
void init_window_sprites();
void quit_window_sprites();
int get_last_sprite();
void set_recent_window(pWindow window);
void window_draw(void);
int window_calc(Uint32 steps);
#endif