Freeciv-3.3: /fast/freeciv/nightly/main/client/gui-sdl3/widget_core.c File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Functions
widget_core.c File Reference
`#include <SDL3/SDL.h>`
`#include "colors.h"`
`#include "graphics.h"`
`#include "mapview.h"`
`#include "themespec.h"`
`#include "widget.h"`
`#include "widget_p.h"`

Go to the source code of this file.

## Functions

void | set_wstate (struct widget *pwidget, enum widget_state state)
void | set_wtype (struct widget *pwidget, enum widget_type type)
void | set_wflag (struct widget *pwidget, enum widget_flag flag)
void | clear_wflag (struct widget *pwidget, enum widget_flag flag)
enum widget_state | get_wstate (const struct widget *pwidget)
enum widget_type | get_wtype (const struct widget *pwidget)
enum widget_flag | get_wflags (const struct widget *pwidget)
void | widget_free (struct widget **pwidget)
static void | widget_core_set_area (struct widget *pwidget, SDL_Rect area)
static void | widget_core_set_position (struct widget *pwidget, int x, int y)
static void | widget_core_resize (struct widget *pwidget, int w, int h)
static int | widget_core_redraw (struct widget *pwidget)
static void | widget_core_draw_frame (struct widget *pwidget)
static void | widget_core_mark_dirty (struct widget *pwidget)
static void | widget_core_flush (struct widget *pwidget)
static void | widget_core_undraw (struct widget *pwidget)
static void | widget_core_select (struct widget *pwidget)
static void | widget_core_unselect (struct widget *pwidget)
struct widget * | widget_new (void)

## Function Documentation

## ◆ clear_wflag()

void clear_wflag | ( | struct widget * | pwidget,
|  | enum widget_flag | flag
| ) |  |

Clear flag from the widget.

Definition at line 58 of file widget_core.c.

Referenced by del_widget_from_vertical_scroll_widget_list(), del_widget_from_vertical_scroll_widget_list(), popup_conn_list_dialog(), popup_connection_dialog(), popup_worklist_editor(), real_conn_list_dialog_update(), real_menus_update(), show_group(), show_minimap_window_buttons(), show_unitinfo_window_buttons(), and vertical_scroll_widget_list().

## ◆ get_wflags()

enum widget_flag get_wflags | ( | const struct widget * | pwidget | ) |

Get all flags of the widget.

Definition at line 82 of file widget_core.c.

Referenced by add_new_worklist_callback(), add_widget_to_vertical_scroll_widget_list(), add_widget_to_vertical_scroll_widget_list(), convert_iconlabel_to_themeiconlabel2(), create_window_skeleton(), draw_edit(), draw_icon(), edit_field(), edit_textinput(), find_next_widget_at_pos(), find_next_widget_for_key(), inside_scroll_down_loop(), inside_scroll_up_loop(), redraw_edit(), redraw_group(), redraw_ibutton(), redraw_iconlabel(), redraw_label(), redraw_order_widgets(), redraw_window(), refresh_production_label(), refresh_worklist_count_label(), remake_label_size(), report_scroll_mouse_motion_handler(), resize_window(), scroll_mouse_motion_handler(), scroll_mouse_motion_handler(), set_client_area(), set_new_order_widget_start_pos(), setup_vertical_widgets_position(), undraw_order_widgets(), unselect_widget_action(), vertical_scroll_widget_list(), widget_pressed_action(), and widget_selected_action().

## ◆ get_wstate()

enum widget_state get_wstate | ( | const struct widget * | pwidget | ) |

Get state of the widget.

Definition at line 66 of file widget_core.c.

Referenced by combo_redraw(), draw_icon(), find_next_widget_for_key(), main_finger_down_handler(), main_mouse_button_down_handler(), main_mouse_motion_handler(), next_name_callback(), popdown_conn_list_dialog(), prev_name_callback(), races_toggles_set_sensitive(), real_menus_update(), redraw_checkbox(), redraw_city_dialog(), redraw_edit(), redraw_horiz(), redraw_ibutton(), redraw_icon(), redraw_icon2(), redraw_label(), redraw_textcheckbox(), redraw_themelabel2(), redraw_tibutton(), redraw_vert(), and unselect_widget_action().

## ◆ get_wtype()

enum widget_type get_wtype | ( | const struct widget * | pwidget | ) |

Get type of the widget.

Definition at line 74 of file widget_core.c.

Referenced by combo_popdown(), combo_popup(), redraw_label(), set_new_checkbox_theme(), set_new_group_start_pos(), and widget_pressed_action().

