Freeciv-3.3
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
widget.h File Reference
#include "fc_types.h"
#include "gui_main.h"
#include "gui_string.h"
#include "widget_button.h"
#include "widget_checkbox.h"
#include "widget_combo.h"
#include "widget_edit.h"
#include "widget_icon.h"
#include "widget_label.h"
#include "widget_scrollbar.h"
#include "widget_window.h"

Go to the source code of this file.

Data Structures

struct  container
 
struct  widget
 
struct  small_dialog
 
struct  advanced_dialog
 

Macros

#define WINDOW_TITLE_HEIGHT   20
 
#define MAX_ID   0xFFFF
 
#define set_action(id, action_callback)    get_widget_pointer_from_main_list(id)->action = action_callback
 
#define set_key(id, keyb)    get_widget_pointer_from_main_list(id)->key = keyb
 
#define set_mod(id, mod)    get_widget_pointer_from_main_list(id)->mod = mod
 
#define enable(id)
 
#define disable(id)
 
#define show(id)    clear_wflag( get_widget_pointer_from_main_list(id), WF_HIDDEN)
 
#define hide(id)    set_wflag(get_widget_pointer_from_main_list(id), WF_HIDDEN)
 
#define draw_widget_info_label()   redraw_widget_info_label(NULL);
 
#define FREEWIDGET(pwidget)
 
#define draw_frame_inside_widget_on_surface(pwidget, pdest)
 
#define draw_frame_inside_widget(pwidget)    draw_frame_inside_widget_on_surface(pwidget , pwidget->dst->surface)
 
#define draw_frame_around_widget_on_surface(pwidget, pdest)
 
#define draw_frame_around_widget(pwidget)    draw_frame_around_widget_on_surface(pwidget, pwidget->dst->surface)
 
#define del_widget_from_gui_list(__gui)
 
#define del_ID_from_gui_list(id)
 
#define move_ID_to_front_of_gui_list(id)
 
#define del_group(begin_group_widget_list, end_group_widget_list)
 
#define enable_group(begin_group_widget_list, end_group_widget_list)
 
#define disable_group(begin_group_widget_list, end_group_widget_list)
 

Enumerations

enum  widget_type {
  WT_BUTTON = 4 , WT_I_BUTTON = 8 , WT_TI_BUTTON = 12 , WT_EDIT = 16 ,
  WT_ICON = 20 , WT_VSCROLLBAR = 24 , WT_HSCROLLBAR = 28 , WT_WINDOW = 32 ,
  WT_T_LABEL = 36 , WT_I_LABEL = 40 , WT_TI_LABEL = 44 , WT_CHECKBOX = 48 ,
  WT_TCHECKBOX = 52 , WT_ICON2 = 56 , WT_T2_LABEL = 60 , WT_COMBO = 64
}
 
enum  widget_flag {
  WF_HIDDEN = (1<<10) , WF_FREE_GFX = (1<<11) , WF_FREE_THEME = (1<<12) , WF_FREE_THEME2 = (1<<13) ,
  WF_FREE_STRING = (1<<14) , WF_FREE_DATA = (1<<15) , WF_FREE_PRIVATE_DATA = (1<<16) , WF_ICON_ABOVE_TEXT = (1<<17) ,
  WF_ICON_UNDER_TEXT = (1<<18) , WF_ICON_CENTER = (1<<19) , WF_ICON_CENTER_RIGHT = (1<<20) , WF_RESTORE_BACKGROUND = (1<<21) ,
  WF_DRAW_FRAME_AROUND_WIDGET = (1<<22) , WF_DRAW_TEXT_LABEL_WITH_SPACE = (1<<23) , WF_WIDGET_HAS_INFO_LABEL = (1<<24) , WF_SELECT_WITHOUT_BAR = (1<<25) ,
  WF_PASSWD_EDIT = (1<<26) , WF_EDIT_LOOP = (1<<27)
}
 
enum  widget_state { FC_WS_NORMAL = 0 , FC_WS_SELECTED = 1 , FC_WS_PRESSED = 2 , FC_WS_DISABLED = 3 }
 
enum  scan_direction { SCAN_FORWARD , SCAN_BACKWARD }
 

Functions

void add_to_gui_list (Uint16 id, struct widget *gui)
 
void del_widget_pointer_from_gui_list (struct widget *gui)
 
void widget_add_as_prev (struct widget *new_widget, struct widget *add_dock)
 
bool is_this_widget_first_on_list (struct widget *gui)
 
void move_widget_to_front_of_gui_list (struct widget *gui)
 
void del_gui_list (struct widget *gui_list)
 
void del_main_list (void)
 
struct widgetfind_next_widget_at_pos (struct widget *start_widget, int x, int y)
 
struct widgetfind_next_widget_for_key (struct widget *start_widget, SDL_Keysym key)
 
struct widgetget_widget_pointer_from_id (const struct widget *gui_list, Uint16 id, enum scan_direction direction)
 
