Created common signature for panel event handling functions.
commit120d3051580ccebb017a5231b92e1dc18ceeb159
authordwk <dwks@theprogrammingsite.com>
Sat, 17 May 2008 22:32:29 +0000 (17 16:32 -0600)
committerdwk <dwks@theprogrammingsite.com>
Sat, 17 May 2008 22:32:29 +0000 (17 16:32 -0600)
treed3c3e85759c49cd5558b5e8f1e896b365203c3e6
parent194e5335d55e2af36ed62c52a217c1f4dee49df1
Created common signature for panel event handling functions.

Made all panel event handlers have the same signature:
    typedef int (*panel_event_func_t)(struct xuni_t *xuni,
        struct panel_data_t *data);
Created a structure, widgets.h::panel_event_t, which handles the
event-specific variables, much like struct widget_t, with a union of
structures. (This needs to be converted to a union of pointers to structures
to save space.)

Note that many events do not use the int return value of this signature.

Updated all panel event handlers to match the new function signature. Any
parameters were translated into equivalent variables, with as little effort
as possible.

At the same time, renamed all panel event handlers to <panel>_<event>.
In other words:
- init_game() became game_init();
- game_perform_click() became game_click();
- and so on.

Also note that several functions could use the new panel_event_recursive() in
loop.c instead of old, specific functions like call_perform_click_func(). There
are many other optimizations that could be made now that a panel event handler
pointer can be created.
15 files changed:
TODO
gui/data/game.xml
gui/data/menu.xml
gui/data/options.xml
src/editor/editor.c
src/loop.c
src/loop.h
src/test/game.c
src/test/game.h
src/test/menu.c
src/test/menu.h
src/test/options.c
src/test/options.h
src/widget/panel.c
src/widget/widgets.h