Freeciv-3.2
Loading...
Searching...
No Matches
Macros | Functions | Variables
gui_main.h File Reference
#include <gtk/gtk.h>
#include "gui_main_g.h"
#include "options.h"

Go to the source code of this file.

Macros

#define GUI_NAME_FULL   "gui-gtk-4.0"
 
#define GUI_NAME_SHORT   "gtk4"
 
#define GUI_GTK_OPTION(optname)   gui_options.gui_gtk4_##optname
 
#define GUI_GTK_OPTION_STR(optname)   "gui_gtk4_" #optname
 
#define GUI_GTK_DEFAULT_THEME_NAME   FC_GTK4_DEFAULT_THEME_NAME
 
#define single_tile_pixmap   (mapview.single_tile->pixmap)
 

Functions

void main_message_area_resize (void *data)
 
void animation_idle_cb (void *data)
 
gcharntoh_str (const gchar *netstr)
 
gboolean map_canvas_focus (void)
 
void reset_unit_table (void)
 
void popup_quit_dialog (void)
 
void quit_gtk_main (void)
 
void refresh_chat_buttons (void)
 
int screen_width (void)
 
int screen_height (void)
 
struct video_moderesolution_request_get (void)
 
void fullscreen_opt_refresh (struct option *poption)
 
GtkApplicationgui_app (void)
 
bool is_gui_up (void)
 
gboolean terminate_signal_processing (GtkEventControllerFocus *controller, gpointer data)
 
gboolean fc_lost_focus (GtkEventControllerFocus *controller, gpointer data)
 
gboolean fc_gained_focus (GtkEventControllerFocus *controller, gpointer data)
 
void update_turn_done_tooltip (void)
 

Variables

PangoFontDescriptioncity_names_style
 
PangoFontDescriptioncity_productions_style
 
PangoFontDescriptionreqtree_text_style
 
GtkTextViewmain_message_area
 
GtkWidgettext_scrollbar
 
GtkWidgettoplevel
 
GtkWidgettop_vbox
 
GtkWidgetmain_frame_civ_name
 
GtkWidgetmain_label_info
 
GtkWidgetecon_label [10]
 
GtkWidgetbulb_label
 
GtkWidgetsun_label
 
GtkWidgetflake_label
 
GtkWidgetgovernment_label
 
GtkWidgetecon_widget
 
GtkWidgetmap_canvas
 
GtkWidgetoverview_canvas
 
GtkWidgetoverview_scrolled_window
 
GtkWidgettimeout_label
 
GtkWidgetturn_done_button
 
GtkWidgetunit_info_box
 
GtkWidgetunit_info_label
 
GtkWidgetunit_info_frame
 
GtkWidgetmap_horizontal_scrollbar
 
GtkWidgetmap_vertical_scrollbar
 
GtkWidgettoplevel_tabs
 
GtkWidgettop_notebook
 
GtkWidgetmap_widget
 
GtkWidgetbottom_notebook
 
GtkWidgetright_notebook
 
GtkTextBuffermessage_buffer
 
int overview_canvas_store_width
 
int overview_canvas_store_height
 

Macro Definition Documentation

◆ GUI_GTK_DEFAULT_THEME_NAME

#define GUI_GTK_DEFAULT_THEME_NAME   FC_GTK4_DEFAULT_THEME_NAME

Definition at line 27 of file gui_main.h.

◆ GUI_GTK_OPTION

#define GUI_GTK_OPTION (   optname)    gui_options.gui_gtk4_##optname

Definition at line 25 of file gui_main.h.

◆ GUI_GTK_OPTION_STR

#define GUI_GTK_OPTION_STR (   optname)    "gui_gtk4_" #optname

Definition at line 26 of file gui_main.h.

◆ GUI_NAME_FULL

#define GUI_NAME_FULL   "gui-gtk-4.0"

Definition at line 22 of file gui_main.h.

◆ GUI_NAME_SHORT

#define GUI_NAME_SHORT   "gtk4"

Definition at line 23 of file gui_main.h.

◆ single_tile_pixmap

#define single_tile_pixmap   (mapview.single_tile->pixmap)

Definition at line 39 of file gui_main.h.

Function Documentation

◆ animation_idle_cb()

void animation_idle_cb ( void data)

Add idle callback for updating animations.

Definition at line 2428 of file gui_main.c.

Referenced by animation_idle_cb(), and real_set_client_page().

◆ fc_gained_focus()

gboolean fc_gained_focus ( GtkEventControllerFocus controller,
gpointer  data 
)

Freeciv window has gained focus

Definition at line 753 of file gui_main.c.

◆ fc_lost_focus()

gboolean fc_lost_focus ( GtkEventControllerFocus controller,
gpointer  data 
)

Freeciv window has lost focus

Definition at line 742 of file gui_main.c.

◆ fullscreen_opt_refresh()

