|  |  |  | GIO Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Prerequisites | Known Implementations | Properties | Signals | ||||
| ExampleAnimalExampleAnimal — Generated C code for the org.gtk.GDBus.Example.ObjectManager.Animal D-Bus interface | 
ExampleAnimal; struct ExampleAnimalIface; GDBusInterfaceInfo * example_animal_interface_info (void); guint example_animal_override_properties (GObjectClass *klass,guint property_id_begin); void example_animal_call_poke (ExampleAnimal *proxy,gboolean arg_make_sad,gboolean arg_make_happy,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean example_animal_call_poke_finish (ExampleAnimal *proxy,GAsyncResult *res,GError **error); gboolean example_animal_call_poke_sync (ExampleAnimal *proxy,gboolean arg_make_sad,gboolean arg_make_happy,GCancellable *cancellable,GError **error); void example_animal_complete_poke (ExampleAnimal *object,GDBusMethodInvocation *invocation); void example_animal_emit_jumped (ExampleAnimal *object,gdouble arg_height); const gchar * example_animal_get_mood (ExampleAnimal *object); gchar * example_animal_dup_mood (ExampleAnimal *object); void example_animal_set_mood (ExampleAnimal *object,const gchar *value); struct ExampleAnimalProxy; struct ExampleAnimalProxyClass; void example_animal_proxy_new (GDBusConnection *connection,GDBusProxyFlags flags,const gchar *name,const gchar *object_path,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); ExampleAnimal * example_animal_proxy_new_finish (GAsyncResult *res,GError **error); ExampleAnimal * example_animal_proxy_new_sync (GDBusConnection *connection,GDBusProxyFlags flags,const gchar *name,const gchar *object_path,GCancellable *cancellable,GError **error); void example_animal_proxy_new_for_bus (GBusType bus_type,GDBusProxyFlags flags,const gchar *name,const gchar *object_path,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); ExampleAnimal * example_animal_proxy_new_for_bus_finish (GAsyncResult *res,GError **error); ExampleAnimal * example_animal_proxy_new_for_bus_sync (GBusType bus_type,GDBusProxyFlags flags,const gchar *name,const gchar *object_path,GCancellable *cancellable,GError **error); struct ExampleAnimalSkeleton; struct ExampleAnimalSkeletonClass; ExampleAnimal * example_animal_skeleton_new (void);
GInterface +----ExampleAnimal
GObject +----GDBusProxy +----ExampleAnimalProxy
GObject +----GDBusInterfaceSkeleton +----ExampleAnimalSkeleton
ExampleAnimalProxy implements GDBusInterface, GInitable, GAsyncInitable and ExampleAnimal.
ExampleAnimalSkeleton implements GDBusInterface and ExampleAnimal.
This section contains code for working with the org.gtk.GDBus.Example.ObjectManager.Animal D-Bus interface in C.
typedef struct _ExampleAnimal ExampleAnimal;
Abstract interface type for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Animal.
Since 2.30
struct ExampleAnimalIface {
  GTypeInterface parent_iface;
  gboolean (*handle_poke) (
    ExampleAnimal *object,
    GDBusMethodInvocation *invocation,
    gboolean arg_make_sad,
    gboolean arg_make_happy);
  const gchar * (*get_mood) (ExampleAnimal *object);
  void (*jumped) (
    ExampleAnimal *object,
    gdouble arg_height);
};
Virtual table for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Animal.
| GTypeInterface  | The parent interface. | 
| Handler for the "handle-poke" signal. | |
| Getter for the "mood" property. | |
| Handler for the "jumped" signal. | 
Since 2.30
GDBusInterfaceInfo * example_animal_interface_info      (void);
Gets a machine-readable description of the org.gtk.GDBus.Example.ObjectManager.Animal D-Bus interface.
| Returns : | A GDBusInterfaceInfo. Do not free. [transfer none] | 
Since 2.30
guint example_animal_override_properties (GObjectClass *klass,guint property_id_begin);
Overrides all GObject properties in the ExampleAnimal interface for a concrete class. The properties are overridden in the order they are defined.
| 
 | The class structure for a GObject-derived class. | 
| 
 | The property id to assign to the first overridden property. | 
| Returns : | The last property id. | 
Since 2.30
void example_animal_call_poke (ExampleAnimal *proxy,gboolean arg_make_sad,gboolean arg_make_happy,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously invokes the Poke() D-Bus method on proxy.
When the operation is finished, callback will be invoked in the thread-default main loop of the thread you are calling this method from.
You can then call example_animal_call_poke_finish() to get the result of the operation.
See example_animal_call_poke_sync() for the synchronous, blocking version of this method.
| 
 | A ExampleAnimalProxy. | 
| 
 | Argument to pass with the method invocation. | 
| 
 | Argument to pass with the method invocation. | 
| 
 | A GCancellable or NULL. [allow-none] | 
| 
 | A GAsyncReadyCallback to call when the request is satisfied or NULL. | 
| 
 | User data to pass to callback. | 
Since 2.30
gboolean example_animal_call_poke_finish (ExampleAnimal *proxy,GAsyncResult *res,GError **error);
Finishes an operation started with example_animal_call_poke().
| 
 | A ExampleAnimalProxy. | 
| 
 | The GAsyncResult obtained from the GAsyncReadyCallback passed to example_animal_call_poke(). | 
| 
 | Return location for error or NULL. | 
| Returns : | TRUEif the call succeded,FALSEiferroris set. [skip] | 
Since 2.30
gboolean example_animal_call_poke_sync (ExampleAnimal *proxy,gboolean arg_make_sad,gboolean arg_make_happy,GCancellable *cancellable,GError **error);
Synchronously invokes the Poke() D-Bus method on proxy. The calling thread is blocked until a reply is received.
See example_animal_call_poke() for the asynchronous version of this method.
| 
 | A ExampleAnimalProxy. | 
| 
 | Argument to pass with the method invocation. | 
| 
 | Argument to pass with the method invocation. | 
| 
 | A GCancellable or NULL. [allow-none] | 
| 
 | Return location for error or NULL. | 
| Returns : | TRUEif the call succeded,FALSEiferroris set. [skip] | 
Since 2.30
void example_animal_complete_poke (ExampleAnimal *object,GDBusMethodInvocation *invocation);
Helper function used in service implementations to finish handling invocations of the Poke() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
This method will free invocation, you cannot use it afterwards.
| 
 | A ExampleAnimal. | 
| 
 | A GDBusMethodInvocation. [transfer full] | 
Since 2.30
void example_animal_emit_jumped (ExampleAnimal *object,gdouble arg_height);
Emits the "Jumped" D-Bus signal.
| 
 | A ExampleAnimal. | 
| 
 | Argument to pass with the signal. | 
Since 2.30
const gchar *       example_animal_get_mood             (ExampleAnimal *object);
Gets the value of the "Mood" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
object was constructed. Use example_animal_dup_mood() if on another thread.
| 
 | A ExampleAnimal. | 
| Returns : | The property value or NULLif the property is not set. Do not free the returned value, it belongs toobject. [transfer none] | 
Since 2.30
gchar *             example_animal_dup_mood             (ExampleAnimal *object);
Gets a copy of the "Mood" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
| 
 | A ExampleAnimal. | 
| Returns : | The property value or NULLif the property is not set. The returned value should be freed withg_free(). [transfer full] | 
Since 2.30
void example_animal_set_mood (ExampleAnimal *object,const gchar *value);
Sets the "Mood" D-Bus property to value.
Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
| 
 | A ExampleAnimal. | 
| 
 | The value to set. | 
Since 2.30
struct ExampleAnimalProxy;
The ExampleAnimalProxy structure contains only private data and should only be accessed using the provided API.
Since 2.30
struct ExampleAnimalProxyClass {
  GDBusProxyClass parent_class;
};
Class structure for ExampleAnimalProxy.
| GDBusProxyClass  | The parent class. | 
Since 2.30
void example_animal_proxy_new (GDBusConnection *connection,GDBusProxyFlags flags,const gchar *name,const gchar *object_path,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously creates a proxy for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Animal. See g_dbus_proxy_new() for more details.
When the operation is finished, callback will be invoked in the thread-default main loop of the thread you are calling this method from.
You can then call example_animal_proxy_new_finish() to get the result of the operation.
See example_animal_proxy_new_sync() for the synchronous, blocking version of this constructor.
| 
 | A GDBusConnection. | 
| 
 | Flags from the GDBusProxyFlags enumeration. | 
| 
 | A bus name (well-known or unique) or NULLifconnectionis not a message bus connection. [allow-none] | 
| 
 | An object path. | 
| 
 | A GCancellable or NULL. [allow-none] | 
| 
 | A GAsyncReadyCallback to call when the request is satisfied. | 
| 
 | User data to pass to callback. | 
Since 2.30
ExampleAnimal * example_animal_proxy_new_finish (GAsyncResult *res,GError **error);
Finishes an operation started with example_animal_proxy_new().
| 
 | The GAsyncResult obtained from the GAsyncReadyCallback passed to example_animal_proxy_new(). | 
| 
 | Return location for error or NULL | 
| Returns : | The constructed proxy object or NULLiferroris set. [transfer full][type ExampleAnimalProxy] | 
Since 2.30
ExampleAnimal * example_animal_proxy_new_sync (GDBusConnection *connection,GDBusProxyFlags flags,const gchar *name,const gchar *object_path,GCancellable *cancellable,GError **error);
Synchronously creates a proxy for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Animal. See g_dbus_proxy_new_sync() for more details.
The calling thread is blocked until a reply is received.
See example_animal_proxy_new() for the asynchronous version of this constructor.
| 
 | A GDBusConnection. | 
| 
 | Flags from the GDBusProxyFlags enumeration. | 
| 
 | A bus name (well-known or unique) or NULLifconnectionis not a message bus connection. [allow-none] | 
| 
 | An object path. | 
| 
 | A GCancellable or NULL. [allow-none] | 
| 
 | Return location for error or NULL | 
| Returns : | The constructed proxy object or NULLiferroris set. [transfer full][type ExampleAnimalProxy] | 
Since 2.30
void example_animal_proxy_new_for_bus (GBusType bus_type,GDBusProxyFlags flags,const gchar *name,const gchar *object_path,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Like example_animal_proxy_new() but takes a GBusType instead of a GDBusConnection.
When the operation is finished, callback will be invoked in the thread-default main loop of the thread you are calling this method from.
You can then call example_animal_proxy_new_for_bus_finish() to get the result of the operation.
See example_animal_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
| 
 | A GBusType. | 
| 
 | Flags from the GDBusProxyFlags enumeration. | 
| 
 | A bus name (well-known or unique). | 
| 
 | An object path. | 
| 
 | A GCancellable or NULL. [allow-none] | 
| 
 | A GAsyncReadyCallback to call when the request is satisfied. | 
| 
 | User data to pass to callback. | 
Since 2.30
ExampleAnimal * example_animal_proxy_new_for_bus_finish (GAsyncResult *res,GError **error);
Finishes an operation started with example_animal_proxy_new_for_bus().
| 
 | The GAsyncResult obtained from the GAsyncReadyCallback passed to example_animal_proxy_new_for_bus(). | 
| 
 | Return location for error or NULL | 
| Returns : | The constructed proxy object or NULLiferroris set. [transfer full][type ExampleAnimalProxy] | 
Since 2.30
ExampleAnimal * example_animal_proxy_new_for_bus_sync (GBusType bus_type,GDBusProxyFlags flags,const gchar *name,const gchar *object_path,GCancellable *cancellable,GError **error);
Like example_animal_proxy_new_sync() but takes a GBusType instead of a GDBusConnection.
The calling thread is blocked until a reply is received.
See example_animal_proxy_new_for_bus() for the asynchronous version of this constructor.
| 
 | A GBusType. | 
| 
 | Flags from the GDBusProxyFlags enumeration. | 
| 
 | A bus name (well-known or unique). | 
| 
 | An object path. | 
| 
 | A GCancellable or NULL. [allow-none] | 
| 
 | Return location for error or NULL | 
| Returns : | The constructed proxy object or NULLiferroris set. [transfer full][type ExampleAnimalProxy] | 
Since 2.30
struct ExampleAnimalSkeleton;
The ExampleAnimalSkeleton structure contains only private data and should only be accessed using the provided API.
Since 2.30
struct ExampleAnimalSkeletonClass {
  GDBusInterfaceSkeletonClass parent_class;
};
Class structure for ExampleAnimalSkeleton.
| GDBusInterfaceSkeletonClass  | The parent class. | 
Since 2.30
ExampleAnimal *     example_animal_skeleton_new         (void);
Creates a skeleton object for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Animal.
| Returns : | The skeleton object. [transfer full][type ExampleAnimalSkeleton] | 
Since 2.30
"mood" property"mood" gchar* : Read / Write
Represents the D-Bus property "Mood".
Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
Default value: NULL
Since 2.30
"handle-poke" signalgboolean            user_function                      (ExampleAnimal         *object,
                                                        GDBusMethodInvocation *invocation,
                                                        gboolean               arg_make_sad,
                                                        gboolean               arg_make_happy,
                                                        gpointer               user_data)           : Run Last
Signal emitted when a remote caller is invoking the Poke() D-Bus method.
If a signal handler returns TRUE, it means the signal handler will handle the invocation (e.g. take a reference to invocation and eventually call example_animal_complete_poke() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
| 
 | A ExampleAnimal. | 
| 
 | A GDBusMethodInvocation. | 
| 
 | Argument passed by remote caller. | 
| 
 | Argument passed by remote caller. | 
| 
 | user data set when the signal handler was connected. | 
| Returns : | TRUEif the invocation was handled,FALSEto let other signal handlers run. | 
Since 2.30
"jumped" signalvoid                user_function                      (ExampleAnimal *object,
                                                        gdouble        arg_height,
                                                        gpointer       user_data)       : Run Last
On the client-side, this signal is emitted whenever the D-Bus signal "Jumped" is received.
On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
| 
 | A ExampleAnimal. | 
| 
 | Argument. | 
| 
 | user data set when the signal handler was connected. | 
Since 2.30