[QOF-devel] Outline of new qofevent support

Neil Williams linux at codehelp.co.uk
Sat Feb 25 17:03:06 EST 2006


On Saturday 25 February 2006 9:07 pm, Derek Atkins wrote:
> >> I'd propose:
> >>
> >>   typedef void (*QofEventHandlerWithArg)(QofEntity*, QofEventId,
> >> gpointer);

Umm, those are the exact arguments that we already have for QofEventHandler.

Did you actually mean:

typedef void (*QofEventHandlerWithArg)(QofEntity*, QofEventId, 
gpointer handler_data, gpointer event_data);

?

Or just that the existing gpointer should be handled differently? (which could 
be confusing.)

Currently, the gpointer is set when the handler is registered, not when it is 
used after an event is generated. Do you need both? Is the current gpointer 
used?

Maybe if the qof_event_register_handler_with_arg sets the original gpointer in 
HandlerInfo as NULL and uses the gpointer passed from qof_event_gen_with_arg 
instead?

Then the handler prototype would be the same but the implementation would 
differ according to HOW the prototype is registered. That's confusing too.

Using two prototypes that take the same arguments but handle them differently 
will need some careful documentation.

> >>   void qof_event_add_handler_with_arg(QofEventHandlerWithArg);

qof_event_regsister_handler_with_arg

> >>   void qof_event_del_handler_with_arg(QofEventHandlerWithArg);

qof_event_unregister_handler_with_arg

> >>   void qof_event_with_arg(QofEntity*, QofEventId, gpointer);

qof_event_gen_with_arg

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20060225/cbbf645b/attachment.bin


More information about the gnucash-devel mailing list