Freeciv-3.2
Loading...
Searching...
No Matches
Functions | Variables
gui_interface.c File Reference
#include "client_main.h"
#include "editgui_g.h"
#include "options.h"
#include "chatline_g.h"
#include "citydlg_g.h"
#include "connectdlg_g.h"
#include "dialogs_g.h"
#include "diplodlg_g.h"
#include "graphics_g.h"
#include "gui_main_g.h"
#include "mapview_g.h"
#include "themes_g.h"
#include "gui_interface.h"

Go to the source code of this file.

Functions

struct gui_funcsget_gui_funcs (void)
 
void ui_init (void)
 
int ui_main (int argc, char *argv[])
 
void ui_exit (void)
 
void version_message (const char *vertext)
 
void real_output_window_append (const char *astring, const struct text_tag_list *tags, int conn_id)
 
enum gui_type get_gui_type (void)
 
void insert_client_build_info (char *outbuf, size_t outlen)
 
bool is_view_supported (enum ts_type type)
 
void tileset_type_set (enum ts_type type)
 
struct spriteload_gfxfile (const char *filename, bool svgflag)
 
struct spriteload_gfxnumber (int num)
 
struct spritecreate_sprite (int width, int height, struct color *pcolor)
 
void get_sprite_dimensions (struct sprite *sprite, int *width, int *height)
 
struct spritecrop_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)
 
void free_sprite (struct sprite *s)
 
struct colorcolor_alloc (int r, int g, int b)
 
void color_free (struct color *pcolor)
 
struct canvascanvas_create (int width, int height)
 
void canvas_free (struct canvas *store)
 
void canvas_set_zoom (struct canvas *store, float zoom)
 
bool has_zoom_support (void)
 
void canvas_mapview_init (struct canvas *store)
 
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 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 canvas_put_sprite_full (struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *psprite)
 
void canvas_put_sprite_full_scaled (struct canvas *pcanvas, int canvas_x, int canvas_y, int canvas_w, int canvas_h, struct sprite *psprite)
 
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 canvas_put_rectangle (struct canvas *pcanvas, struct color *pcolor, int canvas_x, int canvas_y, int width, int height)
 
void canvas_fill_sprite_area (struct canvas *pcanvas, struct sprite *psprite, struct color *pcolor, int canvas_x, int canvas_y)
 
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 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 get_text_size (int *width, int *height, enum client_font font, const char *text)
 
void canvas_put_text (struct canvas *pcanvas, int canvas_x, int canvas_y, enum client_font font, struct color *pcolor, const char *text)
 
void map_canvas_size_refresh (void)
 
void set_rulesets (int num_rulesets, char **rulesets)
 
void options_extra_init (void)
 
void server_connect (void)
 
void add_net_input (int sock)
 
void remove_net_input (void)
 
void real_conn_list_dialog_update (void *unused)
 
void close_connection_dialog (void)
 
void add_idle_callback (void(callback)(void *), void *data)
 
void sound_bell (void)
 
void real_set_client_page (enum client_pages page)
 
enum client_pages get_current_client_page (void)
 
void set_unit_icon (int idx, struct unit *punit)
 
void real_focus_units_changed (void)
 
void set_unit_icons_more_arrow (bool onoff)
 
void gui_update_font (const char *font_name, const char *font_value)
 
void editgui_refresh (void)
 
void editgui_notify_object_created (int tag, int id)
 
void editgui_notify_object_changed (int objtype, int object_id, bool removal)
 
void editgui_popup_properties (const struct tile_list *tiles, int objtype)
 
void editgui_tileset_changed (void)
 
