diff options
author | Thomas Haller <thaller@redhat.com> | 2018-04-03 16:37:20 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-04-13 09:09:46 +0200 |
commit | 86229a669bc3c51faf19f15c6a382c20f849b78e (patch) | |
tree | 395e904ee1d0271cc3690be13ca8dbbc6727700a /src/nm-dbus-utils.h | |
parent | 4127f1234fc4593cb80ad01435ac2b1743c8d5e2 (diff) | |
download | NetworkManager-86229a669bc3c51faf19f15c6a382c20f849b78e.tar.gz |
core: add NMDBusTrackObjPath helper
When one D-Bus object exposes (the path of) another D-Bus object,
we want that the path property gets cleared before the other
object gets unexported(). That essentially requires to register
to the "exported-changed" signal.
Add a helper struct NMDBusTrackObjPath to help with this.
Diffstat (limited to 'src/nm-dbus-utils.h')
-rw-r--r-- | src/nm-dbus-utils.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/nm-dbus-utils.h b/src/nm-dbus-utils.h index 3107a29c82..e7e930e938 100644 --- a/src/nm-dbus-utils.h +++ b/src/nm-dbus-utils.h @@ -179,4 +179,34 @@ void nm_dbus_utils_g_value_set_object_path_from_hash (GValue *value, GHashTable *hash, gboolean expect_all_exported); +/*****************************************************************************/ + +typedef struct { + union { + gpointer const obj; + gpointer _obj; + }; + GObject *_notify_target; + const GParamSpec *_notify_pspec; + gulong _notify_signal_id; + union { + const bool visible; + bool _visible; + }; +} NMDBusTrackObjPath; + +void nm_dbus_track_obj_path_init (NMDBusTrackObjPath *track, + GObject *target, + const GParamSpec *pspec); + +void nm_dbus_track_obj_path_deinit (NMDBusTrackObjPath *track); + +void nm_dbus_track_obj_path_notify (const NMDBusTrackObjPath *track); + +const char *nm_dbus_track_obj_path_get (const NMDBusTrackObjPath *track); + +void nm_dbus_track_obj_path_set (NMDBusTrackObjPath *track, + gpointer obj, + gboolean visible); + #endif /* __NM_DBUS_UTILS_H__ */ |