Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
gui_main.h File Reference
#include <SDL2/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_sdl2_##optname
 
#define GUI_SDL_OPTION_STR(optname)   "gui_sdl2_" #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 CF_SWRENDERER   (1<<24)
 
#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)
 
int FilterMouseMotionEvents (void *data, SDL_Event *event)
 
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))
 
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 sdl2_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 141 of file gui_main.h.

◆ CF_CHANGE_TAXRATE_LUX_BLOCK

#define CF_CHANGE_TAXRATE_LUX_BLOCK   (1<<13)

Definition at line 55 of file gui_main.h.

◆ CF_CHANGE_TAXRATE_SCI_BLOCK

#define CF_CHANGE_TAXRATE_SCI_BLOCK   (1<<14)

Definition at line 56 of file gui_main.h.

◆ CF_CHANGED_CITY_NAME

#define CF_CHANGED_CITY_NAME   (1<<11)

Definition at line 53 of file gui_main.h.

◆ CF_CHANGED_PROD

#define CF_CHANGED_PROD   (1<<10)

Definition at line 52 of file gui_main.h.

◆ CF_CITY_STATUS_SPECIAL

#define CF_CITY_STATUS_SPECIAL   (1<<12)

Definition at line 54 of file gui_main.h.

◆ CF_DRAW_CITY_GRID

#define CF_DRAW_CITY_GRID   (1<<17)

Definition at line 57 of file gui_main.h.

◆ CF_DRAW_CITY_WORKER_GRID

#define CF_DRAW_CITY_WORKER_GRID   (1<<18)

Definition at line 58 of file gui_main.h.

◆ CF_DRAW_PLAYERS_ALLIANCE_STATUS

#define CF_DRAW_PLAYERS_ALLIANCE_STATUS   (1<<22)

Definition at line 62 of file gui_main.h.

◆ CF_DRAW_PLAYERS_CEASEFIRE_STATUS

#define CF_DRAW_PLAYERS_CEASEFIRE_STATUS   (1<<20)

Definition at line 60 of file gui_main.h.

◆ CF_DRAW_PLAYERS_NEUTRAL_STATUS

#define CF_DRAW_PLAYERS_NEUTRAL_STATUS   (1<<23)

Definition at line 63 of file gui_main.h.

◆ CF_DRAW_PLAYERS_PEACE_STATUS

#define CF_DRAW_PLAYERS_PEACE_STATUS   (1<<21)

Definition at line 61 of file gui_main.h.

◆ CF_DRAW_PLAYERS_WAR_STATUS

#define CF_DRAW_PLAYERS_WAR_STATUS   (1<<19)

Definition at line 59 of file gui_main.h.

◆ CF_FOCUS_ANIMATION

#define CF_FOCUS_ANIMATION   (1<<9)

Definition at line 51 of file gui_main.h.

◆ CF_GAME_JUST_STARTED

#define CF_GAME_JUST_STARTED   (1<<6)

Definition at line 49 of file gui_main.h.

◆ CF_MAP_UNIT_W_CREATED

#define CF_MAP_UNIT_W_CREATED   (1<<1)

Definition at line 46 of file gui_main.h.

◆ CF_NONE

#define CF_NONE   0

Definition at line 44 of file gui_main.h.

◆ CF_ORDERS_WIDGETS_CREATED

#define CF_ORDERS_WIDGETS_CREATED   (1<<0)

Definition at line 45 of file gui_main.h.

◆ CF_OVERVIEW_SHOWN

#define CF_OVERVIEW_SHOWN   (1<<3)

Definition at line 48 of file gui_main.h.

◆ CF_SWRENDERER

#define CF_SWRENDERER   (1<<24)

Definition at line 64 of file gui_main.h.

◆ CF_UNITINFO_SHOWN

#define CF_UNITINFO_SHOWN   (1<<2)

Definition at line 47 of file gui_main.h.

◆ DEFAULT_MOVE_STEP

#define DEFAULT_MOVE_STEP   5

Definition at line 113 of file gui_main.h.

◆ GUI_SDL_OPTION

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

Definition at line 37 of file gui_main.h.

◆ GUI_SDL_OPTION_STR

#define GUI_SDL_OPTION_STR (   optname)    "gui_sdl2_" #optname

Definition at line 38 of file gui_main.h.

◆ MB_LONG_HOLD_DELAY

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

Definition at line 68 of file gui_main.h.

◆ MB_MEDIUM_HOLD_DELAY

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

Definition at line 67 of file gui_main.h.

◆ PRESSED_EVENT

#define PRESSED_EVENT (   event)
Value:
( \
|| (event).type == SDL_FINGERDOWN \
&& (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 71 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 77 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.

◆ disable_focus_animation()

void disable_focus_animation ( void  )

Don't show Focused Unit Animation.

Definition at line 1204 of file gui_main.c.

◆ enable_focus_animation()

void enable_focus_animation ( void  )

Show Focused Unit Animation.

Definition at line 1195 of file gui_main.c.

◆ FilterMouseMotionEvents()

int 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.

◆ 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.

◆ 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.

◆ gui_event_loop()

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 
)

◆ 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.

Variable Documentation

◆ client_font_sizes

int* client_font_sizes[]
extern

Definition at line 115 of file gui_main.c.

◆ LALT

bool LALT
extern

Definition at line 112 of file gui_main.c.

◆ LCTRL

bool LCTRL
extern

Definition at line 110 of file gui_main.c.

◆ LSHIFT

bool LSHIFT
extern

Definition at line 108 of file gui_main.c.

◆ MOVE_STEP_X

int MOVE_STEP_X
extern

Definition at line 104 of file gui_main.c.

◆ MOVE_STEP_Y

int MOVE_STEP_Y

Definition at line 114 of file gui_main.h.

◆ RCTRL

bool RCTRL
extern

Definition at line 111 of file gui_main.c.

◆ RSHIFT

bool RSHIFT
extern

Definition at line 109 of file gui_main.c.

◆ sdl2_client_flags

Uint32 sdl2_client_flags
extern

◆ selected_widget

struct widget* selected_widget
extern