void editgui_popdown_all (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 update_timeout_label (void)
 
void start_turn (void)
 
void real_city_dialog_popup (struct city *pcity)
 
void real_city_dialog_refresh (struct city *pcity)
 
void popdown_city_dialog (struct city *pcity)
 
void popdown_all_city_dialogs (void)
 
bool handmade_scenario_warning (void)
 
void refresh_unit_city_dialogs (struct unit *punit)
 
bool city_dialog_is_open (struct city *pcity)
 
bool request_transport (struct unit *pcargo, struct tile *ptile)
 
void update_infra_dialog (void)
 
void gui_load_theme (const char *directory, const char *theme_name)
 
void gui_clear_theme (void)
 
char ** get_gui_specific_themes_directories (int *count)
 
char ** get_usable_themes_in_directory (const char *directory, int *count)
 
void gui_init_meeting (struct Treaty *ptreaty, struct player *they, struct player *initiator)
 
void gui_recv_cancel_meeting (struct Treaty *ptreaty, struct player *they, struct player *initiator)
 
void gui_prepare_clause_updt (struct Treaty *ptreaty, struct player *they)
 
void gui_recv_create_clause (struct Treaty *ptreaty, struct player *they)
 
void gui_recv_remove_clause (struct Treaty *ptreaty, struct player *they)
 
void gui_recv_accept_treaty (struct Treaty *ptreaty, struct player *they)
 
void request_action_confirmation (const char *expl, struct act_confirmation_data *data)
 
void popup_image (const char *tag)
 

Variables

static struct gui_funcs funcs
 

Function Documentation

◆ add_idle_callback()

void add_idle_callback ( void(callback)(void *)  ,
void data 
)

Call add_idle_callback callback

Definition at line 413 of file gui_interface.c.

◆ add_net_input()

void add_net_input ( int  sock)

Call add_net_input callback

Definition at line 381 of file gui_interface.c.

◆ 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 
)

Call canvas_copy callback

Definition at line 232 of file gui_interface.c.

◆ canvas_create()

struct canvas * canvas_create ( int  width,
int  height 
)

Call canvas_create callback

Definition at line 192 of file gui_interface.c.

◆ canvas_fill_sprite_area()

void canvas_fill_sprite_area ( struct canvas pcanvas,
struct sprite psprite,
struct color pcolor,
int  canvas_x,
int  canvas_y 
)

Call canvas_fill_sprite_area callback

Definition at line 299 of file gui_interface.c.

◆ canvas_free()

void canvas_free ( struct canvas store)

Call canvas_free callback

Definition at line 200 of file gui_interface.c.

◆ canvas_mapview_init()

void canvas_mapview_init ( struct canvas store)

Call canvas_mapview_init callback

Definition at line 224 of file gui_interface.c.

◆ 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 
)

Call canvas_put_curved_line callback

Definition at line 319 of file gui_interface.c.

◆ 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 
)

Call canvas_put_line callback

Definition at line 309 of file gui_interface.c.

◆ canvas_put_rectangle()

void canvas_put_rectangle ( struct canvas pcanvas,
struct color pcolor,
int  canvas_x,
int  canvas_y,
int  width,
int  height 
)

Call canvas_put_rectangle callback

Definition at line 288 of file gui_interface.c.

◆ 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 
)

Call canvas_put_sprite callback

Definition at line 242 of file gui_interface.c.

◆ 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 
)

Call canvas_put_sprite_fogged callback

Definition at line 276 of file gui_interface.c.

◆ canvas_put_sprite_full()

void canvas_put_sprite_full ( struct canvas pcanvas,
int  canvas_x,
int  canvas_y,
struct sprite psprite 
)

Call canvas_put_sprite_full callback

Definition at line 254 of file gui_interface.c.

◆ canvas_put_sprite_full_scaled()

void canvas_put_sprite_full_scaled ( struct canvas pcanvas,
int  canvas_x,
int  canvas_y,
int  canvas_w,
int  canvas_h,
struct sprite psprite 
)

Call canvas_put_sprite_full_scaled callback

Definition at line 264 of file gui_interface.c.

◆ 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 
)

Call canvas_put_text callback

Definition at line 339 of file gui_interface.c.

◆ canvas_set_zoom()

void canvas_set_zoom ( struct canvas store,
float  zoom 
)

Call canvas_set_zoom callback

Definition at line 208 of file gui_interface.c.

◆ city_dialog_is_open()

bool city_dialog_is_open ( struct city pcity)

Call city_dialog_is_open callback

Definition at line 601 of file gui_interface.c.

◆ close_connection_dialog()

void close_connection_dialog ( void  )

Call close_connection_dialog callback

Definition at line 405 of file gui_interface.c.

◆ color_alloc()

struct color * color_alloc ( int  r,
int  g,
int  b 
)

Call color_alloc callback

Definition at line 176 of file gui_interface.c.

