mirror of
https://github.com/swaywm/sway.git
synced 2026-03-30 11:10:59 -04:00
Add dbus_get_prop_async utility
This drastically reduces the amount of boilerplate needed to get a property from a bus object.
This commit is contained in:
parent
b9f36716b5
commit
87035380e3
4 changed files with 137 additions and 293 deletions
|
|
@ -11,6 +11,23 @@ extern DBusConnection *conn;
|
|||
*/
|
||||
bool dbus_message_iter_check_signature(DBusMessageIter *iter, const char *sig);
|
||||
|
||||
/**
|
||||
* Fetches the property and calls `callback` with a message iter pointing it.
|
||||
* Performs error handling and signature checking.
|
||||
*
|
||||
* Returns: true if message is successfully sent (will not necessarily arrive)
|
||||
* and false otherwise
|
||||
*
|
||||
* NOTE: `expected_signature` must remain valid until the message reply is
|
||||
* received, please only use 'static signatures.
|
||||
*/
|
||||
bool dbus_get_prop_async(const char *destination,
|
||||
const char *path,
|
||||
const char *iface,
|
||||
const char *prop,
|
||||
const char *expected_signature,
|
||||
void(*callback)(DBusMessageIter *iter, void *data),
|
||||
void *data);
|
||||
/**
|
||||
* Should be called in main loop to dispatch events
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue