=== Overview ===
commitd99041904bc8ad4eef8032b3afbfa6a6505fae4a
authordwk <dwk@b022f027-f587-4676-bc72-f0cf7b603704>
Sat, 2 Feb 2008 01:16:17 +0000 (2 01:16 +0000)
committerdwk <dwk@b022f027-f587-4676-bc72-f0cf7b603704>
Sat, 2 Feb 2008 01:16:17 +0000 (2 01:16 +0000)
tree58184b75dd39d382bc351bd9b68504d0b57fc9a7
parent61c98aaae5a18c2397cabee011129c571e0506b5
=== 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:
TODO
editor.xml [new file with mode: 0644]
gui/alienglow/theme.xml
gui/bluesq/check.png [deleted file]
gui/bluesq/corners/in/active.png [moved from gui/bluesq/in/corners.png with 100% similarity]
gui/bluesq/corners/in/hover.png [moved from gui/bluesq/in_act/corners.png with 100% similarity]
gui/bluesq/corners/in/normal.png [moved from gui/bluesq/in_hov/corners.png with 100% similarity]
gui/bluesq/corners/out/active.png [moved from gui/bluesq/out/corners.png with 100% similarity]
gui/bluesq/corners/out/hover.png [moved from gui/bluesq/out_act/corners.png with 100% similarity]
gui/bluesq/corners/out/normal.png [moved from gui/bluesq/out_hov/corners.png with 100% similarity]
gui/data.xml
gui/editor.xml [new file with mode: 0644]
gui/outline/check.png [deleted file]
gui/outline/corners/in/active.png [moved from gui/outline/in_act/corners.png with 100% similarity]
gui/outline/corners/in/hover.png [moved from gui/outline/in_hov/corners.png with 100% similarity]
gui/outline/corners/in/normal.png [moved from gui/outline/in/corners.png with 100% similarity]
gui/outline/corners/out/active.png [moved from gui/outline/out_act/corners.png with 100% similarity]
gui/outline/corners/out/hover.png [moved from gui/outline/out_hov/corners.png with 100% similarity]
gui/outline/corners/out/normal.png [moved from gui/outline/out/corners.png with 100% similarity]
gui/shadow/check.png [deleted file]
gui/shadow/corners/in/active.png [moved from gui/shadow/in/corners.png with 100% similarity]
gui/shadow/corners/in/hover.png [moved from gui/shadow/in_act/corners.png with 100% similarity]
gui/shadow/corners/in/normal.png [moved from gui/shadow/in_hov/corners.png with 100% similarity]
gui/shadow/corners/out/active.png [moved from gui/shadow/out/corners.png with 100% similarity]
gui/shadow/corners/out/hover.png [moved from gui/shadow/out_act/corners.png with 100% similarity]
gui/shadow/corners/out/normal.png [moved from gui/shadow/out_hov/corners.png with 100% similarity]
src/Makefile
src/editor/Makefile [copied from src/test/Makefile with 69% similarity]
src/editor/Makewin [copied from src/test/Makefile with 74% similarity]
src/editor/depend [new file with mode: 0644]
src/editor/editor.c [new file with mode: 0644]
src/editor/editor.h [new file with mode: 0644]
src/graphics.c
src/graphics.h
src/gui.c
src/gui.h
src/loop.c
src/loop.h
src/resource/Makefile
src/resource/libexpat.c
src/resource/resource.c
src/resource/resource.h
src/test/Makefile
src/test/game.c
src/test/game.h
src/test/main.c
src/test/main.h
src/test/menu.c
src/test/menu.h
src/test/options.c
src/test/options.h
src/widget/Makefile
src/widget/box.c
src/widget/checkbox.c
src/widget/checkbox.h
src/widget/panel.c
src/widget/scrollbar.c
src/widget/widgets.c
src/widget/widgets.h
src/xuni.c