=== Overview ===
+ xuni editor
+ Themes
- Dynamic theme switching
- Remaining theme images renamed
- Independent libxuni.a
- Widget initialization
+ Resource files
- "reference" -> "tag", new "ref"
- Resource dump code
+ Accelerator keys
- New form of handling keypresses
- Usage
+ Miscellaneous
- Unused code eliminated
- SDL 1.2.12 support
- Notes
=== xuni editor ===
Added a new executable, the xuni editor. This program will hopefully become a dynamic resource editor for xuni programs. It is currently called ./xuni, the previous executable having been renamed to ./test.
The source for this new program is in the new source folder src/editor, and it has its own resource files, currently all called editor.xml (one in ./ and one in gui/).
=== Themes ===
Re-worked the theme code. gui.c now automatically detects themes while initializing the widgets, and uses the first one it finds.
*** Dynamic theme switching ***
Added a textbox to the "graphics theme" panel which allows the theme to be changed dynamically. Currently, one must enter the name of the new theme as it appears in the resource file -- but it works very well.
*** Remaining theme images renamed ***
Renamed the images in gui/bluesq, gui/outline, and gui/shadow to match gui/alienglow and what xuni expects:
./corners
./corners/in
./corners/in/normal.png
./corners/in/hover.png
./corners/in/active.png
./corners/out
./corners/out/normal.png
./corners/out/hover.png
./corners/out/active.png
Note that these themes do not have their own check.png etc, instead referencing the images in alienglow.
*** Independent libxuni.a ***
Moved panel_type_t out of graphics.h and into the application code: main.h and editor.h. In some places, panels are stored in size_t's where they once used this enum. In other places, the typedef (to size_t) panel_type_t is used.
Made main_loop() take an additional parameter, the initial panel type. This should make libxuni.a completely independent of the test code in test/, as is indicated by the new program, the editor.
Moved init_theme_panel() into gui.c -- it was located in the application code in main.c etc.
*** Widget initialization ***
Now that a theme is loaded immediately upon finding it (in the widget init code, not the resource read code), the widget initialization functions such as init_box() can use the nameid code instead of find_widget() -- which is much more efficient.
=== Resource files ===
Edited the ancient gui/alienglow/theme.xml to reflect the latest format of xuni resource files, that is, everything is a widget.
*** "reference" -> "tag", new "ref" ***
Renamed the type that was a reference into a tag. Also added a new type called ref, which is currently not used, to represent a shallow copy of a tag -- a pointer to another tag or other element.
Much of the code that simply checked for references before must now check for tags and refs.
*** Resource dump code ***
Moved the debugging code to dump a resource tree out of libexpat.c and into resource.c, where it can be used. (dump() was dropped, as it used specific code from libexpat.c.)
=== Accelerator keys ===
*** New form of handling keypresses ***
Added accelerator keys for widgets. That is, a key combination such as CTRL-Z or just a letter like 'z' can be mapped to a specific widget -- when that combination is pressed, the *_process_click() function is called, as if that widget had been clicked.
The accelerator list is stored in panel_data_t at the moment.
Handled SDLK_ESCAPE in loop.c, so that widgets can be deactivated etc without having the accelerator SDLK_ESCAPE activated.
*** Usage ***
All of the test program was re-worked to use accelerator keys. This has removed a lot of duplicate code, code that did the same thing when a key was pressed as when a widget was clicked.
=== Miscellaneous ===
*** Unused code eliminated ***
Finally removed struct resize_image_t, as the theme code was re-written. Also removed all supporting functions for this structure, including zoom_resize_image() and free_resize_image().
*** SDL 1.2.12 support ***
Upgraded the version of the SDL to 1.2.12, from 1.2.11. Everything worked as expected, except that many of the SDL header files now generate warnings, because they contain code such as:
#endif // something
With single-line comments disabled, the preprocessor sees that as extra text after the directive. The flag to disable this warning is -Wno-endif-label, and it goes after -pedantic, which is the flag which enables this warning.
*** Notes ***
- Simplified include_resources() by using first_resource_text().
- Added paint_cursor() to facilitate painting cursors, removing that code out of menu.c.
- Started to add data structures which will re-work the coordinate system yet again.
- Suggestion: make a WIDGET_THEME widget type.
- The source code for xuni is now almost 8400 lines long! (Much of that is because of duplication between the editor code and the test code.)
60 files changed: