Freeciv-3.1
|
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "fcintl.h"
#include "log.h"
#include "shared.h"
#include "support.h"
#include "fc_types.h"
#include "game.h"
#include "government.h"
#include "packets.h"
#include "research.h"
#include "tech.h"
#include "unitlist.h"
#include "chatline_common.h"
#include "client_main.h"
#include "climisc.h"
#include "control.h"
#include "mapview_common.h"
#include "options.h"
#include "packhand_gen.h"
#include "reqtree.h"
#include "text.h"
#include "canvas.h"
#include "cityrep.h"
#include "dialogs.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "helpdlg.h"
#include "plrdlg.h"
#include "sprite.h"
#include "repodlgs.h"
Go to the source code of this file.
Data Structures | |
class | science_report |
struct | economy_report |
struct | units_report |
class | endgame_report |
Enumerations | |
enum | science_report_columns { SRD_COL_NAME , SRD_COL_STEPS , SRD_COL_ID , SRD_COL_NUM } |
enum | economy_report_response { ERD_RES_SELL_REDUNDANT = 1 , ERD_RES_SELL_ALL , ERD_RES_DISBAND_UNITS } |
enum | economy_report_columns { ERD_COL_SPRITE , ERD_COL_NAME , ERD_COL_REDUNDANT , ERD_COL_COUNT , ERD_COL_COST , ERD_COL_TOTAL_COST , ERD_COL_EMPTY , ERD_COL_IS_IMPROVEMENT , ERD_COL_CID , ERD_COL_NUM } |
enum | units_report_response { URD_RES_NEAREST = 1 , URD_RES_UPGRADE } |
enum | units_report_columns { URD_COL_UTYPE_NAME , URD_COL_UPGRADABLE , URD_COL_N_UPGRADABLE , URD_COL_IN_PROGRESS , URD_COL_ACTIVE , URD_COL_SHIELD , URD_COL_FOOD , URD_COL_GOLD , URD_COL_EMPTY , URD_COL_TEXT_WEIGHT , URD_COL_UPG_VISIBLE , URD_COL_NUPG_VISIBLE , URD_COL_UTYPE_ID , URD_COL_NUM } |
enum | endgame_report_columns { FRD_COL_PLAYER , FRD_COL_NATION , FRD_COL_SCORE , FRD_COL_TOOLTIP , FRD_COL_NUM } |
Functions | |
static GtkListStore * | science_report_store_new (void) |
static void | science_report_store_set (GtkListStore *store, GtkTreeIter *iter, Tech_type_id tech) |
static bool | science_report_combo_get_active (GtkComboBox *combo, Tech_type_id *tech, char **name) |
static void | science_report_combo_set_active (GtkComboBox *combo, Tech_type_id tech) |
static gboolean | science_diagram_button_release_callback (GtkWidget *widget, GdkEventButton *event, gpointer data) |
static gboolean | science_diagram_update (GtkWidget *widget, cairo_t *cr, gpointer data) |
static GtkWidget * | science_diagram_new (void) |
static void | science_diagram_data (GtkWidget *widget, bool show_all) |
static void | science_diagram_center (GtkWidget *diagram, Tech_type_id tech) |
static void | science_report_redraw (struct science_report *preport) |
static gint | cmp_func (gconstpointer a_p, gconstpointer b_p) |
static void | science_report_update (struct science_report *preport) |
static void | science_report_current_callback (GtkComboBox *combo, gpointer data) |
static void | science_report_show_all_callback (GtkComboBox *combo, gpointer data) |
static void | science_report_goal_callback (GtkComboBox *combo, gpointer data) |
static void | science_report_init (struct science_report *preport) |
static void | science_report_free (struct science_report *preport) |
void | science_report_dialog_popup (bool raise) |
void | science_report_dialog_popdown (void) |
void | real_science_report_dialog_update (void *unused) |
void | science_report_dialog_redraw (void) |
static GtkListStore * | economy_report_store_new (void) |
static const char * | economy_report_column_name (enum economy_report_columns col) |
static void | economy_report_update (struct economy_report *preport) |
static void | economy_report_command_callback (struct gui_dialog *pdialog, int response, gpointer data) |
static void | economy_report_selection_callback (GtkTreeSelection *selection, gpointer data) |
static void | economy_report_init (struct economy_report *preport) |
static void | economy_report_free (struct economy_report *preport) |
void | economy_report_dialog_popup (bool raise) |
void | economy_report_dialog_popdown (void) |
void | real_economy_report_dialog_update (void *unused) |
static GtkListStore * | units_report_store_new (void) |
static void | units_report_update (struct units_report *preport) |
static void | units_report_selection_callback (GtkTreeSelection *selection, gpointer data) |
static struct unit * | find_nearest_unit (const struct unit_type *utype, struct tile *ptile) |
static void | units_report_command_callback (struct gui_dialog *pdialog, int response, gpointer data) |
static void | units_report_init (struct units_report *preport) |
static void | units_report_free (struct units_report *preport) |
void | units_report_dialog_popup (bool raise) |
void | units_report_dialog_popdown (void) |
void | real_units_report_dialog_update (void *unused) |
static const char * | endgame_report_column_name (enum endgame_report_columns col) |
static void | endgame_report_update (struct endgame_report *preport, const struct packet_endgame_report *packet) |
void | endgame_report_dialog_player (const struct packet_endgame_player *packet) |
static void | endgame_report_init (struct endgame_report *preport) |
void | endgame_report_dialog_start (const struct packet_endgame_report *packet) |
Variables | ||
static struct science_report | science_report = { NULL, } | |
static bool | science_report_no_combo_callback = FALSE | |
static struct economy_report | economy_report = { NULL, NULL, NULL } | |
static struct units_report | units_report = { NULL, NULL } | |
struct { | ||
GType type | ||
const char * title | ||
const char * tooltip | ||
bool rightalign | ||
int visible_col | ||
} | unit_report_columns [] | |
static struct endgame_report | endgame_report = { NULL, NULL } | |
Enumerator | |
---|---|
ERD_COL_SPRITE | |
ERD_COL_NAME | |
ERD_COL_REDUNDANT | |
ERD_COL_COUNT | |
ERD_COL_COST | |
ERD_COL_TOTAL_COST | |
ERD_COL_EMPTY | |
ERD_COL_IS_IMPROVEMENT | |
ERD_COL_CID | |
ERD_COL_NUM |
Definition at line 788 of file repodlgs.c.
Enumerator | |
---|---|
ERD_RES_SELL_REDUNDANT | |
ERD_RES_SELL_ALL | |
ERD_RES_DISBAND_UNITS |
Definition at line 780 of file repodlgs.c.
Enumerator | |
---|---|
FRD_COL_PLAYER | |
FRD_COL_NATION | |
FRD_COL_SCORE | |
FRD_COL_TOOLTIP | |
FRD_COL_NUM |
Definition at line 1810 of file repodlgs.c.
Enumerator | |
---|---|
SRD_COL_NAME | |
SRD_COL_STEPS | |
SRD_COL_ID | |
SRD_COL_NUM |
Definition at line 112 of file repodlgs.c.
enum units_report_columns |
Definition at line 1291 of file repodlgs.c.
Enumerator | |
---|---|
URD_RES_NEAREST | |
URD_RES_UPGRADE |
Definition at line 1285 of file repodlgs.c.
|
static |
Utility for g_list_sort.
Definition at line 370 of file repodlgs.c.
Referenced by science_report_update(), and strvec_remove_duplicate().
|
static |
Returns the title of the column (translated).
Definition at line 826 of file repodlgs.c.
Referenced by economy_report_init().
|
static |
Issue a command on the economy report.
Definition at line 952 of file repodlgs.c.
Referenced by economy_report_init().
void economy_report_dialog_popdown | ( | void | ) |
Close the economy report dialog.
Definition at line 1257 of file repodlgs.c.
Referenced by popdown_all_game_dialogs().
void economy_report_dialog_popup | ( | bool | raise | ) |
Create the economy report if needed.
Definition at line 1242 of file repodlgs.c.
Referenced by fc_client::create_game_page(), economy_callback(), report_economy_callback(), report_economy_callback(), and mr_menu::slot_show_eco_report().
|
static |
Free an economy report.
Definition at line 1229 of file repodlgs.c.
Referenced by economy_report_dialog_popdown().
|
static |
Create a new economy report.
Definition at line 1117 of file repodlgs.c.
Referenced by economy_report_dialog_popup().
|
static |
Called when a building or a unit type is selected in the economy list.
Definition at line 1068 of file repodlgs.c.
Referenced by economy_report_init().
|
static |
Create a new economy report list store.
Definition at line 807 of file repodlgs.c.
Referenced by economy_report_init().
|
static |
Update the economy report dialog.
Definition at line 858 of file repodlgs.c.
Referenced by economy_report_init(), and real_economy_report_dialog_update().
|
static |
Returns the title of the column (translated).
Definition at line 1825 of file repodlgs.c.
Referenced by endgame_report_update().
void endgame_report_dialog_player | ( | const struct packet_endgame_player * | packet | ) |
Handle endgame report information about one player.
Definition at line 1914 of file repodlgs.c.
void endgame_report_dialog_start | ( | const struct packet_endgame_report * | packet | ) |
Start building a dialog with player statistics at endgame.
Definition at line 1980 of file repodlgs.c.
Referenced by handle_endgame_report().
|
static |
Prepare a final report.
Definition at line 1945 of file repodlgs.c.
Referenced by endgame_report_dialog_start().
|
static |
Fill a final report with statistics for each player.
Definition at line 1845 of file repodlgs.c.
Referenced by endgame_report_dialog_start().
|
static |
Returns the nearest unit of the type 'utype'.
Definition at line 1537 of file repodlgs.c.
Referenced by units_report_command_callback().
void real_economy_report_dialog_update | ( | void * | unused | ) |
Update the economy report dialog.
Definition at line 1267 of file repodlgs.c.
Referenced by economy_report_dialog_update().
void real_science_report_dialog_update | ( | void * | unused | ) |
Update the science report dialog.
Definition at line 751 of file repodlgs.c.
Referenced by change_research_goal_callback(), science_dialog_callback(), science_report_dialog_popup(), science_report_dialog_update(), and fc_client::switch_page().
void real_units_report_dialog_update | ( | void * | unused | ) |
Update the units report dialog.
Definition at line 1791 of file repodlgs.c.
Referenced by units_report_dialog_update().
|
static |
Change tech goal, research or open help dialog.
Definition at line 197 of file repodlgs.c.
Referenced by science_diagram_new().
|
static |
Set the diagram parent to point to 'tech' location.
Definition at line 312 of file repodlgs.c.
Referenced by science_report_redraw().
|
static |
Recreate the req tree.
Definition at line 290 of file repodlgs.c.
Referenced by science_report_redraw().
|
static |
Return the drawing area widget of new technology diagram. Set in 'x' the position of the current tech to center to it.
Definition at line 270 of file repodlgs.c.
Referenced by science_report_init().
|
static |
Draw the invalidated portion of the reqtree.
Definition at line 235 of file repodlgs.c.
Referenced by science_diagram_new().
|
static |
Get the active tech of the combo.
Definition at line 154 of file repodlgs.c.
Referenced by science_report_current_callback(), and science_report_goal_callback().
|
static |
Set the active tech of the combo.
Definition at line 175 of file repodlgs.c.
Referenced by science_report_current_callback(), and science_report_goal_callback().
|
static |
Activated item in the reachable techs combo box.
Definition at line 521 of file repodlgs.c.
Referenced by science_report_init().
void science_report_dialog_popdown | ( | void | ) |
Closes the science report dialog.
Definition at line 740 of file repodlgs.c.
Referenced by edit_mode_callback(), edit_mode_callback(), and popdown_science_dialog_callback().
void science_report_dialog_popup | ( | bool | raise | ) |
Create the science report is needed.
Definition at line 716 of file repodlgs.c.
Referenced by handle_research_info(), report_research_callback(), report_research_callback(), research_callback(), and mr_menu::slot_show_research_tab().
void science_report_dialog_redraw | ( | void | ) |
Resize and redraw the requirement tree.
Definition at line 761 of file repodlgs.c.
Referenced by apply_reqtree_text_font(), handle_research_info(), reqtree_show_icons_callback(), and tileset_changed().
|
static |
Free a science report.
Definition at line 703 of file repodlgs.c.
Referenced by science_report_dialog_popdown().
|
static |
Activated item in the reachable goals combo box.
Definition at line 557 of file repodlgs.c.
Referenced by science_report_init().
|
static |
Initialize a science report.
Definition at line 581 of file repodlgs.c.
Referenced by science_report_dialog_popup().
|
static |
Resize and redraw the requirement tree.
Definition at line 347 of file repodlgs.c.
Referenced by science_report_dialog_redraw(), science_report_init(), and science_report_show_all_callback().
|
static |
Show or hide unreachable techs.
Definition at line 546 of file repodlgs.c.
Referenced by science_report_init().
|
static |
Create a science report list store.
Definition at line 125 of file repodlgs.c.
Referenced by science_report_init().
|
inlinestatic |
Append a technology to the list store.
Definition at line 136 of file repodlgs.c.
Referenced by science_report_update().
|
static |
Update a science report dialog.
Definition at line 385 of file repodlgs.c.
Referenced by real_science_report_dialog_update(), and science_report_init().
|
static |
void units_report_dialog_popdown | ( | void | ) |
Closes the units report dialog.
Definition at line 1780 of file repodlgs.c.
Referenced by popdown_all_game_dialogs().
void units_report_dialog_popup | ( | bool | raise | ) |
Create the units report if needed.
Definition at line 1765 of file repodlgs.c.
Referenced by main_key_down_handler(), report_units_callback(), report_units_callback(), and units_action_callback().
|
static |
Free an units report.
Definition at line 1752 of file repodlgs.c.
Referenced by units_report_dialog_popdown().
|
static |
Create a units report.
Definition at line 1651 of file repodlgs.c.
Referenced by units_report_dialog_popup().
|
static |
GtkTreeSelection "changed" signal handler.
Definition at line 1499 of file repodlgs.c.
Referenced by units_report_init().
|
static |
Create a new units report list store.
Definition at line 1347 of file repodlgs.c.
Referenced by units_report_init().
|
static |
Update the units report.
Definition at line 1363 of file repodlgs.c.
Referenced by real_units_report_dialog_update(), and units_report_init().
|
static |
Definition at line 778 of file repodlgs.c.
|
static |
Definition at line 1819 of file repodlgs.c.
Referenced by endgame_report_dialog_player().
bool rightalign |
Definition at line 1315 of file repodlgs.c.
Referenced by units_report_init().
|
static |
Definition at line 108 of file repodlgs.c.
Definition at line 109 of file repodlgs.c.
Referenced by science_report_combo_get_active(), science_report_combo_set_active(), and science_report_update().
const char* title |
Definition at line 1313 of file repodlgs.c.
Referenced by action_entry(), action_entry_update(), choice_dialog::add_item(), add_tree_col(), add_treeview_column(), check_vote(), choice_dialog::choice_dialog(), requirers_dlg::clear(), confirm_cancel_pact(), conversion_log::conversion_log(), create_races_dialog(), ruledit_gui::create_requirers(), help_widget::create_terrain_widget(), create_window(), create_window_skeleton(), eco_report::disband_units(), economy_report_init(), endgame_report_update(), gui_dialog_set_title(), help_update_extra(), help_update_goods(), help_update_government(), help_update_improvement(), help_update_specialist(), help_update_tech(), help_update_terrain(), help_update_unit_type(), help_update_wonder(), init_player_dlg_common(), help_dialog::make_tree(), players_war_callback(), players_war_callback(), popup_action_selection(), fc_sc_button::popup_error(), popup_impr_info(), popup_load_game_dialog(), popup_musicset_suggestion_dialog(), popup_soundset_suggestion_dialog(), popup_tech_info(), popup_tileset_suggestion_dialog(), popup_unit_info(), popup_upgrade_dialog(), property_page_new(), races_dialog::races_dialog(), real_players_dialog_update(), ruledit_main::ruledit_main(), save_dialog_file_chooser_popup(), save_dialog_new(), save_governments_ruleset(), eco_report::sell_buildings(), eco_report::sell_redundant(), send_ruleset_governments(), help_widget::set_topic(), help_widget::set_topic_building(), help_widget::set_topic_extra(), help_widget::set_topic_goods(), help_widget::set_topic_government(), help_widget::set_topic_nation(), help_widget::set_topic_specialist(), help_widget::set_topic_tech(), help_widget::set_topic_terrain(), help_widget::set_topic_unit(), show_votes(), units_report_init(), update_intel_dialog(), update_intel_wonder_dialog(), and usdlg_tab_select().
const char* tooltip |
Definition at line 1314 of file repodlgs.c.
Referenced by action_entry(), action_entry_update(), help_widget::create_terrain_widget(), editbar_add_mode_button(), objprop_new(), property_page_new(), query_main_list_tooltip_cb(), query_main_list_tooltip_cb(), fc_sidewidget::set_tooltip(), tool_init(), units_report_init(), and city_dialog::update_improvements().
GType type |
Definition at line 1312 of file repodlgs.c.
Referenced by add_clause(), adv_data_phase_init(), help_widget::anchor_clicked(), chatwdg::anchor_clicked(), api_edit_climate_change(), api_fcdb_option(), apply_solution(), cai_incident(), call_incident(), check_server_scan(), fc_client::check_server_scan(), citizens_dialog_store_new(), city_can_use_specialist(), city_receives_goods(), clause_enabled(), clause_info_get(), client_handle_packet(), client_packet_input(), combat_bonus_against(), compat_load_020600(), conn_pattern_from_string(), conn_pattern_new(), connection_vote(), create_barbarian_player(), create_unit(), create_unit_full(), dai_choose_role_unit(), dai_data_phase_begin(), dai_diplomacy_actions(), dai_diplomacy_first_contact(), dai_go_to_war(), dai_goldequiv_clause(), dai_incident(), plr_item::data(), data_type_size(), dio_get_requirement_raw(), dio_get_type_raw(), dio_put_requirement_raw(), dio_put_type_raw(), diplomacy_dialog_add_pact_clause(), diplomacy_dialog_add_pact_clause(), city_dialog::display_worklist_menu(), dlsend_packet_diplomacy_create_clause(), dlsend_packet_diplomacy_remove_clause(), do_spaceship_place(), download_modpack_list(), download_modpack_recursive(), dsend_packet_authentication_req(), dsend_packet_diplomacy_create_clause(), dsend_packet_diplomacy_create_clause_req(), dsend_packet_diplomacy_remove_clause(), dsend_packet_diplomacy_remove_clause_req(), dsend_packet_edit_unit_create(), dsend_packet_edit_unit_remove(), dsend_packet_report_req(), dsend_packet_spaceship_place(), dsend_packet_unit_sscs_set(), dsend_packet_unit_type_upgrade(), economy_report_init(), edge_color(), edit_buffer_copy(), edit_buffer_has_type(), effect_cumulative_max(), effect_cumulative_min(), effect_new(), effect_to_enabler(), effect_edit::effect_type_menu(), effect_universals_value_never_below(), effect_value_from_universals(), effect_value_will_make_positive(), enqueue_call(), event_after(), event_after(), expl_act_not_enabl(), extract_sequence_text(), fc_sidewidget::fc_sidewidget(), fc_snprintcf(), featured_text_to_plain_text(), fill_row(), get_allied_with_enemy_player(), get_base_by_gui_type(), get_citizen_sprite(), get_citizen_surface(), get_edge_type(), get_lan_server_list(), get_lanserver_announcement(), get_packet_from_connection_raw(), get_req_source_effects(), global_worklist_alloc(), fc_client::handle_authentication_req(), handle_authentication_req(), handle_diplomacy_create_clause(), handle_diplomacy_create_clause_req(), handle_diplomacy_remove_clause(), handle_diplomacy_remove_clause_req(), handle_player_diplstate(), handle_report_req(), handle_spaceship_place(), handle_unit_sscs_set(), handle_vote_submit(), help_hyperlink_callback(), inf_discard_tokens(), inf_token(), init_specialist_lattice_nodes(), init_tile_lattice(), input_from_server(), input_from_server_till_request_got_processed(), inputline_make_chat_link(), inputline_make_tag(), is_client_edit_packet(), is_unit_choice_type(), is_view_supported(), link_mark_add_new(), link_mark_find(), link_mark_new(), link_mark_restore(), load_install_info_list(), load_ruleset_effects(), load_ruleset_game(), lookup_cbonus_list(), lookup_req_list(), luascript_pop_returns(), luascript_push_args(), mpdb_installed_version(), mpdb_update_modpack(), need_war_enabler(), new_help_item(), package_player_info(), packet_check(), packet_has_game_info_flag(), packet_name(), pact_clause_to_diplstate_type(), paste_tile(), play_sound_for_event(), player_has_embassy_from_effect(), players_dialog_store_new(), popup_diplomacy_dialog(), popup_diplomatic_objects(), popup_info_text(), prereqs_filled(), qtg_is_view_supported(), queue_mapview_tile_update(), real_bodyguard_log(), real_players_dialog_update(), receive_packet_authentication_req_100(), receive_packet_diplomacy_create_clause_100(), receive_packet_diplomacy_create_clause_req_100(), receive_packet_diplomacy_remove_clause_100(), receive_packet_diplomacy_remove_clause_req_100(), receive_packet_edit_unit_create_100(), receive_packet_edit_unit_remove_100(), receive_packet_player_diplstate_100(), receive_packet_report_req_100(), receive_packet_ruleset_achievement_100(), receive_packet_ruleset_clause_100(), receive_packet_ruleset_unit_bonus_100(), receive_packet_spaceship_place_100(), receive_packet_unit_info_100(), receive_packet_unit_info_101(), receive_packet_unit_short_info_100(), receive_packet_unit_short_info_101(), receive_packet_unit_sscs_set_100(), receive_packet_unit_sscs_set_101(), receive_packet_unit_type_upgrade_100(), reestablish_city_trade_routes(), mpgui::refresh_list_versions(), remove_clause(), remove_clause_widget_from_list(), req_from_str(), req_from_values(), req_get_values(), revolentype_str(), rscompat_old_effect_3_1(), rscompat_req_name_3_1(), ruleset_purge_redundant_reqs_effects(), ruleset_purge_unused_effects(), save_game_auto(), send_report_request(), send_ruleset_trade_routes(), server_handle_packet(), server_packet_input(), server_scan_begin(), set_city_production(), set_cursor_if_appropriate(), set_diplstate_type(), help_widget::set_topic_building(), set_wtype(), mpgui::setup_list(), setup_modpack_list(), setup_modpack_list(), setup_modpack_list(), setup_modpack_list(), sg_load_player_units(), sg_load_player_units(), sg_load_treaties(), sg_load_treaties(), special_rule_name(), tai_send_msg(), tai_send_req(), terrain_by_number(), texai_city_worker_wants(), texai_send_msg(), texai_send_req(), texai_unit_info_recv(), text_link_type_name(), text_tag_init_from_sequence(), text_tag_initv(), text_tag_type_name(), text_tag_type_short_name(), texwai_incident(), tile_type_destroy(), tile_type_get(), tile_type_init(), tile_type_lattice_add(), tile_type_num_tiles(), tile_type_vector_free_all(), tileset_type_set(), timer_new(), timer_renew(), tolua_server_edit_climate_change00(), trade_route_cancelling_type_by_name(), trade_route_cancelling_type_name(), trade_route_settings_by_type(), trade_route_type_by_name(), trade_route_type_name(), trade_route_type_trade_pct(), trade_route_types_init(), twai_incident(), unit_virtual_prepare(), units_report_init(), update_city_activities(), update_environmental_upset(), unittype_item::upgrade_units(), versionlist_update_main_thread(), and versionlist_update_main_thread().
const struct { ... } unit_report_columns[] |
Referenced by units_report_init(), and units_report_store_new().
|
static |
Definition at line 1283 of file repodlgs.c.
int visible_col |
Definition at line 1316 of file repodlgs.c.
Referenced by units_report_init().