Freeciv-3.3
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
diplodlg.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include "log.h"
#include "mem.h"
#include "shared.h"
#include "support.h"
#include "diptreaty.h"
#include "fcintl.h"
#include "game.h"
#include "government.h"
#include "map.h"
#include "nation.h"
#include "packets.h"
#include "player.h"
#include "research.h"
#include "chatline.h"
#include "client_main.h"
#include "climisc.h"
#include "options.h"
#include "diplodlg.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "mapview.h"
#include "plrdlg.h"
#include "speclist.h"

Go to the source code of this file.

Data Structures

struct  Diplomacy_dialog
 
struct  Diplomacy_notebook
 
struct  city_deal
 
struct  _FcClauseRow
 
struct  _FcClauseClass
 

Macros

#define SPECLIST_TAG   dialog
 
#define SPECLIST_TYPE   struct Diplomacy_dialog
 
#define dialog_list_iterate(dialoglist, pdialog)    TYPED_LIST_ITERATE(struct Diplomacy_dialog, dialoglist, pdialog)
 
#define dialog_list_iterate_end   LIST_ITERATE_END
 
#define RESPONSE_CANCEL_MEETING   100
 
#define RESPONSE_CANCEL_MEETING_ALL   101
 
#define FC_TYPE_CLAUSE_ROW   (fc_clause_row_get_type())
 

Functions

static struct Diplomacy_dialogcreate_diplomacy_dialog (struct treaty *ptreaty, struct player *plr0, struct player *plr1)
 
static struct Diplomacy_dialogfind_diplomacy_dialog (struct player *they)
 
static void popup_diplomacy_dialog (struct treaty *ptreaty, struct player *they, struct player *initiator)
 
static void diplomacy_dialog_map_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void diplomacy_dialog_seamap_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void diplomacy_dialog_tech_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void diplomacy_dialog_city_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void diplomacy_dialog_vision_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void diplomacy_dialog_embassy_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void diplomacy_dialog_shared_tiles_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void diplomacy_dialog_ceasefire_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void diplomacy_dialog_peace_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void diplomacy_dialog_alliance_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void close_diplomacy_dialog (struct Diplomacy_dialog *pdialog)
 
static void update_diplomacy_dialog (struct Diplomacy_dialog *pdialog)
 
static void diplo_dialog_returnkey (GtkWidget *w, gpointer data)
 
static struct Diplomacy_notebookdiplomacy_main_create (void)
 
static void diplomacy_main_destroy (void)
 
static void diplomacy_main_response (struct gui_dialog *dlg, int response, gpointer data)
 
static void fc_clause_row_class_init (FcClauseRowClass *klass)
 
static void fc_clause_row_init (FcClauseRow *self)
 
void gui_recv_accept_treaty (struct treaty *ptreaty, struct player *they)
 
void gui_init_meeting (struct treaty *ptreaty, struct player *they, struct player *initiator)
 
void gui_recv_cancel_meeting (struct treaty *ptreaty, struct player *they, struct player *initiator)
 
void gui_prepare_clause_updt (struct treaty *ptreaty, struct player *they)
 
void gui_recv_create_clause (struct treaty *ptreaty, struct player *they)
 
void gui_recv_remove_clause (struct treaty *ptreaty, struct player *they)
 
static gint sort_advance_names (gconstpointer a, gconstpointer b)
 
static GMenucreate_clause_menu (GActionGroup *group, struct Diplomacy_dialog *pdialog, struct player *partner, bool them)
 
static void row_callback (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
 
static void diplomacy_destroy (struct Diplomacy_dialog *pdialog)
 
static void diplomacy_response (struct gui_dialog *dlg, int response, gpointer data)
 
static void diplomacy_dialog_add_pact_clause (gpointer data, int type)
 
void diplomacy_dialog_init (void)
 
void diplomacy_dialog_done (void)
 
void close_all_diplomacy_dialogs (void)
 

Variables

static struct dialog_list * dialog_list
 
static struct Diplomacy_notebookdipl_main
 

Macro Definition Documentation

◆ dialog_list_iterate

#define dialog_list_iterate (   dialoglist,
  pdialog 
)     TYPED_LIST_ITERATE(struct Diplomacy_dialog, dialoglist, pdialog)

