=== Overview ===
+ Box width and height
- box-width and -height
- Dynamic theme roundness changing
+ Widget callbacks
- New empty functions
- New xuni_t parameter for rescale_*()
+ Accumulative clip positions
+ Bugfixes
- Textbox fix
- Listbox attempted fix
- revert/deactivate keep parameter
- Memory leaks
- KEYDOWN replaces KEYUP
+ Miscellaneous
- something->xuni_t parameters
- File management
- Minor additions
- Minor deletions
- Notes
=== Box width and height ===
*** box-width and -height ***
Added the tags box-width and box-height into PANEL_THEME. This information is used to resize the box images rather than specifying a width and height for each image. This simplified gui/data.xml significantly, and to a lesser extent, gui/editor.xml.
The data is stored in theme_data_t::width and theme_data_t::height, and used in rescale_theme() (which use_theme() now calls). It is retrieved by get_box_(width|height)().
*** Dynamic theme roundness changing ***
Added a textbox to the "graphics theme" panel called "theme roundness" (options.c::WID_THEME_THEME_ROUNDNESS). This can be used to specify new theme roundness values at runtime. Note that this becomes the default for the theme, and there is currently no way to tell what the default roundness used to be.
=== Widget callbacks ===
*** New empty functions ***
Made reposition_widget_nonrec() call callback functions for each widget, like rescale_widget(). Added reposition_*() callback functions for nearly every widget type (save themes), and empty rescale_*() ones in places too. This repositioning callback code is used by reposition_label() to make textboxes work correctly (see the "Textbox fix" section), and by reposition_scrollbar().
*** New xuni_t parameter for rescale_*() ***
rescale_*() callback functions now take a xuni_t parameter, which allowed images to start using xuni->smode->screen instead of storing that value in each image as image_t::screen.
=== Accumulative clip positions ===
clip_pos_t is now accumulative. That it, it is cleared by reposition_widget_nonrec() by calling clear_widget_clip(), and added to by various reposition_*() callback functions. This allows textboxes and (theoretically) listboxes to work correctly.
To reflect this change, set_widget_clip() was renamed to add_widget_clip(). It also adds instead of sets positions, of course.
=== Bugfixes ===
*** Textbox fix ***
Fixed textboxes to align with the new methodology that the parent widget is the selected one. In other words, treated the selected widget as a textbox rather than a textbox's label. See the rather extensive changes in gui.c after line 700 (new code) and in image.c.
As a result of this, textboxes now work properly -- in fact, better than ever before, because with the new box width code, they wrap properly. The only issue is scrolling off the left, but that will have to wait for a separate variable in textboxes, for the clip view, so that that value can be separate from the textbox width.
*** Listbox attempted fix ***
Tried to make listboxes scroll correctly. Only partially succeeded; the current code only works for themes with a roundness of 100 / 30.
*** revert/deactivate keep parameter ***
Made clear_active() take a third parameter: keep. This specifies whether revert_widget() or deactivate_widget() should be called. clear_gui() and init_gui() were also changed as a result. This allows deactivating a textbox by losing window focus to preserve the contents of the widget.
*** Memory leaks ***
Fixed a memory leak: reload_fonts() was not freeing the previous fonts when the font name was changed by options_theme_deactivate(), because the latter function set the font size to -1, causing the former to think that nothing had been loaded. Setting the font size to 0 instead now causes the font to be resized no matter how big it was before, yet lets the font be freed.
*** KEYDOWN replaces KEYUP ***
Widget accelerator keys and widget_process_character() (for textboxes) now activate on KEYDOWN events, rather than KEYUP ones. This prevents xuni from accidentally trapping keypresses intended for other windows.
=== Miscellaneous ===
*** something->xuni_t parameters ***
- rescale_widget() now takes a xuni_t rather than an smode_t.
- clear_gui() now takes a xuni_t rather than a gui_t.
- get_screen_modes() now takes a xuni_t rather than an smode_t and a font_t.
*** File management ***
- Deleted ./.xuni at last, which has not been used for a very long time.
- Finally put some NASA images under subversion control, in gui/background.
- Deleted src/resize.[ch], which is why the line count is down to around 8850. SDL_Resize was just too slow in comparison with SDL_gfx, though filter 5 scaled up quite well.
*** Minor additions ***
- Added an icon in ./editor.xml, which was overlooked for the last commit.
- Added the "outline" theme to gui/data.xml.
- Added quite a few items to the TODO list, and added [done] notes in several places.
- Introduced theme_data_t, moving THEME_* to theme.h.
*** Minor deletions ***
- Deleted the commented-out "font selection" panel in gui/editor.xml -- copied from the "options theme" panel in gui/data.xml.
- Removed the commented-out widget_in_panel() implementation in gui.c.
- Removed some long-unused commented-out code in paint_listbox().
*** Notes ***
- There are no known ordinary memory leaks at the moment, besides SDL ones.
- Replaced a few calls to xuni_memory_decrement() with calls to xuni_memory_free(), fixing several memory leaks: two calls in free_panel(), two in free_widget(), one in editor.c::handle_cancel_actions().
52 files changed: