|
Freeciv-3.1
|
#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 "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 "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 | save_dialog |
Typedefs | |
| typedef void(* | save_dialog_action_fn_t) (const char *filename) |
| typedef struct fileinfo_list *(* | save_dialog_files_fn_t) (void) |
Enumerations | |
| 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 | 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 gboolean | intro_expose (GtkWidget *w, cairo_t *cr, gpointer *data) |
| static void | intro_free (GtkWidget *w, gpointer *data) |
| GtkWidget * | create_main_page (void) |
| static GtkListStore * | save_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 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 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) |
| GtkWidget * | create_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) |
| GtkWidget * | create_network_page (void) |
| static GtkTreeStore * | connection_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 | conn_menu_team_chosen (GObject *object, gpointer data) |
| static void | conn_menu_ready_chosen (GObject *object, gpointer data) |
| static void | conn_menu_nation_chosen (GObject *object, gpointer data) |
| static void | conn_menu_player_command (GObject *object, gpointer data) |
| static void | conn_menu_player_take (GObject *object, gpointer data) |
| static void | conn_menu_connection_command (GObject *object, gpointer data) |
| static void | show_conn_popup (struct player *pplayer, struct connection *pconn) |
| static void | conn_menu_info_chosen (GObject *object, gpointer data) |
| static GtkWidget * | create_conn_menu (struct player *pplayer, struct connection *pconn) |
| static gboolean | delayed_unselect_path (gpointer data) |
| static gboolean | connection_list_event (GtkWidget *widget, GdkEventButton *event, 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) |
| GtkWidget * | create_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) |
| GtkWidget * | create_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) |
| GtkWidget * | create_scenario_page (void) |
| enum client_pages | get_current_client_page (void) |
| void | real_set_client_page (enum client_pages new_page) |
| static struct fileinfo_list * | save_dialog_savegame_list (void) |
| void | save_game_dialog_popup (void) |
| static void | save_dialog_save_scenario (const char *filename) |
| static struct fileinfo_list * | save_dialog_scenario_list (void) |
| void | save_scenario_dialog_popup (void) |
| static struct fileinfo_list * | save_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 GtkWidget * | scenario_description |
| static GtkWidget * | scenario_authors |
| static GtkWidget * | scenario_filename |
| static GtkWidget * | scenario_version |
| static GtkListStore * | load_store |
| static GtkListStore * | scenario_store |
| static GtkListStore * | meta_store |
| static GtkListStore * | lan_store |
| static GtkListStore * | server_playerlist_store |
| static GtkWidget * | server_playerlist_view |
| static GtkTreeSelection * | load_selection |
| static GtkTreeSelection * | scenario_selection |
| static GtkTreeSelection * | meta_selection |
| static GtkTreeSelection * | lan_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 GtkWidget * | statusbar |
| static GtkWidget * | statusbar_frame |
| static GQueue * | statusbar_queue |
| static guint | statusbar_timer = 0 |
| static GtkWidget * | ruleset_combo |
| static bool | holding_srv_list_mutex = FALSE |
| static GtkWidget * | network_login_label |
| static GtkWidget * | network_login |
| static GtkWidget * | network_host_label |
| static GtkWidget * | network_host |
| static GtkWidget * | network_port_label |
| static GtkWidget * | network_port |
| static GtkWidget * | network_password_label |
| static GtkWidget * | network_password |
| static GtkWidget * | network_confirm_password_label |
| static GtkWidget * | network_confirm_password |
| static enum connection_state | connection_status |
| GtkWidget * | start_message_area |
| static GtkWidget * | start_options_table |
| static GtkWidget * | observe_button |
| static GtkWidget * | ready_button |
| static GtkWidget * | nation_button |
| static GtkTreeStore * | connection_list_store |
| static GtkTreeView * | connection_list_view |
| static GtkWidget * | start_aifill_spin = NULL |
| static GtkWidget * | ai_lvl_combobox = NULL |
| static bool | no_ruleset_callback = FALSE |
| static bool | send_new_aifill_to_server = TRUE |
| typedef void(* save_dialog_action_fn_t) (const char *filename) |
| typedef struct fileinfo_list *(* save_dialog_files_fn_t) (void) |
| enum connection_state |
| enum save_dialog_columns |
| enum save_dialog_response |
|
static |
| void ai_fill_changed_by_server | ( | int | aifill | ) |
|
static |
|
static |
| void append_network_statusbar | ( | const char * | text, |
| bool | force | ||
| ) |
|
static |
|
static |
|
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().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
|
static |
|
static |
| GtkWidget * create_load_page | ( | void | ) |
| GtkWidget * create_network_page | ( | void | ) |
| GtkWidget * create_scenario_page | ( | void | ) |
|
static |
|
static |
| enum client_pages get_current_client_page | ( | void | ) |
| void handle_authentication_req | ( | enum authentication_type | type, |
| const char * | message | ||
| ) |
| void handle_game_load | ( | bool | load_successful, |
| const char * | filename | ||
| ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| void mapimg_client_save | ( | const char * | filename | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
Extract the player and the connection set with object_put(). Returns TRUE if at least one of them isn't NULL.
|
static |
|
static |
|
static |
|
static |
| void real_conn_list_dialog_update | ( | void * | unused | ) |
| void real_set_client_page | ( | enum client_pages | new_page | ) |
|
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.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
|
static |
|
static |
| void save_mapimg_dialog_popup | ( | void | ) |
| void save_scenario_dialog_popup | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
| 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.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |