Created Makefiles for the dist/ subdirectory and put dist/ under subversion control.
commite71415d31c7f395fbe06d276a6fa6d3aedfc3762
authordwk <dwk@b022f027-f587-4676-bc72-f0cf7b603704>
Tue, 11 Sep 2007 23:19:55 +0000 (11 23:19 +0000)
committerdwk <dwk@b022f027-f587-4676-bc72-f0cf7b603704>
Tue, 11 Sep 2007 23:19:55 +0000 (11 23:19 +0000)
tree22a2e65ad62a3c98dd3fd43d2845f2a7fb1e02fc
parent9eb9de8fc6b8251fa3bb7f1648e3a616d1b2eea1
Created Makefiles for the dist/ subdirectory and put dist/ under subversion control.

Added reasonably complete support for composite widgets with struct widget_t::compose, a panel_t structure. Listboxes are composed of a scrollbar, which is composed of buttons.

Mouse hovering etc is checked for the components of composite objects before falling through to the composite object itself, by calling set_compose_sel() from set_widget_repaint(). Hovering over and selecting scrollbars in listboxes now works properly.

There are probably some bugs relating to the freeing of composite objects.

set_button_image() is a new function just like set_button(), but it takes an already-existing SDL_Surface for an argument.

Currently, scrollbars' composite buttons use the same images; and so to prevent multiple frees of the images, the SDL's SDL_Surface::refcount is incremented. This is probably not portable and should be done another way.

struct listbox_t::vscroll still exists, though it is just a pointer to widget_t::compose::widget[0].

When a widget is selected, and then the mouse is pressed elsewhere and released back inside the selected widget, the widget now remains selected. (The modifications in loop.c all relate to this.)

options.c uses simpler code to determine which widgets are selected. menu.c and game.c still use the old method with lots of if statements.

Made set_widget_sel_repaint() and set_widget_sel() take a struct panel_t argument instead of a struct widget_t ** and a size_t argument. The same happened to in_widget_array(), but it got renamed to widget_in_panel() in the process.

Part of free_gui() was separated out into free_panel() once again.
12 files changed:
Makefile
Makewin
dist/Makefile [new file with mode: 0644]
dist/Makewin [new file with mode: 0644]
src/game.c
src/graphics.c
src/graphics.h
src/gui.c
src/gui.h
src/loop.c
src/menu.c
src/options.c