Freeciv-3.3
Loading...
Searching...
No Matches
Macros | Functions | Variables
plrdlg.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "astring.h"
#include "fcintl.h"
#include "support.h"
#include "diptreaty.h"
#include "packets.h"
#include "nation.h"
#include "player.h"
#include "client_main.h"
#include "climisc.h"
#include "connectdlg_common.h"
#include "tilespec.h"
#include "colors.h"
#include "graphics.h"
#include "options.h"
#include "text.h"
#include "chatline.h"
#include "dialogs.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "inteldlg.h"
#include "spaceshipdlg.h"
#include "plrdlg.h"

Go to the source code of this file.

Macros

#define PLR_DLG_COL_STYLE   (0 + num_player_dlg_columns)
 
#define PLR_DLG_COL_WEIGHT   (1 + num_player_dlg_columns)
 
#define PLR_DLG_COL_ID   (2 + num_player_dlg_columns)
 
#define PLR_DLG_COL_TOOLTIP   (3 + num_player_dlg_columns)
 
#define PLR_DLG_COL_TOTAL   (PLR_DLG_COL_TOOLTIP + 1)
 
#define MIN_DIMENSION   5
 

Functions

static void create_players_dialog (void)
 
static void players_meet_callback (GtkMenuItem *item, gpointer data)
 
static void players_war_callback (GtkMenuItem *item, gpointer data)
 
static void players_vision_callback (GtkMenuItem *item, gpointer data)
 
static void players_intel_callback (GtkMenuItem *item, gpointer data)
 
static void players_intel_wonder_callback (GtkMenuItem *item, gpointer data)
 
static void players_sship_callback (GtkMenuItem *item, gpointer data)
 
static void players_ai_toggle_callback (GtkMenuItem *item, gpointer data)
 
static void players_ai_skill_callback (GtkMenuItem *item, gpointer data)
 
static void update_views (void)
 
void popup_players_dialog (bool raise)
 
void popdown_players_dialog (void)
 
GdkPixbufcreate_player_icon (const struct player *plr)
 
static void update_players_menu (void)
 
static void selection_callback (GtkTreeSelection *selection, gpointer data)
 
static gboolean button_press_callback (GtkTreeView *view, GdkEventButton *ev)
 
static gint plrdlg_sort_func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data)
 
static GtkListStoreplayers_dialog_store_new (void)
 
static void toggle_view (GtkCheckMenuItem *item, gpointer data)
 
static void toggle_dead_players (GtkCheckMenuItem *item, gpointer data)
 
static GtkWidgetcreate_diplomacy_menu (void)
 
static GtkWidgetcreate_intelligence_menu (void)
 
static GtkWidgetcreate_show_menu (void)
 
GdkPixbufget_flag (const struct nation_type *nation)
 
static void fill_row (GtkListStore *store, GtkTreeIter *it, const struct player *pplayer)
 
static bool player_should_be_shown (const struct player *pplayer)
 
void real_players_dialog_update (void *unused)
 
static void confirm_cancel_pact (enum clause_type clause, int plrno, char *title, char *question)
 

Variables

struct gui_dialogplayers_dialog_shell
 
static GtkWidgetplayers_list
 
static GtkTreeSelectionplayers_selection
 
static GtkWidgetplayers_int_command
 
static GtkWidgetplayers_meet_command
 
static GtkWidgetplayers_war_command
 
static GtkWidgetplayers_vision_command
 
static GtkWidgetplayers_sship_command
 
static GtkListStoreplayers_dialog_store
 

Macro Definition Documentation

◆ MIN_DIMENSION

#define MIN_DIMENSION   5

Definition at line 600 of file plrdlg.c.

◆ PLR_DLG_COL_ID

#define PLR_DLG_COL_ID   (2 + num_player_dlg_columns)

Definition at line 70 of file plrdlg.c.

◆ PLR_DLG_COL_STYLE

#define PLR_DLG_COL_STYLE   (0 + num_player_dlg_columns)

Definition at line 68 of file plrdlg.c.

◆ PLR_DLG_COL_TOOLTIP

#define PLR_DLG_COL_TOOLTIP   (3 + num_player_dlg_columns)

Definition at line 71 of file plrdlg.c.

◆ PLR_DLG_COL_TOTAL

#define PLR_DLG_COL_TOTAL   (PLR_DLG_COL_TOOLTIP + 1)

Definition at line 73 of file plrdlg.c.

◆ PLR_DLG_COL_WEIGHT

