Freeciv-3.3
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
pages.c File Reference
#include <stdio.h>
#include <time.h>
#include <sys/stat.h>
#include <gtk/gtk.h>
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "shared.h"
#include "support.h"
#include "chat.h"
#include "dataio.h"
#include "game.h"
#include "mapimg.h"
#include "version.h"
#include "client_main.h"
#include "climisc.h"
#include "clinet.h"
#include "connectdlg_common.h"
#include "packhand.h"
#include "servers.h"
#include "update_queue.h"
#include "chatline.h"
#include "connectdlg.h"
#include "dialogs.h"
#include "graphics.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "mapview.h"
#include "menu.h"
#include "optiondlg.h"
#include "plrdlg.h"
#include "repodlgs.h"
#include "voteinfo_bar.h"
#include "pages.h"

Go to the source code of this file.

Data Structures

struct  server_scan_timer_data
 
struct  _FcHostRow
 
struct  _FcHostClass
 
struct  _FcPlrRow
 
struct  _FcPlrClass
 
struct  _FcScenRow
 
struct  _FcScenClass
 
struct  _FcSaveRow
 
struct  _FcSaveClass
 
struct  save_dialog
 

Macros

#define FC_TYPE_HOST_ROW   (fc_host_row_get_type())
 
#define FC_TYPE_PLR_ROW   (fc_plr_row_get_type())
 
#define FC_TYPE_SCEN_ROW   (fc_scen_row_get_type())
 
#define FC_TYPE_SAVE_ROW   (fc_save_row_get_type())
 

Typedefs

typedef void(* save_dialog_action_fn_t) (const char *filename)
 
typedef struct fileinfo_list *(* save_dialog_files_fn_t) (void)
 

Enumerations

enum  host_rows {
  host_row_host , host_row_port , host_row_version , host_row_state ,
  host_row_nplayers , host_row_humans , host_row_message
}
 
enum  plr_rows { plr_row_name , plr_row_type , plr_row_host , plr_row_nation }
 
enum  save_dialog_columns { SD_COL_PRETTY_NAME = 0 , SD_COL_FULL_PATH , SD_COL_NUM }
 
enum  save_dialog_response { SD_RES_BROWSE , SD_RES_DELETE , SD_RES_SAVE }
 
enum  connection_state { LOGIN_TYPE , NEW_PASSWORD_TYPE , ENTER_PASSWORD_TYPE , WAITING_TYPE }
 
enum  connection_list_columns {
  CL_COL_PLAYER_NUMBER = 0 , CL_COL_USER_NAME , CL_COL_READY_STATE , CL_COL_PLAYER_NAME ,
  CL_COL_FLAG , CL_COL_COLOR , CL_COL_NATION , CL_COL_TEAM ,
  CL_COL_CONN_ID , CL_COL_STYLE , CL_COL_WEIGHT , CL_COL_COLLAPSED ,
  CL_NUM_COLUMNS
}
 

Functions

static void connection_state_reset (void)
 
static void fc_host_row_class_init (FcHostRowClass *klass)
 
static void fc_host_row_init (FcHostRow *self)
 
static void fc_plr_row_class_init (FcPlrRowClass *klass)
 
static void fc_plr_row_init (FcPlrRow *self)
 
static void fc_scen_row_class_init (FcScenRowClass *klass)
 
static void fc_scen_row_init (FcScenRow *self)
 
static void fc_save_row_class_init (FcSaveRowClass *klass)
 
static void fc_save_row_init (FcSaveRow *self)
 
static void start_new_game_callback (GtkWidget *w, gpointer data)
 
static void start_scenario_callback (GtkWidget *w, gpointer data)
 
static void load_saved_game_callback (GtkWidget *w, gpointer data)
 
static void connect_network_game_callback (GtkWidget *w, gpointer data)
 
static void open_settings (void)
 
static void main_callback (GtkWidget *w, gpointer data)
 
static void intro_expose (GtkDrawingArea *w, cairo_t *cr, int width, int height, gpointer data)
 
static void intro_free (GtkWidget *w, gpointer *data)
 
GtkWidgetcreate_main_page (void)
 
static GtkListStoresave_dialog_store_new (void)
 
static void save_dialog_store_update (GtkListStore *store, const struct fileinfo_list *files)
 
static void save_dialog_update (struct save_dialog *pdialog)
 
static void save_dialog_file_chooser_callback (GtkWidget *widget, gint response, gpointer data)
 
static void save_dialog_file_chooser_popup (const char *title, GtkFileChooserAction action, save_dialog_action_fn_t cb)
 
static void save_dialog_response_callback (GtkWidget *w, gint response, gpointer data)
 
static void save_dialog_row_callback (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer data)
 
static void save_dialog_entry_callback (GtkEntry *entry, gpointer data)
 
static void save_dialog_list_callback (GtkTreeSelection *selection, gpointer data)
 
