Freeciv-3.2
Loading...
Searching...
No Matches
Functions | Variables
gui_main.c File Reference
#include <stdio.h>
#include "fc_cmdline.h"
#include "fciconv.h"
#include "log.h"
#include "gui_stub.h"
#include "gui_cbsetter.h"
#include "client_main.h"
#include "editgui_g.h"
#include "options.h"
#include "gui_main.h"

Go to the source code of this file.

Functions

void gui_ui_init (void)
 
int main (int argc, char **argv)
 
static void print_usage (const char *argv0)
 
static bool parse_options (int argc, char **argv)
 
int gui_ui_main (int argc, char *argv[])
 
void gui_options_extra_init (void)
 
void gui_ui_exit (void)
 
enum gui_type gui_get_gui_type (void)
 
void gui_real_conn_list_dialog_update (void *unused)
 
void gui_sound_bell (void)
 
void gui_add_net_input (int sock)
 
void gui_remove_net_input (void)
 
void gui_set_unit_icon (int idx, struct unit *punit)
 
void gui_set_unit_icons_more_arrow (bool onoff)
 
void gui_real_focus_units_changed (void)
 
void gui_add_idle_callback (void(callback)(void *), void *data)
 
void gui_editgui_tileset_changed (void)
 
void gui_editgui_refresh (void)
 
void gui_editgui_popup_properties (const struct tile_list *tiles, int objtype)
 
void gui_editgui_popdown_all (void)
 
void gui_editgui_notify_object_changed (int objtype, int object_id, bool removal)
 
void gui_editgui_notify_object_created (int tag, int id)
 
void gui_gui_update_font (const char *font_name, const char *font_value)
 
void gui_insert_client_build_info (char *outbuf, size_t outlen)
 

Variables

const charclient_string = "gui-stub"
 
const char *const gui_character_encoding = "UTF-8"
 
const bool gui_use_transliteration = FALSE
 

Function Documentation

◆ gui_add_idle_callback()

void gui_add_idle_callback ( void(callback)(void *)  ,
void data 
)

Enqueue a callback to be called during an idle moment. The 'callback' function should be called sometimes soon, and passed the 'data' pointer as its data.

Definition at line 220 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_add_net_input()

void gui_add_net_input ( int  sock)

Wait for data on the given socket. Call input_from_server() when data is ready to be read.

This function is called after the client has successfully connected to the server.

Definition at line 162 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_editgui_notify_object_changed()

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

Stub for editor function

Definition at line 256 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_editgui_notify_object_created()

void gui_editgui_notify_object_created ( int  tag,
int  id 
)

Stub for editor function

Definition at line 263 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_editgui_popdown_all()

void gui_editgui_popdown_all ( void  )

Stub for editor function

Definition at line 250 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_editgui_popup_properties()

void gui_editgui_popup_properties ( const struct tile_list tiles,
int  objtype 
)

Stub for editor function

Definition at line 244 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_editgui_refresh()

void gui_editgui_refresh ( void  )

Stub for editor function

Definition at line 238 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_editgui_tileset_changed()

void gui_editgui_tileset_changed ( void  )

Stub for editor function

Definition at line 232 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_get_gui_type()

enum gui_type gui_get_gui_type ( void  )

Return our GUI type

Definition at line 133 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_gui_update_font()

void gui_gui_update_font ( const char font_name,
const char font_value 
)

Updates a gui font style.

Definition at line 269 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_insert_client_build_info()

void gui_insert_client_build_info ( char outbuf,
size_t  outlen 
)

Insert build information to help

Definition at line 277 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_options_extra_init()

void gui_options_extra_init ( void  )

Extra initializers for client options.

Definition at line 117 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_real_conn_list_dialog_update()

void gui_real_conn_list_dialog_update ( void unused)

Update the connected users list at pregame state.

Definition at line 141 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_real_focus_units_changed()

void gui_real_focus_units_changed ( void  )

Called when the set of units in focus (get_units_in_focus()) changes. Standard updates like update_unit_info_label() are handled in the platform- independent code, so some clients will not need to do anything here.

Definition at line 210 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_remove_net_input()

void gui_remove_net_input ( void  )

Stop waiting for any server network data. See add_net_input().

This function is called if the client disconnects from the server.

Definition at line 172 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_set_unit_icon()

void gui_set_unit_icon ( int  idx,
struct unit punit 
)

Set one of the unit icons (specified by idx) in the information area based on punit.

punit is the unit the information should be taken from. Use NULL to clear the icon.

idx specified which icon should be modified. Use idx == -1 to indicate the icon for the active unit. Or idx in [0..num_units_below - 1] for secondary (inactive) units on the same tile.

Definition at line 188 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_set_unit_icons_more_arrow()

void gui_set_unit_icons_more_arrow ( bool  onoff)

Most clients use an arrow (e.g., sprites.right_arrow) to indicate when the units_below will not fit. This function is called to activate or deactivate the arrow.

Is disabled by default.

Definition at line 200 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_sound_bell()

void gui_sound_bell ( void  )

Make a bell noise (beep). This provides low-level sound alerts even if there is no real sound support.

Definition at line 150 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_ui_exit()

void gui_ui_exit ( void  )

Do any necessary UI-specific cleanup

Definition at line 125 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_ui_init()

void gui_ui_init ( void  )

Do any necessary pre-initialization of the UI, if necessary.

Definition at line 44 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ gui_ui_main()

int gui_ui_main ( int  argc,
char argv[] 
)

The main loop for the UI. This is called from main(), and when it exits the client will exit.

Definition at line 100 of file gui_main.c.

Referenced by setup_gui_funcs().

◆ main()

int main ( int  argc,
char **  argv 
)

Entry point for whole freeciv client program.

Definition at line 52 of file gui_main.c.

◆ parse_options()

static bool parse_options ( int  argc,
char **  argv 
)
static

Parse and enact any gui-specific command-line options.

Definition at line 76 of file gui_main.c.

◆ print_usage()

static void print_usage ( const char argv0)
static

Print extra usage information, including one line help on each option, to stderr.

Definition at line 62 of file gui_main.c.

Variable Documentation

◆ client_string

const char* client_string = "gui-stub"

Definition at line 36 of file gui_main.c.

◆ gui_character_encoding

const char* const gui_character_encoding = "UTF-8"

Definition at line 38 of file gui_main.c.

Referenced by client_main().

◆ gui_use_transliteration

const bool gui_use_transliteration = FALSE

Definition at line 39 of file gui_main.c.

Referenced by client_main().