Freeciv-3.1: /fast/freeciv/nightly/S3_1/client/gui_cbsetter.c Source File

Freeciv-3.1

Loading...
Searching...
No Matches
gui_cbsetter.c
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#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* Any client that contains this file is using callback interface */
19#define GUI_CB_MODE 1
20
21/* client */
22#include "gui_interface.h"
23
24/* client/include */
25#include "chatline_g.h"
26#include "citydlg_g.h"
27#include "connectdlg_g.h"
28#include "dialogs_g.h"
29#include "editgui_g.h"
30#include "graphics_g.h"
31#include "gui_main_g.h"
32#include "mapview_g.h"
33#include "sprite_g.h"
34#include "themes_g.h"
35
36#include "gui_cbsetter.h"
37
38/**********************************************************************/
41 void setup_gui_funcs(void)
42{
43 struct gui_funcs *funcs = get_gui_funcs();
44
45 funcs->ui_init = gui_ui_init;
46 funcs->ui_main = gui_ui_main;
47 funcs->ui_exit = gui_ui_exit;
48
49 funcs->get_gui_type = gui_get_gui_type;
50 funcs->insert_client_build_info = gui_insert_client_build_info;
51
52 funcs->version_message = gui_version_message;
53 funcs->real_output_window_append = gui_real_output_window_append;
54
55 funcs->is_view_supported = gui_is_view_supported;
56 funcs->load_gfxfile = gui_load_gfxfile;
57 funcs->create_sprite = gui_create_sprite;
58 funcs->get_sprite_dimensions = gui_get_sprite_dimensions;
59 funcs->crop_sprite = gui_crop_sprite;
60 funcs->free_sprite = gui_free_sprite;
61
62 funcs->color_alloc = gui_color_alloc;
63 funcs->color_free = gui_color_free;
64
65 funcs->canvas_create = gui_canvas_create;
66 funcs->canvas_free = gui_canvas_free;
67 funcs->canvas_set_zoom = gui_canvas_set_zoom;
68 funcs->has_zoom_support = gui_has_zoom_support;
69 funcs->canvas_mapview_init = gui_canvas_mapview_init;
70 funcs->canvas_copy = gui_canvas_copy;
71 funcs->canvas_put_sprite = gui_canvas_put_sprite;
72 funcs->canvas_put_sprite_full = gui_canvas_put_sprite_full;
73 funcs->canvas_put_sprite_fogged = gui_canvas_put_sprite_fogged;
74 funcs->canvas_put_rectangle = gui_canvas_put_rectangle;
75 funcs->canvas_fill_sprite_area = gui_canvas_fill_sprite_area;
76 funcs->canvas_put_line = gui_canvas_put_line;
77 funcs->canvas_put_curved_line = gui_canvas_put_curved_line;
78 funcs->get_text_size = gui_get_text_size;
79 funcs->canvas_put_text = gui_canvas_put_text;
80
81 funcs->map_canvas_size_refresh = gui_map_canvas_size_refresh;
82
83 funcs->set_rulesets = gui_set_rulesets;
84 funcs->options_extra_init = gui_options_extra_init;
85 funcs->server_connect = gui_server_connect;
86 funcs->add_net_input = gui_add_net_input;
87 funcs->remove_net_input = gui_remove_net_input;
88 funcs->real_conn_list_dialog_update = gui_real_conn_list_dialog_update;
89 funcs->close_connection_dialog = gui_close_connection_dialog;
90 funcs->add_idle_callback = gui_add_idle_callback;
91 funcs->sound_bell = gui_sound_bell;
92
93 funcs->real_set_client_page = gui_real_set_client_page;
94 funcs->get_current_client_page = gui_get_current_client_page;
95
96 funcs->set_unit_icon = gui_set_unit_icon;
97 funcs->set_unit_icons_more_arrow = gui_set_unit_icons_more_arrow;
98 funcs->real_focus_units_changed = gui_real_focus_units_changed;
99 funcs->gui_update_font = gui_gui_update_font;
100
101 funcs->editgui_refresh = gui_editgui_refresh;
102 funcs->editgui_notify_object_created = gui_editgui_notify_object_created;
103 funcs->editgui_notify_object_changed = gui_editgui_notify_object_changed;
104 funcs->editgui_popup_properties = gui_editgui_popup_properties;
105 funcs->editgui_tileset_changed = gui_editgui_tileset_changed;
106 funcs->editgui_popdown_all = gui_editgui_popdown_all;
107
108 funcs->popup_combat_info = gui_popup_combat_info;
109 funcs->update_timeout_label = gui_update_timeout_label;
110 funcs->start_turn = gui_start_turn;
111 funcs->real_city_dialog_popup = gui_real_city_dialog_popup;
112 funcs->real_city_dialog_refresh = gui_real_city_dialog_refresh;
113 funcs->popdown_city_dialog = gui_popdown_city_dialog;
114 funcs->popdown_all_city_dialogs = gui_popdown_all_city_dialogs;
115 funcs->handmade_scenario_warning = gui_handmade_scenario_warning;
116 funcs->refresh_unit_city_dialogs = gui_refresh_unit_city_dialogs;
117 funcs->city_dialog_is_open = gui_city_dialog_is_open;
118
119 funcs->request_transport = gui_request_transport;
120
121 funcs->update_infra_dialog = gui_update_infra_dialog;
122
123 funcs->gui_load_theme = gui_gui_load_theme;
124 funcs->gui_clear_theme = gui_gui_clear_theme;
125 funcs->get_gui_specific_themes_directories = gui_get_gui_specific_themes_directories;
126 funcs->get_usable_themes_in_directory = gui_get_usable_themes_in_directory;
127}
chatline_g.h
citydlg_g.h
connectdlg_g.h
dialogs_g.h
editgui_g.h
graphics_g.h
gui_canvas_create
struct canvas * gui_canvas_create(int width, int height)
Definition canvas.c:26
gui_canvas_fill_sprite_area
void gui_canvas_fill_sprite_area(struct canvas *pcanvas, struct sprite *psprite, struct color *pcolor, int canvas_x, int canvas_y)
Definition canvas.c:120
gui_canvas_copy
void gui_canvas_copy(struct canvas *dest, struct canvas *src, int src_x, int src_y, int dest_x, int dest_y, int width, int height)
Definition canvas.c:67
gui_canvas_put_curved_line
void gui_canvas_put_curved_line(struct canvas *pcanvas, struct color *pcolor, enum line_type ltype, int start_x, int start_y, int dx, int dy)
Definition canvas.c:140
gui_canvas_free
void gui_canvas_free(struct canvas *store)
Definition canvas.c:36
gui_canvas_put_sprite
void gui_canvas_put_sprite(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *sprite, int offset_x, int offset_y, int width, int height)
Definition canvas.c:77
gui_get_text_size
void gui_get_text_size(int *width, int *height, enum client_font font, const char *text)
Definition canvas.c:152
gui_canvas_put_rectangle
void gui_canvas_put_rectangle(struct canvas *pcanvas, struct color *pcolor, int canvas_x, int canvas_y, int width, int height)
Definition canvas.c:110
gui_canvas_set_zoom
void gui_canvas_set_zoom(struct canvas *store, float zoom)
Definition canvas.c:44
gui_canvas_put_sprite_fogged
void gui_canvas_put_sprite_fogged(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *psprite, bool fog, int fog_x, int fog_y)
Definition canvas.c:99
gui_canvas_mapview_init
void gui_canvas_mapview_init(struct canvas *store)
Definition canvas.c:60
gui_canvas_put_text
void gui_canvas_put_text(struct canvas *pcanvas, int canvas_x, int canvas_y, enum client_font font, struct color *pcolor, const char *text)
Definition canvas.c:169
gui_has_zoom_support
bool gui_has_zoom_support(void)
Definition canvas.c:52
gui_canvas_put_line
void gui_canvas_put_line(struct canvas *pcanvas, struct color *pcolor, enum line_type ltype, int start_x, int start_y, int dx, int dy)
Definition canvas.c:130
gui_canvas_put_sprite_full
void gui_canvas_put_sprite_full(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *sprite)
Definition canvas.c:88
gui_version_message
void gui_version_message(const char *vertext)
Definition chatline.c:61
gui_real_output_window_append
void gui_real_output_window_append(const char *astring, const struct text_tag_list *tags, int conn_id)
Definition chatline.c:30
gui_refresh_unit_city_dialogs
void gui_refresh_unit_city_dialogs(struct unit *punit)
Definition citydlg.c:61
gui_popdown_all_city_dialogs
void gui_popdown_all_city_dialogs(void)
Definition citydlg.c:43
gui_popdown_city_dialog
void gui_popdown_city_dialog(struct city *pcity)
Definition citydlg.c:35
gui_city_dialog_is_open
bool gui_city_dialog_is_open(struct city *pcity)
Definition citydlg.c:85
gui_real_city_dialog_popup
void gui_real_city_dialog_popup(struct city *pcity)
Definition citydlg.c:27
gui_real_city_dialog_refresh
void gui_real_city_dialog_refresh(struct city *pcity)
Definition citydlg.c:51
gui_color_alloc
struct color * gui_color_alloc(int r, int g, int b)
Definition colors.c:33
gui_color_free
void gui_color_free(struct color *color)
Definition colors.c:48
gui_close_connection_dialog
void gui_close_connection_dialog(void)
Definition connectdlg.c:41
gui_server_connect
void gui_server_connect(void)
Definition connectdlg.c:96
gui_request_transport
bool gui_request_transport(struct unit *pcargo, struct tile *ptile)
Definition dialogs.c:349
gui_handmade_scenario_warning
bool gui_handmade_scenario_warning(void)
Definition dialogs.c:340
gui_popup_combat_info
void gui_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)
Definition dialogs.c:358
gui_is_view_supported
bool gui_is_view_supported(enum ts_type type)
Definition graphics.c:31
gui_real_conn_list_dialog_update
void gui_real_conn_list_dialog_update(void *unused)
Definition gui_main.c:141
gui_insert_client_build_info
void gui_insert_client_build_info(char *outbuf, size_t outlen)
Definition gui_main.c:277
gui_editgui_tileset_changed
void gui_editgui_tileset_changed(void)
Definition gui_main.c:232
gui_editgui_popdown_all
void gui_editgui_popdown_all(void)
Definition gui_main.c:250
gui_set_unit_icon
void gui_set_unit_icon(int idx, struct unit *punit)
Definition gui_main.c:188
gui_sound_bell
void gui_sound_bell(void)
Definition gui_main.c:150
gui_editgui_notify_object_changed
void gui_editgui_notify_object_changed(int objtype, int object_id, bool removal)
Definition gui_main.c:256
gui_remove_net_input
void gui_remove_net_input(void)
Definition gui_main.c:172
gui_real_focus_units_changed
void gui_real_focus_units_changed(void)
Definition gui_main.c:210
gui_add_net_input
void gui_add_net_input(int sock)
Definition gui_main.c:162
gui_editgui_notify_object_created
void gui_editgui_notify_object_created(int tag, int id)
Definition gui_main.c:263
gui_ui_init
void gui_ui_init(void)
Definition gui_main.c:44
gui_get_gui_type
enum gui_type gui_get_gui_type(void)
Definition gui_main.c:133
gui_ui_main
int gui_ui_main(int argc, char *argv[])
Definition gui_main.c:100
gui_gui_update_font
void gui_gui_update_font(const char *font_name, const char *font_value)
Definition gui_main.c:269
gui_options_extra_init
void gui_options_extra_init(void)
Definition gui_main.c:117
gui_editgui_refresh
void gui_editgui_refresh(void)
Definition gui_main.c:238
gui_add_idle_callback
void gui_add_idle_callback(void(callback)(void *), void *data)
Definition gui_main.c:220
gui_set_unit_icons_more_arrow
void gui_set_unit_icons_more_arrow(bool onoff)
Definition gui_main.c:200
gui_editgui_popup_properties
void gui_editgui_popup_properties(const struct tile_list *tiles, int objtype)
Definition gui_main.c:244
gui_ui_exit
void gui_ui_exit(void)
Definition gui_main.c:125
gui_update_infra_dialog
void gui_update_infra_dialog(void)
Definition infradlg.c:27
gui_map_canvas_size_refresh
void gui_map_canvas_size_refresh(void)
Definition mapview.c:223
gui_update_timeout_label
void gui_update_timeout_label(void)
Definition mapview.c:92
gui_start_turn
void gui_start_turn(void)
Definition mapview.c:273
gui_real_set_client_page
void gui_real_set_client_page(enum client_pages page)
Definition pages.c:29
gui_set_rulesets
void gui_set_rulesets(int num_rulesets, char **rulesets)
Definition pages.c:39
gui_get_current_client_page
enum client_pages gui_get_current_client_page(void)
Definition pages.c:47
gui_free_sprite
void gui_free_sprite(struct sprite *s)
Definition sprite.c:110
gui_load_gfxfile
struct sprite * gui_load_gfxfile(const char *filename)
Definition sprite.c:49
gui_get_sprite_dimensions
void gui_get_sprite_dimensions(struct sprite *sprite, int *width, int *height)
Definition sprite.c:98
gui_crop_sprite
struct sprite * gui_crop_sprite(struct sprite *source, int x, int y, int width, int height, struct sprite *mask, int mask_offset_x, int mask_offset_y, float scale, bool smooth)
Definition sprite.c:76
gui_create_sprite
struct sprite * gui_create_sprite(int width, int height, struct color *pcolor)
Definition sprite.c:89
gui_gui_load_theme
void gui_gui_load_theme(const char *directory, const char *theme_name)
Definition themes.c:32
gui_get_usable_themes_in_directory
char ** gui_get_usable_themes_in_directory(const char *directory, int *count)
Definition themes.c:63
gui_get_gui_specific_themes_directories
char ** gui_get_gui_specific_themes_directories(int *count)
Definition themes.c:51
gui_gui_clear_theme
void gui_gui_clear_theme(void)
Definition themes.c:40
setup_gui_funcs
void setup_gui_funcs(void)
Definition gui_cbsetter.c:41
gui_cbsetter.h
get_gui_funcs
struct gui_funcs * get_gui_funcs(void)
Definition gui_interface.c:41
funcs
static struct gui_funcs funcs
Definition gui_interface.c:35
gui_interface.h
gui_main_g.h
mapview_g.h
sprite_g.h
gui_funcs
Definition gui_interface.h:33
gui_funcs::server_connect
void(* server_connect)(void)
Definition gui_interface.h:104
gui_funcs::editgui_tileset_changed
void(* editgui_tileset_changed)(void)
Definition gui_interface.h:124
gui_funcs::ui_main
int(* ui_main)(int argc, char *argv[])
Definition gui_interface.h:35
gui_funcs::canvas_put_text
void(* canvas_put_text)(struct canvas *pcanvas, int canvas_x, int canvas_y, enum client_font font, struct color *pcolor, const char *text)
Definition gui_interface.h:96
gui_funcs::get_gui_specific_themes_directories
char **(* get_gui_specific_themes_directories)(int *count)
Definition gui_interface.h:146
gui_funcs::gui_load_theme
void(* gui_load_theme)(const char *directory, const char *theme_name)
Definition gui_interface.h:144
gui_funcs::update_timeout_label
void(* update_timeout_label)(void)
Definition gui_interface.h:130
gui_funcs::canvas_put_sprite
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)
Definition gui_interface.h:70
gui_funcs::editgui_refresh
void(* editgui_refresh)(void)
Definition gui_interface.h:120
gui_funcs::set_unit_icon
void(* set_unit_icon)(int idx, struct unit *punit)
Definition gui_interface.h:115
gui_funcs::canvas_copy
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)
Definition gui_interface.h:67
gui_funcs::add_idle_callback
void(* add_idle_callback)(void(callback)(void *), void *data)
Definition gui_interface.h:109
gui_funcs::canvas_put_sprite_full
void(* canvas_put_sprite_full)(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *psprite)
Definition gui_interface.h:74
gui_funcs::add_net_input
void(* add_net_input)(int sock)
Definition gui_interface.h:105
gui_funcs::editgui_notify_object_created
void(* editgui_notify_object_created)(int tag, int id)
Definition gui_interface.h:121
gui_funcs::get_current_client_page
enum client_pages(* get_current_client_page)(void)
Definition gui_interface.h:113
gui_funcs::real_city_dialog_refresh
void(* real_city_dialog_refresh)(struct city *pcity)
Definition gui_interface.h:133
gui_funcs::gui_clear_theme
void(* gui_clear_theme)(void)
Definition gui_interface.h:145
gui_funcs::load_gfxfile
struct sprite *(* load_gfxfile)(const char *filename)
Definition gui_interface.h:48
gui_funcs::remove_net_input
void(* remove_net_input)(void)
Definition gui_interface.h:106
gui_funcs::real_city_dialog_popup
void(* real_city_dialog_popup)(struct city *pcity)
Definition gui_interface.h:132
gui_funcs::color_free
void(* color_free)(struct color *pcolor)
Definition gui_interface.h:60
gui_funcs::refresh_unit_city_dialogs
void(* refresh_unit_city_dialogs)(struct unit *punit)
Definition gui_interface.h:137
gui_funcs::is_view_supported
bool(* is_view_supported)(enum ts_type type)
Definition gui_interface.h:46
gui_funcs::get_text_size
void(* get_text_size)(int *width, int *height, enum client_font font, const char *text)
Definition gui_interface.h:94
gui_funcs::editgui_popup_properties
void(* editgui_popup_properties)(const struct tile_list *tiles, int objtype)
Definition gui_interface.h:123
gui_funcs::update_infra_dialog
void(* update_infra_dialog)(void)
Definition gui_interface.h:142
gui_funcs::popup_combat_info
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)
Definition gui_interface.h:127
gui_funcs::map_canvas_size_refresh
void(* map_canvas_size_refresh)(void)
Definition gui_interface.h:100
gui_funcs::editgui_notify_object_changed
void(* editgui_notify_object_changed)(int objtype, int object_id, bool removal)
Definition gui_interface.h:122
gui_funcs::handmade_scenario_warning
bool(* handmade_scenario_warning)(void)
Definition gui_interface.h:136
gui_funcs::canvas_fill_sprite_area
void(* canvas_fill_sprite_area)(struct canvas *pcanvas, struct sprite *psprite, struct color *pcolor, int canvas_x, int canvas_y)
Definition gui_interface.h:85
gui_funcs::request_transport
bool(* request_transport)(struct unit *pcargo, struct tile *ptile)
Definition gui_interface.h:140
gui_funcs::set_rulesets
void(* set_rulesets)(int num_rulesets, char **rulesets)
Definition gui_interface.h:102
gui_funcs::version_message
void(* version_message)(const char *vertext)
Definition gui_interface.h:41
gui_funcs::real_output_window_append
void(* real_output_window_append)(const char *astring, const struct text_tag_list *tags, int conn_id)
Definition gui_interface.h:42
gui_funcs::create_sprite
struct sprite *(* create_sprite)(int width, int height, struct color *pcolor)
Definition gui_interface.h:50
gui_funcs::has_zoom_support
bool(* has_zoom_support)(void)
Definition gui_interface.h:65
gui_funcs::get_sprite_dimensions
void(* get_sprite_dimensions)(struct sprite *sprite, int *width, int *height)
Definition gui_interface.h:51
gui_funcs::set_unit_icons_more_arrow
void(* set_unit_icons_more_arrow)(bool onoff)
Definition gui_interface.h:116
gui_funcs::gui_update_font
void(* gui_update_font)(const char *font_name, const char *font_value)
Definition gui_interface.h:118
gui_funcs::canvas_create
struct canvas *(* canvas_create)(int width, int height)
Definition gui_interface.h:62
gui_funcs::ui_exit
void(* ui_exit)(void)
Definition gui_interface.h:36
gui_funcs::canvas_put_sprite_fogged
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)
Definition gui_interface.h:77
gui_funcs::free_sprite
void(* free_sprite)(struct sprite *s)
Definition gui_interface.h:57
gui_funcs::get_usable_themes_in_directory
char **(* get_usable_themes_in_directory)(const char *directory, int *count)
Definition gui_interface.h:147
gui_funcs::canvas_put_curved_line
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)
Definition gui_interface.h:91
gui_funcs::options_extra_init
void(* options_extra_init)(void)
Definition gui_interface.h:103
gui_funcs::popdown_city_dialog
void(* popdown_city_dialog)(struct city *pcity)
Definition gui_interface.h:134
gui_funcs::canvas_put_line
void(* canvas_put_line)(struct canvas *pcanvas, struct color *pcolor, enum line_type ltype, int start_x, int start_y, int dx, int dy)
Definition gui_interface.h:88
gui_funcs::start_turn
void(* start_turn)(void)
Definition gui_interface.h:131
gui_funcs::canvas_free
void(* canvas_free)(struct canvas *store)
Definition gui_interface.h:63
gui_funcs::canvas_set_zoom
void(* canvas_set_zoom)(struct canvas *store, float zoom)
Definition gui_interface.h:64
gui_funcs::insert_client_build_info
void(* insert_client_build_info)(char *outbuf, size_t outlen)
Definition gui_interface.h:39
gui_funcs::crop_sprite
struct sprite *(* crop_sprite)(struct sprite *source, int x, int y, int width, int height, struct sprite *mask, int mask_offset_x, int mask_offset_y, float scale, bool smooth)
Definition gui_interface.h:52
gui_funcs::canvas_put_rectangle
void(* canvas_put_rectangle)(struct canvas *pcanvas, struct color *pcolor, int canvas_x, int canvas_y, int width, int height)
Definition gui_interface.h:81
gui_funcs::get_gui_type
enum gui_type(* get_gui_type)(void)
Definition gui_interface.h:38
gui_funcs::editgui_popdown_all
void(* editgui_popdown_all)(void)
Definition gui_interface.h:125
gui_funcs::popdown_all_city_dialogs
void(* popdown_all_city_dialogs)(void)
Definition gui_interface.h:135
gui_funcs::canvas_mapview_init
void(* canvas_mapview_init)(struct canvas *store)
Definition gui_interface.h:66
gui_funcs::close_connection_dialog
void(* close_connection_dialog)(void)
Definition gui_interface.h:108
gui_funcs::sound_bell
void(* sound_bell)(void)
Definition gui_interface.h:110
gui_funcs::real_focus_units_changed
void(* real_focus_units_changed)(void)
Definition gui_interface.h:117
gui_funcs::real_set_client_page
void(* real_set_client_page)(enum client_pages page)
Definition gui_interface.h:112
gui_funcs::ui_init
void(* ui_init)(void)
Definition gui_interface.h:34
gui_funcs::real_conn_list_dialog_update
void(* real_conn_list_dialog_update)(void *unused)
Definition gui_interface.h:107
gui_funcs::color_alloc
struct color *(* color_alloc)(int r, int g, int b)
Definition gui_interface.h:59
gui_funcs::city_dialog_is_open
bool(* city_dialog_is_open)(struct city *pcity)
Definition gui_interface.h:138
themes_g.h