void fullscreen_opt_refresh ( struct option poption)

Option callback for the 'fullscreen' gtk-gui option.

Definition at line 2433 of file gui_main.c.

Referenced by full_screen_callback(), full_screen_callback(), and options_extra_init().

◆ gui_app()

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().

◆ is_gui_up()

bool is_gui_up ( void  )

Return whether gui is currently running.

Definition at line 2058 of file gui_main.c.

Referenced by show_tileset_error().

◆ main_message_area_resize()

void main_message_area_resize ( void data)

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 359 of file gui_main.c.

Referenced by main_message_area_resize(), and real_set_client_page().

◆ map_canvas_focus()

gboolean map_canvas_focus ( void  )

Focus on map canvas

Definition at line 359 of file gui_main.c.

Referenced by map_view_callback(), map_view_callback(), toplevel_key_press_handler(), and toplevel_key_press_handler().

◆ ntoh_str()

gchar * ntoh_str ( const gchar netstr)

◆ popup_quit_dialog()

void popup_quit_dialog ( )

Popups the dialog with the message: Are you sure you want to quit?

Open dialog to confirm that user wants to quit client.

Definition at line 2349 of file gui_main.c.

◆ quit_gtk_main()

void quit_gtk_main ( void  )

Exit gtk main loop.

Definition at line 2337 of file gui_main.c.

Referenced by create_main_page(), and quit_dialog_response().

◆ refresh_chat_buttons()

void refresh_chat_buttons ( void  )

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 2509 of file gui_main.c.

Referenced by real_set_client_page().

◆ reset_unit_table()

void reset_unit_table ( void  )

Called when the tileset is changed to reset the unit pixmap table.

Definition at line 1023 of file gui_main.c.

Referenced by real_set_client_page(), and tileset_changed().

◆ resolution_request_get()

struct video_mode * resolution_request_get ( void  )

Give resolution requested by user, if any.

Definition at line 2611 of file gui_main.c.

Referenced by real_set_client_page().

◆ screen_height()

int screen_height ( void  )

Return height of the primary monitor

Definition at line 2593 of file gui_main.c.

Referenced by adjust_default_options(), create_main_page(), and initialize_city_dialogs().

◆ screen_width()

int screen_width ( void  )

Return width of the primary monitor

Definition at line 2575 of file gui_main.c.

◆ terminate_signal_processing()

gboolean terminate_signal_processing ( GtkEventControllerFocus controller,
gpointer  data 
)

Override background color for canvases Callback that just returns TRUE.

Definition at line 1042 of file gui_main.c.

Referenced by create_network_page().

◆ update_turn_done_tooltip()

void update_turn_done_tooltip ( )

Override background color for canvases Update tooltip of the Turn Done button

Update tooltip of the Turn Done button

Definition at line 1108 of file gui_main.c.

Variable Documentation

◆ bottom_notebook

GtkWidget* bottom_notebook
extern

◆ bulb_label

GtkWidget* bulb_label
extern

Definition at line 144 of file gui_main.c.

Referenced by set_indicator_icons(), setup_widgets(), and update_info_label().

◆ city_names_style

PangoFontDescription* city_names_style
extern

Definition at line 133 of file gui_main.c.

Referenced by activate_gui(), apply_city_names_font(), and ui_main().

◆ city_productions_style

PangoFontDescription* city_productions_style
extern

Definition at line 134 of file gui_main.c.

Referenced by activate_gui(), apply_city_productions_font(), and ui_main().

◆ econ_label

GtkWidget* econ_label[10]
extern

Definition at line 143 of file gui_main.c.

Referenced by setup_widgets(), and update_info_label().

◆ econ_widget

GtkWidget* econ_widget
extern

Definition at line 154 of file gui_main.c.

Referenced by setup_widgets(), and update_info_label().

◆ flake_label

GtkWidget* flake_label
extern

Definition at line 146 of file gui_main.c.

Referenced by set_indicator_icons(), setup_widgets(), and update_info_label().

◆ government_label

GtkWidget* government_label
extern

Definition at line 147 of file gui_main.c.

Referenced by set_indicator_icons(), setup_widgets(), and update_info_label().

◆ main_frame_civ_name

GtkWidget* main_frame_civ_name
extern

Definition at line 137 of file gui_main.c.

Referenced by setup_widgets(), and update_info_label().

◆ main_label_info

GtkWidget* main_label_info
extern

Definition at line 138 of file gui_main.c.

Referenced by setup_widgets(), and update_info_label().

◆ main_message_area

GtkTextView* main_message_area
extern

◆ map_canvas

GtkWidget* map_canvas
extern

◆ map_horizontal_scrollbar

GtkWidget* map_horizontal_scrollbar
extern

Definition at line 108 of file gui_main.c.

Referenced by setup_widgets(), and update_map_canvas_scrollbars_size().

