=== Overview ===
commit74b7b8bf2745b0c75060ac3cc5e363e3baa25ecc
authordwk <dwk@b022f027-f587-4676-bc72-f0cf7b603704>
Tue, 15 Apr 2008 14:37:24 +0000 (15 14:37 +0000)
committerdwk <dwk@b022f027-f587-4676-bc72-f0cf7b603704>
Tue, 15 Apr 2008 14:37:24 +0000 (15 14:37 +0000)
tree050206caf53be7c6998238c45218456b0efa85f3
parentad9a04478f36b09082893a603f4e9fe459bbed65
=== Overview ===
+ Resource files
    - Relative paths in resource files
    - Recursive calling
    - Implementation notes
    - Small changes to actual resource files
    - High memory usage
+ Horizontal scrollbars and associated changes
    - Horizontal scrollbars
    - Modifications for horizontal scrollbars
    - Textareas
    - Use of horizontal scrollbars
    - Implementation problems
+ Textbox scrolling
    - (Almost) proper scrolling
    - Implementation problems
+ Notes on specific features
    - WIDGET_EVENT_UPDATE_TEXT
    - get_widget_type_name()
    - assert_widget_type()
+ Miscellaneous
    - Build system
    - Notes

=== Resource files ===

*** Relative paths in resource files ***
Made paths in <include> and <path> tags relative to the resource file instead of to the xuni executable. Note that the original XML file passed to parse_resource() still has to be relative to the xuni executable for it to be found, however.

*** Recursive calling ***
parse_resource_filename() is now the main recursive function instead of parse_resource(). It is called by make_paths_relative_to_xuni(), which is the new function that recursively parses resource files and makes paths relative to the xuni executable at one fell swoop.

*** Implementation notes ***
Several static functions were introduced to implement relative paths, including prepend_directory_to_filename() and filename_path_length().

The current implementation of make_paths_relative_to_xuni() is rather inefficient, building entirely new strings and discarding old ones -- but at least it works. In the end, hopefully it will just resize existing paths, as set_relative_paths() was trying to do.

*** Small changes to actual resource files ***
- Changed xuni's version in all of the XML resource files from 1.0.0 to 0.3.0.
- Renamed ./xuni.xml to ./test.xml.
- Removed some ancient comments in ./editor.xml and ./test.xml (former ./xuni.xml).
- Added the glowbox and shadowglow themes.

*** High memory usage ***
xuni's memory consumption is now very high, because of the extra themes, which have rather large images. xuni should only rescale images that will actually be displayed. Rescaling and storing images for all of the themes uses far more memory than is required.

=== Horizontal scrollbars and associated changes ===

*** Horizontal scrollbars ***
Began implementing horizontal scrollbars. This requires an extra two images per theme (only alienglow has them right now). It also required a re-write of a good deal of scrollbar.c. Scrolling with the mouse wheel works on both orientations of scrollbars now.

*** Modifications for horizontal scrollbars ***
Every scrollbar widget now has an enum scrollbar_orientation_t (which is a rather long name) that indicates whether it is a vertical or a horizontal scrollbar. Scrollbar initialization had to be changed somewhat.

Listboxes also have two enum scrollbar_use_ts, which indicates which scrollbars are forced and which are allowed. Forced scrollbars are always visible, and allowable scrollbars are visible if they are required. (Allowable scrollbars are not implemented yet.)

*** Textareas ***
Added a new widget that is basically a clone of listboxes: textareas. Currently, textareas can only be empty and do almost nothing. In fact, they will probably be eliminated and replaced with ordinary listboxes.

*** Use of horizontal scrollbars ***
Added an empty textarea to the options theme menu. Also added a listbox which contains the fontsample labels to the same menu via get_font_samples(). One of these labels is blue, and it still works correctly -- the first time multi-coloured text has been tested in a listbox. The listbox scrolls horizontally quite well, clipping-wise, but the amount it scrolls is hard-coded.

*** Implementation problems ***
- The seek area of the scrollbar is displayed vertically, not horizontally. Though for some reason it seems to work for textareas.
- Because images are rescaled and then rotated, the left and right scrollbar images have reversed ratios.

=== Textbox scrolling ===

*** (Almost) proper scrolling ***
Textboxes finally scroll properly (almost). They remember where they were scrolled to just like normal textboxes in other GUI widget toolkits. For example, they do not scroll as far to the left or to the right as possible, but "remember" the last place they were scrolled to and only scroll if they have to (i.e., if the text cursor moves outside the textbox).