#define PLR_DLG_COL_WEIGHT   (1 + num_player_dlg_columns)

Definition at line 69 of file plrdlg.c.

Function Documentation

◆ button_press_callback()

static gboolean button_press_callback ( GtkTreeView view,
GdkEventButton ev 
)
static

Button pressed on player list

Definition at line 209 of file plrdlg.c.

Referenced by create_players_dialog().

◆ confirm_cancel_pact()

static void confirm_cancel_pact ( enum clause_type  clause,
int  plrno,
char title,
char question 
)
static

Confirm pact/treaty cancellation. Frees strings passed in.

Definition at line 785 of file plrdlg.c.

Referenced by players_vision_callback(), players_vision_callback(), players_war_callback(), and players_war_callback().

◆ create_diplomacy_menu()

static GtkWidget * create_diplomacy_menu ( void  )
static

Create and return the "diplomacy" menu for the player report. This menu contains diplomacy actions the current player can use on other nations.

Definition at line 335 of file plrdlg.c.

Referenced by create_players_dialog().

◆ create_intelligence_menu()

static GtkWidget * create_intelligence_menu ( void  )
static

Create and return the "intelligence" menu. The items in this menu are used by the player to see more detailed information about other nations.

Definition at line 366 of file plrdlg.c.

Referenced by create_players_dialog().

◆ create_player_icon()

GdkPixbuf * create_player_icon ( const struct player plr)

Create a small colored square representing the player color, for use in player lists. May return NULL if the player has no color yet.

Definition at line 117 of file plrdlg.c.

Referenced by fill_row(), and real_conn_list_dialog_update().

◆ create_players_dialog()

void create_players_dialog ( void  )
static

Create all of player dialog

Definition at line 427 of file plrdlg.c.

Referenced by popup_players_dialog().

◆ create_show_menu()

static GtkWidget * create_show_menu ( void  )
static

Create 'show' menu for player dialog

Definition at line 395 of file plrdlg.c.

Referenced by create_players_dialog().

◆ fill_row()

static void fill_row ( GtkListStore store,
GtkTreeIter it,
const struct player pplayer 
)
static

Fills the player list with the information for 'pplayer' at the row given by 'it'.

Definition at line 648 of file plrdlg.c.

Referenced by real_players_dialog_update().

◆ get_flag()

GdkPixbuf * get_flag ( const struct nation_type nation)

Builds the flag pixmap. May return NULL if there is not enough memory. You must call g_object_unref on the returned pixbuf when it is no longer needed.

Definition at line 607 of file plrdlg.c.

Referenced by citizens_dialog_row(), create_list_of_nations_in_group(), endgame_report_dialog_player(), extviewer_refresh_widgets(), extviewer_view_cell_toggled(), fill_row(), list_store_append_player_cities(), property_page_set_store_value(), real_conn_list_dialog_update(), refresh_player_pov_indicator(), and refresh_tool_applied_player_combo().

◆ player_should_be_shown()

static bool player_should_be_shown ( const struct player pplayer)
static

Return TRUE if the player should be shown in the player list.

Definition at line 720 of file plrdlg.c.

Referenced by real_players_dialog_update().

◆ players_ai_skill_callback()

static void players_ai_skill_callback ( GtkMenuItem item,
gpointer  data 
)
static

AI skill level setting callback.

Definition at line 945 of file plrdlg.c.

Referenced by create_ai_menu(), and create_players_dialog().

◆ players_ai_toggle_callback()

static void players_ai_toggle_callback ( GtkMenuItem item,
gpointer  data 
)
static

AI toggle callback.

Definition at line 928 of file plrdlg.c.

Referenced by create_ai_menu(), and create_players_dialog().

◆ players_dialog_store_new()

static GtkListStore * players_dialog_store_new ( void  )
static

Create a player dialog store.

Definition at line 266 of file plrdlg.c.

Referenced by create_players_dialog().

◆ players_intel_callback()

void players_intel_callback ( GtkMenuItem item,
gpointer  data 
)
static

Intelligence report query

Definition at line 876 of file plrdlg.c.

Referenced by create_intelligence_menu(), and create_intelligence_menu().

◆ players_intel_wonder_callback()

void players_intel_wonder_callback ( GtkMenuItem item,
gpointer  data 
)
static

Wonders list report query

Definition at line 895 of file plrdlg.c.

Referenced by create_intelligence_menu(), and create_intelligence_menu().

◆ players_meet_callback()

void players_meet_callback ( GtkMenuItem item,
gpointer  data 
)
static