◆ map_vertical_scrollbar

GtkWidget* map_vertical_scrollbar
extern

Definition at line 109 of file gui_main.c.

Referenced by setup_widgets(), and update_map_canvas_scrollbars_size().

◆ map_widget

GtkWidget* map_widget
extern

Definition at line 130 of file gui_main.c.

Referenced by leave_mapcanvas(), and setup_widgets().

◆ message_buffer

GtkTextBuffer* message_buffer
extern

◆ overview_canvas

GtkWidget* overview_canvas
extern

◆ overview_canvas_store_height

int overview_canvas_store_height
extern

Definition at line 123 of file gui_main.c.

Referenced by setup_widgets(), and update_overview_scroll_window_pos().

◆ overview_canvas_store_width

int overview_canvas_store_width
extern

◆ overview_scrolled_window

GtkWidget* overview_scrolled_window
extern

Definition at line 112 of file gui_main.c.

Referenced by setup_widgets(), and update_overview_scroll_window_pos().

◆ reqtree_text_style

PangoFontDescription* reqtree_text_style
extern

Definition at line 135 of file gui_main.c.

Referenced by activate_gui(), apply_reqtree_text_font(), and ui_main().

◆ right_notebook

GtkWidget* right_notebook
extern

Definition at line 129 of file gui_main.c.

Referenced by luaconsole_dialog_create(), meswin_dialog_init(), and setup_widgets().

◆ sun_label

GtkWidget* sun_label
extern

Definition at line 145 of file gui_main.c.

Referenced by set_indicator_icons(), setup_widgets(), and update_info_label().

◆ text_scrollbar

GtkWidget* text_scrollbar
extern

◆ timeout_label

GtkWidget* timeout_label
extern

Definition at line 148 of file gui_main.c.

Referenced by setup_widgets(), and update_timeout_label().

◆ top_notebook

GtkWidget* top_notebook
extern

◆ top_vbox

GtkWidget* top_vbox
extern

◆ toplevel

GtkWidget* toplevel
extern

Definition at line 125 of file gui_main.c.

Referenced by activate_gui(), anim_cursor_cb(), choice_dialog_start(), confirm_cancel_pact(), create_advances_list(), create_city_dialog(), create_city_info_table(), create_goto_dialog(), create_help_dialog(), create_improvements_list(), create_intel_dialog(), create_intel_wonder_dialog(), create_line_at_mouse_pos(), create_multiplier_dialog(), create_races_dialog(), create_rates_dialog(), create_tool_value_selector(), create_worklists_report(), detached_widget_fill(), dlg_tab_provider_prepare(), enable_menus(), fullscreen_opt_refresh(), get_text_size(), gui_clear_theme(), gui_dialog_detach(), gui_dialog_new(), gui_load_theme(), gui_update_font(), infra_dialog_popup(), leave_callback(), leave_callback(), luaconsole_load_file_popup(), main(), map_canvas_focus(), modinst_setup_widgets(), option_color_select_callback(), option_dialog_new(), popit(), popup_action_selection(), popup_bribe_dialog(), popup_connect_msg(), popup_disband_dialog(), popup_help_dialog_typed(), popup_incite_dialog(), popup_newcity_dialog(), popup_notify_goto_dialog(), popup_quit_dialog(), popup_revolution_dialog(), popup_soundset_suggestion_dialog(), popup_tileset_suggestion_dialog(), popup_upgrade_dialog(), popup_workertask_dlg(), propagate_keypress(), property_editor_new(), rally_dialog_popup(), real_set_client_page(), remove_net_input(), request_action_confirmation(), save_dialog_file_chooser_popup(), save_dialog_new(), select_color_callback(), select_color_callback(), select_tgt_extra(), select_tgt_unit(), setup_widgets(), show_conn_popup(), show_info_popup(), show_tileset_error(), surface_put_text(), tearoff_callback(), tileset_changed(), toplevel_handler(), try_to_set_editor_tool(), ui_main(), update_rect_at_mouse_pos(), update_turn_done_button(), and usdlg_create().

◆ toplevel_tabs

GtkWidget* toplevel_tabs
extern

Definition at line 127 of file gui_main.c.

Referenced by real_set_client_page(), setup_widgets(), and ui_main().

◆ turn_done_button

GtkWidget* turn_done_button
extern

◆ unit_info_box

GtkWidget* unit_info_box
extern

Definition at line 152 of file gui_main.c.

Referenced by editinfobox_refresh(), setup_widgets(), and ui_main().

◆ unit_info_frame

GtkWidget* unit_info_frame
extern

Definition at line 153 of file gui_main.c.

Referenced by setup_widgets(), and update_unit_info_label().

◆ unit_info_label

GtkWidget* unit_info_label
extern

Definition at line 151 of file gui_main.c.

Referenced by popup_unit_info(), setup_widgets(), and update_unit_info_label().