Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
gui_main.h File Reference
#include <SDL3/SDL.h>
#include "gui_main_g.h"

Go to the source code of this file.

Data Structures

struct  finger_behavior
 
struct  mouse_button_behavior
 

Macros

#define GUI_SDL_OPTION(optname)   gui_options.gui_sdl3_##optname
 
#define GUI_SDL_OPTION_STR(optname)   "gui_sdl3_" #optname
 
#define CF_NONE   0
 
#define CF_ORDERS_WIDGETS_CREATED   (1<<0)
 
#define CF_MAP_UNIT_W_CREATED   (1<<1)
 
#define CF_UNITINFO_SHOWN   (1<<2)
 
#define CF_OVERVIEW_SHOWN   (1<<3)
 
#define CF_GAME_JUST_STARTED   (1<<6)
 
#define CF_FOCUS_ANIMATION   (1<<9)
 
#define CF_CHANGED_PROD   (1<<10)
 
#define CF_CHANGED_CITY_NAME   (1<<11)
 
#define CF_CITY_STATUS_SPECIAL   (1<<12)
 
#define CF_CHANGE_TAXRATE_LUX_BLOCK   (1<<13)
 
#define CF_CHANGE_TAXRATE_SCI_BLOCK   (1<<14)
 
#define CF_DRAW_CITY_GRID   (1<<17)
 
#define CF_DRAW_CITY_WORKER_GRID   (1<<18)
 
#define CF_DRAW_PLAYERS_WAR_STATUS   (1<<19)
 
#define CF_DRAW_PLAYERS_CEASEFIRE_STATUS   (1<<20)
 
#define CF_DRAW_PLAYERS_PEACE_STATUS   (1<<21)
 
#define CF_DRAW_PLAYERS_ALLIANCE_STATUS   (1<<22)
 
#define CF_DRAW_PLAYERS_NEUTRAL_STATUS   (1<<23)
 
#define MB_MEDIUM_HOLD_DELAY   500 /* Medium hold: 500ms */
 
#define MB_LONG_HOLD_DELAY   2000 /* Long hold: 2000ms */
 
#define PRESSED_EVENT(event)
 
#define DEFAULT_MOVE_STEP   5
 
#define adj_size(size)   (size)
 

Enumerations

enum  mouse_button_hold_state { MB_HOLD_SHORT , MB_HOLD_MEDIUM , MB_HOLD_LONG }
 

Functions

void force_exit_from_event_loop (void)
 
void enable_focus_animation (void)
 
void disable_focus_animation (void)
 
bool FilterMouseMotionEvents (void *data, SDL_Event *event)
 
Uint16 gui_event_loop (void *data, void(*loop_action)(void *data), Uint16(*key_down_handler)(SDL_KeyboardEvent *key, void *data), Uint16(*key_up_handler)(SDL_KeyboardEvent *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))
 
unsigned default_font_size (struct theme *act_theme)
 
void update_font_from_theme (int theme_font_size)
 
bool flush_event (void)
 

Variables

struct widgetselected_widget
 
Uint32 sdl3_client_flags
 
bool LSHIFT
 
bool RSHIFT
 
bool LCTRL
 
bool RCTRL
 
bool LALT
 
intclient_font_sizes []
 
int MOVE_STEP_X
 
int MOVE_STEP_Y
 

Macro Definition Documentation

◆ adj_size

#define adj_size (   size)    (size)

Definition at line 136 of file gui_main.h.

◆ CF_CHANGE_TAXRATE_LUX_BLOCK

#define CF_CHANGE_TAXRATE_LUX_BLOCK   (1<<13)

Definition at line 51 of file gui_main.h.

◆ CF_CHANGE_TAXRATE_SCI_BLOCK

#define CF_CHANGE_TAXRATE_SCI_BLOCK   (1<<14)

Definition at line 52 of file gui_main.h.

◆ CF_CHANGED_CITY_NAME

#define CF_CHANGED_CITY_NAME   (1<<11)

Definition at line 49 of file gui_main.h.

◆ CF_CHANGED_PROD

#define CF_CHANGED_PROD   (1<<10)

Definition at line 48 of file gui_main.h.

◆ CF_CITY_STATUS_SPECIAL

#define CF_CITY_STATUS_SPECIAL   (1<<12)

Definition at line 50 of file gui_main.h.

◆ CF_DRAW_CITY_GRID

#define CF_DRAW_CITY_GRID   (1<<17)

Definition at line 53 of file gui_main.h.

◆ CF_DRAW_CITY_WORKER_GRID

#define CF_DRAW_CITY_WORKER_GRID   (1<<18)

Definition at line 54 of file gui_main.h.

◆ CF_DRAW_PLAYERS_ALLIANCE_STATUS

#define CF_DRAW_PLAYERS_ALLIANCE_STATUS   (1<<22)

Definition at line 58 of file gui_main.h.

◆ CF_DRAW_PLAYERS_CEASEFIRE_STATUS

#define CF_DRAW_PLAYERS_CEASEFIRE_STATUS   (1<<20)

Definition at line 56 of file gui_main.h.

◆ CF_DRAW_PLAYERS_NEUTRAL_STATUS

#define CF_DRAW_PLAYERS_NEUTRAL_STATUS   (1<<23)

Definition at line 59 of file gui_main.h.

◆ CF_DRAW_PLAYERS_PEACE_STATUS