Callback for diplomatic meetings button. This button is enabled iff we can meet with the other player.

Definition at line 767 of file plrdlg.c.

Referenced by create_diplomacy_menu(), and create_diplomacy_menu().

◆ players_sship_callback()

void players_sship_callback ( GtkMenuItem item,
gpointer  data 
)
static

Spaceship query callback

Definition at line 912 of file plrdlg.c.

Referenced by create_intelligence_menu(), and create_intelligence_menu().

◆ players_vision_callback()

void players_vision_callback ( GtkMenuItem item,
gpointer  data 
)
static

Withdrawing shared vision

Definition at line 849 of file plrdlg.c.

Referenced by create_diplomacy_menu(), and create_diplomacy_menu().

◆ players_war_callback()

void players_war_callback ( GtkMenuItem item,
gpointer  data 
)
static

Pact cancellation requested

Definition at line 808 of file plrdlg.c.

Referenced by create_diplomacy_menu(), and create_diplomacy_menu().

◆ plrdlg_sort_func()

static gint plrdlg_sort_func ( GtkTreeModel model,
GtkTreeIter a,
GtkTreeIter b,
gpointer  data 
)
static

Sorting function for plr dlg.

Definition at line 242 of file plrdlg.c.

Referenced by players_dialog_store_new().

◆ popdown_players_dialog()

void popdown_players_dialog ( void  )

Closes the players dialog.

Definition at line 105 of file plrdlg.c.

Referenced by exit_players_dlg_callback(), player_nation_callback(), and popdown_all_game_dialogs().

◆ popup_players_dialog()

void popup_players_dialog ( bool  raise)

Popup the dialog 10% inside the main-window, and optionally raise it.

Definition at line 91 of file plrdlg.c.

Referenced by fc_client::create_game_page(), players_action_callback(), report_nations_callback(), report_nations_callback(), and mr_menu::slot_show_nations().

◆ real_players_dialog_update()

void real_players_dialog_update ( void unused)

Clear and refill the entire player list.

Definition at line 730 of file plrdlg.c.

Referenced by create_players_dialog(), players_dialog_update(), toggle_dead_players(), and toggle_dead_players().

◆ selection_callback()

static void selection_callback ( GtkTreeSelection selection,
gpointer  data 
)
static

Something selected from player menu

Definition at line 201 of file plrdlg.c.

Referenced by create_players_dialog().

◆ toggle_dead_players()

static void toggle_dead_players ( GtkCheckMenuItem item,
gpointer  data 
)
static

Called whenever player toggles the 'Show/Dead Players' menu item

Definition at line 324 of file plrdlg.c.

Referenced by create_show_menu(), and create_show_menu().

◆ toggle_view()

static void toggle_view ( GtkCheckMenuItem item,
gpointer  data 
)
static

Toggled column visibility

Definition at line 313 of file plrdlg.c.

Referenced by create_show_menu(), and create_show_menu().

◆ update_players_menu()

static void update_players_menu ( void  )
static

Refresh player menu

Definition at line 154 of file plrdlg.c.

Referenced by selection_callback().

◆ update_views()

static void update_views ( void  )
static

Refresh players dialog views.

Definition at line 964 of file plrdlg.c.

Referenced by real_players_dialog_update(), toggle_view(), and toggle_view().

Variable Documentation

◆ players_dialog_shell

struct gui_dialog* players_dialog_shell

◆ players_dialog_store

GtkListStore* players_dialog_store
static

Definition at line 67 of file plrdlg.c.

Referenced by create_players_dialog(), and real_players_dialog_update().

◆ players_int_command

GtkWidget* players_int_command
static

◆ players_list

GtkWidget* players_list
static

Definition at line 59 of file plrdlg.c.

Referenced by create_players_dialog(), and update_views().

◆ players_meet_command

GtkWidget* players_meet_command
static

Definition at line 62 of file plrdlg.c.

Referenced by create_diplomacy_menu(), create_diplomacy_menu(), and update_players_menu().

◆ players_selection

GtkTreeSelection* players_selection
static

◆ players_sship_command

GtkWidget* players_sship_command
static

◆ players_vision_command

GtkWidget* players_vision_command
static

Definition at line 64 of file plrdlg.c.

Referenced by create_diplomacy_menu(), create_diplomacy_menu(), and update_players_menu().

◆ players_war_command

GtkWidget* players_war_command
static

Definition at line 63 of file plrdlg.c.

Referenced by create_diplomacy_menu(), create_diplomacy_menu(), and update_players_menu().