◆ color_free()

void color_free ( struct color pcolor)

Call color_free callback

Definition at line 184 of file gui_interface.c.

◆ create_sprite()

struct sprite * create_sprite ( int  width,
int  height,
struct color pcolor 
)

Call create_sprite callback

Definition at line 140 of file gui_interface.c.

◆ 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 
)

Call crop_sprite callback

Definition at line 156 of file gui_interface.c.

◆ editgui_notify_object_changed()

void editgui_notify_object_changed ( int  objtype,
int  object_id,
bool  removal 
)

Call editgui_notify_object_changed callback

Definition at line 493 of file gui_interface.c.

◆ editgui_notify_object_created()

void editgui_notify_object_created ( int  tag,
int  id 
)

Call editgui_notify_object_created callback

Definition at line 485 of file gui_interface.c.

◆ editgui_popdown_all()

void editgui_popdown_all ( void  )

Call editgui_popdown_all callback

Definition at line 517 of file gui_interface.c.

◆ editgui_popup_properties()

void editgui_popup_properties ( const struct tile_list tiles,
int  objtype 
)

Call editgui_popup_properties callback

Definition at line 501 of file gui_interface.c.

◆ editgui_refresh()

void editgui_refresh ( void  )

Call editgui_refresh callback

Definition at line 477 of file gui_interface.c.

◆ editgui_tileset_changed()

void editgui_tileset_changed ( void  )

Call editgui_tileset_changed callback

Definition at line 509 of file gui_interface.c.

◆ free_sprite()

void free_sprite ( struct sprite s)

Call free_sprite callback

Definition at line 168 of file gui_interface.c.

◆ get_current_client_page()

enum client_pages get_current_client_page ( void  )

Call get_current_client_page callback

Definition at line 437 of file gui_interface.c.

◆ get_gui_funcs()

struct gui_funcs * get_gui_funcs ( void  )

Return gui_funcs table. Used by gui side to get table for filling with function addresses.

Definition at line 42 of file gui_interface.c.

Referenced by setup_gui_funcs(), and setup_gui_funcs().

◆ get_gui_specific_themes_directories()

char ** get_gui_specific_themes_directories ( int count)

Call get_gui_specific_themes_directories callback

Definition at line 641 of file gui_interface.c.

◆ get_gui_type()

enum gui_type get_gui_type ( void  )

Call get_gui_type callback

Definition at line 92 of file gui_interface.c.

◆ get_sprite_dimensions()

void get_sprite_dimensions ( struct sprite sprite,
int width,
int height 
)

Call get_sprite_dimensions callback

Definition at line 148 of file gui_interface.c.

◆ get_text_size()

void get_text_size ( int width,
int height,
enum client_font  font,
const char text 
)

Call get_text_size callback

Definition at line 330 of file gui_interface.c.

◆ get_usable_themes_in_directory()

char ** get_usable_themes_in_directory ( const char directory,
int count 
)

Call get_usable_themes_in_directory callback

Definition at line 649 of file gui_interface.c.

◆ gui_clear_theme()

void gui_clear_theme ( void  )

Call gui_clear_theme callback

Definition at line 633 of file gui_interface.c.

◆ gui_init_meeting()

void gui_init_meeting ( struct Treaty ptreaty,
struct player they,
struct player initiator 
)

Call gui_init_meeting callback

Definition at line 657 of file gui_interface.c.

◆ gui_load_theme()

void gui_load_theme ( const char directory,
const char theme_name 
)

Call gui_load_theme callback

Definition at line 625 of file gui_interface.c.

◆ gui_prepare_clause_updt()

void gui_prepare_clause_updt ( struct Treaty ptreaty,
struct player they 
)

Call gui_prepare_clause_updt callback

Definition at line 675 of file gui_interface.c.

◆ gui_recv_accept_treaty()

void gui_recv_accept_treaty ( struct Treaty ptreaty,
struct player they 
)

Call gui_recv_accept_treaty callback

Definition at line 699 of file gui_interface.c.

◆ gui_recv_cancel_meeting()

void gui_recv_cancel_meeting ( struct Treaty ptreaty,
struct player they,
struct player initiator 
)

Call gui_recv_cancel_meeting callback

Definition at line 666 of file gui_interface.c.

