23#ifdef SDL2_PLAIN_INCLUDE
44#include <gdk/gdkkeysyms.h>
117#define OVERVIEW_CANVAS_STORE_WIDTH_NETBOOK (2 * 64)
118#define OVERVIEW_CANVAS_STORE_HEIGHT_NETBOOK (2 * 46)
119#define OVERVIEW_CANVAS_STORE_WIDTH \
120 (2 * OVERVIEW_CANVAS_STORE_WIDTH_NETBOOK)
121#define OVERVIEW_CANVAS_STORE_HEIGHT \
122 (2 * OVERVIEW_CANVAS_STORE_HEIGHT_NETBOOK)
229 -1.0, 0.13, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 2.0, 2.5, 3.0, 4.0, -1.0
274 _(
"gtk4-client gui-specific options are:\n"));
277 _(
"-r, --resolution WIDTHxHEIGHT\tAssume given resolution "
281 _(
"-z, --zoom LEVEL\tSet zoom level; use value 'default' "
460 "sound_effects_volume");
851 " padding: 0px 0px 0px 0px;\n"
1058 _(
"Fixed length turns"));
1063 _(
"Turn Done"),
_(
"Shift+Return"));
1267 for (
i = 0;
i < 10;
i++) {
1316 for (
i = 0;
i < 4;
i++) {
1736 log_normal(
_(
"Migrating options from gtk2 to gtk3 client"));
1738#define MIGRATE_OPTION(opt) gui_options.gui_gtk3_##opt = gui_options.gui_gtk2_##opt;
1739#define MIGRATE_STR_OPTION(opt) \
1740 strncpy(gui_options.gui_gtk3_##opt, gui_options.gui_gtk2_##opt, \
1741 sizeof(gui_options.gui_gtk3_##opt));
1780#undef MIGRATE_OPTION
1781#undef MIGRATE_STR_OPTION
1791 log_normal(
_(
"Migrating options from gtk3 to gtk3.22 client"));
1793#define MIGRATE_OPTION(opt) gui_options.gui_gtk3_22_##opt = gui_options.gui_gtk3_##opt;
1794#define MIGRATE_STR_OPTION(opt) \
1795 strncpy(gui_options.gui_gtk3_22_##opt, gui_options.gui_gtk3_##opt, \
1796 sizeof(gui_options.gui_gtk3_22_##opt));
1802 log_normal(
_(
"Migrating gtk3-client options from freeciv-2.5 options."));
1839#undef MIGRATE_OPTION
1840#undef MIGRATE_STR_OPTION
1850 log_normal(
_(
"Migrating options from gtk3.22 to gtk4 client"));
1852#define MIGRATE_OPTION(opt) GUI_GTK_OPTION(opt) = gui_options.gui_gtk3_22_##opt;
1853#define MIGRATE_STR_OPTION(opt) \
1854 strncpy(GUI_GTK_OPTION(opt), gui_options.gui_gtk3_22_##opt, \
1855 sizeof(GUI_GTK_OPTION(opt)));
1890#undef MIGRATE_OPTION
1891#undef MIGRATE_STR_OPTION
1907 log_fatal(
_(
"Failed to open graphical mode."));
2030 log_error(
"city_names_style should have been set by options.");
2034 log_error(
"city_productions_style should have been set by options.");
2038 log_error(
"reqtree_text_style should have been set by options.");
2045#ifndef FREECIV_MSWINDOWS
2309#ifdef FREECIV_MSWINDOWS
2372 _(
"Are you sure you want to quit?"));
2506#define option_var_set_callback(var, callback) \
2507 if ((poption = optset_option_by_name(client_optset, \
2508 GUI_GTK_OPTION_STR(var)))) { \
2509 option_set_changed_callback(poption, callback); \
2511 log_error("Didn't find option %s!", GUI_GTK_OPTION_STR(var)); \
2525#undef option_var_set_callback
2565 "\nBuilt against glib %d.%d.%d, using %d.%d.%d"),
2658 log_verbose(
"Changing default to fullscreen due to very small screen");
2663 log_verbose(
"Defaulting to small widget layout due to small screen");
2665 log_verbose(
"Defaulting to merged messages/chat due to small screen");
struct canvas int int struct sprite int int int int height
struct canvas int int struct sprite int int int width
void chat_welcome_message(bool gui_has_copying_mitem)
static struct ai_type * self
bool client_is_observer(void)
double real_timer_callback(void)
int client_main(int argc, char *argv[], bool postpone_tileset)
void user_ended_turn(void)
void start_quitting(void)
void set_client_state(enum client_states newstate)
bool can_client_change_view(void)
void buy_production_in_selected_cities(void)
struct sprite * client_warming_sprite(void)
struct sprite * client_cooling_sprite(void)
struct sprite * client_research_sprite(void)
struct sprite * client_government_sprite(void)
void disconnect_from_server(bool leaving_sound)
void input_from_server(int fd)
struct color * get_color(const struct tileset *t, enum color_std stdcolor)
bool is_server_running(void)
void key_recall_previous_focus_unit(void)
bool unit_is_in_focus(const struct unit *punit)
void key_cancel_action(void)
void unit_focus_set(struct unit *punit)
struct unit_list * get_units_in_focus(void)
void update_unit_pix_label(struct unit_list *punitlist)
void key_unit_move(enum direction8 gui_dir)
enum cursor_hover_state hover_state
struct unit * head_of_units_in_focus(void)
int get_num_units_in_focus(void)
void control_mouse_cursor(struct tile *ptile)
void key_center_capital(void)
#define MAX_NUM_UNITS_BELOW
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
bool editor_is_active(void)
bool is_option(const char *option_name, char *option)
char * get_option_malloc(const char *option_name, char **argv, int *i, int argc, bool gc)
void fc_fprintf(FILE *stream, const char *format,...) fc__attribute((__format__(__printf__
struct unit * game_unit_by_number(int id)
bool inputline_has_focus(void)
void inputline_toolkit_view_append_button(GtkWidget *toolkit_view, GtkWidget *button)
GtkWidget * inputline_toolkit_view_new(void)
void set_message_buffer_view_link_handlers(GtkWidget *view)
bool inputline_is_visible(void)
void inputline_grab_focus(void)
void chatline_scroll_to_bottom(bool delayed)
void citizens_dialog_init(void)
void citizens_dialog_done(void)
void unit_select_dialog_popup(struct tile *ptile)
gboolean taxrates_callback(GtkWidget *w, GdkEventButton *ev, gpointer data)
void diplomacy_dialog_init(void)
void diplomacy_dialog_done(void)
gboolean handle_edit_key_press(GdkEventKey *ev)
void editgui_create_widgets(void)
struct editbar * editgui_get_editbar(void)
void goto_dialog_focus_units_changed(void)
static GtkWidget * source
GtkWidget * map_vertical_scrollbar
int ui_main(int argc, char **argv)
const char * client_string
GtkTextBuffer * message_buffer
static void quit_dialog_response(GtkWidget *dialog, gint response)
void real_focus_units_changed(void)
void set_unit_icons_more_arrow(bool onoff)
static void print_usage(void)
#define OVERVIEW_CANVAS_STORE_WIDTH_NETBOOK
#define option_var_set_callback(var, callback)
static gboolean quit_dialog_callback(void)
static GIOChannel * srv_channel
GtkWidget * main_label_info
static bool monitor_size(GdkRectangle *rect_p)
GtkWidget * bottom_notebook
GtkWidget * unit_info_label
static gboolean timer_callback(gpointer data)
struct video_mode * resolution_request_get(void)
void set_unit_icon(int idx, struct unit *punit)
static int unit_ids[MAX_NUM_UNITS_BELOW]
GtkWidget * timeout_label
static gboolean mouse_scroll_mapcanvas(GtkWidget *w, GdkEventScroll *ev)
PangoFontDescription * city_productions_style
GtkWidget * overview_scrolled_window
static GtkWidget * detached_widget_fill(GtkWidget *tearbox)
#define MIGRATE_STR_OPTION(opt)
GtkWidget * unit_info_box
gboolean fc_lost_focus(GtkWidget *w, GdkEventKey *ev, gpointer data)
enum gui_type get_gui_type(void)
static GtkWidget * detached_widget_new(void)
int main(int argc, char **argv)
void fullscreen_opt_refresh(struct option *poption)
static void free_unit_table(void)
static gboolean idle_callback_wrapper(gpointer data)
static void apply_city_names_font(struct option *poption)
static void apply_city_productions_font(struct option *poption)
gboolean fc_gained_focus(GtkWidget *w, GdkEventKey *ev, gpointer data)
GtkWidget * government_label
PangoFontDescription * city_names_style
void refresh_chat_buttons(void)
gboolean map_canvas_focus(void)
GtkWidget * turn_done_button
static GtkWidget * bottom_hpaned
static void end_turn_callback(GtkWidget *w, gpointer data)
#define OVERVIEW_CANVAS_STORE_HEIGHT_NETBOOK
static void log_callback_utf8(enum log_level level, const char *message, bool file_too)
void add_idle_callback(void(callback)(void *), void *data)
static gboolean show_info_popup(GtkWidget *w, GdkEventButton *ev, gpointer data)
static void set_g_log_callbacks(void)
void reset_unit_table(void)
static gboolean key_press_map_canvas(GtkWidget *w, GdkEventKey *ev, gpointer data)
GtkWidget * unit_info_frame
void options_extra_init(void)
static void allied_chat_only_callback(struct option *poption)
static void adjust_default_options(void)
static void set_wait_for_writable_socket(struct connection *pc, bool socket_writable)
static void apply_reqtree_text_font(struct option *poption)
static gboolean toplevel_focus(GtkWidget *w, GtkDirectionType arg)
PangoFontDescription * reqtree_text_style
static void g_log_to_freelog_cb(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data)
void setup_gui_properties(void)
void insert_client_build_info(char *outbuf, size_t outlen)
static void set_g_log_callback_domain(const char *domain)
GtkWidget * overview_canvas
static void setup_widgets(void)
#define OVERVIEW_CANVAS_STORE_WIDTH
void remove_net_input(void)
GtkWidget * map_horizontal_scrollbar
static gboolean toplevel_key_press_handler(GtkWidget *w, GdkEventKey *ev, gpointer data)
static void migrate_options_from_gtk2(void)
GtkWidget * econ_label[10]
void popup_quit_dialog(void)
static void migrate_options_from_gtk3(void)
const char *const gui_character_encoding
static gboolean get_net_input(GIOChannel *source, GIOCondition condition, gpointer data)
GtkWidget * right_notebook
static void allied_chat_button_toggled(GtkToggleButton *button, gpointer user_data)
static struct video_mode vmode
void add_net_input(int sock)
static GLogWriterOutput g_log_writer_to_freelog_cb(GLogLevelFlags log_level, const GLogField *fields, gsize n_fields, gpointer user_data)
GtkWidget * toplevel_tabs
static GtkWidget * allied_chat_toggle_button
int overview_canvas_store_width
void update_turn_done_tooltip(void)
static void tearoff_callback(GtkWidget *b, gpointer data)
GtkTextView * main_message_area
int overview_canvas_store_height
static bool parse_options(int argc, char **argv)
#define OVERVIEW_CANVAS_STORE_HEIGHT
GtkWidget * main_frame_civ_name
#define MIGRATE_OPTION(opt)
const bool gui_use_transliteration
#define GUI_GTK_OPTION(optname)
void dlg_tab_provider_prepare(void)
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
void gui_update_font_full(const char *font_name, const char *font_value, PangoFontDescription **font_desc)
void happiness_dialog_init(void)
void happiness_dialog_done(void)
void help_system_init(void)
void intel_dialog_done(void)
void intel_dialog_init(void)
void luaconsole_dialog_init(void)
void luaconsole_dialog_done(void)
gboolean move_overviewcanvas(GtkWidget *w, GdkEventMotion *ev, gpointer data)
gboolean move_mapcanvas(GtkWidget *w, GdkEventMotion *ev, gpointer data)
gboolean leave_mapcanvas(GtkWidget *widget, GdkEventCrossing *event)
void update_city_descriptions(void)
gboolean map_canvas_draw(GtkWidget *w, cairo_t *cr, gpointer data)
gboolean overview_canvas_draw(GtkWidget *w, cairo_t *cr, gpointer data)
void meswin_dialog_popup(bool raise)
GtkWidget * create_start_page(void)
GtkWidget * create_network_page(void)
GtkWidget * create_scenario_page(void)
static GtkWidget * statusbar
enum client_pages get_current_client_page(void)
void destroy_server_scans(void)
GtkWidget * create_load_page(void)
GtkWidget * create_statusbar(void)
GtkWidget * create_main_page(void)
void science_report_dialog_redraw(void)
void spaceship_dialog_init(void)
void spaceship_dialog_done(void)
GdkPixbuf * sprite_get_pixbuf(struct sprite *sprite)
GtkWidget * ingame_votebar
GtkWidget * voteinfo_bar_new(bool split_bar)
gboolean reverse_taxrates_callback(GtkGestureClick *gesture, int n_press, double x, double y)
static GdkPaintable * empty_unit_paintable
static void tearoff_close(GtkWidget *w, gpointer data)
static void tearoff_reattach(GtkWidget *box)
gboolean terminate_signal_processing(GtkEventControllerFocus *controller, gpointer data)
static GtkWidget * more_arrow_container
static GtkWidget * unit_pic
static gboolean select_more_arrow_callback(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
static GtkApplication * fc_app
GtkApplication * gui_app(void)
static GtkWidget * more_arrow
static float zoom_steps_custom[]
static void migrate_options_from_gtk3_22(void)
void animation_idle_cb(void *data)
static void activate_gui(GtkApplication *app, gpointer data)
static void populate_unit_pic_table(void)
static void info_popup_closed(GtkWidget *self, gpointer data)
static void move_from_container_to_container(GtkWidget *wdg, GtkWidget *old_wdg, GtkWidget *new_wdg)
static gboolean select_unit_pic_callback(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
static GtkWidget * unit_pic_table
static GtkWidget * unit_below_pic[MAX_NUM_UNITS_BELOW]
void main_message_area_resize(void *data)
void widget_destroyed(GtkWidget *wdg, void *data)
gboolean right_butt_down_overviewcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
gboolean left_butt_up_mapcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
gboolean right_butt_up_mapcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
gboolean left_butt_down_overviewcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
gboolean left_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
gboolean right_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
gboolean middle_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
void map_canvas_resize(GtkWidget *w, int width, int height, gpointer data)
void put_unit_picture(struct unit *punit, GtkPicture *p, int height)
GtkWidget * picture_new_from_surface(cairo_surface_t *surf)
struct client_properties gui_properties
log_callback_fn log_set_callback(log_callback_fn callback)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define log_fatal(message,...)
#define log_debug(message,...)
#define log_normal(message,...)
#define log_base(level, message,...)
#define log_error(message,...)
void update_line(int canvas_x, int canvas_y)
void maybe_activate_keyboardless_goto(int canvas_x, int canvas_y)
bool tiles_hilited_cities
void scroll_mapview(enum direction8 gui_dir)
bool keyboardless_goto_button_down
void update_selection_rectangle(float canvas_x, float canvas_y)
void init_mapcanvas_and_overview(void)
struct tile * canvas_pos_to_tile(float canvas_x, float canvas_y, float zoom)
void free_mapcanvas_and_overview(void)
void get_mapview_scroll_pos(int *scroll_x, int *scroll_y)
void get_mapview_scroll_step(int *xstep, int *ystep)
void set_mapview_scroll_pos(int scroll_x, int scroll_y, float zoom)
void center_tile_mapcanvas(const struct tile *ptile)
void update_animation(void)
void set_frame_by_frame_animation(void)
void link_marks_clear_all(void)
void option_changed(struct option *poption)
const struct option_set * server_optset
const struct option_set * client_optset
bool option_bool_get(const struct option *poption)
enum option_type option_type(const struct option *poption)
const char * option_font_target(const struct option *poption)
bool string_to_video_mode(const char *buf, struct video_mode *mode)
struct client_options gui_options
const char * option_font_get(const struct option *poption)
struct option * optset_option_by_name(const struct option_set *poptset, const char *name)
#define GUI_GTK_OVERVIEW_MIN_XSIZE
#define options_iterate(poptset, poption)
#define options_iterate_end
const char * get_info_label_text_popup(void)
struct setting_list * level[OLEVELS_NUM]
#define CLIP(lower, current, upper)
void(* callback)(void *data)
bool silent_when_not_in_focus
bool gui_gtk3_22_migrated_from_gtk3
bool gui_gtk3_migrated_from_2_5
bool gui_gtk3_migrated_from_gtk2
void(* notify_of_writable_data)(struct connection *pc, bool data_available_and_socket_full)
int fc_snprintf(char *str, size_t n, const char *format,...)
int cat_snprintf(char *str, size_t n, const char *format,...)
void tileset_load_tiles(struct tileset *t)
void tileset_free_tiles(struct tileset *t)
void tileset_use_preferred_theme(const struct tileset *t)
void tileset_init(struct tileset *t)
struct sprite * get_arrow_sprite(const struct tileset *t, enum arrow_type arrow)
struct sprite * get_tax_sprite(const struct tileset *t, Output_type_id otype)
int tileset_tile_width(const struct tileset *t)
void zoom_phase_set(bool individual_tiles)
void zoom_set_steps(float *steps)
void zoom_step_down(void)