EggDBus Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites | Signals |
Synopsis
EggDBusProperties; EggDBusPropertiesIface; #define EGG_DBUS_QUERY_INTERFACE_PROPERTIES (object_proxy) gboolean egg_dbus_properties_get_sync (EggDBusProperties *instance, EggDBusCallFlags call_flags, const gchar *interface_name, const gchar *property_name, EggDBusVariant **out_value, GCancellable *cancellable, GError **error); gboolean egg_dbus_properties_get_all_sync (EggDBusProperties *instance, EggDBusCallFlags call_flags, const gchar *interface_name, EggDBusHashMap **out_properties, GCancellable *cancellable, GError **error); gboolean egg_dbus_properties_set_sync (EggDBusProperties *instance, EggDBusCallFlags call_flags, const gchar *interface_name, const gchar *property_name, EggDBusVariant *value, GCancellable *cancellable, GError **error); guint egg_dbus_properties_get (EggDBusProperties *instance, EggDBusCallFlags call_flags, const gchar *interface_name, const gchar *property_name, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean egg_dbus_properties_get_finish (EggDBusProperties *instance, EggDBusVariant **out_value, GAsyncResult *res, GError **error); guint egg_dbus_properties_get_all (EggDBusProperties *instance, EggDBusCallFlags call_flags, const gchar *interface_name, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean egg_dbus_properties_get_all_finish (EggDBusProperties *instance, EggDBusHashMap **out_properties, GAsyncResult *res, GError **error); guint egg_dbus_properties_set (EggDBusProperties *instance, EggDBusCallFlags call_flags, const gchar *interface_name, const gchar *property_name, EggDBusVariant *value, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean egg_dbus_properties_set_finish (EggDBusProperties *instance, GAsyncResult *res, GError **error); void egg_dbus_properties_handle_get_finish (EggDBusMethodInvocation *method_invocation, EggDBusVariant *out_value); void egg_dbus_properties_handle_get_all_finish (EggDBusMethodInvocation *method_invocation, EggDBusHashMap *out_properties); void egg_dbus_properties_handle_set_finish (EggDBusMethodInvocation *method_invocation); void egg_dbus_properties_emit_signal_egg_dbus_changed (EggDBusProperties *instance, const gchar *destination, const gchar *interface_name, EggDBusHashMap *changed_properties);
Description
Many native APIs will have a concept of object properties or attributes. These can be exposed via the EggDBusProperties interface. The available properties and whether they are writable can be determined by using the EggDBusIntrospectable interface.
Details
EggDBusPropertiesIface
typedef struct { EggDBusInterfaceIface g_iface; void (* handle_get) ( EggDBusProperties *instance, const gchar *interface_name, const gchar *property_name, EggDBusMethodInvocation *method_invocation); void (* handle_get_all) ( EggDBusProperties *instance, const gchar *interface_name, EggDBusMethodInvocation *method_invocation); void (* handle_set) ( EggDBusProperties *instance, const gchar *interface_name, const gchar *property_name, EggDBusVariant *value, EggDBusMethodInvocation *method_invocation); } EggDBusPropertiesIface;
Interface VTable for implementing the org.freedesktop.DBus.Properties D-Bus interface.
EggDBusInterfaceIface |
The parent interface. |
|
Gets the value of the property with name property_name on the interface with name interface_name .
|
|
Gets all properties on the interface with the name interface_name .
|
|
Sets the value of the property with name property_name on the interface with name interface_name to value .
|
EGG_DBUS_QUERY_INTERFACE_PROPERTIES()
#define EGG_DBUS_QUERY_INTERFACE_PROPERTIES(object_proxy) (EGG_DBUS_PROPERTIES (egg_dbus_object_proxy_query_interface (object_proxy, EGG_DBUS_TYPE_PROPERTIES)))
Convenience macro to get an interface proxy for the remote object represented
by object_proxy
. See egg_dbus_object_proxy_query_interface()
for details.
|
A EggDBusObjectProxy. |
Returns : |
An instance derived from EggDBusInterfaceProxy that implements the
EggDBusProperties interface. This instance can be used to access the
org.freedesktop.DBus.Properties D-Bus interface on the remote
object represented by object_proxy . Do not ref or unref the returned instance,
it is owned by object_proxy .
|
egg_dbus_properties_get_sync ()
gboolean egg_dbus_properties_get_sync (EggDBusProperties *instance, EggDBusCallFlags call_flags, const gchar *interface_name, const gchar *property_name, EggDBusVariant **out_value, GCancellable *cancellable, GError **error);
Gets the value of the property with name property_name
on the interface with name interface_name
.
This function synchronously invokes the Get() method on the org.freedesktop.DBus.Properties interface on the object represented by instance
.
See egg_dbus_properties_get()
for the asynchronous version of this function.
|
A EggDBusProperties. |
|
Flags from EggDBusCallFlags detailing how the method should be invoked. |
|
The name of the D-Bus interface. |
|
The name of the property. |
|
The value of the property. Free with g_object_unref() .
|
|
A GCancellable or NULL .
|
|
Return location for error. |
Returns : |
TRUE if the method call succeeded, FALSE if error is set.
|
egg_dbus_properties_get_all_sync ()
gboolean egg_dbus_properties_get_all_sync (EggDBusProperties *instance, EggDBusCallFlags call_flags, const gchar *interface_name, EggDBusHashMap **out_properties, GCancellable *cancellable, GError **error);
Gets all properties on the interface with the name interface_name
.
This function synchronously invokes the GetAll() method on the org.freedesktop.DBus.Properties interface on the object represented by instance
.
See egg_dbus_properties_get_all()
for the asynchronous version of this function.
|
A EggDBusProperties. |
|
Flags from EggDBusCallFlags detailing how the method should be invoked. |
|
The name of the D-Bus interface. |
|
A dictionary containing all the properties. Free with g_object_unref() .
|
|
A GCancellable or NULL .
|
|
Return location for error. |
Returns : |
TRUE if the method call succeeded, FALSE if error is set.
|
egg_dbus_properties_set_sync ()
gboolean egg_dbus_properties_set_sync (EggDBusProperties *instance, EggDBusCallFlags call_flags, const gchar *interface_name, const gchar *property_name, EggDBusVariant *value, GCancellable *cancellable, GError **error);
Sets the value of the property with name property_name
on the interface with name interface_name
to value
.
This function synchronously invokes the Set() method on the org.freedesktop.DBus.Properties interface on the object represented by instance
.
See egg_dbus_properties_set()
for the asynchronous version of this function.
|
A EggDBusProperties. |
|
Flags from EggDBusCallFlags detailing how the method should be invoked. |
|
The name of the D-Bus interface. |
|
The name of the property. |
|
The value to set. |
|
A GCancellable or NULL .
|
|
Return location for error. |
Returns : |
TRUE if the method call succeeded, FALSE if error is set.
|
egg_dbus_properties_get ()
guint egg_dbus_properties_get (EggDBusProperties *instance, EggDBusCallFlags call_flags, const gchar *interface_name, const gchar *property_name, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Gets the value of the property with name property_name
on the interface with name interface_name
.
This function asynchronously invokes the Get() method
on the org.freedesktop.DBus.Properties interface
on the object represented by instance
.
When the reply is ready, callback
will be called (on the main thread).
You can then call egg_dbus_properties_get_finish()
to get the result.
See egg_dbus_properties_get_sync()
for the synchronous version of this function.
|
A EggDBusProperties. |
|
Flags from EggDBusCallFlags detailing how the method should be invoked. |
|
The name of the D-Bus interface. |
|
The name of the property. |
|
A GCancellable or NULL .
|
|
Callback to invoke when the reply is ready. |
|
User data to pass to callback .
|
Returns : |
A pending call id (never zero) that can be used with egg_dbus_connection_pending_call_cancel() or egg_dbus_connection_pending_call_block() .
|
egg_dbus_properties_get_finish ()
gboolean egg_dbus_properties_get_finish (EggDBusProperties *instance, EggDBusVariant **out_value, GAsyncResult *res, GError **error);
Finishes an asynchronous method invocation started with egg_dbus_properties_get()
.
|
A EggDBusProperties. |
|
The value of the property. Free with g_object_unref() .
|
|
A GAsyncResult obtained from the GAsyncReadyCallback function passed to egg_dbus_properties_get() .
|
|
Return location for error. |
Returns : |
TRUE if the method call succeeded, FALSE if error is set.
|
egg_dbus_properties_get_all ()
guint egg_dbus_properties_get_all (EggDBusProperties *instance, EggDBusCallFlags call_flags, const gchar *interface_name, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Gets all properties on the interface with the name interface_name
.
This function asynchronously invokes the GetAll() method
on the org.freedesktop.DBus.Properties interface
on the object represented by instance
.
When the reply is ready, callback
will be called (on the main thread).
You can then call egg_dbus_properties_get_all_finish()
to get the result.
See egg_dbus_properties_get_all_sync()
for the synchronous version of this function.
|
A EggDBusProperties. |
|
Flags from EggDBusCallFlags detailing how the method should be invoked. |
|
The name of the D-Bus interface. |
|
A GCancellable or NULL .
|
|
Callback to invoke when the reply is ready. |
|
User data to pass to callback .
|
Returns : |
A pending call id (never zero) that can be used with egg_dbus_connection_pending_call_cancel() or egg_dbus_connection_pending_call_block() .
|
egg_dbus_properties_get_all_finish ()
gboolean egg_dbus_properties_get_all_finish (EggDBusProperties *instance, EggDBusHashMap **out_properties, GAsyncResult *res, GError **error);
Finishes an asynchronous method invocation started with egg_dbus_properties_get_all()
.
|
A EggDBusProperties. |
|
A dictionary containing all the properties. Free with g_object_unref() .
|
|
A GAsyncResult obtained from the GAsyncReadyCallback function passed to egg_dbus_properties_get_all() .
|
|
Return location for error. |
Returns : |
TRUE if the method call succeeded, FALSE if error is set.
|
egg_dbus_properties_set ()
guint egg_dbus_properties_set (EggDBusProperties *instance, EggDBusCallFlags call_flags, const gchar *interface_name, const gchar *property_name, EggDBusVariant *value, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Sets the value of the property with name property_name
on the interface with name interface_name
to value
.
This function asynchronously invokes the Set() method
on the org.freedesktop.DBus.Properties interface
on the object represented by instance
.
When the reply is ready, callback
will be called (on the main thread).
You can then call egg_dbus_properties_set_finish()
to get the result.
See egg_dbus_properties_set_sync()
for the synchronous version of this function.
|
A EggDBusProperties. |
|
Flags from EggDBusCallFlags detailing how the method should be invoked. |
|
The name of the D-Bus interface. |
|
The name of the property. |
|
The value to set. |
|
A GCancellable or NULL .
|
|
Callback to invoke when the reply is ready. |
|
User data to pass to callback .
|
Returns : |
A pending call id (never zero) that can be used with egg_dbus_connection_pending_call_cancel() or egg_dbus_connection_pending_call_block() .
|
egg_dbus_properties_set_finish ()
gboolean egg_dbus_properties_set_finish (EggDBusProperties *instance, GAsyncResult *res, GError **error);
Finishes an asynchronous method invocation started with egg_dbus_properties_set()
.
|
A EggDBusProperties. |
|
A GAsyncResult obtained from the GAsyncReadyCallback function passed to egg_dbus_properties_set() .
|
|
Return location for error. |
Returns : |
TRUE if the method call succeeded, FALSE if error is set.
|
egg_dbus_properties_handle_get_finish ()
void egg_dbus_properties_handle_get_finish (EggDBusMethodInvocation *method_invocation, EggDBusVariant *out_value);
Function to be called by implementers of the org.freedesktop.DBus.Properties D-Bus interface to finish handling the Get() method.
|
The value of the property. |
|
A EggDBusMethodInvocation. |
egg_dbus_properties_handle_get_all_finish ()
void egg_dbus_properties_handle_get_all_finish (EggDBusMethodInvocation *method_invocation, EggDBusHashMap *out_properties);
Function to be called by implementers of the org.freedesktop.DBus.Properties D-Bus interface to finish handling the GetAll() method.
|
A dictionary containing all the properties. |
|
A EggDBusMethodInvocation. |
egg_dbus_properties_handle_set_finish ()
void egg_dbus_properties_handle_set_finish (EggDBusMethodInvocation *method_invocation);
Function to be called by implementers of the org.freedesktop.DBus.Properties D-Bus interface to finish handling the Set() method.
|
A EggDBusMethodInvocation. |
egg_dbus_properties_emit_signal_egg_dbus_changed ()
void egg_dbus_properties_emit_signal_egg_dbus_changed (EggDBusProperties *instance, const gchar *destination, const gchar *interface_name, EggDBusHashMap *changed_properties);
Type safe wrapper for emitting the "egg-dbus-changed" signal.
|
A GObject derived type implementing the EggDBusProperties interface. |
|
The destination of the signal or NULL to emit signals to all listeners.
|
|
The name of the D-Bus interface. |
|
A dictionary containing the changed properties. |
Signal Details
The "egg-dbus-changed"
signal
void user_function (EggDBusProperties *instance, gchar *interface_name, EggDBusHashMap *changed_properties, gpointer user_data) : Run Last
Emitted when one or more properties change on an interface. Note: this signal is proprietary to EggDBus; no other D-Bus implementation will emit it.
|
A EggDBusProperties. |
|
The name of the D-Bus interface. |
|
A dictionary containing the changed properties. |
|
user data set when the signal handler was connected. |