◆ gui_recv_create_clause()

void gui_recv_create_clause ( struct Treaty ptreaty,
struct player they 
)

Call gui_recv_create_clause callback

Definition at line 683 of file gui_interface.c.

◆ gui_recv_remove_clause()

void gui_recv_remove_clause ( struct Treaty ptreaty,
struct player they 
)

Call gui_recv_remove_clause callback

Definition at line 691 of file gui_interface.c.

◆ gui_update_font()

void gui_update_font ( const char font_name,
const char font_value 
)

Call gui_update_font callback

Definition at line 469 of file gui_interface.c.

◆ handmade_scenario_warning()

bool handmade_scenario_warning ( void  )

Call handmade_scenario_warning callback

Definition at line 585 of file gui_interface.c.

◆ has_zoom_support()

bool has_zoom_support ( void  )

Call has_zoom_support callback

Definition at line 216 of file gui_interface.c.

◆ insert_client_build_info()

void insert_client_build_info ( char outbuf,
size_t  outlen 
)

Call insert_client_build_info callback

Definition at line 100 of file gui_interface.c.

◆ is_view_supported()

bool is_view_supported ( enum ts_type  type)

Call is_view_supported callback

Definition at line 108 of file gui_interface.c.

◆ load_gfxfile()

struct sprite * load_gfxfile ( const char filename,
bool  svgflag 
)

Call load_gfxfile callback

Definition at line 124 of file gui_interface.c.

◆ load_gfxnumber()

struct sprite * load_gfxnumber ( int  num)

Call load_gfxnumber callback

Definition at line 132 of file gui_interface.c.

◆ map_canvas_size_refresh()

void map_canvas_size_refresh ( void  )

Call map_canvas_size_refresh callback

Definition at line 349 of file gui_interface.c.

◆ options_extra_init()

void options_extra_init ( void  )

Call options_extra_init callback

Definition at line 365 of file gui_interface.c.

◆ popdown_all_city_dialogs()

void popdown_all_city_dialogs ( void  )

Call popdown_all_city_dialogs callback

Definition at line 577 of file gui_interface.c.

◆ popdown_city_dialog()

void popdown_city_dialog ( struct city pcity)

Call popdown_city_dialog callback

Definition at line 569 of file gui_interface.c.

◆ 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 
)

Call popup_combat_info callback

Definition at line 525 of file gui_interface.c.

◆ popup_image()

void popup_image ( const char tag)

Call popup_image callback

Definition at line 716 of file gui_interface.c.

◆ real_city_dialog_popup()

void real_city_dialog_popup ( struct city pcity)

Call real_city_dialog_popup callback

Definition at line 553 of file gui_interface.c.

◆ real_city_dialog_refresh()

void real_city_dialog_refresh ( struct city pcity)

Call real_city_dialog_refresh callback

Definition at line 561 of file gui_interface.c.

◆ real_conn_list_dialog_update()

void real_conn_list_dialog_update ( void unused)

Call real_conn_list_dialog_update callback

Definition at line 397 of file gui_interface.c.

◆ real_focus_units_changed()

void real_focus_units_changed ( void  )

Call real_focus_units_changed callback

Definition at line 453 of file gui_interface.c.

◆ real_output_window_append()

void real_output_window_append ( const char astring,
const struct text_tag_list tags,
int  conn_id 
)

Call real_output_window_append callback

Definition at line 82 of file gui_interface.c.

◆ real_set_client_page()

void real_set_client_page ( enum client_pages  page)

Call real_set_client_page callback

Definition at line 429 of file gui_interface.c.

◆ refresh_unit_city_dialogs()

void refresh_unit_city_dialogs ( struct unit punit)

Call refresh_unit_city_dialogs callback

Definition at line 593 of file gui_interface.c.

◆ remove_net_input()

void remove_net_input ( void  )

Call remove_net_input callback

Definition at line 389 of file gui_interface.c.

◆ request_action_confirmation()

void request_action_confirmation ( const char expl,
struct act_confirmation_data data 
)

Call request_action_confirmation callback

Definition at line 707 of file gui_interface.c.

◆ request_transport()

bool request_transport ( struct unit pcargo,
struct tile ptile 
)

Call request_transport callback

