Began implementing listboxes. They are very rudimentary right now, without scrolling or even wrapping. This involved changing a lot of code spanning graphics.c and gui.c. All listbox function are new; there was no support whatsoever for listboxes previously (besides the structure declaration).
The one listbox used displays the available screen modes in the graphics options menu. The new function graphics.c:list_graphics_modes() returns a SDL_Rect** representing the modes by calling SDL_ListModes(). It could perhaps share some some code with set_graphics_mode(). The new function options.c:get_screen_modes() adds these strings to a listbox.
This listbox displays "All" in windowed mode and a long list of modes in fullscreen mode. It is not updated except when xuni first starts; there are currently no functions to remove data from listboxes.
The options menu now supports pressing 'T' to go to the themes sub-menu, and 'G' to go to the graphics sub-menu.
The text demonstrating many characters of a font is now displayed in the Theme menu relative to the window size, rather than just at y=200.
widget->p.all is once again allocated in allocate_widget() instead of in set_<widget>(). The function allocate_widget_p() was added which initializes the newly allocated widget->p.all.
The set_<widget>() functions are designed to change only the members of a widget that might be affected by the window resizing, the font changing, etc. The new function set_textbox_data() was added that changes the actual data of a textbox. Likewise, add_listbox_item() adds an item to a listbox.
Removed support for reverting textboxes -- it was too buggy and needs to be implemented differently anyway.
Added two documentation comments into font.c, graphics.c, and settings.c.
Redid the formula that pick_font_point() uses, though it's not much better now.
Removed the hard-coded 16 for the size of a checkbox's check, using font->point instead. This means that resize_theme() now takes struct font_t *font as a parameter.
The tag of the structure menu_text_t was removed (it is now an anonymous structure) since there wasn't any code that used its structure tag.
Experimented with a smart permissions target in Makefile.
Added some items into the TODO list.
12 files changed: