Commit graph

320 commits

Author SHA1 Message Date
Kp 57780e0450 Move window_is_visible,window_set_visible to be window methods
Shrink w_visible to uint8_t.  Move it to pack better.
2021-11-01 03:37:18 +00:00
Kp 21241471c6 Return string width/height from gr_get_string_size
Use structured bindings to capture the values on return, so that they
can be declared as `const` if they are immutable after initial
computation.
2021-09-12 16:20:52 +00:00
Kp 0750046bc1 Move retrieval of font average width out of gr_get_string_size
Most callers do not need it, and it is only vaguely related to the
purpose of measuring a particular string.  For those callers that need
it, lift it out.
2021-09-12 16:20:52 +00:00
Kp 5d39c52b0c Remote write-only field UI_GADGET::status 2021-08-26 03:13:46 +00:00
Kp be5061c072 Remove write-only field UI_GADGET::oldstatus 2021-08-26 03:13:46 +00:00
Kp 1c13d3c8d3 Improve error reporting for PHYSFSX_openReadBuffered
Return the PHYSFS error code on failure, so that callers can report why
the open failed.
2021-07-25 23:00:56 +00:00
Kp 7b12aac1bb Transpose returned values for enumerate() of non-tuple
Match the order used for tuple.
2021-06-28 03:37:50 +00:00
Kp 80fc124a63 Remove unnecessary definitions of static member variables
C++17 permits, but deprecates, this form.  Remove it to simplify the
code.
2020-12-27 22:03:09 +00:00
Kp 479884288c Always delegate to window_create for send_creation_events 2020-12-20 20:39:07 +00:00
Kp 5c7fc7d143 Remove unused UI_DIALOG d_callback
Every user now uses inheritance and a virtual function override.  Make
callback_handler pure virtual, delete its body, and then delete the
member variables that existed only for use in that body.  Remove the
constructor parameters that initialized those variables, and update all
derived classes accordingly.
2020-12-19 16:13:26 +00:00
Kp 2709676f8d Rename ui_create_dialog to window_create
The requirement to call send_creation_events from outside the
constructor makes the presence of a helper function convenient.  Rename
ui_create_dialog to window_create, and move it to window.h.
2020-12-19 16:13:26 +00:00
Kp ae657007fe Remove send_creation_events parameter
It is always nullptr.
2020-10-22 02:26:16 +00:00
Kp 2869566866 Remove unused ui_create_dialog parameter createdata
It is always nullptr.  Remove the parameter and pass nullptr where the
parameter was used.
2020-10-22 02:26:16 +00:00
Kp e7cd8bedec Remove obsolete embed_window_pointer_t 2020-10-22 02:26:16 +00:00
Kp 4d3eeb903e Make MENU's window to inherit from window
Due to ordering constraints, this is not merged into MENU, but is
instead kept as a distinct sub-type that is pointed at by MENU.  MENU
sets the window's position based on parsing of the menu definition file,
but the parser expects to store window position data into MENU before
creating the window.  If menubar_window were merged into MENU, the
parser would need a temporary, and all callers that create the window
would need to consult that temporary.
2020-10-12 03:28:26 +00:00
Kp 07eb412244 Make menubar.cpp Menu[] an array of MENU*, not MENU 2020-10-12 03:28:26 +00:00
Kp 6ffa495bf4 Split out special handling for creating menubar
All callers request either the menubar or something else, but never
conditionally request one or the other.  Split the special handling that
picks a different handler based on which element the caller requested.
2020-10-12 03:28:26 +00:00
Kp f8185494ad Pass UI_DIALOG& to ui_add_gadget_icon 2020-10-12 03:28:26 +00:00
Kp 4f572bbe23 Pass UI_DIALOG& to ui_add_gadget_userbox 2020-10-12 03:28:26 +00:00
Kp 95598a34e3 Pass UI_DIALOG& to ui_add_gadget_inputbox 2020-10-12 03:28:26 +00:00
Kp 466f431c91 Pass UI_DIALOG& to ui_add_gadget_checkbox 2020-10-12 03:28:26 +00:00
Kp 3b7a34b066 Pass UI_DIALOG& to ui_draw_scrollbar 2020-10-12 03:28:26 +00:00
Kp 028f0c4cda Remove unused function ui_draw_frame 2020-10-12 03:28:26 +00:00
Kp c5afd0eb55 Pass UI_DIALOG& to ui_draw_icon 2020-10-12 03:28:26 +00:00
Kp 9e9429fe58 Pass UI_DIALOG& to ui_draw_userbox 2020-10-12 03:28:26 +00:00
Kp b45e696574 Pass UI_DIALOG& to ui_draw_checkbox 2020-10-12 03:28:26 +00:00
Kp 380d30f943 Pass UI_DIALOG& to ui_draw_radio 2020-10-12 03:28:26 +00:00
Kp 506f24ed04 Pass UI_GADGET_RADIO& to ui_radio_set_value 2020-10-12 03:28:26 +00:00
Kp f531c7d43e Pass UI_DIALOG& to ui_add_gadget_radio 2020-10-12 03:28:26 +00:00
Kp ff039c0c90 Pass UI_DIALOG& to ui_add_gadget_scrollbar 2020-10-12 03:28:26 +00:00
Kp 1d7f2e2ab5 Replace ui_gadget_do with virtual function dispatch 2020-10-12 03:28:26 +00:00
Kp d78d16b82f Pass UI_DIALOG& to ui_draw_inputbox 2020-10-12 03:28:26 +00:00
Kp a399fa7b58 Rename ui_icon_do to UI_GADGET_ICON::event_handler 2020-10-12 03:28:26 +00:00
Kp ca0894c3ab Rename ui_userbox_do to UI_GADGET_USERBOX::event_handler 2020-10-12 03:28:26 +00:00
Kp 6c89583ca0 Rename ui_inputbox_do to UI_GADGET_INPUTBOX::event_handler 2020-10-12 03:28:26 +00:00
Kp be157822d8 Rename ui_checkbox_do to UI_GADGET_CHECKBOX::event_handler 2020-10-12 03:28:26 +00:00
Kp 9280187833 Rename ui_radio_do to UI_GADGET_RADIO::event_handler 2020-10-12 03:28:26 +00:00
Kp 43c30bd6b3 Rename ui_scrollbar_do to UI_GADGET_SCROLLBAR::event_handler 2020-10-12 03:28:26 +00:00
Kp 8a4879a7e7 Rename ui_listbox_do to UI_GADGET_LISTBOX::event_handler 2020-10-12 03:28:26 +00:00
Kp 422ee41626 Rename ui_button_do to UI_GADGET_BUTTON::event_handler 2020-10-12 03:28:26 +00:00
Kp 26cb111bc0 Pass UI_DIALOG& to ui_mouse_on_gadget 2020-10-12 03:28:26 +00:00
Kp a21d89ea6c Pass UI_DIALOG& to ui_draw_button 2020-10-12 03:28:26 +00:00
Kp a563b5edf7 Pass UI_DIALOG& to ui_add_gadget_button 2020-10-12 03:28:26 +00:00
Kp dd2a60de69 Pass UI_DIALOG& to ui_dialog_set_current_canvas 2020-10-12 03:28:26 +00:00
Kp 6dce3f90c2 Pass UI_DIALOG& to ui_close_dialog 2020-10-12 03:28:26 +00:00
Kp 564f699002 Pass UI_DIALOG& to ui_gadget_get_next, ui_gadget_get_prev 2020-10-12 03:28:26 +00:00
Kp b6a7f63e5d Pass UI_DIALOG& to ui_gadget_calc_keys 2020-10-12 03:28:26 +00:00
Kp d7bff3daf3 Pass UI_DIALOG& to ui_dialog_do_gadgets 2020-10-12 03:28:25 +00:00
Kp f79e0343d9 Pass UI_DIALOG& to ui_gadget_send_event 2020-10-12 03:28:25 +00:00
Kp 6ff47e2a18 Pass UI_DIALOG& to ui_add_gadget_listbox 2020-10-12 03:28:25 +00:00