RE: [AD] [back from AL] new window hooks patch - specifics

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I've attached a (tested this time :-) patch which does the following:

- adds a set_window_close_hook field to SYSTEM_DRIVER in allegro.h
- creates the set_window_close_hook() function in alinline.h
- modifies the SYSTEM_DRIVER declarations in allegro.h (system_none),
bsystem.c, dsystem.c, lsystem.c, wsystem.c and xsystem.c, to include the new
set_window_close_hook field.

Note that I have not added any functionality; the SYSTEM_DRIVERs all contain
NULL for the set_window_close_hook field. All I've done is prepared Allegro
to receive the close hook functionality.

So this is the new function prototype:

void set_window_close_hook(int enable, void (*proc)());

If enable is 0, the close box will be disabled if possible. On X where it's
not possible, I'm organising another vote, the details of which I'll post on
the [AL] list in a moment.

proc can be NULL to restore default behaviour, or else it can point to a
user function to handle the close request.

Here are some examples:

void my_close_hook();

set_window_close_hook(0,NULL); // disable the close box
set_window_close_hook(1,my_close_hook); // install a hook
set_window_close_hook(1,NULL); // restore default action

Ben Davis

Attachment: closehook.diff
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/