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 (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void players_war_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void players_vision_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void players_intel_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void players_intel_wonder_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void players_sship_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void players_ai_toggle_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void players_ai_skill_callback (GSimpleAction *action, GVariant *parameter, 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 left_button_press_callback (GtkGestureClick *gesture, int n_press, double x, double y)
 
static gboolean right_button_press_callback (GtkGestureClick *gesture, int n_press, double x, double y)
 
static gint plrdlg_sort_func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data)
 
static GtkListStoreplayers_dialog_store_new (void)
 
static GMenuItemcreate_plrdlg_display_menu_item (int pos)
 
static GMenuItemcreate_dead_players_menu_item (void)
 
static void toggle_view (GSimpleAction *act, GVariant *value, gpointer data)
 
static void toggle_dead_players (GSimpleAction *act, GVariant *value, gpointer data)
 
static GMenucreate_diplomacy_menu (GActionGroup *group)
 
static GMenucreate_intelligence_menu (GActionGroup *group)
 
static GMenucreate_show_menu (GActionGroup *group)
 
static GMenucreate_ai_menu (GActionGroup *group)
 
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 GSimpleActionplayers_int_command
 
static GSimpleActionplayers_meet_command
 
static GSimpleActionplayers_war_command
 
static GSimpleActionplayers_vision_command
 
static GSimpleActionplayers_sship_command
 
static GtkListStoreplayers_dialog_store
 
static GMenudisplay_menu
 

Macro Definition Documentation

◆ MIN_DIMENSION

#define MIN_DIMENSION   5

Definition at line 736 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

◆ 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 921 of file plrdlg.c.

◆ create_ai_menu()

static GMenu * create_ai_menu ( GActionGroup group)
static

Create and return the "AI" menu, to adjust difficulty levels of players.

Definition at line 538 of file plrdlg.c.

Referenced by create_players_dialog().

◆ create_dead_players_menu_item()

static GMenuItem * create_dead_players_menu_item ( void  )
static

Create up-to-date menu item for "Dead Players" menu entry. Caller need to g_object_unref() returned item.

Definition at line 378 of file plrdlg.c.

Referenced by create_show_menu(), and toggle_dead_players().

◆ create_diplomacy_menu()

static GMenu * create_diplomacy_menu ( GActionGroup group)
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 435 of file plrdlg.c.

◆ create_intelligence_menu()

static GMenu * create_intelligence_menu ( GActionGroup group)
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 469 of file plrdlg.c.

◆ 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 126 of file plrdlg.c.

◆ create_players_dialog()

void create_players_dialog ( void  )
static

Create all of player dialog

Definition at line 577 of file plrdlg.c.

◆ create_plrdlg_display_menu_item()

static GMenuItem * create_plrdlg_display_menu_item ( int  pos)
static

Create up-to-date menu item for the plrdlg display menu. Caller need to g_object_unref() returned item.

Definition at line 358 of file plrdlg.c.

Referenced by create_show_menu(), and toggle_view().

◆ create_show_menu()

static GMenu * create_show_menu ( GActionGroup group)
static

Create 'show' menu for player dialog

Definition at line 499 of file plrdlg.c.

◆ 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 783 of file plrdlg.c.

◆ 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 743 of file plrdlg.c.

◆ left_button_press_callback()

static gboolean left_button_press_callback ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y 
)
static

Left button pressed on player list

Definition at line 218 of file plrdlg.c.

Referenced by create_players_dialog().

◆ 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 855 of file plrdlg.c.

◆ players_ai_skill_callback()

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

AI skill level setting callback.

Definition at line 1088 of file plrdlg.c.

◆ players_ai_toggle_callback()

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

AI toggle callback.

Definition at line 1069 of file plrdlg.c.

◆ players_dialog_store_new()

static GtkListStore * players_dialog_store_new ( void  )
static

Create a player dialog store.

Definition at line 310 of file plrdlg.c.

◆ players_intel_callback()

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

Intelligence report query

Definition at line 1014 of file plrdlg.c.

◆ players_intel_wonder_callback()

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

Wonders list report query

Definition at line 1034 of file plrdlg.c.

◆ players_meet_callback()

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

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

Definition at line 902 of file plrdlg.c.

◆ players_sship_callback()

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

Spaceship query callback

Definition at line 1052 of file plrdlg.c.

◆ players_vision_callback()

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

Withdrawing shared vision

Definition at line 986 of file plrdlg.c.

◆ players_war_callback()

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

Pact cancellation requested

Definition at line 944 of file plrdlg.c.

◆ 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 286 of file plrdlg.c.

◆ popdown_players_dialog()

void popdown_players_dialog ( void  )

Closes the players dialog.

Definition at line 114 of file plrdlg.c.

◆ popup_players_dialog()

void popup_players_dialog ( bool  raise)

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

Definition at line 100 of file plrdlg.c.

◆ real_players_dialog_update()

void real_players_dialog_update ( void unused)

Clear and refill the entire player list.

Definition at line 865 of file plrdlg.c.

◆ right_button_press_callback()

static gboolean right_button_press_callback ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y 
)
static

Right button pressed on player list

Definition at line 252 of file plrdlg.c.

Referenced by create_players_dialog().

◆ selection_callback()

static void selection_callback ( GtkTreeSelection selection,
gpointer  data 
)
static

Something selected from player menu

Definition at line 210 of file plrdlg.c.

◆ toggle_dead_players()

static void toggle_dead_players ( GSimpleAction act,
GVariant value,
gpointer  data 
)
static

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

Definition at line 414 of file plrdlg.c.

◆ toggle_view()

static void toggle_view ( GSimpleAction act,
GVariant value,
gpointer  data 
)
static

Toggled column visibility

Definition at line 396 of file plrdlg.c.

◆ update_players_menu()

static void update_players_menu ( void  )
static

Refresh player menu

Definition at line 163 of file plrdlg.c.

◆ update_views()

static void update_views ( void  )
static

Refresh players dialog views.

Definition at line 1109 of file plrdlg.c.

Variable Documentation

◆ display_menu

GMenu* display_menu
static

Definition at line 95 of file plrdlg.c.

Referenced by create_show_menu(), toggle_dead_players(), and toggle_view().

◆ players_dialog_shell

struct gui_dialog* players_dialog_shell

Definition at line 58 of file plrdlg.c.

◆ players_dialog_store

GtkListStore* players_dialog_store
static

Definition at line 67 of file plrdlg.c.

◆ players_int_command

GSimpleAction* players_int_command
static

Definition at line 61 of file plrdlg.c.

◆ players_list

GtkWidget* players_list
static

Definition at line 59 of file plrdlg.c.

◆ players_meet_command

GSimpleAction* players_meet_command
static

Definition at line 62 of file plrdlg.c.

◆ players_selection

GtkTreeSelection* players_selection
static

Definition at line 60 of file plrdlg.c.

◆ players_sship_command

GSimpleAction* players_sship_command
static

Definition at line 65 of file plrdlg.c.

◆ players_vision_command

GSimpleAction* players_vision_command
static

Definition at line 64 of file plrdlg.c.

◆ players_war_command

GSimpleAction* players_war_command
static

Definition at line 63 of file plrdlg.c.