Freeciv-3.3: /fast/freeciv/nightly/main/client/gui-gtk-5.0/gui_main.h File Reference

Freeciv-3.3

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.x"
#define | GUI_NAME_SHORT "gtk4x"
#define | GUI_GTK_OPTION(optname) gui_options.gui_gtk5_##optname
#define | GUI_GTK_OPTION_STR(optname) "gui_gtk5_" #optname
#define | GUI_GTK_DEFAULT_THEME_NAME FC_GTK5_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)
gchar * | ntoh_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_mode * | resolution_request_get (void)
void | fullscreen_opt_refresh (struct option *poption)
GtkApplication * | gui_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

PangoFontDescription * | city_names_style
PangoFontDescription * | city_productions_style
PangoFontDescription * | reqtree_text_style
GtkTextView * | main_message_area
GtkWidget * | text_scrollbar
GtkWidget * | toplevel
GtkWidget * | top_vbox
GtkWidget * | main_frame_civ_name
GtkWidget * | main_label_info
GtkWidget * | econ_label [10]
GtkWidget * | bulb_label
GtkWidget * | sun_label
GtkWidget * | flake_label
GtkWidget * | government_label
GtkWidget * | econ_widget
GtkWidget * | map_canvas
GtkWidget * | overview_canvas
GtkWidget * | overview_scrolled_window
GtkWidget * | timeout_label
GtkWidget * | turn_done_button
GtkWidget * | unit_info_box
GtkWidget * | unit_info_label
GtkWidget * | unit_info_frame
GtkWidget * | map_horizontal_scrollbar
GtkWidget * | map_vertical_scrollbar
GtkWidget * | toplevel_tabs
GtkWidget * | top_notebook
GtkWidget * | map_widget
GtkWidget * | bottom_notebook
GtkWidget * | right_notebook
GtkTextBuffer * | message_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_GTK5_DEFAULT_THEME_NAME

Definition at line 27 of file gui_main.h.

## ◆ GUI_GTK_OPTION

#define GUI_GTK_OPTION | ( |  | optname | ) | gui_options.gui_gtk5_##optname

Definition at line 25 of file gui_main.h.

## ◆ GUI_GTK_OPTION_STR

#define GUI_GTK_OPTION_STR | ( |  | optname | ) | "gui_gtk5_" #optname

Definition at line 26 of file gui_main.h.

## ◆ GUI_NAME_FULL

#define GUI_NAME_FULL "gui-gtk-4.x"

Definition at line 22 of file gui_main.h.

## ◆ GUI_NAME_SHORT

#define GUI_NAME_SHORT "gtk4x"

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

## ◆ fc_lost_focus()

gboolean fc_lost_focus | ( | GtkEventControllerFocus * | controller,
|  | gpointer | data
| ) |  |

Freeciv window has lost focus

Definition at line 751 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 2456 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 2682 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 2081 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 368 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 382 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 2372 of file gui_main.c.

## ◆ quit_gtk_main()

void quit_gtk_main | ( | void |  | ) |

Exit gtk main loop.

Definition at line 2360 of file gui_main.c.

Referenced by create_main_page(), quit_dialog_response(), 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 2532 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 1046 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 2634 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 2616 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 2598 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 1051 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 1131 of file gui_main.c.

## Variable Documentation

## ◆ bottom_notebook

GtkWidget* bottom_notebook

extern

Definition at line 129 of file gui_main.c.

Referenced by luaconsole_dialog_create(), meswin_dialog_init(), popup_find_dialog(), popup_notify_dialog(), setup_widgets(), toplevel_key_press_handler(), and toplevel_key_press_handler().

## ◆ 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

Definition at line 177 of file gui_main.c.

Referenced by chatline_is_scrolled_to_bottom(), chatline_scroll_to_bottom(), key_press_map_canvas(), key_press_map_canvas(), main_message_area_resize(), real_output_window_append(), and setup_widgets().

## ◆ map_canvas

GtkWidget* map_canvas

extern

Definition at line 107 of file gui_main.c.

Referenced by butt_down_mapcanvas(), create_line_at_mouse_pos(), dirty_all(), dirty_rect(), draw_selection_rectangle(), event_after(), event_after(), flush_dirty(), left_butt_down_mapcanvas(), map_canvas_focus(), middle_butt_down_mapcanvas(), mouse_scroll_mapcanvas(), mouse_scroll_mapcanvas(), move_mapcanvas(), move_mapcanvas(), popit(), popupinfo_positioning_callback(), put_cross_overlay_tile(), right_butt_down_mapcanvas(), setup_widgets(), and update_rect_at_mouse_pos().

## ◆ 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

Definition at line 178 of file gui_main.c.

Referenced by chatline_scroll_to_bottom(), create_start_page(), log_output_window(), real_output_window_append(), set_output_window_text(), setup_widgets(), ui_exit(), and ui_main().

## ◆ overview_canvas

GtkWidget* overview_canvas

extern

Definition at line 111 of file gui_main.c.

Referenced by create_line_at_mouse_pos(), get_overview_window(), overview_size_changed(), refresh_overview(), setup_widgets(), and update_map_canvas_scrollbars().

## ◆ 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

Definition at line 122 of file gui_main.c.

Referenced by populate_unit_image_table(), populate_unit_pic_table(), setup_widgets(), and update_overview_scroll_window_pos().

## ◆ 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

Definition at line 129 of file gui_main.c.

Referenced by create_city_report_dialog(), create_messageopt_dialog(), create_players_dialog(), create_spaceship_dialog(), diplomacy_main_create(), economy_report_init(), endgame_report_init(), gui_dialog_new(), leave_mapcanvas(), map_canvas_focus(), science_report_init(), setup_widgets(), toplevel_key_press_handler(), toplevel_key_press_handler(), and units_report_init().

## ◆ top_vbox

GtkWidget* top_vbox

extern

Definition at line 128 of file gui_main.c.

Referenced by enable_menus(), setup_widgets(), toplevel_key_press_handler(), toplevel_key_press_handler(), and toplevel_key_release_handler().

## ◆ toplevel

GtkWidget* toplevel

extern

Definition at line 125 of file gui_main.c.

Referenced by activate_gui(), anim_cursor_cb(), buy_callback(), 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_impr_or_unit_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

Definition at line 149 of file gui_main.c.

Referenced by end_turn_callback(), set_turn_done_button_state(), setup_widgets(), update_turn_done_button(), and update_turn_done_tooltip().

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