struct widgetget_widget_pointer_from_main_list (Uint16 id)
 
void widget_selected_action (struct widget *pwidget)
 
Uint16 widget_pressed_action (struct widget *pwidget)
 
void unselect_widget_action (void)
 
void redraw_widget_info_label (SDL_Rect *area)
 
void set_wstate (struct widget *pwidget, enum widget_state state)
 
enum widget_state get_wstate (const struct widget *pwidget)
 
void set_wtype (struct widget *pwidget, enum widget_type type)
 
enum widget_type get_wtype (const struct widget *pwidget)
 
void set_wflag (struct widget *pwidget, enum widget_flag flag)
 
void clear_wflag (struct widget *pwidget, enum widget_flag flag)
 
enum widget_flag get_wflags (const struct widget *pwidget)
 
static void widget_set_area (struct widget *pwidget, SDL_Rect area)
 
static void widget_set_position (struct widget *pwidget, int x, int y)
 
static void widget_resize (struct widget *pwidget, int w, int h)
 
static int widget_redraw (struct widget *pwidget)
 
static void widget_draw_frame (struct widget *pwidget)
 
static void widget_mark_dirty (struct widget *pwidget)
 
static void widget_flush (struct widget *pwidget)
 
static void widget_undraw (struct widget *pwidget)
 
void widget_free (struct widget **gui)
 
void refresh_widget_background (struct widget *pwidget)
 
Uint16 redraw_group (const struct widget *begin_group_widget_list, const struct widget *end_group_widget_list, int add_to_update)
 
