Freeciv-3.3: /fast/freeciv/nightly/main/client/gui-sdl3/gui_main.h File Reference

Freeciv-3.3

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 | 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)(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 widget * | selected_widget
Uint32 | sdl3_client_flags
bool | LSHIFT
bool | RSHIFT
bool | LCTRL
bool | RCTRL
bool | LALT
int * | client_font_sizes []
int | MOVE_STEP_X
int | MOVE_STEP_Y

## Macro Definition Documentation

## ◆ adj_size

#define adj_size | ( |  | size | ) | (size)

Definition at line 137 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_SWRENDERER

#define CF_SWRENDERER (1<<24)

Definition at line 60 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 109 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 64 of file gui_main.h.

## ◆ MB_MEDIUM_HOLD_DELAY

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

Definition at line 63 of file gui_main.h.

## ◆ PRESSED_EVENT

#define PRESSED_EVENT | ( |  | event | ) |

Value:
( \
(event).type == SDL_EVENT_KEY_DOWN \
|| (event).type == SDL_EVENT_FINGER_DOWN \
|| ((event).type == SDL_EVENT_MOUSE_BUTTON_DOWN \
&& (event).button.button == SDL_BUTTON_LEFT))
incite_cost
char * incite_cost
Definition comments.c:74
event
enum event_type event
Definition events.c:81
type
GType type
Definition repodlgs.c:1313

Definition at line 67 of file gui_main.h.

## Enumeration Type Documentation

## ◆ mouse_button_hold_state

enum mouse_button_hold_state

Enumerator
MB_HOLD_SHORT |
MB_HOLD_MEDIUM |
MB_HOLD_LONG |

Definition at line 73 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 1310 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 1201 of file gui_main.c.

Referenced by end_turn_callback(), 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 1192 of file gui_main.c.

Referenced by add_net_input(), and update_unit_info_label().

## ◆ 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 577 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 1337 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 561 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_Keysym key, void *data) | key_down_handler,
|  | Uint16(*)(SDL_Keysym key, void *data) | key_up_handler,
|  | Uint16(*)(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.

SDL3-client main loop.

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

## ◆ update_font_from_theme()

void update_font_from_theme | ( | int | theme_font_size | ) |

Update font sizes based on theme.

Definition at line 1320 of file gui_main.c.

Referenced by gui_load_theme().

## Variable Documentation

## ◆ client_font_sizes

int* client_font_sizes[]

extern

Definition at line 111 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 108 of file gui_main.c.

Referenced by button_up_on_map(), and gui_event_loop().

## ◆ LCTRL

bool LCTRL

extern

Definition at line 106 of file gui_main.c.

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

## ◆ LSHIFT

bool LSHIFT

extern

Definition at line 104 of file gui_main.c.

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

## ◆ MOVE_STEP_X

int MOVE_STEP_X

extern

Definition at line 100 of file gui_main.c.

Referenced by factor_horiz_cma_callback(), FilterMouseMotionEvents(), min_horiz_cma_callback(), and vertic_scroll_widget_list().

## ◆ MOVE_STEP_Y

int MOVE_STEP_Y

Definition at line 110 of file gui_main.h.

## ◆ RCTRL

bool RCTRL

extern

Definition at line 107 of file gui_main.c.

Referenced by gui_event_loop(), and map_event_handler().

## ◆ RSHIFT

bool RSHIFT

extern

Definition at line 105 of file gui_main.c.

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

## ◆ sdl3_client_flags

Uint32 sdl3_client_flags

extern

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

## ◆ selected_widget

struct widget* selected_widget

extern

Definition at line 48 of file widget.c.

Referenced by del_widget_pointer_from_gui_list(), redraw_widget_info_label(), unselect_widget_action(), and widget_selected_action().