1 /* NetHack may be freely redistributed.  See license for details. */
2 
3 #ifndef _vulture_win_h_
4 #define _vulture_win_h_
5 
6 #include "vulture_types.h"
7 #include <string>
8 
9 class window;
10 
11 /*
12 * External files used by the GUI.
13 * Note: The intro sequence may use other
14 * external images, listed in the script file.
15 */
16 #define V_MAX_FILENAME_LENGTH 1024
17 
18 #define V_FILENAME_INTRO_SCRIPT  "vulture_intro.txt"
19 #define V_FILENAME_OPTIONS       "vulture.conf"
20 #define V_FILENAME_SOUNDS_CONFIG "vulture_sounds.conf"
21 
22 /*
23 * graphics files, without ".png" extension
24 */
25 #define V_FILENAME_LOGO                 "logo"
26 #ifdef VULTURE_NETHACK
27 #define V_FILENAME_MAP_SYMBOLS          "nethack_tiles"
28 #endif
29 #ifdef VULTURE_SLASHEM
30 #define V_FILENAME_MAP_SYMBOLS          "slashem_tiles"
31 #endif
32 #ifdef VULTURE_UNNETHACK
33 #define V_FILENAME_MAP_SYMBOLS          "unnethack_tiles"
34 #endif
35 #ifndef V_FILENAME_MAP_SYMBOLS
36 #error Variant?
37 #endif
38 #define V_FILENAME_CHARACTER_GENERATION "chargen2"
39 #define V_FILENAME_FONT                 "VeraSe.ttf"
40 #define V_FILENAME_WINDOW_STYLE         "winelem"
41 #define V_FILENAME_MAP_PARCHMENT        "parchment"
42 
43 /* how many ms must the mouse remain stationary until a tooltip is displayed */
44 #define HOVERTIMEOUT 400
45 
46 
47 enum responses {
48 	V_RESPOND_ANY,
49 	V_RESPOND_CHARACTER,
50 	V_RESPOND_INT,
51 	V_RESPOND_POSKEY
52 };
53 
54 
55 typedef struct {
56 	SDL_Surface *border_top;
57 	SDL_Surface *border_bottom;
58 	SDL_Surface *border_left;
59 	SDL_Surface *border_right;
60 	SDL_Surface *corner_tl;
61 	SDL_Surface *corner_tr;
62 	SDL_Surface *corner_bl;
63 	SDL_Surface *corner_br;
64 	SDL_Surface *center;
65 	SDL_Surface *radiobutton_on;
66 	SDL_Surface *radiobutton_off;
67 	SDL_Surface *checkbox_on;
68 	SDL_Surface *checkbox_count;
69 	SDL_Surface *checkbox_off;
70 	SDL_Surface *scrollbar;
71 	SDL_Surface *scrollbutton_up;
72 	SDL_Surface *scrollbutton_down;
73 	SDL_Surface *scroll_indicator;
74 	SDL_Surface *direction_arrows;
75 	SDL_Surface *invarrow_left;
76 	SDL_Surface *invarrow_right;
77 	SDL_Surface *closebutton;
78 } vulture_window_graphics;
79 
80 
81 typedef struct event {
82 	int x, y;
83 	int num;
84 	int rtype;
85 } vulture_event;
86 
87 
88 /* exported functions */
89 
90 /* high-level window functions */
91 extern void vulture_messagebox(std::string message);
92 extern int vulture_get_input(int x, int y, const char *ques, char *input);
93 
94 
95 /* drawing functions */
96 extern void vulture_refresh_window_region(void);
97 extern void vulture_invalidate_region(int, int, int, int);
98 
99 
100 /* eventstack handling */
101 extern void vulture_eventstack_add(int, int, int, int);
102 extern vulture_event * vulture_eventstack_get(void);
103 extern void vulture_eventstack_destroy(void);
104 
105 
106 /* event handling */
107 extern void vulture_event_dispatcher(void * result, int resulttype, window * topwin);
108 extern int vulture_event_dispatcher_nonblocking(void * result, window * topwin);
109 
110 /* misc functions */
111 extern void vulture_win_resize(int width, int height);
112 extern void vulture_show_mainmenu(void);
113 
114 
115 /* exported variables */
116 extern vulture_window_graphics vulture_winelem;
117 extern int vulture_suppress_helpmsg;
118 extern int vulture_whatis_singleshot;
119 extern int vulture_windows_inited;
120 
121 
122 
123 extern SDL_Rect *vulture_invrects;
124 extern int vulture_invrects_num;
125 extern int vulture_invrects_max;
126 
127 
128 #endif
129 /* End of vulture_win.h */
130