webperimental: killstack decides stack protects.
[freeciv.git] / client / gui_interface.h
blob21ae5862e5cc5deb1b4a90371bf285ab035d2f44
1 /***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
14 #ifndef FC__QTG_CSIDE_H
15 #define FC__QTG_CSIDE_H
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
21 /* common */
22 #include "fc_types.h"
23 #include "featured_text.h"
24 #include "tile.h"
26 /* client/include */
27 #include "canvas_g.h"
28 #include "pages_g.h"
30 /* client */
31 #include "tilespec.h"
33 struct gui_funcs {
34 void (*ui_init)(void);
35 void (*ui_main)(int argc, char *argv[]);
36 void (*ui_exit)(void);
38 enum gui_type (*get_gui_type)(void);
39 void (*insert_client_build_info)(char *outbuf, size_t outlen);
40 void (*adjust_default_options)(void);
42 void (*version_message)(const char *vertext);
43 void (*real_output_window_append)(const char *astring,
44 const struct text_tag_list *tags,
45 int conn_id);
47 bool (*is_view_supported)(enum ts_type type);
48 void (*free_intro_radar_sprites)(void);
49 struct sprite * (*load_gfxfile)(const char *filename);
50 struct sprite * (*create_sprite)(int width, int height, struct color *pcolor);
51 void (*get_sprite_dimensions)(struct sprite *sprite, int *width, int *height);
52 struct sprite * (*crop_sprite)(struct sprite *source,
53 int x, int y, int width, int height,
54 struct sprite *mask,
55 int mask_offset_x, int mask_offset_y,
56 float scale, bool smooth);
57 void (*free_sprite)(struct sprite *s);
59 struct color *(*color_alloc)(int r, int g, int b);
60 void (*color_free)(struct color *pcolor);
62 struct canvas *(*canvas_create)(int width, int height);
63 void (*canvas_free)(struct canvas *store);
64 void (*canvas_set_zoom)(struct canvas *store, float zoom);
65 bool (*has_zoom_support)(void);
66 void (*canvas_copy)(struct canvas *dest, struct canvas *src,
67 int src_x, int src_y, int dest_x, int dest_y, int width,
68 int height);
69 void (*canvas_put_sprite)(struct canvas *pcanvas,
70 int canvas_x, int canvas_y,
71 struct sprite *psprite,
72 int offset_x, int offset_y, int width, int height);
73 void (*canvas_put_sprite_full)(struct canvas *pcanvas,
74 int canvas_x, int canvas_y,
75 struct sprite *psprite);
76 void (*canvas_put_sprite_fogged)(struct canvas *pcanvas,
77 int canvas_x, int canvas_y,
78 struct sprite *psprite,
79 bool fog, int fog_x, int fog_y);
80 void (*canvas_put_rectangle)(struct canvas *pcanvas,
81 struct color *pcolor,
82 int canvas_x, int canvas_y,
83 int width, int height);
84 void (*canvas_fill_sprite_area)(struct canvas *pcanvas,
85 struct sprite *psprite, struct color *pcolor,
86 int canvas_x, int canvas_y);
87 void (*canvas_put_line)(struct canvas *pcanvas, struct color *pcolor,
88 enum line_type ltype, int start_x, int start_y,
89 int dx, int dy);
90 void (*canvas_put_curved_line)(struct canvas *pcanvas, struct color *pcolor,
91 enum line_type ltype, int start_x, int start_y,
92 int dx, int dy);
93 void (*get_text_size)(int *width, int *height,
94 enum client_font font, const char *text);
95 void (*canvas_put_text)(struct canvas *pcanvas, int canvas_x, int canvas_y,
96 enum client_font font, struct color *pcolor,
97 const char *text);
99 void (*set_rulesets)(int num_rulesets, char **rulesets);
100 void (*options_extra_init)(void);
101 void (*server_connect)(void);
102 void (*add_net_input)(int sock);
103 void (*remove_net_input)(void);
104 void (*real_conn_list_dialog_update)(void);
105 void (*close_connection_dialog)(void);
106 void (*add_idle_callback)(void (callback)(void *), void *data);
107 void (*sound_bell)(void);
109 void (*real_set_client_page)(enum client_pages page);
110 enum client_pages (*get_current_client_page)(void);
112 void (*set_unit_icon)(int idx, struct unit *punit);
113 void (*set_unit_icons_more_arrow)(bool onoff);
114 void (*real_focus_units_changed)(void);
115 void (*gui_update_font)(const char *font_name, const char *font_value);
116 void (*set_city_names_font_sizes)(int my_city_names_font_size,
117 int my_city_productions_font_size);
119 void (*editgui_refresh)(void);
120 void (*editgui_notify_object_created)(int tag, int id);
121 void (*editgui_notify_object_changed)(int objtype, int object_id, bool removal);
122 void (*editgui_popup_properties)(const struct tile_list *tiles, int objtype);
123 void (*editgui_tileset_changed)(void);
124 void (*editgui_popdown_all)(void);
126 void (*popup_combat_info)(int attacker_unit_id, int defender_unit_id,
127 int attacker_hp, int defender_hp,
128 bool make_winner_veteran);
129 void (*update_timeout_label)(void);
130 void (*real_city_dialog_popup)(struct city *pcity);
131 void (*real_city_dialog_refresh)(struct city *pcity);
132 void (*popdown_city_dialog)(struct city *pcity);
133 void (*popdown_all_city_dialogs)(void);
134 bool (*handmade_scenario_warning)(void);
135 void (*refresh_unit_city_dialogs)(struct unit *punit);
136 bool (*city_dialog_is_open)(struct city *pcity);
138 bool (*request_transport)(struct unit *pcargo, struct tile *ptile);
140 void (*gui_load_theme)(const char *directory, const char *theme_name);
141 void (*gui_clear_theme)(void);
142 char **(*get_gui_specific_themes_directories)(int *count);
143 char **(*get_useable_themes_in_directory)(const char *directory, int *count);
146 struct gui_funcs *get_gui_funcs(void);
148 #ifdef __cplusplus
150 #endif /* __cplusplus */
152 #endif /* FC__QTG_CSIDE_H */