Definition at line 609 of file gui_interface.c.

◆ server_connect()

void server_connect ( void  )

Call server_connect callback

Definition at line 373 of file gui_interface.c.

◆ set_rulesets()

void set_rulesets ( int  num_rulesets,
char **  rulesets 
)

Call set_rulesets callback

Definition at line 357 of file gui_interface.c.

◆ set_unit_icon()

void set_unit_icon ( int  idx,
struct unit punit 
)

Call set_unit_icon callback

Definition at line 445 of file gui_interface.c.

◆ set_unit_icons_more_arrow()

void set_unit_icons_more_arrow ( bool  onoff)

Call set_unit_icons_more_arrow callback

Definition at line 461 of file gui_interface.c.

◆ sound_bell()

void sound_bell ( void  )

Call sound_bell callback

Definition at line 421 of file gui_interface.c.

◆ start_turn()

void start_turn ( void  )

Call start_turn callback

Definition at line 545 of file gui_interface.c.

◆ tileset_type_set()

void tileset_type_set ( enum ts_type  type)

Call tileset_type_set callback

Definition at line 116 of file gui_interface.c.

◆ ui_exit()

void ui_exit ( void  )

Call ui_exit callback

Definition at line 66 of file gui_interface.c.

◆ ui_init()

void ui_init ( void  )

Call ui_init callback

Definition at line 50 of file gui_interface.c.

◆ ui_main()

int ui_main ( int  argc,
char argv[] 
)

Call ui_main callback

Definition at line 58 of file gui_interface.c.

◆ update_infra_dialog()

void update_infra_dialog ( void  )

Call update_infra_dialog callback

Definition at line 617 of file gui_interface.c.

◆ update_timeout_label()

void update_timeout_label ( void  )

Call update_timeout_label callback

Definition at line 537 of file gui_interface.c.

◆ version_message()

void version_message ( const char vertext)

Call version_message callback

Definition at line 74 of file gui_interface.c.

Variable Documentation

◆ funcs

struct gui_funcs funcs
static

Definition at line 36 of file gui_interface.c.

Referenced by add_idle_callback(), add_net_input(), canvas_copy(), canvas_create(), canvas_fill_sprite_area(), canvas_free(), canvas_mapview_init(), canvas_put_curved_line(), canvas_put_line(), canvas_put_rectangle(), canvas_put_sprite(), canvas_put_sprite_fogged(), canvas_put_sprite_full(), canvas_put_sprite_full_scaled(), canvas_put_text(), canvas_set_zoom(), city_dialog_is_open(), close_connection_dialog(), color_alloc(), color_free(), create_sprite(), crop_sprite(), editgui_notify_object_changed(), editgui_notify_object_created(), editgui_popdown_all(), editgui_popup_properties(), editgui_refresh(), editgui_tileset_changed(), fc_interface_init_client(), fc_interface_init_server(), fc_interface_init_tool(), free_sprite(), get_current_client_page(), get_gui_funcs(), get_gui_specific_themes_directories(), get_gui_type(), get_sprite_dimensions(), get_text_size(), get_usable_themes_in_directory(), gui_clear_theme(), gui_init_meeting(), gui_load_theme(), gui_prepare_clause_updt(), gui_recv_accept_treaty(), gui_recv_cancel_meeting(), gui_recv_create_clause(), gui_recv_remove_clause(), gui_update_font(), handmade_scenario_warning(), has_zoom_support(), insert_client_build_info(), is_view_supported(), load_gfxfile(), load_gfxnumber(), map_canvas_size_refresh(), options_extra_init(), popdown_all_city_dialogs(), popdown_city_dialog(), popup_combat_info(), popup_image(), real_city_dialog_popup(), real_city_dialog_refresh(), real_conn_list_dialog_update(), real_focus_units_changed(), real_output_window_append(), real_set_client_page(), refresh_unit_city_dialogs(), remove_net_input(), request_action_confirmation(), request_transport(), server_connect(), set_rulesets(), set_unit_icon(), set_unit_icons_more_arrow(), setup_gui_funcs(), setup_gui_funcs(), sound_bell(), start_turn(), tileset_type_set(), ui_exit(), ui_init(), ui_main(), update_infra_dialog(), update_timeout_label(), and version_message().