| Top |
ExampleAnimalExampleAnimal — Generated C code for the org.gtk.GDBus.Example.ObjectManager.Animal D-Bus interface |
| ExampleAnimal | |
| struct | ExampleAnimalIface |
| struct | ExampleAnimalProxy |
| struct | ExampleAnimalProxyClass |
| struct | ExampleAnimalSkeleton |
| struct | ExampleAnimalSkeletonClass |
GInterface ╰── ExampleAnimal GObject ├── GDBusInterfaceSkeleton │ ╰── ExampleAnimalSkeleton ╰── GDBusProxy ╰── ExampleAnimalProxy
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.
GDBusInterfaceInfo *
example_animal_interface_info (void);
Gets a machine-readable description of the org.gtk.GDBus.Example.ObjectManager.Animal D-Bus interface.
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.
klass |
The class structure for a GObject derived class. |
|
property_id_begin |
The property id to assign to the first overridden property. |
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 (see g_main_context_push_thread_default()).
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.
proxy |
||
arg_make_sad |
Argument to pass with the method invocation. |
|
arg_make_happy |
Argument to pass with the method invocation. |
|
cancellable |
A GCancellable or |
[nullable] |
callback |
A GAsyncReadyCallback to call when the request is satisfied or |
|
user_data |
User data to pass to |
Since: 2.30
gboolean example_animal_call_poke_finish (ExampleAnimal *proxy,GAsyncResult *res,GError **error);
Finishes an operation started with example_animal_call_poke().
proxy |
||
res |
The GAsyncResult obtained from the GAsyncReadyCallback passed to |
|
error |
Return location for error or |
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.
proxy |
||
arg_make_sad |
Argument to pass with the method invocation. |
|
arg_make_happy |
Argument to pass with the method invocation. |
|
cancellable |
A GCancellable or |
[nullable] |
error |
Return location for error or |
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.
Since: 2.30
void example_animal_emit_jumped (ExampleAnimal *object,gdouble arg_height);
Emits the "Jumped" D-Bus 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.
The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object
was constructed. Use example_animal_dup_mood() if on another thread.
[skip]
The property value or NULL if the property is not set. Do not free the returned value, it belongs to object
.
[transfer none][nullable]
const gchar *
example_animal_get_foo (ExampleAnimal *object);
Gets the value of the "Foo" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object
was constructed. Use example_animal_dup_foo() if on another thread.
[skip]
The property value or NULL if the property is not set. Do not free the returned value, it belongs to object
.
[transfer none][nullable]
const gchar *
example_animal_get_bar (ExampleAnimal *object);
Gets the value of the "Bar" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object
was constructed. Use example_animal_dup_bar() if on another thread.
[skip]
The property value or NULL if the property is not set. Do not free the returned value, it belongs to object
.
[transfer none][nullable]
Since: 2.36
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.
[skip]
gchar *
example_animal_dup_foo (ExampleAnimal *object);
Gets a copy of the "Foo" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
[skip]
gchar *
example_animal_dup_bar (ExampleAnimal *object);
Gets a copy of the "Bar" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
[skip]
The property value or NULL if the property is not set. The returned value should be freed with g_free().
[transfer full][nullable]
Since: 2.36
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.
[skip]
void example_animal_set_foo (ExampleAnimal *object,const gchar *value);
Sets the "Foo" 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.
[skip]
void example_animal_set_bar (ExampleAnimal *object,const gchar *value);
Sets the "Bar" 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.
[skip]
Since: 2.36
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 (see g_main_context_push_thread_default()).
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.
connection |
||
flags |
Flags from the GDBusProxyFlags enumeration. |
|
name |
A bus name (well-known or unique) or |
[nullable] |
object_path |
An object path. |
|
cancellable |
A GCancellable or |
[nullable] |
callback |
A GAsyncReadyCallback to call when the request is satisfied. |
|
user_data |
User data to pass to |
ExampleAnimal * example_animal_proxy_new_finish (GAsyncResult *res,GError **error);
Finishes an operation started with example_animal_proxy_new().
res |
The GAsyncResult obtained from the GAsyncReadyCallback passed to |
|
error |
Return location for error or |
The constructed proxy object or NULL if error
is set.
[transfer full][type ExampleAnimalProxy]
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.
connection |
||
flags |
Flags from the GDBusProxyFlags enumeration. |
|
name |
A bus name (well-known or unique) or |
[nullable] |
object_path |
An object path. |
|
cancellable |
A GCancellable or |
[nullable] |
error |
Return location for error or |
The constructed proxy object or NULL if error
is set.
[transfer full][type ExampleAnimalProxy]
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 (see g_main_context_push_thread_default()).
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.
bus_type |
A GBusType. |
|
flags |
Flags from the GDBusProxyFlags enumeration. |
|
name |
A bus name (well-known or unique). |
|
object_path |
An object path. |
|
cancellable |
A GCancellable or |
[nullable] |
callback |
A GAsyncReadyCallback to call when the request is satisfied. |
|
user_data |
User data to pass to |
ExampleAnimal * example_animal_proxy_new_for_bus_finish (GAsyncResult *res,GError **error);
Finishes an operation started with example_animal_proxy_new_for_bus().
res |
The GAsyncResult obtained from the GAsyncReadyCallback passed to |
|
error |
Return location for error or |
The constructed proxy object or NULL if error
is set.
[transfer full][type ExampleAnimalProxy]
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.
bus_type |
A GBusType. |
|
flags |
Flags from the GDBusProxyFlags enumeration. |
|
name |
A bus name (well-known or unique). |
|
object_path |
An object path. |
|
cancellable |
A GCancellable or |
[nullable] |
error |
Return location for error or |
The constructed proxy object or NULL if error
is set.
[transfer full][type ExampleAnimalProxy]
ExampleAnimal *
example_animal_skeleton_new (void);
Creates a skeleton object for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Animal.
typedef struct _ExampleAnimal ExampleAnimal;
Abstract interface type for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Animal.
struct ExampleAnimalIface {
GTypeInterface parent_iface;
const gchar * (*get_foo) (ExampleAnimal *object);
const gchar * (*get_mood) (ExampleAnimal *object);
gboolean (*handle_poke) (
ExampleAnimal *object,
GDBusMethodInvocation *invocation,
gboolean arg_make_sad,
gboolean arg_make_happy);
void (*jumped) (
ExampleAnimal *object,
gdouble arg_height);
const gchar * (*get_bar) (ExampleAnimal *object);
};
Virtual table for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Animal.
GTypeInterface |
The parent interface. |
|
Getter for the “foo” property. |
||
Getter for the “mood” property. |
||
Handler for the “handle-poke” signal. |
||
Handler for the “jumped” signal. |
||
Getter for the “bar” property. |
struct ExampleAnimalProxy;
The ExampleAnimalProxy structure contains only private data and should only be accessed using the provided API.
struct ExampleAnimalProxyClass {
GDBusProxyClass parent_class;
};
Class structure for ExampleAnimalProxy.
struct ExampleAnimalSkeleton;
The ExampleAnimalSkeleton structure contains only private data and should only be accessed using the provided API.
struct ExampleAnimalSkeletonClass {
GDBusInterfaceSkeletonClass parent_class;
};
Class structure for ExampleAnimalSkeleton.
“bar” property “bar” char *
Represents the D-Bus property "Bar".
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.
Owner: ExampleAnimal
Flags: Read / Write
Default value: NULL
Since: 2.36
“foo” property “foo” char *
Represents the D-Bus property "Foo".
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.
Owner: ExampleAnimal
Flags: Read / Write
Default value: NULL
“mood” property “mood” char *
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.
Owner: ExampleAnimal
Flags: Read / Write
Default value: NULL
“handle-poke” signalgboolean user_function (ExampleAnimal *object, GDBusMethodInvocation *invocation, gboolean arg_make_sad, gboolean arg_make_happy, gpointer user_data)
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 other signal handlers will run. If no signal handler handles the invocation, the G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
object |
||
invocation |
||
arg_make_sad |
Argument passed by remote caller. |
|
arg_make_happy |
Argument passed by remote caller. |
|
user_data |
user data set when the signal handler was connected. |
G_DBUS_METHOD_INVOCATION_HANDLED or TRUE if the invocation was handled, G_DBUS_METHOD_INVOCATION_UNHANDLED or FALSE to let other signal handlers run.
Flags: Run Last
Since: 2.30
“jumped” signalvoid user_function (ExampleAnimal *object, double arg_height, gpointer user_data)
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.
object |
||
arg_height |
Argument. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.30