From 9dd917ecf3ba4cb37b8de2aa9c7e0540ee61bfe8 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Sun, 26 Feb 2006 19:03:37 +0000 Subject: [PATCH] simplify creation of new application events git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13397 57a11ea4-9604-0410-9ed3-97b8803252fd --- lib/libqof/qof/qofevent.c | 2 +- lib/libqof/qof/qofevent.h | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lib/libqof/qof/qofevent.c b/lib/libqof/qof/qofevent.c index 7833e7b395..76504c6f56 100644 --- a/lib/libqof/qof/qofevent.c +++ b/lib/libqof/qof/qofevent.c @@ -205,7 +205,7 @@ qof_event_generate_internal (QofEntity *entity, QofEventId event_id, g_return_if_fail(entity); - if (event_id <= QOF_DEFAULT_EVENT_LIMIT) + if (event_id <= QOF_EVENT_BASE) { use_old_handlers = TRUE; } diff --git a/lib/libqof/qof/qofevent.h b/lib/libqof/qof/qofevent.h index 899c0ddfd5..a5e148e44a 100644 --- a/lib/libqof/qof/qofevent.h +++ b/lib/libqof/qof/qofevent.h @@ -40,23 +40,36 @@ /** Define the type of events allowed. */ typedef gint QofEventId; +/** \brief Allow application-specific events to be created. + +Used together with QOF_EVENT_BASE to simplify creation +of application events without interfering with any new +events added within QOF. + +/verbatim +#define APP_EVENT_A QOF_MAKE_EVENT(QOF_EVENT_BASE+0) +#define APP_EVENT_B QOF_MAKE_EVENT(QOF_EVENT_BASE+1) +/endverbatim +*/ +#define QOF_MAKE_EVENT(x) (1<