Freeciv-3.1
|
#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 "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 |
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 |
Functions | |
static struct Diplomacy_dialog * | create_diplomacy_dialog (struct player *plr0, struct player *plr1) |
static struct Diplomacy_dialog * | find_diplomacy_dialog (int other_player_id) |
static void | popup_diplomacy_dialog (int other_player_id, int initiated_from) |
static void | diplomacy_dialog_map_callback (GtkWidget *w, gpointer data) |
static void | diplomacy_dialog_seamap_callback (GtkWidget *w, gpointer data) |
static void | diplomacy_dialog_tech_callback (GtkWidget *w, gpointer data) |
static void | diplomacy_dialog_city_callback (GtkWidget *w, gpointer data) |
static void | diplomacy_dialog_ceasefire_callback (GtkWidget *w, gpointer data) |
static void | diplomacy_dialog_peace_callback (GtkWidget *w, gpointer data) |
static void | diplomacy_dialog_alliance_callback (GtkWidget *w, gpointer data) |
static void | diplomacy_dialog_vision_callback (GtkWidget *w, gpointer data) |
static void | diplomacy_dialog_embassy_callback (GtkWidget *w, 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_notebook * | diplomacy_main_create (void) |
static void | diplomacy_main_destroy (void) |
static void | diplomacy_main_response (struct gui_dialog *dlg, int response, gpointer data) |
void | handle_diplomacy_accept_treaty (int counterpart, bool I_accepted, bool other_accepted) |
void | handle_diplomacy_init_meeting (int counterpart, int initiated_from) |
void | handle_diplomacy_cancel_meeting (int counterpart, int initiated_from) |
void | handle_diplomacy_create_clause (int counterpart, int giver, enum clause_type type, int value) |
void | handle_diplomacy_remove_clause (int counterpart, int giver, enum clause_type type, int value) |
static gint | sort_advance_names (gconstpointer a, gconstpointer b) |
static void | popup_add_menu (GtkMenuShell *parent, gpointer data) |
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 (GtkWidget *w, 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_notebook * | dipl_main |
#define dialog_list_iterate | ( | dialoglist, | |
pdialog | |||
) | TYPED_LIST_ITERATE(struct Diplomacy_dialog, dialoglist, pdialog) |
Definition at line 80 of file diplodlg.c.
#define dialog_list_iterate_end LIST_ITERATE_END |
Definition at line 82 of file diplodlg.c.
#define RESPONSE_CANCEL_MEETING 100 |
Definition at line 110 of file diplodlg.c.
#define RESPONSE_CANCEL_MEETING_ALL 101 |
Definition at line 111 of file diplodlg.c.
#define SPECLIST_TAG dialog |
Definition at line 76 of file diplodlg.c.
#define SPECLIST_TYPE struct Diplomacy_dialog |
Definition at line 77 of file diplodlg.c.
void close_all_diplomacy_dialogs | ( | void | ) |
Close all dialogs, for when client disconnects from game.
Definition at line 1230 of file diplodlg.c.
Referenced by set_client_state().
|
static |
Close diplomacy dialog
Definition at line 1167 of file diplodlg.c.
Referenced by close_all_diplomacy_dialogs(), and handle_diplomacy_cancel_meeting().
|
static |
Setups diplomacy dialog widgets.
Definition at line 670 of file diplodlg.c.
Referenced by handle_diplomacy_init_meeting(), and popup_diplomacy_dialog().
|
static |
User hit enter after entering gold amount
Definition at line 1210 of file diplodlg.c.
Referenced by create_diplomacy_dialog().
|
static |
Destroy diplomacy dialog
Definition at line 606 of file diplodlg.c.
Referenced by close_diplomacy_dialog().
|
static |
Adding pact clause
Definition at line 1099 of file diplodlg.c.
Referenced by diplomacy_dialog_alliance_callback(), diplomacy_dialog_alliance_callback(), diplomacy_dialog_ceasefire_callback(), diplomacy_dialog_ceasefire_callback(), diplomacy_dialog_peace_callback(), and diplomacy_dialog_peace_callback().
|
static |
Alliance pact menu item activated
Definition at line 1129 of file diplodlg.c.
Referenced by create_clause_menu(), and popup_add_menu().
|
static |
Ceasefire pact menu item activated
Definition at line 1113 of file diplodlg.c.
Referenced by create_clause_menu(), and popup_add_menu().
|
static |
Callback for trading cities
Definition at line 1048 of file diplodlg.c.
Referenced by create_clause_menu(), and popup_add_menu().
void diplomacy_dialog_done | ( | void | ) |
Free resources allocated for diplomacy dialog
Definition at line 1184 of file diplodlg.c.
|
static |
Embassy menu item activated
Definition at line 1152 of file diplodlg.c.
Referenced by create_clause_menu(), and popup_add_menu().
void diplomacy_dialog_init | ( | void | ) |
Initialize diplomacy dialog
Definition at line 1175 of file diplodlg.c.
Referenced by activate_gui(), ui_main(), and ui_main().
|
static |
Map menu item activated
Definition at line 1068 of file diplodlg.c.
Referenced by create_clause_menu(), and popup_add_menu().
|
static |
Peace pact menu item activated
Definition at line 1121 of file diplodlg.c.
Referenced by create_clause_menu(), and popup_add_menu().
|
static |
Seamap menu item activated
Definition at line 1083 of file diplodlg.c.
Referenced by create_clause_menu(), and popup_add_menu().
|
static |
Callback for the diplomatic dialog: give tech.
Definition at line 1000 of file diplodlg.c.
Referenced by create_clause_menu(), and popup_add_menu().
|
static |
Shared vision menu item activated
Definition at line 1137 of file diplodlg.c.
Referenced by create_clause_menu(), and popup_add_menu().
|
static |
Create the main tab for diplomatic meetings.
Definition at line 522 of file diplodlg.c.
Referenced by create_diplomacy_dialog().
|
static |
Destroy main diplomacy dialog.
Definition at line 567 of file diplodlg.c.
Referenced by diplomacy_destroy().
|
static |
User has responded to whole diplomacy dialog (main tab).
Definition at line 579 of file diplodlg.c.
Referenced by diplomacy_main_create().
|
static |
User has responded to whole diplomacy dialog (one meeting).
Definition at line 639 of file diplodlg.c.
Referenced by create_diplomacy_dialog().
|
static |
Find diplomacy dialog between player and other player
Definition at line 1192 of file diplodlg.c.
Referenced by handle_diplomacy_accept_treaty(), handle_diplomacy_cancel_meeting(), handle_diplomacy_create_clause(), handle_diplomacy_remove_clause(), and popup_diplomacy_dialog().
Server tells us that either party has accepted treaty
Definition at line 116 of file diplodlg.c.
Referenced by client_handle_packet().
void handle_diplomacy_cancel_meeting | ( | int | counterpart, |
int | initiated_from | ||
) |
Meeting has been cancelled.
Definition at line 143 of file diplodlg.c.
void handle_diplomacy_create_clause | ( | int | counterpart, |
int | giver, | ||
enum clause_type | type, | ||
int | value | ||
) |
Added clause to the meeting
Definition at line 157 of file diplodlg.c.
Referenced by client_handle_packet().
void handle_diplomacy_init_meeting | ( | int | counterpart, |
int | initiated_from | ||
) |
Someone is initiating meeting with us.
Definition at line 135 of file diplodlg.c.
Referenced by client_handle_packet().
void handle_diplomacy_remove_clause | ( | int | counterpart, |
int | giver, | ||
enum clause_type | type, | ||
int | value | ||
) |
Removed clause from meeting.
Definition at line 175 of file diplodlg.c.
|
static |
Popup menu about adding clauses
Definition at line 239 of file diplodlg.c.
Referenced by create_diplomacy_dialog().
|
static |
Popup the dialog 10% inside the main-window
Definition at line 192 of file diplodlg.c.
Referenced by handle_diplomacy_init_meeting(), and player_nation_callback().
|
static |
Some clause activated
Definition at line 496 of file diplodlg.c.
Referenced by create_diplomacy_dialog().
|
static |
Utility for g_list_sort(). See below.
Definition at line 227 of file diplodlg.c.
Referenced by create_clause_menu(), and popup_add_menu().
|
static |
Update diplomacy dialog
Definition at line 962 of file diplodlg.c.
Referenced by create_diplomacy_dialog(), handle_diplomacy_accept_treaty(), handle_diplomacy_create_clause(), handle_diplomacy_init_meeting(), and handle_diplomacy_remove_clause().
|
static |
Definition at line 84 of file diplodlg.c.
Referenced by close_all_diplomacy_dialogs(), create_diplomacy_dialog(), diplomacy_destroy(), diplomacy_dialog_done(), diplomacy_dialog_init(), diplomacy_main_response(), find_diplomacy_dialog(), get_diplomacy_dialog(), handle_diplomacy_cancel_meeting(), and popdown_diplomacy_dialogs().
|
static |
Definition at line 85 of file diplodlg.c.
Referenced by diplomacy_destroy(), diplomacy_dialog_init(), diplomacy_main_create(), diplomacy_main_destroy(), diplomacy_main_response(), and popup_diplomacy_dialog().