Freeciv-3.3
|
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "fc_cmdline.h"
#include "fciconv.h"
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "support.h"
#include "dataio.h"
#include "featured_text.h"
#include "game.h"
#include "government.h"
#include "map.h"
#include "unitlist.h"
#include "version.h"
#include "audio.h"
#include "client_main.h"
#include "climisc.h"
#include "clinet.h"
#include "colors.h"
#include "connectdlg_common.h"
#include "control.h"
#include "editor.h"
#include "gui_properties.h"
#include "options.h"
#include "text.h"
#include "tilespec.h"
#include "zoom.h"
#include "chatline.h"
#include "citizensinfo.h"
#include "connectdlg.h"
#include "cma_fe.h"
#include "dialogs.h"
#include "diplodlg.h"
#include "editgui.h"
#include "gotodlg.h"
#include "graphics.h"
#include "gui_stuff.h"
#include "happiness.h"
#include "helpdlg.h"
#include "inteldlg.h"
#include "mapctrl.h"
#include "mapview.h"
#include "menu.h"
#include "messagewin.h"
#include "optiondlg.h"
#include "pages.h"
#include "plrdlg.h"
#include "luaconsole.h"
#include "spaceshipdlg.h"
#include "repodlgs.h"
#include "voteinfo_bar.h"
#include "gui_main.h"
Go to the source code of this file.
Data Structures | |
struct | callback |
#define MIGRATE_OPTION | ( | opt | ) | gui_options.gui_gtk3_##opt = gui_options.gui_gtk2_##opt; |
#define MIGRATE_OPTION | ( | opt | ) | gui_options.gui_gtk3_22_##opt = gui_options.gui_gtk3_##opt; |
#define MIGRATE_OPTION | ( | opt | ) | GUI_GTK_OPTION(opt) = gui_options.gui_gtk3_22_##opt; |
#define OVERVIEW_CANVAS_STORE_HEIGHT (2 * OVERVIEW_CANVAS_STORE_HEIGHT_NETBOOK) |
Definition at line 121 of file gui_main.c.
#define OVERVIEW_CANVAS_STORE_HEIGHT_NETBOOK (2 * 46) |
Definition at line 118 of file gui_main.c.
#define OVERVIEW_CANVAS_STORE_WIDTH (2 * OVERVIEW_CANVAS_STORE_WIDTH_NETBOOK) |
Definition at line 119 of file gui_main.c.
#define OVERVIEW_CANVAS_STORE_WIDTH_NETBOOK (2 * 64) |
Definition at line 117 of file gui_main.c.
|
static |
Enqueue a callback to be called during an idle moment. The 'callback' function should be called sometimes soon, and passed the 'data' pointer as its data.
Definition at line 2417 of file gui_main.c.
This function is called after the client has successfully connected to the server
Definition at line 2307 of file gui_main.c.
Make dynamic adjustments to first-launch default options.
Definition at line 2648 of file gui_main.c.
|
static |
Handle a toggle of the "Allies Only" chat button.
Definition at line 2553 of file gui_main.c.
Option callback for the 'allied_chat_only' gtk-gui option. This updates the state of the associated toggle button.
Definition at line 2441 of file gui_main.c.
Add idle callback for updating animations.
Definition at line 2429 of file gui_main.c.
Referenced by animation_idle_cb(), and real_set_client_page().
Change the city names font.
Definition at line 2468 of file gui_main.c.
Change the city productions font.
Definition at line 2479 of file gui_main.c.
Change the city productions font.
Definition at line 2490 of file gui_main.c.
Creates the toggle button necessary to detach and reattach the widget and returns a vbox in which you fill your goodies.
Definition at line 839 of file gui_main.c.
Create the container for the widget that's able to be detached.
Definition at line 828 of file gui_main.c.
User clicked "Turn Done" button
Definition at line 2262 of file gui_main.c.
gboolean fc_gained_focus | ( | GtkEventControllerFocus * | controller, |
gpointer | data | ||
) |
Freeciv window has gained focus
Definition at line 754 of file gui_main.c.
gboolean fc_lost_focus | ( | GtkEventControllerFocus * | controller, |
gpointer | data | ||
) |
Freeciv window has lost focus
Definition at line 743 of file gui_main.c.
Free unit image table.
Definition at line 977 of file gui_main.c.
Option callback for the 'fullscreen' gtk-gui option.
Definition at line 2456 of file gui_main.c.
|
static |
g_log callback to log with freelog
Definition at line 1642 of file gui_main.c.
|
static |
g_log callback to log with freelog
Definition at line 1670 of file gui_main.c.
Return our GUI type
Definition at line 2097 of file gui_main.c.
|
static |
Read input from server socket
Definition at line 2271 of file gui_main.c.
GtkApplication * gui_app | ( | void | ) |
Return the client GtkApplication
Definition at line 2674 of file gui_main.c.
Referenced by create_toggle_menu_item(), enable_menus(), menus_disable_unit_commands(), real_menus_update(), and view_menu_item_toggle().
A wrapper for the callback called through add_idle_callback().
Definition at line 2402 of file gui_main.c.
On close of the info popup
Definition at line 2232 of file gui_main.c.
Referenced by show_info_popup().
Insert build information to help
Definition at line 2562 of file gui_main.c.
Return whether gui is currently running.
Definition at line 2078 of file gui_main.c.
|
static |
Handle keypress events when map canvas is in focus
Definition at line 393 of file gui_main.c.
Callback for freelog
Definition at line 235 of file gui_main.c.
Entry point for whole freeciv client program.
Definition at line 1726 of file gui_main.c.
When the chatline text view is resized, scroll it to the bottom. This prevents users from accidentally missing messages when the chatline gets scrolled up a small amount and stops scrolling down automatically.
Definition at line 360 of file gui_main.c.
Referenced by main_message_area_resize(), and real_set_client_page().
Focus on map canvas
Definition at line 381 of file gui_main.c.
Migrate gtk3 client specific options from gtk2 client options.
Definition at line 1734 of file gui_main.c.
Migrate gtk3.22 client specific options from gtk3 client options.
Definition at line 1789 of file gui_main.c.
Migrate gtk4 client specific options from gtk3.22 client options.
Definition at line 1848 of file gui_main.c.
Referenced by activate_gui().
|
static |
Return dimensions of primary monitor, if any (in 'application pixels')
Definition at line 2576 of file gui_main.c.
|
static |
Mouse/touchpad scrolling over the mapview
Definition at line 663 of file gui_main.c.
|
static |
Move widget from parent to parent
Definition at line 710 of file gui_main.c.
Referenced by tearoff_callback(), and tearoff_reattach().
Extra initializers for client options. Here we make set the callback for the specific gui-gtk-4.0 options.
Definition at line 2502 of file gui_main.c.
Search for gui-specific command line options.
Definition at line 291 of file gui_main.c.
Called to build the unit_below pixmap table. This is the table on the left of the screen that shows all of the inactive units in the current tile.
It may be called again if the tileset changes.
Definition at line 882 of file gui_main.c.
Referenced by reset_unit_table().
Popups the dialog with the message: Are you sure you want to quit?
Definition at line 2363 of file gui_main.c.
Print extra usage information, including one line help on each option, to stderr.
Definition at line 270 of file gui_main.c.
Popups the quit dialog.
Definition at line 2387 of file gui_main.c.
This is the response callback for the dialog with the message: Are you sure you want to quit?
Definition at line 2336 of file gui_main.c.
Exit gtk main loop.
Definition at line 2351 of file gui_main.c.
Called when the set of units in focus (get_units_in_focus()) changes. Standard updates like update_unit_info_label() are handled in the platform- independent code; we use this to keep the goto/airlift dialog up to date, if it's visible.
Definition at line 2176 of file gui_main.c.
Set the chatline buttons to reflect the state of the game and current client options. This function should be called on game start.
Definition at line 2532 of file gui_main.c.
This function is called if the client disconnects from the server
Definition at line 2325 of file gui_main.c.
Called when the tileset is changed to reset the unit pixmap table.
Definition at line 1001 of file gui_main.c.
struct video_mode * resolution_request_get | ( | void | ) |
Give resolution requested by user, if any.
Definition at line 2636 of file gui_main.c.
Return height of the primary monitor
Definition at line 2618 of file gui_main.c.
Return width of the primary monitor
Definition at line 2600 of file gui_main.c.
|
static |
Callback for clicking a unit icon underneath unit info box. these are the units on the same tile as the focus unit.
Definition at line 2217 of file gui_main.c.
Referenced by populate_unit_pic_table().
|
static |
Callback for clicking a unit icon underneath unit info box. these are the units on the same tile as the focus unit.
Definition at line 2185 of file gui_main.c.
Referenced by populate_unit_pic_table().
Set up g_log callback for a single domain.
Definition at line 1686 of file gui_main.c.
Set up g_log callbacks.
Definition at line 1698 of file gui_main.c.
Set one of the unit icons in information area based on punit. Use punit == NULL to clear icon. Index 'idx' is -1 for "active unit", or 0 to (num_units_below - 1) for units below. Also updates unit_ids[idx] for idx >= 0.
Definition at line 2116 of file gui_main.c.
Set the "more arrow" for the unit icons to on(1) or off(0). Maintains a static record of current state to avoid unnecessary redraws. Note initial state should match initial gui setup (off).
Definition at line 2153 of file gui_main.c.
|
static |
Set socket writability state
Definition at line 2282 of file gui_main.c.
Define properties of this gui.
Definition at line 2682 of file gui_main.c.
Do the heavy lifting for the widget setup.
Definition at line 1071 of file gui_main.c.
|
static |
Popup info box
Definition at line 2240 of file gui_main.c.
Obvious...
Definition at line 2105 of file gui_main.c.
Callback for the toggle button in the detachable widget: causes the widget to detach or reattach.
Definition at line 791 of file gui_main.c.
User requested close of the detach window.
Definition at line 782 of file gui_main.c.
Referenced by tearoff_callback().
Reattach tearoff to its normal parent and destroy the detach window.
Definition at line 765 of file gui_main.c.
Referenced by tearoff_callback(), and tearoff_close().
gboolean terminate_signal_processing | ( | GtkEventControllerFocus * | controller, |
gpointer | data | ||
) |
Override background color for canvases Callback that just returns TRUE.
Definition at line 1043 of file gui_main.c.
Referenced by create_network_page().
Called while in gtk_main() (which is all of the time) TIMER_INTERVAL is now set by real_timer_callback()
Definition at line 247 of file gui_main.c.
|
static |
Focus on widget. Returns whether focus was really changed.
Definition at line 333 of file gui_main.c.
|
static |
Handle a keyboard key press made in the client's toplevel window.
Definition at line 576 of file gui_main.c.
Do any necessary UI-specific cleanup
Definition at line 2086 of file gui_main.c.
Called from main().
Definition at line 1714 of file gui_main.c.
Called from client_main(), is what it's named.
Definition at line 1899 of file gui_main.c.
Update tooltip of the Turn Done button
Definition at line 1052 of file gui_main.c.
GtkWidget * ahbox |
Definition at line 140 of file gui_main.c.
|
static |
Definition at line 172 of file gui_main.c.
Definition at line 181 of file gui_main.c.
GtkWidget* avbox |
Definition at line 140 of file gui_main.c.
|
static |
Definition at line 131 of file gui_main.c.
GtkWidget * bottom_notebook |
Definition at line 129 of file gui_main.c.
GtkWidget* bulb_label |
Definition at line 144 of file gui_main.c.
PangoFontDescription* city_names_style = NULL |
Definition at line 133 of file gui_main.c.
PangoFontDescription* city_productions_style = NULL |
Definition at line 134 of file gui_main.c.
Definition at line 182 of file gui_main.c.
const char* client_string = GUI_NAME_FULL |
Definition at line 106 of file gui_main.c.
GtkWidget * conn_box |
Definition at line 140 of file gui_main.c.
gint cur_x |
Definition at line 177 of file gui_main.c.
gint cur_y |
Definition at line 177 of file gui_main.c.
GtkWidget* econ_label[10] |
Definition at line 143 of file gui_main.c.
GtkWidget* econ_widget |
Definition at line 155 of file gui_main.c.
Referenced by setup_widgets(), and update_info_label().
|
static |
Definition at line 160 of file gui_main.c.
Referenced by set_unit_icon(), and ui_main().
|
static |
Definition at line 184 of file gui_main.c.
Referenced by enable_menus(), gui_app(), quit_gtk_main(), real_menus_update(), setup_app_actions(), and ui_main().
GtkWidget* flake_label |
Definition at line 146 of file gui_main.c.
GtkWidget* government_label |
Definition at line 147 of file gui_main.c.
Definition at line 157 of file gui_main.c.
Definition at line 179 of file gui_main.c.
Definition at line 158 of file gui_main.c.
GtkWidget* main_frame_civ_name |
Definition at line 137 of file gui_main.c.
GtkWidget* main_label_info |
Definition at line 138 of file gui_main.c.
GtkTextView* main_message_area |
Definition at line 170 of file gui_main.c.
GtkWidget* map_canvas |
Definition at line 108 of file gui_main.c.
GtkWidget* map_horizontal_scrollbar |
Definition at line 109 of file gui_main.c.
GtkWidget* map_vertical_scrollbar |
Definition at line 110 of file gui_main.c.
GtkWidget* map_widget |
Definition at line 130 of file gui_main.c.
GtkTextBuffer* message_buffer = NULL |
Definition at line 171 of file gui_main.c.
|
static |
Definition at line 164 of file gui_main.c.
Referenced by free_unit_table(), populate_unit_pic_table(), reset_unit_table(), and set_unit_icons_more_arrow().
|
static |
Definition at line 165 of file gui_main.c.
Referenced by free_unit_table(), and populate_unit_pic_table().
GtkWidget* overview_canvas |
Definition at line 112 of file gui_main.c.
int overview_canvas_store_height = OVERVIEW_CANVAS_STORE_HEIGHT |
Definition at line 124 of file gui_main.c.
int overview_canvas_store_width = OVERVIEW_CANVAS_STORE_WIDTH |
Definition at line 123 of file gui_main.c.
GtkWidget* overview_scrolled_window |
Definition at line 113 of file gui_main.c.
PangoFontDescription* reqtree_text_style = NULL |
Definition at line 135 of file gui_main.c.
GtkWidget * right_notebook |
Definition at line 129 of file gui_main.c.
GtkWidget* scroll_panel |
Definition at line 141 of file gui_main.c.
|
static |
Definition at line 175 of file gui_main.c.
|
static |
Definition at line 176 of file gui_main.c.
GtkWidget* sun_label |
Definition at line 145 of file gui_main.c.
GtkWidget* timeout_label |
Definition at line 148 of file gui_main.c.
|
static |
Definition at line 174 of file gui_main.c.
GtkWidget* top_notebook |
Definition at line 129 of file gui_main.c.
GtkWidget* top_vbox |
Definition at line 128 of file gui_main.c.
GtkWidget* toplevel |
Definition at line 126 of file gui_main.c.
GtkWidget* toplevel_tabs |
Definition at line 127 of file gui_main.c.
GtkWidget* turn_done_button |
Definition at line 149 of file gui_main.c.
|
static |
Definition at line 163 of file gui_main.c.
Referenced by free_unit_table(), populate_unit_pic_table(), and set_unit_icon().
|
static |
Definition at line 167 of file gui_main.c.
|
static |
Definition at line 168 of file gui_main.c.
GtkWidget* unit_info_box |
Definition at line 152 of file gui_main.c.
GtkWidget* unit_info_frame |
Definition at line 153 of file gui_main.c.
GtkWidget* unit_info_label |
Definition at line 151 of file gui_main.c.
|
static |
Definition at line 162 of file gui_main.c.
Referenced by free_unit_table(), populate_unit_pic_table(), and set_unit_icon().
|
static |
Definition at line 161 of file gui_main.c.
Referenced by free_unit_table(), populate_unit_pic_table(), and setup_widgets().
|
static |
Definition at line 186 of file gui_main.c.
|
static |
Definition at line 228 of file gui_main.c.
Referenced by ui_init().