## ◆ set_wflag()

void set_wflag | ( | struct widget * | pwidget,
|  | enum widget_flag | flag
| ) |  |

Set flags of the widget.

Definition at line 50 of file widget_core.c.

Referenced by add_widget_to_vertical_scroll_widget_list(), add_widget_to_vertical_scroll_widget_list(), combo_new(), create_checkbox(), create_edit(), create_horizontal(), create_icon2(), create_icon_button(), create_iconlabel(), create_present_supported_units_widget_list(), create_themeicon(), create_themelabel(), create_themelabel2(), create_vertical(), create_window_skeleton(), economy_report_dialog_popup(), hide_group(), hide_minimap_window_buttons(), hide_unitinfo_window_buttons(), init_options_button(), option_dialog_worklist(), popup_advanced_terrain_dialog(), popup_change_research_dialog(), popup_change_research_goal_dialog(), popup_connection_dialog(), popup_diplomatic_objects(), popup_find_dialog(), popup_impr_info(), popup_load_del_presets_dialog(), popup_players_nations_dialog(), popup_races_dialog(), popup_sabotage_dialog(), popup_tech_info(), popup_unit_info(), popup_worklist_editor(), real_activeunits_report_dialog_update(), real_info_city_report_dialog_update(), real_menus_update(), rebuild_imprm_list(), redraw_unit_info_label(), set_new_checkbox_theme(), spy_steal_popup_shared(), unit_select_dialog_popup(), update_goto_dialog(), update_intel_dialog(), and vertical_scroll_widget_list().

## ◆ set_wstate()

void set_wstate | ( | struct widget * | pwidget,
|  | enum widget_state | state
| ) |  |

Set state of the widget.

Definition at line 32 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_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
| ) |  |

Set type of the widget.

Definition at line 41 of file widget_core.c.

Referenced by combo_new(), convert_iconlabel_to_themeiconlabel2(), create_checkbox(), create_edit(), create_horizontal(), create_icon2(), create_icon_button(), create_iconlabel(), create_textcheckbox(), create_themeicon(), create_themeicon_button(), create_themelabel(), create_themelabel2(), create_vertical(), and create_window_skeleton().

## ◆ widget_core_draw_frame()

static void widget_core_draw_frame | ( | struct widget * | pwidget | ) |

static

Draw frame of the widget.

Definition at line 176 of file widget_core.c.

## ◆ widget_core_flush()

static void widget_core_flush | ( | struct widget * | pwidget | ) |

static

Flush part of the display covered by the widget.

Definition at line 199 of file widget_core.c.

## ◆ widget_core_mark_dirty()

static void widget_core_mark_dirty | ( | struct widget * | pwidget | ) |

static

Mark part of the display covered by the widget dirty.

Definition at line 184 of file widget_core.c.

## ◆ widget_core_redraw()

static int widget_core_redraw | ( | struct widget * | pwidget | ) |

static

Draw widget to the surface its on, if it's visible.

Definition at line 156 of file widget_core.c.

## ◆ widget_core_resize()

static void widget_core_resize | ( | struct widget * | pwidget,
|  | int | w,
|  | int | h
| ) |  |

static

Set widget size.

Definition at line 147 of file widget_core.c.

## ◆ widget_core_select()

static void widget_core_select | ( | struct widget * | pwidget | ) |

static

Callback for when widget gets selected.

Definition at line 230 of file widget_core.c.

## ◆ widget_core_set_area()

static void widget_core_set_area | ( | struct widget * | pwidget,
|  | SDL_Rect | area
| ) |  |

static

Set widget area.

Definition at line 130 of file widget_core.c.

## ◆ widget_core_set_position()

static void widget_core_set_position | ( | struct widget * | pwidget,
|  | int | x,
|  | int | y
| ) |  |

static

Set widget position.

Definition at line 138 of file widget_core.c.

## ◆ widget_core_undraw()

static void widget_core_undraw | ( | struct widget * | pwidget | ) |

static

Clear widget from the display.

Definition at line 214 of file widget_core.c.

## ◆ widget_core_unselect()

static void widget_core_unselect | ( | struct widget * | pwidget | ) |

static

Callback for when widget gets unselected.

Definition at line 239 of file widget_core.c.

## ◆ widget_free()

void widget_free | ( | struct widget ** | pwidget | ) |

Free resources allocated for the widget.

Definition at line 90 of file widget_core.c.

## ◆ widget_new()

struct widget * widget_new | ( | void |  | ) |

Create a new widget.

Definition at line 248 of file widget_core.c.