39#include <emscripten.h>
86#define UNITS_TIMER_INTERVAL 128
87#define MAP_SCROLL_TIMER_INTERVAL 500
162#define SPECLIST_TAG callback
163#define SPECLIST_TYPE struct callback
178 _(
" -f, --fullscreen\tStart Client in Fullscreen mode\n"));
180 _(
" -F, --Font SIZE\tUse SIZE as the base font size\n"));
228 static struct widget *pwidget;
426 #define SCROLL_MAP_AREA 8
428 #define SCROLL_MAP_AREA 1
437 static struct widget *pwidget;
566 event.user.data1 =
NULL;
567 event.user.data2 =
NULL;
579 static int x = 0,
y = 0;
967#define option_var_set_callback(var, callback) \
968 if ((poption = optset_option_by_name(client_optset, \
969 GUI_SDL_OPTION_STR(var)))) { \
970 option_set_changed_callback(poption, callback); \
972 log_error("Didn't find option %s!", GUI_SDL_OPTION_STR(var)); \
977#undef option_var_set_callback
1011 log_normal(
_(
"Migrating options from sdl2 to sdl3 client"));
1013#define MIGRATE_OPTION(opt) gui_options.gui_sdl3_##opt = gui_options.gui_sdl2_##opt;
1014#define MIGRATE_STR_OPTION(opt) \
1015 strncpy(gui_options.gui_sdl3_##opt, gui_options.gui_sdl2_##opt, \
1016 sizeof(gui_options.gui_sdl3_##opt));
1028#undef MIGRATE_OPTION
1293#define CHECK_FONT(client_font, action) \
1295 if (strcmp(#client_font, font_name) == 0) { \
1297 long size = strtol(font_value, &end, 10); \
1298 if (end && *end == '\0' && size > 0) { \
1299 *client_font_sizes[client_font] = size; \
#define city_owner(_pcity_)
void popup_city_dialog(struct city *pcity)
double real_timer_callback(void)
int client_main(int argc, char *argv[], bool postpone_tileset)
enum client_states client_state(void)
void send_report_request(enum report_type type)
void start_quitting(void)
void set_client_state(enum client_states newstate)
void center_on_something(void)
double try_to_autoconnect(void)
void input_from_server(int fd)
@ REPORT_WONDERS_OF_THE_WORLD
struct unit_list * get_units_in_focus(void)
struct unit * head_of_units_in_focus(void)
void control_mouse_cursor(struct tile *ptile)
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
editgui_notify_object_changed
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__
void city_report_dialog_popup(bool raise)
void diplomacy_dialog_init(void)
void diplomacy_dialog_done(void)
int ui_main(int argc, char **argv)
const char * client_string
static void print_usage(void)
#define option_var_set_callback(var, callback)
#define MIGRATE_STR_OPTION(opt)
enum gui_type get_gui_type(void)
int main(int argc, char **argv)
void add_idle_callback(void(callback)(void *), void *data)
void options_extra_init(void)
void insert_client_build_info(char *outbuf, size_t outlen)
void remove_net_input(void)
const char *const gui_character_encoding
void add_net_input(int sock)
static bool parse_options(int argc, char **argv)
#define MIGRATE_OPTION(opt)
const bool gui_use_transliteration
void intel_dialog_done(void)
void intel_dialog_init(void)
void update_info_label(void)
void update_unit_info_label(struct unit_list *punits)
void update_city_descriptions(void)
void update_mouse_cursor(enum cursor_type new_cursor_type)
void meswin_dialog_popdown(void)
void meswin_dialog_popup(bool raise)
bool meswin_dialog_is_open(void)
void units_report_dialog_popup(bool raise)
void popup_spaceship_dialog(struct player *pplayer)
void popup_input_line(void)
bool set_video_mode(unsigned width, unsigned height, unsigned flags_in)
int main_window_width(void)
void update_main_screen(void)
bool is_in_rect_area(int x, int y, const SDL_Rect *rect)
struct sdl2_data main_data
bool create_surfaces(int width, int height)
int main_window_height(void)
static int city_names_font_size
static Uint16 main_key_down_handler(SDL_Keysym key, void *data)
static SDL_Event __anim_user_event
static SDL_Event * net_user_event
static void resize_window_callback(struct option *poption)
static void fullscreen_callback(struct option *poption)
void editgui_popup_properties(const struct tile_list *tiles, int objtype)
void editgui_notify_object_created(int tag, int id)
#define CHECK_FONT(client_font, action)
static struct mouse_button_behavior button_behavior
bool is_unit_move_blocked
static SDL_Event __info_user_event
static SDL_Event __flush_user_event
int FilterMouseMotionEvents(void *data, SDL_Event *event)
static SDL_Event * info_user_event
static Uint16 main_mouse_button_down_handler(SDL_MouseButtonEvent *button_event, void *data)
static SDL_Event __net_user_event
void enable_focus_animation(void)
void editgui_popdown_all(void)
#define MAP_SCROLL_TIMER_INTERVAL
static void real_resize_window_callback(void *data)
bool draw_goto_patrol_lines
#define UNITS_TIMER_INTERVAL
Uint16 gui_event_loop(void *data, void(*loop_action)(void *data), Uint16(*key_down_handler)(SDL_Keysym key, void *data), Uint16(*key_up_handler)(SDL_Keysym key, void *data), Uint16(*textinput_handler)(const char *text, void *data), Uint16(*finger_down_handler)(SDL_TouchFingerEvent *touch_event, void *data), Uint16(*finger_up_handler)(SDL_TouchFingerEvent *touch_event, void *data), Uint16(*finger_motion_handler)(SDL_TouchFingerEvent *touch_event, void *data), Uint16(*mouse_button_down_handler)(SDL_MouseButtonEvent *button_event, void *data), Uint16(*mouse_button_up_handler)(SDL_MouseButtonEvent *button_event, void *data), Uint16(*mouse_motion_handler)(SDL_MouseMotionEvent *motion_event, void *data))
static void update_button_hold_state(void)
static bool is_map_scrolling
static SDL_Event * map_scroll_user_event
static Uint16 main_finger_down_handler(SDL_TouchFingerEvent *touch_event, void *data)
Uint32 widget_info_counter
static Uint16 main_mouse_motion_handler(SDL_MouseMotionEvent *motion_event, void *data)
static SDL_Event * anim_user_event
static bool check_scroll_area(int x, int y)
static Uint16 main_finger_up_handler(SDL_TouchFingerEvent *touch_event, void *data)
void update_font_from_theme(int theme_font_size)
static int city_productions_font_size
unsigned default_font_size(struct theme *act_theme)
static void clear_double_messages_call(void)
void force_exit_from_event_loop(void)
void disable_focus_animation(void)
static enum direction8 scroll_dir
static unsigned font_size_parameter
int * client_font_sizes[FONT_COUNT]
void editgui_refresh(void)
static SDL_Event __map_scroll_user_event
static SDL_Event * flush_user_event
struct callback_list * callbacks
static Uint16 main_key_up_handler(SDL_Keysym key, void *data)
void editgui_tileset_changed(void)
static Uint16 main_mouse_button_up_handler(SDL_MouseButtonEvent *button_event, void *data)
#define CF_FOCUS_ANIMATION
#define CF_DRAW_PLAYERS_ALLIANCE_STATUS
#define CF_DRAW_PLAYERS_CEASEFIRE_STATUS
#define CF_DRAW_PLAYERS_PEACE_STATUS
#define MB_MEDIUM_HOLD_DELAY
struct widget * selected_widget
#define CF_DRAW_PLAYERS_NEUTRAL_STATUS
#define DEFAULT_MOVE_STEP
#define MB_LONG_HOLD_DELAY
#define CF_DRAW_PLAYERS_WAR_STATUS
#define GUI_SDL_OPTION(optname)
void animate_mouse_cursor(void)
void unload_cursors(void)
void draw_mouse_cursor(void)
void free_font_system(void)
void setup_auxiliary_tech_icons(void)
void draw_intro_gfx(void)
void free_auxiliary_tech_icons(void)
void button_down_on_map(struct mouse_button_behavior *button_behavior)
void button_up_on_map(struct mouse_button_behavior *button_behavior)
void finger_up_on_map(struct finger_behavior *finger_behavior)
bool map_event_handler(SDL_Keysym key)
void set_new_minimap_window_pos(void)
void set_new_unitinfo_window_pos(void)
void city_map_canvas_free(void)
void theme_free(struct theme *ftheme)
int theme_default_font_size(const struct theme *t)
struct theme * active_theme
static void migrate_options_from_sdl2(void)
#define log_debug(message,...)
#define log_normal(message,...)
void update_line(int canvas_x, int canvas_y)
void scroll_mapview(enum direction8 gui_dir)
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)
bool map_canvas_resized(int width, int height)
#define fc_calloc(n, esz)
int fc_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, fc_timeval *timeout)
struct timeval fc_timeval
int messages_where[E_COUNT]
struct client_options gui_options
#define VIDEO_MODE(ARG_width, ARG_height)
bool str_to_uint(const char *str, unsigned int *pint)
void(* callback)(void *data)
bool gui_sdl3_migrated_from_sdl2
SDL_TouchFingerEvent event
enum mouse_button_hold_state hold_state
int fc_snprintf(char *str, size_t n, const char *format,...)
#define sz_strlcpy(dest, src)
struct city * tile_city(const struct tile *ptile)
void tileset_load_tiles(struct tileset *t)
void tileset_use_preferred_theme(const struct tileset *t)
void tileset_init(struct tileset *t)
void update_queue_add(uq_callback_t callback, void *data)