Freeciv-3.1
Loading...
Searching...
No Matches
gui_interface.h
Go to the documentation of this file.
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.
7
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***********************************************************************/
13
14#ifndef FC__QTG_CSIDE_H
15#define FC__QTG_CSIDE_H
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
21/* common */
22#include "fc_types.h"
23#include "featured_text.h"
24#include "tile.h"
25
26/* client/include */
27#include "canvas_g.h"
28#include "pages_g.h"
29
30/* client */
31#include "tilespec.h"
32
33struct gui_funcs {
34 void (*ui_init)(void);
35 int (*ui_main)(int argc, char *argv[]);
36 void (*ui_exit)(void);
37
38 enum gui_type (*get_gui_type)(void);
39 void (*insert_client_build_info)(char *outbuf, size_t outlen);
40
41 void (*version_message)(const char *vertext);
43 const struct text_tag_list *tags,
44 int conn_id);
45
46 bool (*is_view_supported)(enum ts_type type);
47 void (*tileset_type_set)(enum ts_type type);
48 struct sprite * (*load_gfxfile)(const char *filename);
49 struct sprite * (*load_gfxnumber)(int num);
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);
58
59 struct color *(*color_alloc)(int r, int g, int b);
60 void (*color_free)(struct color *pcolor);
61
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);
66 void (*canvas_mapview_init)(struct canvas *store);
67 void (*canvas_copy)(struct canvas *dest, struct canvas *src,
68 int src_x, int src_y, int dest_x, int dest_y, int width,
69 int height);
71 int canvas_x, int canvas_y,
72 struct sprite *psprite,
73 int offset_x, int offset_y, int width, int height);
75 int canvas_x, int canvas_y,
76 struct sprite *psprite);
78 int canvas_x, int canvas_y,
79 struct sprite *psprite,
80 bool fog, int fog_x, int fog_y);
82 struct color *pcolor,
83 int canvas_x, int canvas_y,
84 int width, int height);
86 struct sprite *psprite, struct color *pcolor,
87 int canvas_x, int canvas_y);
88 void (*canvas_put_line)(struct canvas *pcanvas, struct color *pcolor,
89 enum line_type ltype, int start_x, int start_y,
90 int dx, int dy);
92 enum line_type ltype, int start_x, int start_y,
93 int dx, int dy);
94 void (*get_text_size)(int *width, int *height,
95 enum client_font font, const char *text);
96 void (*canvas_put_text)(struct canvas *pcanvas, int canvas_x, int canvas_y,
97 enum client_font font, struct color *pcolor,
98 const char *text);
99
101
102 void (*set_rulesets)(int num_rulesets, char **rulesets);
103 void (*options_extra_init)(void);
104 void (*server_connect)(void);
105 void (*add_net_input)(int sock);
106 void (*remove_net_input)(void);
107 void (*real_conn_list_dialog_update)(void *unused);
109 void (*add_idle_callback)(void (callback)(void *), void *data);
110 void (*sound_bell)(void);
111
112 void (*real_set_client_page)(enum client_pages page);
113 enum client_pages (*get_current_client_page)(void);
114
115 void (*set_unit_icon)(int idx, struct unit *punit);
116 void (*set_unit_icons_more_arrow)(bool onoff);
118 void (*gui_update_font)(const char *font_name, const char *font_value);
119
120 void (*editgui_refresh)(void);
121 void (*editgui_notify_object_created)(int tag, int id);
122 void (*editgui_notify_object_changed)(int objtype, int object_id, bool removal);
123 void (*editgui_popup_properties)(const struct tile_list *tiles, int objtype);
125 void (*editgui_popdown_all)(void);
126
127 void (*popup_combat_info)(int attacker_unit_id, int defender_unit_id,
128 int attacker_hp, int defender_hp,
129 bool make_att_veteran, bool make_def_veteran);
130 void (*update_timeout_label)(void);
131 void (*start_turn)(void);
132 void (*real_city_dialog_popup)(struct city *pcity);
133 void (*real_city_dialog_refresh)(struct city *pcity);
134 void (*popdown_city_dialog)(struct city *pcity);
138 bool (*city_dialog_is_open)(struct city *pcity);
139
140 bool (*request_transport)(struct unit *pcargo, struct tile *ptile);
141
142 void (*update_infra_dialog)(void);
143
144 void (*gui_load_theme)(const char *directory, const char *theme_name);
145 void (*gui_clear_theme)(void);
146 char **(*get_gui_specific_themes_directories)(int *count);
147 char **(*get_usable_themes_in_directory)(const char *directory, int *count);
148};
149
150struct gui_funcs *get_gui_funcs(void);
151
152#ifdef __cplusplus
153}
154#endif /* __cplusplus */
155
156#endif /* FC__QTG_CSIDE_H */
struct canvas int int struct sprite int int int int height
Definition canvas_g.h:44
struct canvas int int struct sprite bool int int fog_y struct canvas struct sprite struct color * pcolor
Definition canvas_g.h:57
struct canvas int int struct sprite bool int fog_x
Definition canvas_g.h:51
struct canvas int int canvas_y
Definition canvas_g.h:43
struct canvas int canvas_x
Definition canvas_g.h:43
struct canvas int int struct sprite bool int int fog_y struct canvas struct sprite struct color int int canvas_y struct canvas struct color enum line_type ltype int start_x int start_y int dx int dy enum client_font
Definition canvas_g.h:69
struct canvas int int struct sprite int int int width
Definition canvas_g.h:44
struct canvas * pcanvas
Definition canvas_g.h:42
struct canvas int int struct sprite * psprite
Definition canvas_g.h:50
struct canvas int int struct sprite int int offset_y
Definition canvas_g.h:44
struct canvas int int struct sprite int offset_x
Definition canvas_g.h:44
line_type
Definition canvas_g.h:25
struct canvas int int struct sprite bool fog
Definition canvas_g.h:51
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:73
int objtype
Definition editgui_g.h:28
int int id
Definition editgui_g.h:28
static GtkWidget * source
Definition gotodlg.c:58
GType type
Definition repodlgs.c:1312
struct gui_funcs * get_gui_funcs(void)
const char * font_name
Definition gui_main_g.h:43
Definition city.h:309
Definition colors.h:20
void(* server_connect)(void)
void(* editgui_tileset_changed)(void)
int(* ui_main)(int argc, char *argv[])
void(* canvas_put_text)(struct canvas *pcanvas, int canvas_x, int canvas_y, enum client_font font, struct color *pcolor, const char *text)
void(* gui_load_theme)(const char *directory, const char *theme_name)
void(* update_timeout_label)(void)
void(* canvas_put_sprite)(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *psprite, int offset_x, int offset_y, int width, int height)
void(* editgui_refresh)(void)
void(* set_unit_icon)(int idx, struct unit *punit)
void(* canvas_copy)(struct canvas *dest, struct canvas *src, int src_x, int src_y, int dest_x, int dest_y, int width, int height)
void(* add_idle_callback)(void(callback)(void *), void *data)
void(* canvas_put_sprite_full)(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *psprite)
void(* add_net_input)(int sock)
void(* tileset_type_set)(enum ts_type type)
void(* editgui_notify_object_created)(int tag, int id)
enum client_pages(* get_current_client_page)(void)
void(* real_city_dialog_refresh)(struct city *pcity)
void(* gui_clear_theme)(void)
void(* remove_net_input)(void)
void(* real_city_dialog_popup)(struct city *pcity)
void(* color_free)(struct color *pcolor)
void(* refresh_unit_city_dialogs)(struct unit *punit)
bool(* is_view_supported)(enum ts_type type)
void(* get_text_size)(int *width, int *height, enum client_font font, const char *text)
void(* editgui_popup_properties)(const struct tile_list *tiles, int objtype)
void(* update_infra_dialog)(void)
void(* popup_combat_info)(int attacker_unit_id, int defender_unit_id, int attacker_hp, int defender_hp, bool make_att_veteran, bool make_def_veteran)
void(* map_canvas_size_refresh)(void)
void(* editgui_notify_object_changed)(int objtype, int object_id, bool removal)
bool(* handmade_scenario_warning)(void)
void(* canvas_fill_sprite_area)(struct canvas *pcanvas, struct sprite *psprite, struct color *pcolor, int canvas_x, int canvas_y)
bool(* request_transport)(struct unit *pcargo, struct tile *ptile)
void(* set_rulesets)(int num_rulesets, char **rulesets)
void(* version_message)(const char *vertext)
void(* real_output_window_append)(const char *astring, const struct text_tag_list *tags, int conn_id)
bool(* has_zoom_support)(void)
void(* get_sprite_dimensions)(struct sprite *sprite, int *width, int *height)
void(* set_unit_icons_more_arrow)(bool onoff)
void(* gui_update_font)(const char *font_name, const char *font_value)
void(* ui_exit)(void)
void(* canvas_put_sprite_fogged)(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *psprite, bool fog, int fog_x, int fog_y)
void(* free_sprite)(struct sprite *s)
void(* canvas_put_curved_line)(struct canvas *pcanvas, struct color *pcolor, enum line_type ltype, int start_x, int start_y, int dx, int dy)
void(* options_extra_init)(void)
void(* popdown_city_dialog)(struct city *pcity)
void(* canvas_put_line)(struct canvas *pcanvas, struct color *pcolor, enum line_type ltype, int start_x, int start_y, int dx, int dy)
void(* start_turn)(void)
void(* canvas_free)(struct canvas *store)
void(* canvas_set_zoom)(struct canvas *store, float zoom)
void(* insert_client_build_info)(char *outbuf, size_t outlen)
void(* canvas_put_rectangle)(struct canvas *pcanvas, struct color *pcolor, int canvas_x, int canvas_y, int width, int height)
enum gui_type(* get_gui_type)(void)
void(* editgui_popdown_all)(void)
void(* popdown_all_city_dialogs)(void)
void(* canvas_mapview_init)(struct canvas *store)
void(* close_connection_dialog)(void)
void(* sound_bell)(void)
void(* real_focus_units_changed)(void)
void(* real_set_client_page)(enum client_pages page)
void(* ui_init)(void)
void(* real_conn_list_dialog_update)(void *unused)
bool(* city_dialog_is_open)(struct city *pcity)
Definition tile.h:49
Definition unit.h:138
#define bool
Definition support.h:61
const char * directory
Definition themes_g.h:23