Definition at line 78 of file diplodlg.c.

◆ dialog_list_iterate_end

#define dialog_list_iterate_end   LIST_ITERATE_END

Definition at line 80 of file diplodlg.c.

◆ FC_TYPE_CLAUSE_ROW

#define FC_TYPE_CLAUSE_ROW   (fc_clause_row_get_type())

Definition at line 137 of file diplodlg.c.

◆ RESPONSE_CANCEL_MEETING

#define RESPONSE_CANCEL_MEETING   100

Definition at line 133 of file diplodlg.c.

◆ RESPONSE_CANCEL_MEETING_ALL

#define RESPONSE_CANCEL_MEETING_ALL   101

Definition at line 134 of file diplodlg.c.

◆ SPECLIST_TAG

#define SPECLIST_TAG   dialog

Definition at line 74 of file diplodlg.c.

◆ SPECLIST_TYPE

#define SPECLIST_TYPE   struct Diplomacy_dialog

Definition at line 75 of file diplodlg.c.

Function Documentation

◆ close_all_diplomacy_dialogs()

void close_all_diplomacy_dialogs ( void  )

Close all dialogs, for when client disconnects from game.

Definition at line 1391 of file diplodlg.c.

◆ close_diplomacy_dialog()

void close_diplomacy_dialog ( struct Diplomacy_dialog pdialog)
static

Close diplomacy dialog

Definition at line 1329 of file diplodlg.c.

◆ create_clause_menu()

static GMenu * create_clause_menu ( GActionGroup group,
struct Diplomacy_dialog pdialog,
struct player partner,
bool  them 
)
static

Popup menu about adding clauses

Definition at line 316 of file diplodlg.c.

◆ create_diplomacy_dialog()

static struct Diplomacy_dialog * create_diplomacy_dialog ( struct treaty ptreaty,
struct player plr0,
struct player plr1 
)
static

Setups diplomacy dialog widgets.

Definition at line 808 of file diplodlg.c.

◆ diplo_dialog_returnkey()

static void diplo_dialog_returnkey ( GtkWidget w,
gpointer  data 
)
static

User hit enter after entering gold amount

Definition at line 1371 of file diplodlg.c.

◆ diplomacy_destroy()

static void diplomacy_destroy ( struct Diplomacy_dialog pdialog)
static

Destroy diplomacy dialog

Definition at line 744 of file diplodlg.c.

◆ diplomacy_dialog_add_pact_clause()

static void diplomacy_dialog_add_pact_clause ( gpointer  data,
int  type 
)
static

Adding pact clause

Definition at line 1231 of file diplodlg.c.

◆ diplomacy_dialog_alliance_callback()

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

Alliance pact menu item activated

Definition at line 1264 of file diplodlg.c.

◆ diplomacy_dialog_ceasefire_callback()

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

Ceasefire pact menu item activated

Definition at line 1244 of file diplodlg.c.

◆ diplomacy_dialog_city_callback()

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

Callback for trading cities

  • Kris Bubendorfer

Definition at line 1176 of file diplodlg.c.

◆ diplomacy_dialog_done()

void diplomacy_dialog_done ( void  )

Free resources allocated for diplomacy dialog

Definition at line 1346 of file diplodlg.c.

◆ diplomacy_dialog_embassy_callback()

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

Embassy menu item activated

Definition at line 1292 of file diplodlg.c.

◆ diplomacy_dialog_init()

void diplomacy_dialog_init ( void  )

Initialize diplomacy dialog

Definition at line 1337 of file diplodlg.c.

◆ diplomacy_dialog_map_callback()

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

Map menu item activated

Definition at line 1198 of file diplodlg.c.

◆ diplomacy_dialog_peace_callback()

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

Peace pact menu item activated

Definition at line 1254 of file diplodlg.c.

◆ diplomacy_dialog_seamap_callback()

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

Seamap menu item activated

Definition at line 1214 of file diplodlg.c.

◆ diplomacy_dialog_shared_tiles_callback()

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

Shared tiles menu item activated

Definition at line 1310 of file diplodlg.c.

◆ diplomacy_dialog_tech_callback()

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