void undraw_group (struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
 
void set_new_group_start_pos (const struct widget *begin_group_widget_list, const struct widget *end_group_widget_list, Sint16 Xrel, Sint16 Yrel)
 
void del_group_of_widgets_from_gui_list (struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
 
void move_group_to_front_of_gui_list (struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
 
void set_group_state (struct widget *begin_group_widget_list, struct widget *end_group_widget_list, enum widget_state state)
 
void show_group (struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
 
void hide_group (struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
 
void group_set_area (struct widget *begin_group_widget_list, struct widget *end_group_widget_list, SDL_Rect area)
 
void popdown_window_group_dialog (struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
 
bool select_window_group_dialog (struct widget *begin_widget_list, struct widget *pwindow)
 
bool move_window_group_dialog (struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
 
void move_window_group (struct widget *begin_widget_list, struct widget *pwindow)
 
int setup_vertical_widgets_position (int step, Sint16 start_x, Sint16 start_y, Uint16 w, Uint16 h, struct widget *begin, struct widget *end)
 
bool add_widget_to_vertical_scroll_widget_list (struct advanced_dialog *dlg, struct widget *new_widget, struct widget *add_dock, bool dir, Sint16 start_x, Sint16 start_y) fc__attribute((nonnull(2)))
 
bool del_widget_from_vertical_scroll_widget_list (struct advanced_dialog *dlg, struct widget *pwidget) fc__attribute((nonnull(2)))
 
SDL_Surfacecreate_bcgnd_surf (SDL_Surface *ptheme, enum widget_state state, Uint16 width, Uint16 height)
 
void draw_frame (SDL_Surface *pdest, Sint16 start_x, Sint16 start_y, Uint16 w, Uint16 h)
 

Macro Definition Documentation

◆ del_group

Value:

Definition at line 389 of file widget.h.

◆ del_ID_from_gui_list

#define del_ID_from_gui_list (   id)
Value:
do { \
} while (FALSE)
struct widget * get_widget_pointer_from_main_list(Uint16 id)
Definition widget.c:578

Definition at line 378 of file widget.h.

◆ del_widget_from_gui_list

#define del_widget_from_gui_list (   __gui)
Value:

Definition at line 372 of file widget.h.

◆ disable

#define disable (   id)
Value:
do { \
} while (FALSE)
@ FC_WS_DISABLED
Definition widget.h:99

Definition at line 229 of file widget.h.

◆ disable_group

Value:
void set_group_state(struct widget *begin_group_widget_list, struct widget *end_group_widget_list, enum widget_state state)
Definition widget.c:898

Definition at line 401 of file widget.h.

◆ draw_frame_around_widget

#define draw_frame_around_widget (   pwidget)     draw_frame_around_widget_on_surface(pwidget, pwidget->dst->surface)

Definition at line 325 of file widget.h.

◆ draw_frame_around_widget_on_surface

#define draw_frame_around_widget_on_surface (   pwidget,
  pdest 
)
Value:
do { \
draw_frame(pdest, pwidget->size.x - ptheme->FR_Left->w, pwidget->size.y - ptheme->FR_Top->h, \
pwidget->size.w + ptheme->FR_Left->w + ptheme->FR_Right->w,\
pwidget->size.h + ptheme->FR_Top->h + ptheme->FR_Bottom->h); \
} while (FALSE);

Definition at line 318 of file widget.h.

◆ draw_frame_inside_widget

#define draw_frame_inside_widget (   pwidget)     draw_frame_inside_widget_on_surface(pwidget , pwidget->dst->surface)

Definition at line 315 of file widget.h.

◆ draw_frame_inside_widget_on_surface

#define draw_frame_inside_widget_on_surface (   pwidget,
  pdest 
)
Value:
do { \
draw_frame(pdest, pwidget->size.x, pwidget->size.y, pwidget->size.w, pwidget->size.h); \
} while (FALSE);

Definition at line 310 of file widget.h.

◆ draw_widget_info_label

#define draw_widget_info_label ( )    redraw_widget_info_label(NULL);

Definition at line 246 of file widget.h.

◆ enable

#define enable (   id)
Value:
do { \
} while (FALSE)
@ FC_WS_NORMAL
Definition widget.h:96

Definition at line 223 of file widget.h.

◆ enable_group

◆ FREEWIDGET

#define FREEWIDGET (   pwidget)
Value:
do { \
widget_free(&pwidget); \
} while (FALSE)

Definition at line 305 of file widget.h.

◆ hide

Definition at line 238 of file widget.h.

◆ MAX_ID

#define MAX_ID   0xFFFF

Definition at line 38 of file widget.h.

◆ move_ID_to_front_of_gui_list

#define move_ID_to_front_of_gui_list (   id)
Value:
void move_widget_to_front_of_gui_list(struct widget *gui)
Definition widget.c:667

Definition at line 385 of file widget.h.

◆ set_action

Definition at line 214 of file widget.h.

◆ set_key

#define set_key (   id,
  keyb 
)     get_widget_pointer_from_main_list(id)->key = keyb

Definition at line 217 of file widget.h.

◆ set_mod

#define set_mod (   id,
  mod 
)     get_widget_pointer_from_main_list(id)->mod = mod

Definition at line 220 of file widget.h.

◆ show

Definition at line 235 of file widget.h.

◆ WINDOW_TITLE_HEIGHT

#define WINDOW_TITLE_HEIGHT   20

Definition at line 35 of file widget.h.

Enumeration Type Documentation

◆ scan_direction

Enumerator
SCAN_FORWARD 
SCAN_BACKWARD 

Definition at line 190 of file widget.h.

◆ widget_flag

Enumerator
WF_HIDDEN 
WF_FREE_GFX 
WF_FREE_THEME 
WF_FREE_THEME2 
WF_FREE_STRING 
WF_FREE_DATA 
WF_FREE_PRIVATE_DATA 
WF_ICON_ABOVE_TEXT 
WF_ICON_UNDER_TEXT 
WF_ICON_CENTER 
WF_ICON_CENTER_RIGHT 
WF_RESTORE_BACKGROUND 
WF_DRAW_FRAME_AROUND_WIDGET 
WF_DRAW_TEXT_LABEL_WITH_SPACE 
WF_WIDGET_HAS_INFO_LABEL 
WF_SELECT_WITHOUT_BAR 
WF_PASSWD_EDIT 
WF_EDIT_LOOP 

Definition at line 67 of file widget.h.

◆ widget_state

Enumerator
FC_WS_NORMAL 
FC_WS_SELECTED 
FC_WS_PRESSED 
FC_WS_DISABLED 

Definition at line 95 of file widget.h.

◆ widget_type

Enumerator
WT_BUTTON 
WT_I_BUTTON 
WT_TI_BUTTON 
WT_EDIT 
WT_ICON 
WT_VSCROLLBAR 
WT_HSCROLLBAR 
WT_WINDOW 
WT_T_LABEL 
WT_I_LABEL 
WT_TI_LABEL 
WT_CHECKBOX 
WT_TCHECKBOX 
WT_ICON2 
WT_T2_LABEL 
WT_COMBO 

Definition at line 41 of file widget.h.

Function Documentation

◆ add_to_gui_list()

void add_to_gui_list ( Uint16  id,
struct widget gui 
)

Add Widget to Main widgets list ( begin_widget_list )

Definition at line 586 of file widget.c.

◆ add_widget_to_vertical_scroll_widget_list()

bool add_widget_to_vertical_scroll_widget_list ( struct advanced_dialog dlg,
struct widget new_widget,
struct widget add_dock,
bool  dir,
Sint16  start_x,
Sint16  start_y 
)

Add new widget to scrolled list and set draw position of all changed widgets. dir : TRUE - upper add => add_dock->next = new_widget. FALSE - down add => add_dock->prev = new_widget. start_x, start_y - positions of first seen widget (active_widget_list). dlg->scroll ( scrollbar ) must exist. It isn't full secure to multi widget list.

Definition at line 1146 of file widget_scrollbar.c.

Referenced by add_global_worklist(), add_new_worklist_callback(), add_target_to_worklist(), add_to_chat_list(), popup_load_game_dialog(), real_conn_list_dialog_update(), real_meswin_dialog_update(), set_global_worklist(), and update_clauses_list().

◆ clear_wflag()

void clear_wflag ( struct widget pwidget,
enum widget_flag  flag 
)

◆ create_bcgnd_surf()

SDL_Surface * create_bcgnd_surf ( SDL_Surface ptheme,
enum widget_state  state,
Uint16  width,
Uint16  height 
)

Create background image for buttons, iconbuttons and edit fields then return pointer to this image.

Graphic is taken from ptheme surface and blit to new created image.

Type of image depend of "state" parameter.

Definition at line 78 of file widget.c.

◆ del_group_of_widgets_from_gui_list()

void del_group_of_widgets_from_gui_list ( struct widget begin_group_widget_list,
struct widget end_group_widget_list 
)

Remove all widgets of the group from the list of displayed widgets. Does not free widget memory.

Definition at line 863 of file widget.c.

◆ del_gui_list()

void del_gui_list ( struct widget gui_list)

Delete Wideget's List ('gui_list').

Definition at line 699 of file widget.c.

◆ del_main_list()

void del_main_list ( void  )

Delete Main widgets list.

Definition at line 691 of file widget.c.

◆ del_widget_from_vertical_scroll_widget_list()

bool del_widget_from_vertical_scroll_widget_list ( struct advanced_dialog dlg,
struct widget pwidget 
)

Delete widget from scrolled list and set draw position of all changed widgets. Don't free dlg and dlg->scroll (if exist) It is full secure for multi widget list case.

Definition at line 1344 of file widget_scrollbar.c.

Referenced by edit_worklist_callback(), ok_sell_impr_callback(), real_units_report_dialog_update(), remove_clause_widget_from_list(), remove_item_from_worklist(), sell_imprvm_dlg_ok_callback(), and set_global_worklist().

◆ del_widget_pointer_from_gui_list()

void del_widget_pointer_from_gui_list ( struct widget gui)

Delete Widget from Main widgets list ( begin_widget_list )

NOTE: This function does not destroy Widget, only remove its pointer from list. To destroy this Widget totaly ( free mem... ) call macro: del_widget_from_gui_list( pwidget ). This macro call this function.

Definition at line 622 of file widget.c.

◆ draw_frame()

void draw_frame ( SDL_Surface pdest,
Sint16  start_x,
Sint16  start_y,
Uint16  w,
Uint16  h 
)

Draw Themed Frame.

Definition at line 1114 of file widget.c.

◆ find_next_widget_at_pos()

struct widget * find_next_widget_at_pos ( struct widget start_widget,
int  x,
int  y 
)

Find the next visible widget in the widget list starting with start_widget that is drawn at position (x, y). If start_widget is NULL, the search starts with the first entry of the main widget list.

Definition at line 222 of file widget.c.

◆ find_next_widget_for_key()

struct widget * find_next_widget_for_key ( struct widget start_widget,
SDL_Keysym  key 
)

Find the next enabled and visible widget in the widget list starting with start_widget that handles the given key. If start_widget is NULL, the search starts with the first entry of the main widget list. NOTE: This function ignores CapsLock and NumLock Keys.

Definition at line 252 of file widget.c.

Referenced by main_key_down_handler(), and main_key_down_handler().

◆ get_wflags()

enum widget_flag get_wflags ( const struct widget pwidget)

◆ get_widget_pointer_from_id()

struct widget * get_widget_pointer_from_id ( const struct widget gui_list,
Uint16  id,
enum scan_direction  direction 
)

Find ID in widgets list ('gui_list') and return pointer to this Widget.

Definition at line 552 of file widget.c.

◆ get_widget_pointer_from_main_list()

struct widget * get_widget_pointer_from_main_list ( Uint16  id)

Find ID in MAIN widgets list ( begin_widget_list ) and return pointer to this Widgets.

Definition at line 578 of file widget.c.

◆ get_wstate()

enum widget_state get_wstate ( const struct widget pwidget)

◆ get_wtype()

enum widget_type get_wtype ( const struct widget pwidget)

◆ group_set_area()

void group_set_area ( struct widget begin_group_widget_list,
struct widget end_group_widget_list,
SDL_Rect  area 
)

Set area for all widgets in the group.

Definition at line 953 of file widget.c.

◆ hide_group()

void hide_group ( struct widget begin_group_widget_list,
struct widget end_group_widget_list 
)

Hide all widgets in the group.

Definition at line 915 of file widget.c.

◆ is_this_widget_first_on_list()

bool is_this_widget_first_on_list ( struct widget gui)

Determinate if 'gui' is first on WidgetList

NOTE: This is used by My (move) GUI Window mechanism. Return TRUE if is first.

Definition at line 657 of file widget.c.

◆ move_group_to_front_of_gui_list()

void move_group_to_front_of_gui_list ( struct widget begin_group_widget_list,
struct widget end_group_widget_list 
)

Move group of Widget's pointers to begin of main list. Move group destination buffer to end of buffer array. NOTE: This is used by My GUI Window(group) mechanism.

Definition at line 812 of file widget.c.

◆ move_widget_to_front_of_gui_list()

void move_widget_to_front_of_gui_list ( struct widget gui)

Move pointer to Widget to list begin.

NOTE: This is used by My GUI Window mechanism.

Definition at line 667 of file widget.c.

◆ move_window_group()

void move_window_group ( struct widget begin_widget_list,
struct widget pwindow 
)

Standart Window Group Widget Callback (window) When Pressed check mouse move; if move then move window and redraw else if not on front then move window up to list and redraw.

Definition at line 1039 of file widget.c.

◆ move_window_group_dialog()

bool move_window_group_dialog ( struct widget begin_group_widget_list,
struct widget end_group_widget_list 
)

Move Window Group. The Trick is simple. We move only last member of group: the window , and then set new position to all members of group.

Function return 1 when group was moved.

Definition at line 1016 of file widget.c.

◆ popdown_window_group_dialog()

void popdown_window_group_dialog ( struct widget begin_group_widget_list,
struct widget end_group_widget_list 
)

Undraw and destroy Window Group The Trick is simple. We undraw only last member of group: the window.

Definition at line 983 of file widget.c.

◆ redraw_group()

Uint16 redraw_group ( const struct widget begin_group_widget_list,
const struct widget end_group_widget_list,
int  add_to_update 
)

Universal redraw Group of Widget function. Function is optimized to WindowGroup: start draw from 'end' and stop on 'begin', in theory 'end' is window widget;

Definition at line 720 of file widget.c.

◆ redraw_widget_info_label()

void redraw_widget_info_label ( SDL_Rect rect)

Draw or redraw info label to screen.

Definition at line 467 of file widget.c.

◆ refresh_widget_background()

void refresh_widget_background ( struct widget pwidget)

Redraw background of the widget.

Definition at line 1151 of file widget.c.

◆ select_window_group_dialog()

bool select_window_group_dialog ( struct widget begin_widget_list,
struct widget pwindow 
)

Select Window Group. (move widget group up the widgets list) Function return TRUE when group was selected.

Definition at line 998 of file widget.c.

◆ set_group_state()

void set_group_state ( struct widget begin_group_widget_list,
struct widget end_group_widget_list,
enum widget_state  state 
)

Set state for all the widgets in the group.

Definition at line 898 of file widget.c.

◆ set_new_group_start_pos()

void set_new_group_start_pos ( const struct widget begin_group_widget_list,
const struct widget end_group_widget_list,
Sint16  Xrel,
Sint16  Yrel 
)

Move all widgets in the group by the given amounts.

Definition at line 774 of file widget.c.

◆ set_wflag()

void set_wflag ( struct widget pwidget,
enum widget_flag  flag 
)

◆ set_wstate()

void set_wstate ( struct widget pwidget,
enum widget_state  state 
)

Set state of the widget.

Definition at line 36 of file widget_core.c.

Referenced by action_entry(), add_global_worklist(), add_new_worklist_callback(), add_target_to_production(), add_target_to_worklist(), change_sex_callback(), cities_action_callback(), combo_new(), combo_popup(), connect_callback(), convert_first_passwd_callback(), convert_second_passwd_callback(), create_checkbox(), create_city_options_widget_list(), create_edit(), create_horizontal(), create_horizontal_scrollbar(), create_icon2(), create_icon_button(), create_iconlabel(), create_present_supported_units_widget_list(), create_tech_info(), create_tech_tree(), create_themeicon(), create_themelabel(), create_themelabel2(), create_units_order_widgets(), create_vertical(), create_vertical_scrollbar(), create_window_skeleton(), disable_economy_dlg(), disable_minimap_widgets(), disable_minimap_window_buttons(), disable_options_button(), disable_unitinfo_window_buttons(), economy_report_dialog_popdown(), economy_report_dialog_popup(), edit_field(), enable_and_redraw_find_city_button(), enable_and_redraw_revolution_button(), enable_city_dlg_widgets(), enable_economy_dlg(), enable_minimap_widgets(), enable_options_button(), exit_economy_dialog_callback(), factor_horiz_cma_callback(), get_target_help_data(), horiz_taxrate_callback(), meswin_dialog_popup(), min_horiz_cma_callback(), nation_button_callback(), next_name_callback(), notify_goto_dialog_new(), notify_goto_dialog_update(), ok_buy_prod_city_dlg_callback(), option_dialog_new(), option_dialog_optset(), option_dialog_optset_category(), option_dialog_worklist(), option_widget_new(), option_widget_update(), optiondlg_callback(), players_action_callback(), popdown_load_game_dialog(), popup_action_selection(), popup_advanced_terrain_dialog(), popup_bribe_stack_dialog(), popup_bribe_unit_dialog(), popup_change_research_dialog(), popup_change_research_dialog_callback(), popup_change_research_goal_dialog(), popup_change_research_goal_dialog_callback(), popup_city_cma_dialog(), popup_conn_list_dialog(), popup_connection_dialog(), popup_diplomacy_dialog(), popup_diplomatic_objects(), popup_find_dialog(), popup_goto_airlift_dialog(), popup_government_dialog(), popup_hurry_production_dialog(), popup_image(), popup_impr_info(), popup_incite_dialog(), popup_join_game_dialog(), popup_load_del_presets_dialog(), popup_load_game_dialog(), popup_new_user_passwd_dialog(), popup_newcity_dialog(), popup_notify_dialog(), popup_pillage_dialog(), popup_players_dialog(), popup_players_nations_dialog(), popup_races_dialog(), popup_sabotage_dialog(), popup_sell_impr_callback(), popup_spaceship_dialog(), popup_tech_info(), popup_terrain_info_dialog(), popup_unit_disband_dlg(), popup_unit_info(), popup_unit_upgrade_dlg(), popup_upgrade_unit_callback(), popup_user_passwd_dialog(), popup_war_dialog(), popup_worklist_editor(), prev_name_callback(), races_dialog_ok_callback(), races_toggles_set_sensitive(), real_activeunits_report_dialog_update(), real_city_dialog_popup(), real_conn_list_dialog_update(), real_info_city_report_dialog_update(), real_meswin_dialog_update(), real_units_report_dialog_update(), rebuild_imprm_list(), redraw_city_dialog(), redraw_unit_info_label(), refresh_spaceship_dialog(), revolution_callback(), save_cma_callback(), science_report_dialog_popdown(), science_report_dialog_popup(), science_report_dialogs_popdown_all(), select_random_leader(), sell_imprvm_dlg_callback(), send_passwd_callback(), set_global_worklist(), set_group_state(), set_turn_done_button_state(), show_main_page(), spy_steal_popup_shared(), std_down_advanced_dlg_callback(), std_up_advanced_dlg_callback(), std_vscroll_advanced_dlg_callback(), style_callback(), toggle_map_window_callback(), toggle_msg_window_callback(), toggle_unit_info_window_callback(), unit_order_callback(), unit_select_dialog_popup(), units_action_callback(), units_orders_city_dlg_callback(), unselect_widget_action(), update_city_cma_dialog(), update_clauses_list(), update_diplomacy_dialog(), update_goto_dialog(), update_intel_dialog(), widget_pressed_action(), and widget_selected_action().

◆ set_wtype()

void set_wtype ( struct widget pwidget,
enum widget_type  type 
)

◆ setup_vertical_widgets_position()

int setup_vertical_widgets_position ( int  step,
Sint16  start_x,
Sint16  start_y,
Uint16  w,
Uint16  h,
struct widget begin,
struct widget end 
)

Setup widgets vertically.

Definition at line 1051 of file widget.c.

◆ show_group()

void show_group ( struct widget begin_group_widget_list,
struct widget end_group_widget_list 
)

Show all widgets in the group.

Definition at line 934 of file widget.c.

◆ undraw_group()

void undraw_group ( struct widget begin_group_widget_list,
struct widget end_group_widget_list 
)

Undraw all widgets in the group.

Definition at line 754 of file widget.c.

◆ unselect_widget_action()

void unselect_widget_action ( void  )

Unselect (selected) widget and redraw this widget;

Definition at line 418 of file widget.c.

◆ widget_add_as_prev()

void widget_add_as_prev ( struct widget new_widget,
struct widget add_dock 
)

Add Widget to widgets list at add_dock position on 'prev' slot.

Definition at line 602 of file widget.c.

◆ widget_draw_frame()

static void widget_draw_frame ( struct widget pwidget)
inlinestatic

Definition at line 281 of file widget.h.

Referenced by redraw_window().

◆ widget_flush()

static void widget_flush ( struct widget pwidget)
inlinestatic

Definition at line 291 of file widget.h.

Referenced by add_target_to_production(), add_target_to_worklist(), apply_taxrates_callback(), army_city_dlg_callback(), buy_prod_city_dlg_callback(), change_prod_dlg_callback(), change_research_goal_dialog_callback(), change_sex_callback(), city_dlg_callback(), connect_callback(), convert_first_passwd_callback(), convert_second_passwd_callback(), end_turn_callback(), gold_callback(), happy_city_dlg_callback(), horiz_taxrate_callback(), info_city_dlg_callback(), misc_panel_city_dlg_callback(), move_window_group(), nation_button_callback(), nations_dialog_callback(), option_dialog_optset_category(), option_dialog_worklist(), optiondlg_callback(), options_city_dlg_callback(), players_window_dlg_callback(), popup_action_selection(), popup_advanced_terrain_dialog(), popup_bribe_stack_dialog(), popup_bribe_unit_dialog(), popup_change_research_dialog(), popup_change_research_dialog_callback(), popup_change_research_goal_dialog(), popup_change_research_goal_dialog_callback(), popup_connection_dialog(), popup_government_dialog(), popup_image(), popup_incite_dialog(), popup_load_del_presets_dialog(), popup_newcity_dialog(), popup_notify_dialog(), popup_pillage_dialog(), popup_races_dialog(), popup_sabotage_dialog(), popup_spaceship_dialog(), popup_worklist_editor(), races_dialog_ok_callback(), races_toggles_set_sensitive(), real_conn_list_dialog_update(), real_economy_report_dialog_update(), real_meswin_dialog_update(), redraw_edit_chain(), redraw_impr_info_dlg(), redraw_tech_info_dlg(), redraw_tech_tree_dlg(), redraw_unit_info_dlg(), science_dialog_callback(), set_turn_done_button_state(), std_down_advanced_dlg_callback(), std_up_advanced_dlg_callback(), std_vscroll_advanced_dlg_callback(), supported_unit_city_dlg_callback(), unit_select_dialog_popup(), units_orders_city_dlg_callback(), update_acceptance_icons(), update_city_cma_dialog(), update_goto_dialog(), widget_core_select(), and widget_core_unselect().

◆ widget_free()

void widget_free ( struct widget **  pwidget)

Free resources allocated for the widget.

Definition at line 94 of file widget_core.c.

◆ widget_mark_dirty()

static void widget_mark_dirty ( struct widget pwidget)
inlinestatic

Definition at line 286 of file widget.h.

Referenced by add_new_worklist_callback(), add_target_to_production(), add_to_chat_list(), add_widget_to_vertical_scroll_widget_list(), add_widget_to_vertical_scroll_widget_list(), arrange_widgets(), back_callback(), cities_action_callback(), combo_menu_item_callback(), combo_popdown(), combo_popup(), convert_playername_callback(), convert_portnr_callback(), convert_servername_callback(), del_widget_from_vertical_scroll_widget_list(), del_widget_from_vertical_scroll_widget_list(), economy_report_dialog_popdown(), economy_report_dialog_popup(), edit_worklist_callback(), enable_and_redraw_find_city_button(), enable_and_redraw_revolution_button(), exit_economy_dialog_callback(), inside_scroll_down_loop(), inside_scroll_up_loop(), leader_name_edit_callback(), move_window_motion(), nation_button_callback(), new_name_city_dlg_callback(), newcity_name_edit_callback(), next_name_callback(), notify_goto_dialog_destroy(), notify_goto_dialog_update(), ok_buy_prod_city_dlg_callback(), option_widget_update(), players_action_callback(), popdown_load_game_dialog(), popdown_window_group_dialog(), popup_diplomacy_dialog(), popup_find_dialog(), popup_hurry_production_dialog(), popup_input_line(), popup_load_game_dialog(), popup_players_nations_dialog(), popup_sell_impr_callback(), popup_terrain_info_dialog(), popup_unit_disband_dlg(), popup_unit_upgrade_dlg(), popup_upgrade_unit_callback(), popup_war_dialog(), prev_name_callback(), real_activeunits_report_dialog_update(), real_city_report_dialog_update(), real_city_report_update_city(), real_info_city_report_dialog_update(), real_menus_update(), real_players_dialog_update(), real_science_report_dialog_update(), real_units_report_dialog_update(), redraw_city_dialog(), redraw_group(), redraw_order_widgets(), redraw_unit_info_label(), refresh_overview(), refresh_production_label(), refresh_spaceship_dialog(), rename_worklist_editor_callback(), report_scroll_mouse_motion_handler(), revolution_callback(), save_cma_callback(), science_report_dialog_popdown(), science_report_dialog_popup(), science_report_dialogs_popdown_all(), scroll_mouse_motion_handler(), scroll_mouse_motion_handler(), sell_imprvm_dlg_callback(), send_passwd_callback(), set_indicator_icons(), spy_steal_popup_shared(), style_callback(), toggle_map_window_callback(), toggle_msg_window_callback(), toggle_unit_info_window_callback(), undraw_group(), undraw_order_widgets(), units_action_callback(), update_clauses_list(), update_diplomacy_dialog(), update_intel_dialog(), update_worklist_report_dialog(), vertical_scroll_widget_list(), and widget_pressed_action().

◆ widget_pressed_action()

Uint16 widget_pressed_action ( struct widget pwidget)

Do default Widget action when pressed, and then call widget callback function.

example for Button: set flags FW_Pressed redraw button ( pressed ) refresh screen ( to see result ) wait 300 ms ( to see result :) If exist (button callback function) then call (button callback function)

Function normal return Widget ID. NOTE: NOZERO return of this function determinate exit of MAIN_SDL_GAME_LOOP if ( pwidget->action ) if ( pwidget->action(pwidget) ) ID = 0; if widget callback function return = 0 then return NOZERO I default return (-1) from Widget callback functions.

Definition at line 296 of file widget.c.

◆ widget_redraw()

static int widget_redraw ( struct widget pwidget)
inlinestatic

Definition at line 276 of file widget.h.

Referenced by add_new_worklist_callback(), add_target_to_production(), add_target_to_worklist(), add_to_chat_list(), apply_taxrates_callback(), army_city_dlg_callback(), back_callback(), buy_prod_city_dlg_callback(), change_prod_dlg_callback(), change_sex_callback(), cities_action_callback(), combo_menu_item_callback(), connect_callback(), convert_first_passwd_callback(), convert_playername_callback(), convert_portnr_callback(), convert_second_passwd_callback(), convert_servername_callback(), economy_report_dialog_popdown(), economy_report_dialog_popup(), enable_and_redraw_find_city_button(), enable_and_redraw_revolution_button(), end_turn_callback(), exit_economy_dialog_callback(), get_target_help_data(), gold_callback(), happy_city_dlg_callback(), horiz_taxrate_callback(), info_city_dlg_callback(), leader_name_edit_callback(), meswin_dialog_popup(), misc_panel_city_dlg_callback(), nation_button_callback(), new_name_city_dlg_callback(), newcity_name_edit_callback(), next_name_callback(), notify_goto_dialog_update(), ok_buy_prod_city_dlg_callback(), option_widget_update(), optiondlg_callback(), options_city_dlg_callback(), players_action_callback(), popdown_load_game_dialog(), popup_change_research_dialog_callback(), popup_change_research_goal_dialog_callback(), popup_connection_dialog(), popup_load_game_dialog(), popup_minimap_window(), popup_sell_impr_callback(), popup_unitinfo_window(), popup_upgrade_unit_callback(), prev_name_callback(), races_dialog_ok_callback(), real_menus_update(), real_players_dialog_update(), real_science_report_dialog_update(), redraw_city_dialog(), redraw_group(), redraw_minimap_window_buttons(), redraw_order_widgets(), redraw_textcheckbox(), redraw_unit_info_label(), refresh_production_label(), refresh_worklist_count_label(), rename_worklist_editor_callback(), report_scroll_mouse_motion_handler(), revolution_callback(), science_report_dialog_popdown(), science_report_dialog_popup(), science_report_dialogs_popdown_all(), scroll_mouse_motion_handler(), send_passwd_callback(), set_indicator_icons(), set_turn_done_button_state(), std_down_advanced_dlg_callback(), std_up_advanced_dlg_callback(), style_callback(), supported_unit_city_dlg_callback(), toggle_map_window_callback(), toggle_msg_window_callback(), toggle_unit_info_window_callback(), units_action_callback(), update_acceptance_icons(), update_clauses_list(), widget_core_select(), widget_core_unselect(), and widget_pressed_action().

◆ widget_resize()

static void widget_resize ( struct widget pwidget,
int  w,
int  h 
)
inlinestatic

◆ widget_selected_action()

void widget_selected_action ( struct widget pwidget)

Select widget. Redraw this widget;

Definition at line 443 of file widget.c.

◆ widget_set_area()

static void widget_set_area ( struct widget pwidget,
SDL_Rect  area 
)
inlinestatic

◆ widget_set_position()

static void widget_set_position ( struct widget pwidget,
int  x,
int  y 
)
inlinestatic

Definition at line 266 of file widget.h.

Referenced by arrange_widgets(), combo_popup(), economy_report_dialog_popup(), init_options_button(), meswin_dialog_popup(), move_window_motion(), nation_button_callback(), notify_goto_dialog_update(), option_dialog_worklist(), popup_advanced_terrain_dialog(), popup_change_research_dialog(), popup_change_research_goal_dialog(), popup_city_cma_dialog(), popup_conn_list_dialog(), popup_connection_dialog(), popup_diplomacy_dialog(), popup_diplomatic_objects(), popup_find_dialog(), popup_goto_airlift_dialog(), popup_government_dialog(), popup_hurry_production_dialog(), popup_image(), popup_impr_info(), popup_join_game_dialog(), popup_load_del_presets_dialog(), popup_load_game_dialog(), popup_new_user_passwd_dialog(), popup_newcity_dialog(), popup_notify_dialog(), popup_players_dialog(), popup_players_nations_dialog(), popup_races_dialog(), popup_sell_impr_callback(), popup_spaceship_dialog(), popup_tech_info(), popup_unit_disband_dlg(), popup_unit_info(), popup_unit_upgrade_dlg(), popup_upgrade_unit_callback(), popup_user_passwd_dialog(), popup_war_dialog(), popup_worklist_editor(), put_window_near_map_tile(), real_activeunits_report_dialog_update(), real_city_dialog_popup(), real_info_city_report_dialog_update(), real_resize_window_callback(), real_science_report_dialog_update(), save_cma_callback(), science_report_dialog_popup(), sell_imprvm_dlg_callback(), set_new_group_start_pos(), set_new_minimap_window_pos(), set_new_unitinfo_window_pos(), show_game_page(), show_main_page(), spy_steal_popup_shared(), units_orders_city_dlg_callback(), update_diplomacy_dialog(), and update_intel_dialog().

◆ widget_undraw()

static void widget_undraw ( struct widget pwidget)
inlinestatic