Debian Codegraph @

lib/wp/event.h

raw
1 /* WirePlumber
2 *
3 * Copyright © 2022 Collabora Ltd.
4 * @author George Kiagiadakis <[email protected]>
5 *
6 * SPDX-License-Identifier: MIT
7 */
8
9 #ifndef __WIREPLUMBER_EVENT_H__
10 #define __WIREPLUMBER_EVENT_H__
11
12 #include "properties.h"
13 #include "iterator.h"
14
15 G_BEGIN_DECLS
16
17 typedef struct _WpEventDispatcher WpEventDispatcher;
18
19 /*! \defgroup wpevent WpEvent */
20 /*!
21 * \struct WpEvent
22 *
23 * WpEvent describes an event, an event is an entity which can be pushed on to
24 * event stack and the event dispatcher is going to pick and dispatch it.
25 *
26 */
27 #define WP_TYPE_EVENT (wp_event_get_type ())
28 WP_API
29 GType wp_event_get_type (void) G_GNUC_CONST;
30
31 typedef struct _WpEvent WpEvent;
32
33 WP_API
34 WpEvent * wp_event_new (const gchar * type, gint priority,
35 WpProperties * properties, GObject * source, GObject * subject);
36
37 WP_API
38 WpEvent * wp_event_ref (WpEvent * self);
39
40 WP_API
41 void wp_event_unref (WpEvent * self);
42
43 WP_API
44 gint wp_event_get_priority (WpEvent * self);
45
46 WP_API
47 WpProperties * wp_event_get_properties (WpEvent * self);
48
49 WP_API
50 GObject * wp_event_get_source (WpEvent * self);
51
52 WP_API
53 const gchar *wp_event_get_name(WpEvent *self);
54
55 WP_API
56 GObject * wp_event_get_subject (WpEvent * self);
57
58 WP_API
59 GCancellable * wp_event_get_cancellable (WpEvent * self);
60
61 WP_API
62 void wp_event_stop_processing (WpEvent * self);
63
64 WP_API
65 void wp_event_set_data (WpEvent * self, const gchar * key, const GValue * data);
66
67 WP_API
68 const GValue * wp_event_get_data (WpEvent * self, const gchar * key);
69
70 WP_API
71 gboolean wp_event_collect_hooks (WpEvent * event,
72 WpEventDispatcher * dispatcher);
73
74 WP_API
75 WpIterator * wp_event_new_hooks_iterator (WpEvent * event);
76
77 G_DEFINE_AUTOPTR_CLEANUP_FUNC (WpEvent, wp_event_unref)
78
79 G_END_DECLS
80
81 #endif