#define CF_DRAW_PLAYERS_PEACE_STATUS   (1<<21)

Definition at line 57 of file gui_main.h.

◆ CF_DRAW_PLAYERS_WAR_STATUS

#define CF_DRAW_PLAYERS_WAR_STATUS   (1<<19)

Definition at line 55 of file gui_main.h.

◆ CF_FOCUS_ANIMATION

#define CF_FOCUS_ANIMATION   (1<<9)

Definition at line 47 of file gui_main.h.

◆ CF_GAME_JUST_STARTED

#define CF_GAME_JUST_STARTED   (1<<6)

Definition at line 45 of file gui_main.h.

◆ CF_MAP_UNIT_W_CREATED

#define CF_MAP_UNIT_W_CREATED   (1<<1)

Definition at line 42 of file gui_main.h.

◆ CF_NONE

#define CF_NONE   0

Definition at line 40 of file gui_main.h.

◆ CF_ORDERS_WIDGETS_CREATED

#define CF_ORDERS_WIDGETS_CREATED   (1<<0)

Definition at line 41 of file gui_main.h.

◆ CF_OVERVIEW_SHOWN

#define CF_OVERVIEW_SHOWN   (1<<3)

Definition at line 44 of file gui_main.h.

◆ CF_UNITINFO_SHOWN

#define CF_UNITINFO_SHOWN   (1<<2)

Definition at line 43 of file gui_main.h.

◆ DEFAULT_MOVE_STEP

#define DEFAULT_MOVE_STEP   5

Definition at line 108 of file gui_main.h.

◆ GUI_SDL_OPTION

#define GUI_SDL_OPTION (   optname)    gui_options.gui_sdl3_##optname

Definition at line 33 of file gui_main.h.

◆ GUI_SDL_OPTION_STR

#define GUI_SDL_OPTION_STR (   optname)    "gui_sdl3_" #optname

Definition at line 34 of file gui_main.h.

◆ MB_LONG_HOLD_DELAY

#define MB_LONG_HOLD_DELAY   2000 /* Long hold: 2000ms */

Definition at line 63 of file gui_main.h.

◆ MB_MEDIUM_HOLD_DELAY

#define MB_MEDIUM_HOLD_DELAY   500 /* Medium hold: 500ms */

Definition at line 62 of file gui_main.h.

◆ PRESSED_EVENT

#define PRESSED_EVENT (   event)
Value:
( \
&& (event).button.button == SDL_BUTTON_LEFT))
char * incite_cost
Definition comments.c:75
enum event_type event
Definition events.c:81
GType type
Definition repodlgs.c:1313

Definition at line 66 of file gui_main.h.

Enumeration Type Documentation

◆ mouse_button_hold_state

Enumerator
MB_HOLD_SHORT 
MB_HOLD_MEDIUM 
MB_HOLD_LONG 

Definition at line 72 of file gui_main.h.

Function Documentation

◆ default_font_size()

unsigned default_font_size ( struct theme act_theme)

Return default font size, from any source.

Definition at line 1313 of file gui_main.c.

Referenced by gui_load_theme().

◆ disable_focus_animation()

void disable_focus_animation ( void  )

Don't show Focused Unit Animation.

Definition at line 1204 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().

◆ enable_focus_animation()

void enable_focus_animation ( void  )

Show Focused Unit Animation.

Definition at line 1195 of file gui_main.c.

Referenced by add_net_input(), and update_unit_info_label().

◆ FilterMouseMotionEvents()

bool FilterMouseMotionEvents ( void data,
SDL_Event event 
)

Filter out mouse motion events for too small movement to react to. This function may run in a separate event thread.

Definition at line 581 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().

◆ flush_event()

bool flush_event ( void  )

Queue a flush event to be handled later by SDL.

Definition at line 1340 of file gui_main.c.

Referenced by queue_flush().

◆ force_exit_from_event_loop()

void force_exit_from_event_loop ( void  )

Instruct event loop to exit.

Definition at line 565 of file gui_main.c.

Referenced by exit_callback(), popdown_conn_list_dialog(), and races_toggles_set_sensitive().

◆ gui_event_loop()

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.

◆ update_font_from_theme()

void update_font_from_theme ( int  theme_font_size)

Update font sizes based on theme.

Definition at line 1323 of file gui_main.c.

Referenced by gui_load_theme().

Variable Documentation

◆ client_font_sizes

int* client_font_sizes[]
extern

Definition at line 115 of file gui_main.c.

Referenced by canvas_put_text(), get_text_size(), and update_font_from_theme().

◆ LALT

bool LALT
extern

Definition at line 112 of file gui_main.c.

Referenced by button_up_on_map(), gui_event_loop(), and gui_event_loop().

◆ LCTRL

bool LCTRL
extern

◆ LSHIFT

bool LSHIFT
extern

◆ MOVE_STEP_X

int MOVE_STEP_X
extern

◆ MOVE_STEP_Y

int MOVE_STEP_Y

Definition at line 109 of file gui_main.h.

◆ RCTRL

bool RCTRL
extern

Definition at line 111 of file gui_main.c.

Referenced by gui_event_loop(), gui_event_loop(), map_event_handler(), and map_event_handler().

◆ RSHIFT

bool RSHIFT
extern

◆ sdl3_client_flags

Uint32 sdl3_client_flags
extern

◆ selected_widget

struct widget* selected_widget
extern