Callback for the diplomatic dialog: give tech.

Definition at line 1126 of file diplodlg.c.

◆ diplomacy_dialog_vision_callback()

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

Shared vision menu item activated

Definition at line 1274 of file diplodlg.c.

◆ diplomacy_main_create()

static struct Diplomacy_notebook * diplomacy_main_create ( void  )
static

Create the main tab for diplomatic meetings.

Definition at line 659 of file diplodlg.c.

◆ diplomacy_main_destroy()

static void diplomacy_main_destroy ( void  )
static

Destroy main diplomacy dialog.

Definition at line 705 of file diplodlg.c.

◆ diplomacy_main_response()

static void diplomacy_main_response ( struct gui_dialog dlg,
int  response,
gpointer  data 
)
static

User has responded to whole diplomacy dialog (main tab).

Definition at line 717 of file diplodlg.c.

◆ diplomacy_response()

static void diplomacy_response ( struct gui_dialog dlg,
int  response,
gpointer  data 
)
static

User has responded to whole diplomacy dialog (one meeting).

Definition at line 777 of file diplodlg.c.

◆ fc_clause_row_class_init()

static void fc_clause_row_class_init ( FcClauseRowClass klass)
static

Initialization method for FcClauseRow class

Definition at line 159 of file diplodlg.c.

◆ fc_clause_row_init()

static void fc_clause_row_init ( FcClauseRow self)
static

Initialization method for FcClauseRow

Definition at line 167 of file diplodlg.c.

◆ find_diplomacy_dialog()

static struct Diplomacy_dialog * find_diplomacy_dialog ( struct player they)
static

Find diplomacy dialog between player and other player

Definition at line 1354 of file diplodlg.c.

◆ gui_init_meeting()

void gui_init_meeting ( struct treaty ptreaty,
struct player they,
struct player initiator 
)

Someone is initiating meeting with us.

Definition at line 205 of file diplodlg.c.

◆ gui_prepare_clause_updt()

void gui_prepare_clause_updt ( struct treaty ptreaty,
struct player they 
)

Prepare to clause creation or removal.

Definition at line 231 of file diplodlg.c.

◆ gui_recv_accept_treaty()

void gui_recv_accept_treaty ( struct treaty ptreaty,
struct player they 
)

FcClauseRow creation method Server tells us that either party has accepted treaty

Definition at line 188 of file diplodlg.c.

◆ gui_recv_cancel_meeting()

void gui_recv_cancel_meeting ( struct treaty ptreaty,
struct player they,
struct player initiator 
)

Meeting has been cancelled.

Definition at line 214 of file diplodlg.c.

◆ gui_recv_create_clause()

void gui_recv_create_clause ( struct treaty ptreaty,
struct player they 
)

Added clause to the meeting

Definition at line 239 of file diplodlg.c.

◆ gui_recv_remove_clause()

void gui_recv_remove_clause ( struct treaty ptreaty,
struct player they 
)

Removed clause from meeting.

Definition at line 256 of file diplodlg.c.

◆ popup_diplomacy_dialog()

static void popup_diplomacy_dialog ( struct treaty ptreaty,
struct player they,
struct player initiator 
)
static

Popup the dialog 10% inside the main-window

Definition at line 273 of file diplodlg.c.

◆ row_callback()

static void row_callback ( GtkTreeView view,
GtkTreePath path,
GtkTreeViewColumn col,
gpointer  data 
)
static

Some clause activated

Definition at line 633 of file diplodlg.c.

◆ sort_advance_names()

static gint sort_advance_names ( gconstpointer  a,
gconstpointer  b 
)
static

Utility for g_list_sort(). See below.

Definition at line 304 of file diplodlg.c.

◆ update_diplomacy_dialog()

static void update_diplomacy_dialog ( struct Diplomacy_dialog pdialog)
static

Update diplomacy dialog

Definition at line 1088 of file diplodlg.c.

Variable Documentation

◆ dialog_list

struct dialog_list* dialog_list
static

Definition at line 82 of file diplodlg.c.

◆ dipl_main

struct Diplomacy_notebook* dipl_main
static

Definition at line 83 of file diplodlg.c.