*** Implementation problems ***
However, the new textbox scrolling has some problems. They are explained in more detail in the TODO file.
- When textboxes revert (i.e., the user presses escape), the text jumps to the end.
- When the mouse selects a character that is only partially visible, the textbox cursor can appear outside the textbox.

=== Notes on specific features ===

*** WIDGET_EVENT_UPDATE_TEXT ***
Added a new widget event, WIDGET_EVENT_UPDATE_TEXT, that only re-renders text labels. It is used when the font is changed, and has improved the performance of doing so enormously. (Rescaling all of the theme and menuhover images and so on takes a long time.)

*** get_widget_type_name() ***
Made get_widget_type_name() use the wtype array in xuni_t instead of a hard-coded static array of widget names. However, this involved passing a xuni_t to this function, which involved passing a xuni_t to many, many other functions as well.

*** assert_widget_type() ***
Added a new function, assert_widget_type(), that might be a good function to call from all widget event handling functions. Right now it always checks the type of a widget, but it could be disabled for release builds.

=== Miscellaneous ===

*** Build system ***
- Modified chwinmod.sh (and added chwinmod1.sh, a helper script) so that it really works with spaces.
- The SVN version is still determined at configure time. (Though at least it prints a better error message now.)

*** Notes ***
- Rearranged the fontsample labels in the options theme menu.
- Added several Doxygen comments. The total percentage of normal functions documented is now 23.05%, 59/256.
- Added some items to the TODO list as usual.
- xuni's line count is now 12,636.
78 files changed:
TODO
chwinmod.sh
chwinmod1.sh [new file with mode: 0755]
configure.ac
editor.xml
gui/alienglow/theme.xml
gui/bluesq/corners/in/hover.png [deleted file]
gui/bluesq/corners/out/hover.png [deleted file]
gui/bluesq/theme.xml
gui/data/data.xml
gui/data/game.xml
gui/data/menu.xml
gui/data/options.xml
gui/editor.xml
gui/font.xml
gui/glowbox/corners/active.png [new file with mode: 0644]
gui/glowbox/corners/hover.png [new file with mode: 0644]
gui/glowbox/corners/normal.png [new file with mode: 0644]
gui/glowbox/theme.xml [copied from gui/outline/theme.xml with 70% similarity]
gui/gui.xml
gui/outline/corners/active.png [moved from gui/outline/corners/in/active.png with 100% similarity]
gui/outline/corners/hover.png [moved from gui/outline/corners/in/hover.png with 100% similarity]
gui/outline/corners/normal.png [moved from gui/outline/corners/in/normal.png with 100% similarity]
gui/outline/corners/out/active.png [deleted file]
gui/outline/corners/out/hover.png [deleted file]
gui/outline/corners/out/normal.png [deleted file]
gui/outline/theme.xml
gui/raykelm/theme.xml
gui/shadow/corners.png [moved from gui/shadow/corners/in/active.png with 100% similarity]
gui/shadow/corners/in/hover.png [deleted file]
gui/shadow/corners/in/normal.png [deleted file]
gui/shadow/corners/out/active.png [deleted file]
gui/shadow/corners/out/hover.png [deleted file]
gui/shadow/corners/out/normal.png [deleted file]
gui/shadow/theme.xml
gui/shadowglow/corners/active.png [new file with mode: 0644]
gui/shadowglow/corners/hover.png [new file with mode: 0644]
gui/shadowglow/corners/normal.png [new file with mode: 0644]
gui/shadowglow/theme.xml [copied from gui/outline/theme.xml with 70% similarity]
gui/theme.xml
make32.sh
src/editor/editor.c
src/error.c
src/gui.c
src/loop.c
src/memory.c
src/resource/resource.c
src/resource/resource.h
src/test/game.c
src/test/main.h
src/test/menu.c
src/test/options.c
src/test/test.so
src/widget/Makefile.am
src/widget/box.c
src/widget/button.c
src/widget/checkbox.c
src/widget/combobox.c
src/widget/dump.c
src/widget/dump.h
src/widget/font.c
src/widget/image.c
src/widget/image_tile.c
src/widget/label.c
src/widget/listbox.c
src/widget/listbox.h
src/widget/panel.c
src/widget/scrollbar.c
src/widget/scrollbar.h
src/widget/textarea.c [new file with mode: 0644]
src/widget/textarea.h [new file with mode: 0644]
src/widget/textbox.c
src/widget/textbox.h
src/widget/theme.c
src/widget/theme.h
src/widget/widgets.c
src/widget/widgets.h
test.xml [moved from xuni.xml with 50% similarity]