Freeciv-3.2
|
#include "fc_prehdrs.h"
#include <errno.h>
#include <SDL3/SDL.h>
#include "fc_cmdline.h"
#include "fciconv.h"
#include "fcintl.h"
#include "log.h"
#include "netintf.h"
#include "unitlist.h"
#include "client_main.h"
#include "climisc.h"
#include "clinet.h"
#include "editgui_g.h"
#include "tilespec.h"
#include "update_queue.h"
#include "zoom.h"
#include "chatline.h"
#include "citydlg.h"
#include "cityrep.h"
#include "diplodlg.h"
#include "graphics.h"
#include "gui_id.h"
#include "gui_mouse.h"
#include "gui_tilespec.h"
#include "inteldlg.h"
#include "mapctrl.h"
#include "mapview.h"
#include "menu.h"
#include "messagewin.h"
#include "optiondlg.h"
#include "repodlgs.h"
#include "themespec.h"
#include "spaceshipdlg.h"
#include "widget.h"
#include "gui_main.h"
#include "speclist.h"
Go to the source code of this file.
Data Structures | |
struct | callback |
Enumerations | |
enum | USER_EVENT_ID { EVENT_ERROR = 0 , NET , ANIM , TRY_AUTO_CONNECT , SHOW_WIDGET_INFO_LABEL , FLUSH , MAP_SCROLL , EXIT_FROM_EVENT_LOOP } |
#define CHECK_FONT | ( | client_font, | |
action | |||
) |
#define MAP_SCROLL_TIMER_INTERVAL 500 |
Definition at line 87 of file gui_main.c.
#define MIGRATE_OPTION | ( | opt | ) | gui_options.gui_sdl3_##opt = gui_options.gui_sdl2_##opt; |
#define SCROLL_MAP_AREA 1 |
Definition at line 428 of file gui_main.c.
Definition at line 162 of file gui_main.c.
Definition at line 163 of file gui_main.c.
#define UNITS_TIMER_INTERVAL 128 /* milliseconds */ |
Definition at line 86 of file gui_main.c.
Enumerator | |
---|---|
EVENT_ERROR | |
NET | |
ANIM | |
TRY_AUTO_CONNECT | |
SHOW_WIDGET_INFO_LABEL | |
FLUSH | |
MAP_SCROLL | |
EXIT_FROM_EVENT_LOOP |
Definition at line 146 of file gui_main.c.
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 1240 of file gui_main.c.
Wait for data on the given socket. Call input_from_server() when data is ready to be read.
Definition at line 1215 of file gui_main.c.
Check if coordinate is in scroll area.
Definition at line 513 of file gui_main.c.
Remove double messages caused by message configured to both MW_MESSAGES and MW_OUTPUT.
Definition at line 984 of file gui_main.c.
Return default font size, from any source.
Definition at line 1315 of file gui_main.c.
Don't show Focused Unit Animation.
Definition at line 1206 of file gui_main.c.
Stub for editor function
Definition at line 1279 of file gui_main.c.
Stub for editor function
Definition at line 1285 of file gui_main.c.
Stub for editor function
Definition at line 1273 of file gui_main.c.
Stub for editor function
Definition at line 1267 of file gui_main.c.
Stub for editor function
Definition at line 1261 of file gui_main.c.
Stub for editor function
Definition at line 1255 of file gui_main.c.
Show Focused Unit Animation.
Definition at line 1197 of file gui_main.c.
Filter out mouse motion events for too small movement to react to. This function may run in a separate event thread.
Definition at line 576 of file gui_main.c.
Queue a flush event to be handled later by SDL.
Definition at line 1342 of file gui_main.c.
Instruct event loop to exit.
Definition at line 560 of file gui_main.c.
Change fullscreen status after option changed.
Definition at line 935 of file gui_main.c.
Return our GUI type
Definition at line 1180 of file gui_main.c.
Uint16 gui_event_loop | ( | void * | data, |
void(*)(void *data) | loop_action, | ||
Uint16(*)(SDL_KeyboardEvent *key, void *data) | key_down_handler, | ||
Uint16(*)(SDL_KeyboardEvent *key, void *data) | key_up_handler, | ||
Uint16(*)(const char *text, void *data) | textinput_handler, | ||
Uint16(*)(SDL_TouchFingerEvent *touch_event, void *data) | finger_down_handler, | ||
Uint16(*)(SDL_TouchFingerEvent *touch_event, void *data) | finger_up_handler, | ||
Uint16(*)(SDL_TouchFingerEvent *touch_event, void *data) | finger_motion_handler, | ||
Uint16(*)(SDL_MouseButtonEvent *button_event, void *data) | mouse_button_down_handler, | ||
Uint16(*)(SDL_MouseButtonEvent *button_event, void *data) | mouse_button_up_handler, | ||
Uint16(*)(SDL_MouseMotionEvent *motion_event, void *data) | mouse_motion_handler | ||
) |
SDL3-client main loop.
Definition at line 597 of file gui_main.c.
Updates a gui font style.
Definition at line 1291 of file gui_main.c.
Insert build information to help
Definition at line 1334 of file gui_main.c.
Entry point for freeciv client program. SDL has macro magic to turn this in to function named SDL_main() and it provides actual main() itself.
Definition at line 1001 of file gui_main.c.
|
static |
Main finger down handler.
Definition at line 319 of file gui_main.c.
|
static |
Main finger release handler.
Definition at line 348 of file gui_main.c.
|
static |
Main handler for key presses
Definition at line 226 of file gui_main.c.
|
static |
Main key release handler.
Definition at line 307 of file gui_main.c.
|
static |
Main mouse click handler.
Definition at line 372 of file gui_main.c.
|
static |
Main mouse button release handler.
Definition at line 408 of file gui_main.c.
|
static |
Main handler for mouse movement handling.
Definition at line 434 of file gui_main.c.
Migrate sdl3 client specific options from sdl2 client options.
Definition at line 1009 of file gui_main.c.
Referenced by ui_main().
Extra initializers for client options. Here we make set the callback for the specific gui-sdl3 options.
Definition at line 963 of file gui_main.c.
Search for gui-specific command-line options.
Definition at line 190 of file gui_main.c.
Print extra usage information, including one line help on each option, to stderr.
Definition at line 174 of file gui_main.c.
Really resize the main window.
Definition at line 892 of file gui_main.c.
Stop waiting for any server network data. See add_net_input().
Definition at line 1226 of file gui_main.c.
Resize the main window after option changed.
Definition at line 927 of file gui_main.c.
Make a bell noise (beep). This provides low-level sound alerts even if there is no real sound support.
Definition at line 1189 of file gui_main.c.
Do any necessary UI-specific cleanup
Definition at line 1173 of file gui_main.c.
Do any necessary pre-initialization of the UI, if necessary.
Definition at line 874 of file gui_main.c.
The main loop for the UI. This is called from main(), and when it exits the client will exit.
Definition at line 1037 of file gui_main.c.
This is called every TIMER_INTERVAL milliseconds whilst we are in gui_main_loop() (which is all of the time) TIMER_INTERVAL needs to be .5s
Definition at line 485 of file gui_main.c.
Update font sizes based on theme.
Definition at line 1325 of file gui_main.c.
|
static |
Definition at line 129 of file gui_main.c.
|
static |
Definition at line 131 of file gui_main.c.
|
static |
Definition at line 130 of file gui_main.c.
|
static |
Definition at line 132 of file gui_main.c.
|
static |
Definition at line 128 of file gui_main.c.
Definition at line 135 of file gui_main.c.
Definition at line 121 of file gui_main.c.
|
static |
Definition at line 126 of file gui_main.c.
Definition at line 166 of file gui_main.c.
|
static |
Definition at line 109 of file gui_main.c.
|
static |
Definition at line 110 of file gui_main.c.
int* client_font_sizes[FONT_COUNT] |
Definition at line 111 of file gui_main.c.
Definition at line 89 of file gui_main.c.
|
extern |
Definition at line 104 of file mapctrl.c.
Referenced by button_down_on_map(), button_up_on_map(), create_line_at_mouse_pos(), map_event_handler(), and map_event_handler().
|
static |
Definition at line 125 of file gui_main.c.
Definition at line 137 of file gui_main.c.
|
static |
Definition at line 117 of file gui_main.c.
Definition at line 94 of file gui_main.c.
Definition at line 95 of file gui_main.c.
Definition at line 136 of file gui_main.c.
Definition at line 122 of file gui_main.c.
bool is_unit_move_blocked |
Definition at line 103 of file gui_main.c.
Referenced by exit_unit_select_callback(), map_event_handler(), map_event_handler(), popdown_advanced_terrain_dialog(), popdown_bribe_dialog(), popdown_connect_dialog(), popdown_diplomat_dialog(), popdown_incite_dialog(), popdown_pillage_dialog(), popup_action_selection(), popup_advanced_terrain_dialog(), popup_bribe_dialog(), popup_incite_dialog(), popup_pillage_dialog(), popup_sabotage_dialog(), unit_select_dialog_popdown(), and unit_select_dialog_popup().
bool LALT |
Definition at line 108 of file gui_main.c.
bool LCTRL |
Definition at line 106 of file gui_main.c.
bool LSHIFT |
Definition at line 104 of file gui_main.c.
Definition at line 138 of file gui_main.c.
int MOVE_STEP_X = DEFAULT_MOVE_STEP |
Definition at line 100 of file gui_main.c.
int MOVE_STEP_Y = DEFAULT_MOVE_STEP |
Definition at line 101 of file gui_main.c.
|
static |
Definition at line 120 of file gui_main.c.
Definition at line 134 of file gui_main.c.
bool RCTRL |
Definition at line 107 of file gui_main.c.
bool RSHIFT |
Definition at line 105 of file gui_main.c.
|
static |
Definition at line 123 of file gui_main.c.
Uint32 sdl3_client_flags = 0 |
Definition at line 97 of file gui_main.c.
Referenced by close_game_page(), create_units_order_widgets(), delete_units_order_widgets(), disable_focus_animation(), economy_report_dialog_popup(), enable_focus_animation(), horiz_taxrate_callback(), is_focus_anim_enabled(), minimap_window_callback(), new_name_city_dlg_callback(), popdown_city_dialog(), popdown_minimap_window(), popdown_unitinfo_window(), popup_minimap_window(), popup_players_dialog(), popup_unitinfo_window(), real_city_dialog_popup(), real_menus_update(), real_players_dialog_update(), redraw_city_dialog(), redraw_unit_info_label(), refresh_city_names(), refresh_overview(), set_new_unitinfo_window_pos(), show_game_page(), toggle_block_callback(), toggle_draw_alliance_status_callback(), toggle_draw_ceasefire_status_callback(), toggle_draw_neutral_status_callback(), toggle_draw_peace_status_callback(), toggle_draw_war_status_callback(), toggle_map_window_callback(), toggle_unit_info_window_callback(), ui_init(), and ui_main().
int user_event_type |
Definition at line 144 of file gui_main.c.
Uint32 widget_info_counter = 0 |
Definition at line 99 of file gui_main.c.
Referenced by unselect_widget_action(), widget_pressed_action(), and widget_selected_action().