## EEvent EEvent |

## Synopsis

    struct              EEvent;
    enum                e_event_t;
    struct              EEventItem;
                        EEventFactory;
    struct              EEventTarget;
    void                (*EEventItemsFunc)                  (EEvent *ee,
                                                             GSList *items,
                                                             gpointer data);
    void                (*EEventFunc)                       (EEvent *ee,
                                                             EEventItem *item,
                                                             gpointer data);
    void                (*EEventFactoryFunc)                (EEvent *ee,
                                                             gpointer Param2);
    EEvent *            e_event_construct                   (EEvent *event,
                                                             const gchar *id);
    gpointer            e_event_add_items                   (EEvent *event,
                                                             GSList *items,
                                                             EEventItemsFunc freefunc,
                                                             gpointer data);
    void                e_event_remove_items                (EEvent *event,
                                                             gpointer handle);
    void                e_event_emit                        (EEvent *event,
                                                             const gchar *id,
                                                             EEventTarget *target);
    gpointer            e_event_target_new                  (EEvent *event,
                                                             gint type,
                                                             gsize size);
    void                e_event_target_free                 (EEvent *event,
                                                             gpointer target);
    struct              EEventHook;
    typedef             EEventHookTargetMap;
    typedef             EEventHookTargetMask;
    void                (*EEventHookFunc)                   (EPlugin *plugin,
                                                             EEventTarget *target);
    void                e_event_hook_class_add_target_map   (EEventHookClass *hook_class,
                                                             const EEventHookTargetMap *map);

## Object Hierarchy

      GObject
       +----EEvent

      GObject
       +----EPluginHook
             +----EEventHook

## Description

## Details

### struct EEvent

    struct EEvent;

### enum e_event_t

    enum e_event_t {
    	E_EVENT_PASS,		/* passthrough */
    	E_EVENT_SINK		/* sink events */
    };

`E_EVENT_PASS` |
`E_EVENT_SINK` |

### struct EEventItem

    struct EEventItem {
    	enum _e_event_t type;
    	gint priority;		/* priority of event */
    	const gchar *id;		/* event id */
    	gint target_type;
    	EEventFunc handle;
    	gpointer user_data;
    	guint32 enable;		/* enable mask */
    };

### EEventFactory

    typedef struct _EEventFactory EEventFactory;

### struct EEventTarget

    struct EEventTarget {
    	EEvent *event; /* used for virtual methods */

    	guint32 type;		/* targe type, for implementors */
    	guint32 mask;		/* depends on type, enable mask */

    	/* implementation fields follow */
    };

### EEventItemsFunc ()

    void                (*EEventItemsFunc)                  (EEvent *ee,
                                                             GSList *items,
                                                             gpointer data);

### EEventFunc ()

    void                (*EEventFunc)                       (EEvent *ee,
                                                             EEventItem *item,
                                                             gpointer data);

### EEventFactoryFunc ()

    void                (*EEventFactoryFunc)                (EEvent *ee,
                                                             gpointer Param2);

### e_event_construct ()

    EEvent *            e_event_construct                   (EEvent *event,
                                                             const gchar *id);

Construct the base event instance with standard parameters.

`event` : | An instantiated but uninitialised EEvent.
`id` : | Event manager id.
Returns : | the `event`

### e_event_add_items ()

    gpointer            e_event_add_items                   (EEvent *event,
                                                             GSList *items,
                                                             EEventItemsFunc freefunc,
                                                             gpointer data);

Adds `items` to the list of events listened to on the event manager `event`.

`event` : | An initialised EEvent structure.
`items` : | A list of EEventItems event listeners to register on this event manager.
`freefunc` : | A function called when the `items` list is no longer needed.
`data` : | callback data for `freefunc` and for item event handlers.
Returns : | An opaque key which can later be passed to remove_items.

### e_event_remove_items ()

    void                e_event_remove_items                (EEvent *event,
                                                             gpointer handle);

Remove items previously added. They MUST have been previously added, and may only be removed once.

`event` : | an EEvent
`handle` : | an opaque key returned by `e_event_add_items()`

### e_event_emit ()

    void                e_event_emit                        (EEvent *event,
                                                             const gchar *id,
                                                             EEventTarget *target);

Emit an event. `target` will automatically be freed once its emission is complete.

`id` : | Event name. This will be compared against EEventItem.id.
`target` : | The target describing the event context. This will be implementation defined.

### e_event_target_new ()

    gpointer            e_event_target_new                  (EEvent *event,
                                                             gint type,
                                                             gsize size);

Allocate a new event target suitable for this class. It is up to the implementation to define the available target types and their structure.

`event` : | An initialised EEvent instance.
`type` : | type, up to implementor
`size` : | The size of memory to allocate. This must be >= sizeof(EEventTarget).

### e_event_target_free ()

    void                e_event_target_free                 (EEvent *event,
                                                             gpointer target);

Free a target. This invokes the virtual free method on the EEventClass.

`event` : | An initialised EEvent instance on which this target was allocated.
`target` : | The target to free.

### struct EEventHook

    struct EEventHook;

### EEventHookTargetMap

    typedef struct _EPluginHookTargetMap EEventHookTargetMap;

### EEventHookTargetMask

    typedef struct _EPluginHookTargetKey EEventHookTargetMask;

### EEventHookFunc ()

    void                (*EEventHookFunc)                   (EPlugin *plugin,
                                                             EEventTarget *target);

### e_event_hook_class_add_target_map ()

    void                e_event_hook_class_add_target_map   (EEventHookClass *hook_class,
                                                             const EEventHookTargetMap *map);

Add a target map to a concrete derived class of EEvent. The target map enumerates a single target type and th eenable mask bit names, so that the type can be loaded automatically by the base EEvent class.

`hook_class` : | The derived EEventHook class.
`map` : | A map used to describe a single EEventTarget type for this class.