Freeciv-3.3
|
#include "fc_prehdrs.h"
#include <errno.h>
#include <SDL2/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 "gui_properties.h"
#include "spaceshipdlg_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 "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 92 of file gui_main.c.
#define MIGRATE_OPTION | ( | opt | ) | gui_options.gui_sdl2_##opt = gui_options.gui_sdl_##opt; |
#define SCROLL_MAP_AREA 1 |
Definition at line 434 of file gui_main.c.
Definition at line 167 of file gui_main.c.
Definition at line 168 of file gui_main.c.
#define UNITS_TIMER_INTERVAL 128 /* milliseconds */ |
Definition at line 91 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 151 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 1244 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 1219 of file gui_main.c.
Check if coordinate is in scroll area.
Definition at line 519 of file gui_main.c.
Referenced by main_mouse_button_down_handler(), and main_mouse_motion_handler().
Remove double messages caused by message configured to both MW_MESSAGES and MW_OUTPUT.
Definition at line 990 of file gui_main.c.
Referenced by ui_main().
Return default font size, from any source.
Definition at line 1319 of file gui_main.c.
Referenced by gui_load_theme().
Don't show Focused Unit Animation.
Definition at line 1210 of file gui_main.c.
Referenced by end_turn_callback(), main_key_down_handler(), main_key_down_handler(), remove_net_input(), and update_unit_info_label().
Stub for editor function
Definition at line 1283 of file gui_main.c.
Stub for editor function
Definition at line 1289 of file gui_main.c.
Stub for editor function
Definition at line 1277 of file gui_main.c.
Stub for editor function
Definition at line 1271 of file gui_main.c.
Stub for editor function
Definition at line 1265 of file gui_main.c.
Stub for editor function
Definition at line 1259 of file gui_main.c.
Show Focused Unit Animation.
Definition at line 1201 of file gui_main.c.
Referenced by add_net_input(), and update_unit_info_label().
Filter out mouse motion events for too small movement to react to. This function may run in a separate event thread.
Definition at line 582 of file gui_main.c.
Referenced by factor_horiz_cma_callback(), horiz_taxrate_callback(), min_horiz_cma_callback(), move_window(), and vertic_scroll_widget_list().
Queue a flush event to be handled later by SDL.
Definition at line 1346 of file gui_main.c.
Referenced by queue_flush().
Instruct event loop to exit.
Definition at line 566 of file gui_main.c.
Referenced by exit_callback(), popdown_conn_list_dialog(), and races_toggles_set_sensitive().
Change fullscreen status after option changed.
Definition at line 941 of file gui_main.c.
Referenced by options_extra_init().
Return our GUI type
Definition at line 1184 of file gui_main.c.
Uint16 gui_event_loop | ( | void * | data, |
void(*)(void *data) | loop_action, | ||
Uint16(*)(SDL_Keysym key, void *data) | key_down_handler, | ||
Uint16(*)(SDL_Keysym 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 | ||
) |
SDL2-client main loop.
Definition at line 603 of file gui_main.c.
Referenced by down_scroll_widget_list(), edit_field(), factor_horiz_cma_callback(), horiz_taxrate_callback(), min_horiz_cma_callback(), move_window(), ui_main(), up_scroll_widget_list(), and vertic_scroll_widget_list().
Updates a gui font style.
Definition at line 1295 of file gui_main.c.
Insert build information to help
Definition at line 1338 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 1007 of file gui_main.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Main mouse button release handler.
Definition at line 414 of file gui_main.c.
Referenced by ui_main().
|
static |
Main handler for mouse movement handling.
Definition at line 440 of file gui_main.c.
Referenced by ui_main().
Migrate sdl2 client specific options from sdl client options.
Definition at line 1015 of file gui_main.c.
Referenced by ui_main().
Extra initializers for client options. Here we make set the callback for the specific gui-sdl2 options.
Definition at line 969 of file gui_main.c.
Search for gui-specific command-line options.
Definition at line 196 of file gui_main.c.
Print extra usage information, including one line help on each option, to stderr.
Definition at line 179 of file gui_main.c.
Really resize the main window.
Definition at line 898 of file gui_main.c.
Referenced by fullscreen_callback(), and resize_window_callback().
Stop waiting for any server network data. See add_net_input().
Definition at line 1230 of file gui_main.c.
Resize the main window after option changed.
Definition at line 933 of file gui_main.c.
Referenced by options_extra_init().
Define properties of this gui.
Definition at line 1354 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 1193 of file gui_main.c.
Do any necessary UI-specific cleanup
Definition at line 1177 of file gui_main.c.
Do any necessary pre-initialization of the UI, if necessary.
Definition at line 880 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 1036 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 491 of file gui_main.c.
Referenced by gui_event_loop(), and gui_event_loop().
Update font sizes based on theme.
Definition at line 1329 of file gui_main.c.
Referenced by gui_load_theme().
|
static |
Definition at line 134 of file gui_main.c.
Referenced by ui_main().
|
static |
Definition at line 136 of file gui_main.c.
Referenced by ui_main().
|
static |
Definition at line 135 of file gui_main.c.
Referenced by ui_main().
|
static |
Definition at line 137 of file gui_main.c.
Referenced by ui_main().
|
static |
Definition at line 133 of file gui_main.c.
Referenced by ui_main().
Definition at line 140 of file gui_main.c.
Referenced by enable_focus_animation(), gui_event_loop(), gui_event_loop(), and ui_main().
Definition at line 126 of file gui_main.c.
Referenced by add_net_input(), gui_event_loop(), and gui_event_loop().
|
static |
Definition at line 131 of file gui_main.c.
Referenced by button_down_on_map(), button_up_on_map(), main_mouse_button_down_handler(), main_mouse_button_up_handler(), main_mouse_motion_handler(), ui_init(), ui_main(), and update_button_hold_state().
Definition at line 171 of file gui_main.c.
Referenced by add_idle_callback(), gui_event_loop(), gui_event_loop(), and ui_main().
|
static |
Definition at line 114 of file gui_main.c.
|
static |
Definition at line 115 of file gui_main.c.
int* client_font_sizes[FONT_COUNT] |
Definition at line 116 of file gui_main.c.
Referenced by canvas_put_text(), get_text_size(), and update_font_from_theme().
Definition at line 94 of file gui_main.c.
|
extern |
Definition at line 104 of file mapctrl.c.
Referenced by main_mouse_motion_handler(), and remove_net_input().
|
static |
Definition at line 130 of file gui_main.c.
Definition at line 142 of file gui_main.c.
Referenced by flush_event(), and ui_main().
|
static |
Definition at line 122 of file gui_main.c.
Referenced by default_font_size(), parse_options(), and ui_main().
Definition at line 99 of file gui_main.c.
Definition at line 100 of file gui_main.c.
Definition at line 141 of file gui_main.c.
Referenced by gui_event_loop(), gui_event_loop(), and ui_main().
Definition at line 127 of file gui_main.c.
Referenced by check_scroll_area(), gui_event_loop(), gui_event_loop(), main_finger_up_handler(), and main_mouse_button_up_handler().
bool is_unit_move_blocked |
Definition at line 108 of file gui_main.c.
Referenced by ui_main().
bool LALT |
Definition at line 113 of file gui_main.c.
Referenced by button_up_on_map(), gui_event_loop(), and gui_event_loop().
bool LCTRL |
Definition at line 111 of file gui_main.c.
Referenced by button_up_on_map(), gui_event_loop(), gui_event_loop(), map_event_handler(), and map_event_handler().
bool LSHIFT |
Definition at line 109 of file gui_main.c.
Referenced by button_up_on_map(), gui_event_loop(), gui_event_loop(), main_key_down_handler(), main_key_down_handler(), map_event_handler(), and map_event_handler().
Definition at line 143 of file gui_main.c.
Referenced by gui_event_loop(), gui_event_loop(), and ui_main().
int MOVE_STEP_X = DEFAULT_MOVE_STEP |
Definition at line 105 of file gui_main.c.
Referenced by factor_horiz_cma_callback(), FilterMouseMotionEvents(), min_horiz_cma_callback(), and vertic_scroll_widget_list().
int MOVE_STEP_Y = DEFAULT_MOVE_STEP |
Definition at line 106 of file gui_main.c.
Referenced by factor_horiz_cma_callback(), FilterMouseMotionEvents(), horiz_taxrate_callback(), min_horiz_cma_callback(), and vertic_scroll_widget_list().
|
static |
Definition at line 125 of file gui_main.c.
Referenced by add_net_input(), gui_event_loop(), gui_event_loop(), and remove_net_input().
Definition at line 139 of file gui_main.c.
Referenced by gui_event_loop(), gui_event_loop(), and ui_main().
bool RCTRL |
Definition at line 112 of file gui_main.c.
Referenced by gui_event_loop(), gui_event_loop(), map_event_handler(), and map_event_handler().
bool RSHIFT |
Definition at line 110 of file gui_main.c.
Referenced by gui_event_loop(), gui_event_loop(), main_key_down_handler(), main_key_down_handler(), map_event_handler(), and map_event_handler().
|
static |
Definition at line 128 of file gui_main.c.
Referenced by check_scroll_area(), gui_event_loop(), and gui_event_loop().
Uint32 sdl2_client_flags = 0 |
Definition at line 102 of file gui_main.c.
Referenced by close_game_page(), create_surfaces(), 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(), parse_options(), 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 149 of file gui_main.c.
Referenced by force_exit_from_event_loop(), gui_event_loop(), gui_event_loop(), and ui_main().
Uint32 widget_info_counter = 0 |
Definition at line 104 of file gui_main.c.
Referenced by gui_event_loop(), and gui_event_loop().