static void save_factory_bind (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static void save_factory_setup (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static GtkWidgetsave_dialog_new (const char *title, const char *savelabel, const char *savefilelabel, save_dialog_action_fn_t action, save_dialog_files_fn_t files)
 
static void update_server_list (enum server_scan_type sstype, const struct server_list *list)
 
void destroy_server_scans (void)
 
static gboolean check_server_scan (gpointer data)
 
static void server_scan_error (struct server_scan *scan, const char *message)
 
static void update_network_lists (void)
 
static gboolean update_network_statusbar (gpointer data)
 
static void clear_network_statusbar (void)
 
void append_network_statusbar (const char *text, bool force)
 
GtkWidgetcreate_statusbar (void)
 
static void set_connection_state (enum connection_state state)
 
void handle_authentication_req (enum authentication_type type, const char *message)
 
static void connect_callback (GtkWidget *w, gpointer data)
 
static void network_activate_callback (GtkTreeView *view, GtkTreePath *arg1, GtkTreeViewColumn *arg2, gpointer data)
 
static void update_server_playerlist (const struct server *pserver)
 
static void network_list_callback (GtkTreeSelection *select, gpointer data)
 
static void update_network_page (void)
 
static void host_factory_bind (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static void host_factory_setup (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static void plr_factory_bind (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static void plr_factory_setup (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
GtkWidgetcreate_network_page (void)
 
static GtkTreeStoreconnection_list_store_new (void)
 
static void client_aitoggle_player (void *data)
 
static void client_take_player (struct player *pplayer)
 
static void object_put (GObject *object, struct player *pplayer, struct connection *pconn)
 
static bool object_extract (GObject *object, struct player **ppplayer, struct connection **ppconn)
 
static void game_options_callback (GtkWidget *w, gpointer data)
 
static void ai_skill_callback (GtkWidget *w, gpointer data)
 
static void ruleset_selected (const char *name)
 
static void ruleset_entry_changed (GtkWidget *w, gpointer data)
 
static void ai_fill_changed_by_user (GtkWidget *w, gpointer data)
 
void ai_fill_changed_by_server (int aifill)
 
void update_start_page (void)
 
static void close_conn_menu_popover (void)
 
static void conn_menu_team_chosen (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void conn_menu_ready_chosen (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void conn_menu_nation_chosen (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void conn_menu_player_command (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void conn_menu_player_take (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void conn_menu_connection_command (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void show_conn_popup (struct player *pplayer, struct connection *pconn)
 
static void conn_menu_info_chosen (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static GtkWidgetcreate_conn_menu (struct player *pplayer, struct connection *pconn)
 
static gboolean delayed_unselect_path (gpointer data)
 
static gboolean connect_list_left_button (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
static gboolean connect_list_right_button (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
static void connection_list_row_callback (GtkTreeView *tree_view, GtkTreeIter *iter, GtkTreePath *path, gpointer data)
 
static bool conn_list_selection (struct player **ppplayer, struct connection **ppconn)
 
static void conn_list_select_conn (struct connection *pconn)
 
static void ready_button_callback (GtkWidget *w, gpointer data)
 
static void nation_button_callback (GtkWidget *w, gpointer data)
 
static void observe_button_callback (GtkWidget *w, gpointer data)
 
static void update_start_page_buttons (void)
 
static bool model_get_player_iter (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *start, const struct player *pplayer)
 
static bool model_get_conn_iter (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent, GtkTreeIter *start, const struct connection *pconn)
 
void real_conn_list_dialog_update (void *unused)
 
static void add_tree_col (GtkWidget *treeview, GType gtype, const char *title, int colnum, const char *key)
 
GtkWidgetcreate_start_page (void)
 
void handle_game_load (bool load_successful, const char *filename)
 
static void load_filename (const char *filename)
 
static void load_callback (void)
 
static void load_browse_callback (GtkWidget *w, gpointer data)
 
static void update_load_page (void)
 
GtkWidgetcreate_load_page (void)
 
static void scenario_list_callback (void)
 
static void scenario_callback (void)
 
static void scenario_browse_callback (GtkWidget *w, gpointer data)
 
static void update_scenario_page (void)
 
static void scenario_factory_bind (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static void scenario_factory_setup (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
GtkWidgetcreate_scenario_page (void)
 
enum client_pages get_current_client_page (void)
 
void real_set_client_page (enum client_pages new_page)
 
static struct fileinfo_listsave_dialog_savegame_list (void)
 
void save_game_dialog_popup (void)
 
static void save_dialog_save_scenario (const char *filename)
 
static struct fileinfo_listsave_dialog_scenario_list (void)
 
void save_scenario_dialog_popup (void)
 
static struct fileinfo_listsave_dialog_mapimg_list (void)
 
void save_mapimg_dialog_popup (void)
 
void mapimg_client_save (const char *filename)
 
void set_rulesets (int num_rulesets, char **rulesets)
 

Variables

static GtkWidgetscenario_description
 
static GtkWidgetscenario_authors
 
static GtkWidgetscenario_filename
 
static GtkWidgetscenario_version
 
static GtkListStoreload_store
 
static GtkListStorescenario_store
 
static GtkListStoremeta_store
 
static GtkListStorelan_store
 
static GtkListStoreserver_playerlist_store
 
static GtkWidgetserver_playerlist_view
 
static GtkTreeSelectionload_selection
 
static GtkTreeSelectionscenario_selection
 
static GtkTreeSelectionmeta_selection
 
static GtkTreeSelectionlan_selection
 
static enum client_pages current_page = -1
 
static struct server_scan_timer_data meta_scan = { NULL, 0 }
 
static struct server_scan_timer_data lan_scan = { NULL, 0 }
 
static GtkWidgetstatusbar
 
static GtkWidgetstatusbar_frame
 
static GQueuestatusbar_queue
 
static guint statusbar_timer = 0
 
static GtkWidgetruleset_combo
 
static GtkWidgetconn_popover = NULL
 
static bool holding_srv_list_mutex = FALSE
 
static GtkWidgetnetwork_login_label
 
static GtkWidgetnetwork_login
 
static GtkWidgetnetwork_host_label
 
static GtkWidgetnetwork_host
 
static GtkWidgetnetwork_port_label
 
static GtkWidgetnetwork_port
 
static GtkWidgetnetwork_password_label
 
static GtkWidgetnetwork_password
 
static GtkWidgetnetwork_confirm_password_label
 
static GtkWidgetnetwork_confirm_password
 
static enum connection_state connection_status
 
GtkWidgetstart_message_area
 
static GtkWidgetstart_options_table
 
static GtkWidgetobserve_button
 
static GtkWidgetready_button
 
static GtkWidgetnation_button
 
static GtkTreeStoreconnection_list_store
 
static GtkTreeViewconnection_list_view
 
static GtkWidgetstart_aifill_spin = NULL
 
static GtkWidgetai_lvl_combobox = NULL
 
static bool no_ruleset_callback = FALSE
 
static bool send_new_aifill_to_server = TRUE
 

Macro Definition Documentation

◆ FC_TYPE_HOST_ROW

#define FC_TYPE_HOST_ROW   (fc_host_row_get_type())

Definition at line 103 of file pages.c.

◆ FC_TYPE_PLR_ROW

#define FC_TYPE_PLR_ROW   (fc_plr_row_get_type())

Definition at line 138 of file pages.c.

◆ FC_TYPE_SAVE_ROW

#define FC_TYPE_SAVE_ROW   (fc_save_row_get_type())

Definition at line 190 of file pages.c.

◆ FC_TYPE_SCEN_ROW

#define FC_TYPE_SCEN_ROW   (fc_scen_row_get_type())

Definition at line 167 of file pages.c.

Typedef Documentation

◆ save_dialog_action_fn_t

typedef void(* save_dialog_action_fn_t) (const char *filename)

Definition at line 607 of file pages.c.

◆ save_dialog_files_fn_t

typedef struct fileinfo_list *(* save_dialog_files_fn_t) (void)

Definition at line 607 of file pages.c.

Enumeration Type Documentation

◆ connection_list_columns

Enumerator
CL_COL_PLAYER_NUMBER 
CL_COL_USER_NAME 
CL_COL_READY_STATE 
CL_COL_PLAYER_NAME 
CL_COL_FLAG 
CL_COL_COLOR 
CL_COL_NATION 
CL_COL_TEAM 
CL_COL_CONN_ID 
CL_COL_STYLE 
CL_COL_WEIGHT 
CL_COL_COLLAPSED 
CL_NUM_COLUMNS 

Definition at line 1857 of file pages.c.

◆ connection_state

Enumerator
LOGIN_TYPE 
NEW_PASSWORD_TYPE 
ENTER_PASSWORD_TYPE 
WAITING_TYPE 

Definition at line 1122 of file pages.c.

◆ host_rows

Enumerator
host_row_host 
host_row_port 
host_row_version 
host_row_state 
host_row_nplayers 
host_row_humans 
host_row_message 

Definition at line 127 of file pages.c.

◆ plr_rows

Enumerator
plr_row_name 
plr_row_type 
plr_row_host 
plr_row_nation 

Definition at line 159 of file pages.c.

◆ save_dialog_columns

Enumerator
SD_COL_PRETTY_NAME 
SD_COL_FULL_PATH 
SD_COL_NUM 

Definition at line 618 of file pages.c.

◆ save_dialog_response

Enumerator
SD_RES_BROWSE 
SD_RES_DELETE 
SD_RES_SAVE 

Definition at line 625 of file pages.c.

Function Documentation

◆ add_tree_col()

static void add_tree_col ( GtkWidget treeview,
GType  gtype,
const char title,
int  colnum,
const char key 
)
static

Helper function for adding columns to a tree view. If 'key' is not NULL then the added column is added to the object data of the treeview using g_object_set_data() under 'key'.

Definition at line 3059 of file pages.c.

◆ ai_fill_changed_by_server()

void ai_fill_changed_by_server ( int  aifill)

Server changed AI fill setting.

Definition at line 2042 of file pages.c.

◆ ai_fill_changed_by_user()

static void ai_fill_changed_by_user ( GtkWidget w,
gpointer  data 
)
static

Definition at line 2031 of file pages.c.

◆ ai_skill_callback()

static void ai_skill_callback ( GtkWidget w,
gpointer  data 
)
static

AI skill setting callback.

Definition at line 1978 of file pages.c.

◆ append_network_statusbar()

void append_network_statusbar ( const char text,
bool  force 
)

Queue statusbar label text change.

Definition at line 1165 of file pages.c.

◆ check_server_scan()

static gboolean check_server_scan ( gpointer  data)
static

This function updates the list of servers every so often.

Definition at line 1061 of file pages.c.

◆ clear_network_statusbar()

static void clear_network_statusbar ( void  )
static

Clear statusbar queue.

Definition at line 1150 of file pages.c.

◆ client_aitoggle_player()

static void client_aitoggle_player ( void data)
static

Maybe toggle AI of the player if the client could take the player. This function shouldn't be used directly, see in client_take_player().

Definition at line 1898 of file pages.c.

◆ client_take_player()

static void client_take_player ( struct player pplayer)
static

Send the /take command by chat and toggle AI if needed (after that).

Definition at line 1912 of file pages.c.

◆ close_conn_menu_popover()

static void close_conn_menu_popover ( void  )
static

Close connection menu.

Definition at line 2071 of file pages.c.

◆ conn_list_select_conn()

static void conn_list_select_conn ( struct connection pconn)
static

Selects connection's row in the connection/player list.

Definition at line 2564 of file pages.c.

◆ conn_list_selection()

static bool conn_list_selection ( struct player **  ppplayer,
struct connection **  ppconn 
)
static

Returns TRUE if a row is selected in the connection/player list. Fills the not null data.

Definition at line 2528 of file pages.c.

◆ conn_menu_connection_command()

static void conn_menu_connection_command ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

Miscellaneous callback for the conn menu that allows an arbitrary command (/cmdlevel, /cut, etc.) to be run on the connection.

Definition at line 2174 of file pages.c.

◆ conn_menu_info_chosen()

static void conn_menu_info_chosen ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

Callback for when the "info" entry is chosen from the conn menu.

Definition at line 2223 of file pages.c.

◆ conn_menu_nation_chosen()

static void conn_menu_nation_chosen ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

Callback for when the pick-nation entry is chosen from the conn menu.

Definition at line 2122 of file pages.c.

◆ conn_menu_player_command()

static void conn_menu_player_command ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

Miscellaneous callback for the conn menu that allows an arbitrary command (/observe, /remove, /hard, etc.) to be run on the player.

Definition at line 2139 of file pages.c.

◆ conn_menu_player_take()

static void conn_menu_player_take ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

Take command in the conn menu.

Definition at line 2157 of file pages.c.

◆ conn_menu_ready_chosen()

static void conn_menu_ready_chosen ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

Callback for when the "ready" entry is chosen from the conn menu.

Definition at line 2105 of file pages.c.

◆ conn_menu_team_chosen()

static void conn_menu_team_chosen ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

Callback for when a team is chosen from the conn menu.

Definition at line 2084 of file pages.c.

◆ connect_callback()

static void connect_callback ( GtkWidget w,
gpointer  data 
)
static

If on the network page, switch page to the login page (with new server and port). if on the login page, send connect and/or authentication requests to the server.

Definition at line 1317 of file pages.c.

◆ connect_list_left_button()

static gboolean connect_list_left_button ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)
static

Called on a left button click on the pregame player list.

Definition at line 2431 of file pages.c.

◆ connect_list_right_button()

static gboolean connect_list_right_button ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)
static

Called on a right button click on the pregame player list.

Definition at line 2460 of file pages.c.

◆ connect_network_game_callback()

static void connect_network_game_callback ( GtkWidget w,
gpointer  data 
)
static

Reset the connection status and switch to network page.

Definition at line 362 of file pages.c.

◆ connection_list_row_callback()

static void connection_list_row_callback ( GtkTreeView tree_view,
GtkTreeIter iter,
GtkTreePath path,
gpointer  data 
)
static

Mark a row as collapsed or expanded.

Definition at line 2513 of file pages.c.

◆ connection_list_store_new()

static GtkTreeStore * connection_list_store_new ( void  )
inlinestatic

Create a new tree store for connection list.

Definition at line 1877 of file pages.c.

◆ connection_state_reset()

static void connection_state_reset ( void  )
static

Reset the connection state.

Definition at line 1272 of file pages.c.

◆ create_conn_menu()

static GtkWidget * create_conn_menu ( struct player pplayer,
struct connection pconn 
)
static

Called when you click on a player; this function pops up a menu to allow changing the team.

Definition at line 2241 of file pages.c.

◆ create_load_page()

GtkWidget * create_load_page ( void  )

Create the load page.

Definition at line 3398 of file pages.c.

◆ create_main_page()

GtkWidget * create_main_page ( void  )

Create the main page.

Definition at line 460 of file pages.c.

◆ create_network_page()

GtkWidget * create_network_page ( void  )

Create the network page.

Definition at line 1565 of file pages.c.

◆ create_scenario_page()

GtkWidget * create_scenario_page ( void  )

Create the scenario page.

Definition at line 3706 of file pages.c.

◆ create_start_page()

GtkWidget * create_start_page ( void  )

Create start page.

Definition at line 3093 of file pages.c.

◆ create_statusbar()

GtkWidget * create_statusbar ( void  )

Create statusbar.

Definition at line 1180 of file pages.c.

◆ delayed_unselect_path()

static gboolean delayed_unselect_path ( gpointer  data)
static

Unselect a tree path.

Definition at line 2415 of file pages.c.

◆ destroy_server_scans()

void destroy_server_scans ( void  )

Free the server scans.

Definition at line 1038 of file pages.c.

◆ fc_host_row_class_init()

static void fc_host_row_class_init ( FcHostRowClass klass)
static

Initialization method for FcHostRow class

Definition at line 213 of file pages.c.

◆ fc_host_row_init()

static void fc_host_row_init ( FcHostRow self)
static

Initialization method for FcHostRow

Definition at line 221 of file pages.c.

◆ fc_plr_row_class_init()

static void fc_plr_row_class_init ( FcPlrRowClass klass)
static

FcHostRow creation method Initialization method for FcPlrRow class

Definition at line 243 of file pages.c.

◆ fc_plr_row_init()

static void fc_plr_row_init ( FcPlrRow self)
static

Initialization method for FcPlrRow

Definition at line 251 of file pages.c.

◆ fc_save_row_class_init()

static void fc_save_row_class_init ( FcSaveRowClass klass)
static

FcScenRow creation method Initialization method for FcSaveRow class

Definition at line 303 of file pages.c.

◆ fc_save_row_init()

static void fc_save_row_init ( FcSaveRow self)
static

Initialization method for FcSaveRow

Definition at line 311 of file pages.c.

◆ fc_scen_row_class_init()

static void fc_scen_row_class_init ( FcScenRowClass klass)
static

FcPlrRow creation method Initialization method for FcScenRow class

Definition at line 273 of file pages.c.

◆ fc_scen_row_init()

static void fc_scen_row_init ( FcScenRow self)
static

Initialization method for FcScenRow

Definition at line 281 of file pages.c.

◆ game_options_callback()

static void game_options_callback ( GtkWidget w,
gpointer  data 
)
static

Request the game options dialog.

Definition at line 1970 of file pages.c.

◆ get_current_client_page()

enum client_pages get_current_client_page ( void  )

Returns current client page

Definition at line 3886 of file pages.c.

◆ handle_authentication_req()

void handle_authentication_req ( enum authentication_type  type,
const char message 
)

Configure the dialog depending on what type of authentication request the server is making.

Definition at line 1281 of file pages.c.

◆ handle_game_load()

void handle_game_load ( bool  load_successful,
const char filename 
)

This regenerates the player information from a loaded game on the server.

Definition at line 3335 of file pages.c.

◆ host_factory_bind()

static void host_factory_bind ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Host table cell bind function

Definition at line 1477 of file pages.c.

Referenced by create_network_page().

◆ host_factory_setup()

static void host_factory_setup ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Host table cell setup function

Definition at line 1517 of file pages.c.

Referenced by create_network_page().

◆ intro_expose()

static void intro_expose ( GtkDrawingArea w,
cairo_t cr,
int  width,
int  height,
gpointer  data 
)
static

This is called whenever the intro graphic needs a graphics refresh.

Definition at line 394 of file pages.c.

◆ intro_free()

static void intro_free ( GtkWidget w,
gpointer data 
)
static

This is called when main page is getting destroyed.

Definition at line 450 of file pages.c.

◆ load_browse_callback()

static void load_browse_callback ( GtkWidget w,
gpointer  data 
)
static

Call the default GTK requester for saved game loading.

Definition at line 3375 of file pages.c.

◆ load_callback()

static void load_callback ( void  )
static

Loads the currently selected game.

Definition at line 3358 of file pages.c.

◆ load_filename()

static void load_filename ( const char filename)
static

Load a savegame/scenario.

Definition at line 3350 of file pages.c.

◆ load_saved_game_callback()

static void load_saved_game_callback ( GtkWidget w,
gpointer  data 
)
static

Go to the load page, spawning a server.

Definition at line 354 of file pages.c.

◆ main_callback()

static void main_callback ( GtkWidget w,
gpointer  data 
)
static

Cancel, by terminating the connection and going back to main page.

Definition at line 379 of file pages.c.

◆ mapimg_client_save()

void mapimg_client_save ( const char filename)

Save map image. On error popup a message window for the user.

Definition at line 4109 of file pages.c.

◆ model_get_conn_iter()

static bool model_get_conn_iter ( GtkTreeModel model,
GtkTreeIter iter,
GtkTreeIter parent,
GtkTreeIter start,
const struct connection pconn 
)
static

Search a connection iterator in the model. Begin the iteration at 'start' or at the start of the model if 'start' is set to NULL.

Definition at line 2785 of file pages.c.

◆ model_get_player_iter()

static bool model_get_player_iter ( GtkTreeModel model,
GtkTreeIter iter,
GtkTreeIter start,
const struct player pplayer 
)
static

Search a player iterator in the model. Begin the iteration at 'start' or at the start of the model if 'start' is set to NULL.

Definition at line 2754 of file pages.c.

◆ nation_button_callback()

static void nation_button_callback ( GtkWidget w,
gpointer  data 
)
static

'nation_button' clicked callback.

Definition at line 2629 of file pages.c.

◆ network_activate_callback()

static void network_activate_callback ( GtkTreeView view,
GtkTreePath arg1,
GtkTreeViewColumn arg2,
gpointer  data 
)
static

Connect on list item double-click.

Definition at line 1374 of file pages.c.

◆ network_list_callback()

static void network_list_callback ( GtkTreeSelection select,
gpointer  data 
)
static

Sets the host, port and player list of the selected server.

Definition at line 1415 of file pages.c.

◆ object_extract()

static bool object_extract ( GObject object,
struct player **  ppplayer,
struct connection **  ppconn 
)
static

Extract the player and the connection set with object_put(). Returns TRUE if at least one of them isn't NULL.

Definition at line 1943 of file pages.c.

◆ object_put()

static void object_put ( GObject object,
struct player pplayer,
struct connection pconn 
)
static

Connect the object to the player and the connection.

Definition at line 1924 of file pages.c.

◆ observe_button_callback()

static void observe_button_callback ( GtkWidget w,
gpointer  data 
)
static

'observe_button' clicked callback.

Definition at line 2649 of file pages.c.

◆ open_settings()

static void open_settings ( void  )
static

Callback to open settings dialog.

Definition at line 371 of file pages.c.

◆ plr_factory_bind()

static void plr_factory_bind ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Player table cell bind function

Definition at line 1527 of file pages.c.

Referenced by create_network_page().

◆ plr_factory_setup()

static void plr_factory_setup ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Player table cell setup function

Definition at line 1555 of file pages.c.

Referenced by create_network_page().

◆ ready_button_callback()

static void ready_button_callback ( GtkWidget w,
gpointer  data 
)
static

'ready_button' clicked callback.

Definition at line 2615 of file pages.c.

◆ real_conn_list_dialog_update()

void real_conn_list_dialog_update ( void unused)

Update the connected users list at pregame state.

Definition at line 2814 of file pages.c.

◆ real_set_client_page()

void real_set_client_page ( enum client_pages  new_page)

Changes the current page. The action is delayed.

Definition at line 3894 of file pages.c.

◆ ruleset_entry_changed()

static void ruleset_entry_changed ( GtkWidget w,
gpointer  data 
)
static

Ruleset selection callback. Note that this gets also called when ever user types to entry box. In that case we don't want to set_ruleset() after each letter.

Definition at line 2016 of file pages.c.

◆ ruleset_selected()

static void ruleset_selected ( const char name)
static

Ruleset name has been given

Definition at line 2004 of file pages.c.

◆ save_dialog_entry_callback()

static void save_dialog_entry_callback ( GtkEntry entry,
gpointer  data 
)
static

Handle save filename entry activation.

Definition at line 789 of file pages.c.

◆ save_dialog_file_chooser_callback()

static void save_dialog_file_chooser_callback ( GtkWidget widget,
gint  response,
gpointer  data 
)
static

Callback for save_dialog_file_chooser_new().

Definition at line 679 of file pages.c.

◆ save_dialog_file_chooser_popup()

static void save_dialog_file_chooser_popup ( const char title,
GtkFileChooserAction  action,
save_dialog_action_fn_t  cb 
)
static

Create a file chooser for both the load and save commands.

Definition at line 704 of file pages.c.

◆ save_dialog_list_callback()

static void save_dialog_list_callback ( GtkTreeSelection selection,
gpointer  data 
)
static

Handle the save list selection changes.

Definition at line 797 of file pages.c.

◆ save_dialog_mapimg_list()

static struct fileinfo_list * save_dialog_mapimg_list ( void  )
static

Save mapimg 'save_dialog_files_fn_t' implementation. If possible, only the current directory is used. As fallback, the files in the save directories are listed.

Definition at line 4082 of file pages.c.

◆ save_dialog_new()

static GtkWidget * save_dialog_new ( const char title,
const char savelabel,
const char savefilelabel,
save_dialog_action_fn_t  action,
save_dialog_files_fn_t  files 
)
static

Create a new save dialog.

Definition at line 843 of file pages.c.

◆ save_dialog_response_callback()

static void save_dialog_response_callback ( GtkWidget w,
gint  response,
gpointer  data 
)
static

Handle save dialog response.

Definition at line 728 of file pages.c.

◆ save_dialog_row_callback()

static void save_dialog_row_callback ( GtkTreeView tree_view,
GtkTreePath path,
GtkTreeViewColumn column,
gpointer  data 
)
static

Handle save list double click.

Definition at line 778 of file pages.c.

◆ save_dialog_save_scenario()

static void save_dialog_save_scenario ( const char filename)
static

Save scenario 'save_dialog_action_fn_t' implementation.

Definition at line 4045 of file pages.c.

◆ save_dialog_savegame_list()

static struct fileinfo_list * save_dialog_savegame_list ( void  )
static

Save game 'save_dialog_files_fn_t' implementation.

Definition at line 4018 of file pages.c.

◆ save_dialog_scenario_list()

static struct fileinfo_list * save_dialog_scenario_list ( void  )
static

Save scenario 'save_dialog_files_fn_t' implementation.

Definition at line 4053 of file pages.c.

◆ save_dialog_store_new()

static GtkListStore * save_dialog_store_new ( void  )
inlinestatic

Create a new file list store.

Definition at line 634 of file pages.c.

◆ save_dialog_store_update()

static void save_dialog_store_update ( GtkListStore store,
const struct fileinfo_list files 
)
static

Fill a file list store with 'files'.

Definition at line 644 of file pages.c.

◆ save_dialog_update()

static void save_dialog_update ( struct save_dialog pdialog)
static

Update a save dialog.

Definition at line 662 of file pages.c.

◆ save_factory_bind()

static void save_factory_bind ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Save table cell bind function

Definition at line 818 of file pages.c.

Referenced by save_dialog_new().

◆ save_factory_setup()

static void save_factory_setup ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Save table cell setup function

Definition at line 833 of file pages.c.

Referenced by save_dialog_new().

◆ save_game_dialog_popup()

void save_game_dialog_popup ( void  )

Save game dialog.

Definition at line 4026 of file pages.c.

◆ save_mapimg_dialog_popup()

void save_mapimg_dialog_popup ( void  )

Save scenario dialog.

Definition at line 4090 of file pages.c.

◆ save_scenario_dialog_popup()

void save_scenario_dialog_popup ( void  )

Save scenario dialog.

Definition at line 4061 of file pages.c.

◆ scenario_browse_callback()

static void scenario_browse_callback ( GtkWidget w,
gpointer  data 
)
static

Call the default GTK requester for scenario loading.

Definition at line 3555 of file pages.c.

◆ scenario_callback()

static void scenario_callback ( void  )
static

Loads the currently selected scenario.

Definition at line 3539 of file pages.c.

◆ scenario_factory_bind()

static void scenario_factory_bind ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Scenario table cell bind function

Definition at line 3681 of file pages.c.

Referenced by create_scenario_page().

◆ scenario_factory_setup()

static void scenario_factory_setup ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Scenario table cell setup function

Definition at line 3696 of file pages.c.

Referenced by create_scenario_page().

◆ scenario_list_callback()

static void scenario_list_callback ( void  )
static

Updates the info for the currently selected scenario.

Definition at line 3483 of file pages.c.

◆ server_scan_error()

static void server_scan_error ( struct server_scan scan,
const char message 
)
static

Callback function for when there's an error in the server scan.

Definition at line 1095 of file pages.c.

◆ set_connection_state()

static void set_connection_state ( enum connection_state  state)
static

Update network page connection state.

Definition at line 1200 of file pages.c.

◆ set_rulesets()

void set_rulesets ( int  num_rulesets,
char **  rulesets 
)

Set the list of available rulesets. The default ruleset should be "default", and if the user changes this then set_ruleset() should be called.

Definition at line 4125 of file pages.c.

◆ show_conn_popup()

static void show_conn_popup ( struct player pplayer,
struct connection pconn 
)
static

Show details about a user in the Connected Users dialog in a popup.

Definition at line 2192 of file pages.c.

◆ start_new_game_callback()

static void start_new_game_callback ( GtkWidget w,
gpointer  data 
)
static

FcSaveRow creation method Spawn a server, if there isn't one, using the default settings.

Definition at line 332 of file pages.c.

◆ start_scenario_callback()

static void start_scenario_callback ( GtkWidget w,
gpointer  data 
)
static

Go to the scenario page, spawning a server.

Definition at line 345 of file pages.c.

◆ update_load_page()

static void update_load_page ( void  )
static

Update the load page.

Definition at line 3385 of file pages.c.

◆ update_network_lists()

static void update_network_lists ( void  )
static

Stop and restart the metaserver and lan server scans.

Definition at line 1108 of file pages.c.

◆ update_network_page()

static void update_network_page ( void  )
static

Update the network page.

Definition at line 1461 of file pages.c.

◆ update_network_statusbar()

static gboolean update_network_statusbar ( gpointer  data)
static

Update statusbar label text.

Definition at line 1134 of file pages.c.

◆ update_scenario_page()

static void update_scenario_page ( void  )
static

Update the scenario page.

Definition at line 3565 of file pages.c.

◆ update_server_list()

static void update_server_list ( enum server_scan_type  sstype,
const struct server_list list 
)
static

Update a server list.

Definition at line 974 of file pages.c.

◆ update_server_playerlist()

static void update_server_playerlist ( const struct server pserver)
static

Fills the server player list with the players in the given server, or clears it if there is no player data.

Definition at line 1386 of file pages.c.

◆ update_start_page()

void update_start_page ( void  )

Update the start page.

Definition at line 2063 of file pages.c.

◆ update_start_page_buttons()

static void update_start_page_buttons ( void  )
static

Update the buttons of the start page.

Definition at line 2669 of file pages.c.

Variable Documentation

◆ ai_lvl_combobox

GtkWidget* ai_lvl_combobox = NULL
static

Definition at line 1853 of file pages.c.

◆ conn_popover

GtkWidget* conn_popover = NULL
static

Definition at line 97 of file pages.c.

◆ connection_list_store

GtkTreeStore* connection_list_store
static

Definition at line 1850 of file pages.c.

◆ connection_list_view

GtkTreeView* connection_list_view
static

Definition at line 1851 of file pages.c.

◆ connection_status

enum connection_state connection_status
static

Definition at line 1129 of file pages.c.

◆ current_page

enum client_pages current_page = -1
static

Definition at line 80 of file pages.c.

◆ holding_srv_list_mutex

bool holding_srv_list_mutex = FALSE
static

Definition at line 99 of file pages.c.

◆ lan_scan

struct server_scan_timer_data lan_scan = { NULL, 0 }
static

Definition at line 89 of file pages.c.

◆ lan_selection

GtkTreeSelection * lan_selection
static

Definition at line 76 of file pages.c.

◆ lan_store

GtkListStore * lan_store
static

Definition at line 70 of file pages.c.

◆ load_selection

GtkTreeSelection* load_selection
static

Definition at line 75 of file pages.c.

◆ load_store

GtkListStore* load_store
static

Definition at line 70 of file pages.c.

◆ meta_scan

struct server_scan_timer_data meta_scan = { NULL, 0 }
static

Definition at line 88 of file pages.c.

◆ meta_selection

GtkTreeSelection* meta_selection
static

Definition at line 76 of file pages.c.

◆ meta_store

GtkListStore * meta_store
static

Definition at line 70 of file pages.c.

◆ nation_button

GtkWidget * nation_button
static

Definition at line 1849 of file pages.c.

◆ network_confirm_password

GtkWidget * network_confirm_password
static

Definition at line 969 of file pages.c.

◆ network_confirm_password_label

GtkWidget* network_confirm_password_label
static

Definition at line 969 of file pages.c.

◆ network_host

GtkWidget * network_host
static

Definition at line 966 of file pages.c.

◆ network_host_label

GtkWidget* network_host_label
static

Definition at line 966 of file pages.c.

◆ network_login

GtkWidget * network_login
static

Definition at line 965 of file pages.c.

◆ network_login_label

GtkWidget* network_login_label
static

Definition at line 965 of file pages.c.

◆ network_password

GtkWidget * network_password
static

Definition at line 968 of file pages.c.

◆ network_password_label

GtkWidget* network_password_label
static

Definition at line 968 of file pages.c.

◆ network_port

GtkWidget * network_port
static

Definition at line 967 of file pages.c.

◆ network_port_label

GtkWidget* network_port_label
static

Definition at line 967 of file pages.c.

◆ no_ruleset_callback

bool no_ruleset_callback = FALSE
static

Definition at line 1999 of file pages.c.

◆ observe_button

GtkWidget* observe_button
static

Definition at line 1849 of file pages.c.

◆ ready_button

GtkWidget * ready_button
static

Definition at line 1849 of file pages.c.

◆ ruleset_combo

GtkWidget* ruleset_combo
static

Definition at line 95 of file pages.c.

◆ scenario_authors

GtkWidget* scenario_authors
static

Definition at line 66 of file pages.c.

◆ scenario_description

GtkWidget* scenario_description
static

Definition at line 65 of file pages.c.

◆ scenario_filename

GtkWidget* scenario_filename
static

Definition at line 67 of file pages.c.

◆ scenario_selection

GtkTreeSelection * scenario_selection
static

Definition at line 75 of file pages.c.

◆ scenario_store

GtkListStore * scenario_store
static

Definition at line 70 of file pages.c.

◆ scenario_version

GtkWidget* scenario_version
static

Definition at line 68 of file pages.c.

◆ send_new_aifill_to_server

bool send_new_aifill_to_server = TRUE
static

User changed AI fill setting.

Definition at line 2030 of file pages.c.

◆ server_playerlist_store

GtkListStore* server_playerlist_store
static

Definition at line 72 of file pages.c.

◆ server_playerlist_view

GtkWidget* server_playerlist_view
static

Definition at line 73 of file pages.c.

◆ start_aifill_spin

GtkWidget* start_aifill_spin = NULL
static

Definition at line 1852 of file pages.c.

◆ start_message_area

GtkWidget* start_message_area

Definition at line 1846 of file pages.c.

◆ start_options_table

GtkWidget* start_options_table
static

Definition at line 1848 of file pages.c.

◆ statusbar

GtkWidget* statusbar
static

Definition at line 91 of file pages.c.

◆ statusbar_frame

GtkWidget * statusbar_frame
static

Definition at line 91 of file pages.c.

◆ statusbar_queue

GQueue* statusbar_queue
static

Definition at line 92 of file pages.c.

◆ statusbar_timer

guint statusbar_timer = 0
static

Definition at line 93 of file pages.c.