Top |
ExampleAnimalExampleAnimal — Generated C code for the org.gtk.GDBus.Example.ObjectManager.Animal D-Bus interface |
Functions
Types and Values
ExampleAnimal | |
struct | ExampleAnimalIface |
struct | ExampleAnimalProxy |
struct | ExampleAnimalProxyClass |
struct | ExampleAnimalSkeleton |
struct | ExampleAnimalSkeletonClass |
Object Hierarchy
GInterface ╰── ExampleAnimal GObject ├── GDBusInterfaceSkeleton │ ╰── ExampleAnimalSkeleton ╰── GDBusProxy ╰── ExampleAnimalProxy
Implemented Interfaces
ExampleAnimalProxy implements GDBusInterface, GInitable, GAsyncInitable and ExampleAnimal.
ExampleAnimalSkeleton implements GDBusInterface and ExampleAnimal.
Description
This section contains code for working with the org.gtk.GDBus.Example.ObjectManager.Animal D-Bus interface in C.
Functions
example_animal_interface_info ()
GDBusInterfaceInfo *
example_animal_interface_info (void
);
Gets a machine-readable description of the org.gtk.GDBus.Example.ObjectManager.Animal D-Bus interface.
Since 2.30
example_animal_override_properties ()
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.
Parameters
klass |
The class structure for a GObject-derived class. |
|
property_id_begin |
The property id to assign to the first overridden property. |
Since 2.30
example_animal_call_poke ()
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.
Parameters
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 |
[allow-none] |
callback |
A GAsyncReadyCallback to call when the request is satisfied or |
|
user_data |
User data to pass to |
Since 2.30
example_animal_call_poke_finish ()
gboolean example_animal_call_poke_finish (ExampleAnimal *proxy
,GAsyncResult *res
,GError **error
);
Finishes an operation started with example_animal_call_poke()
.
Parameters
proxy |
||
res |
The GAsyncResult obtained from the GAsyncReadyCallback passed to |
|
error |
Return location for error or |
Since 2.30
example_animal_call_poke_sync ()
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.
Parameters
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 |
[allow-none] |
error |
Return location for error or |
Since 2.30
example_animal_complete_poke ()
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
example_animal_emit_jumped ()
void example_animal_emit_jumped (ExampleAnimal *object
,gdouble arg_height
);
Emits the "Jumped" D-Bus signal.
Since 2.30
example_animal_get_mood ()
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.Returns
The property value or NULL
if the property is not set. Do not free the returned value, it belongs to object
.
[transfer none]
Since 2.30
example_animal_get_foo ()
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.
object
was constructed. Use example_animal_dup_foo()
if on another thread.Returns
The property value or NULL
if the property is not set. Do not free the returned value, it belongs to object
.
[transfer none]
Since 2.30
example_animal_get_bar ()
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.
object
was constructed. Use example_animal_dup_bar()
if on another thread.Returns
The property value or NULL
if the property is not set. Do not free the returned value, it belongs to object
.
[transfer none]
Since 2.36
example_animal_dup_mood ()
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.
Returns
The property value or NULL
if the property is not set. The returned value should be freed with g_free()
.
[transfer full]
Since 2.30
example_animal_dup_foo ()
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.
Returns
The property value or NULL
if the property is not set. The returned value should be freed with g_free()
.
[transfer full]
Since 2.30
example_animal_dup_bar ()
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.
Returns
The property value or NULL
if the property is not set. The returned value should be freed with g_free()
.
[transfer full]
Since 2.36
example_animal_set_mood ()
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.
Since 2.30
example_animal_set_foo ()
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.
Since 2.30
example_animal_set_bar ()
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.
Since 2.36
example_animal_proxy_new ()
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.
Parameters
connection |
||
flags |
Flags from the GDBusProxyFlags enumeration. |
|
name |
A bus name (well-known or unique) or |
[allow-none] |
object_path |
An object path. |
|
cancellable |
A GCancellable or |
[allow-none] |
callback |
A GAsyncReadyCallback to call when the request is satisfied. |
|
user_data |
User data to pass to |
Since 2.30
example_animal_proxy_new_finish ()
ExampleAnimal * example_animal_proxy_new_finish (GAsyncResult *res
,GError **error
);
Finishes an operation started with example_animal_proxy_new()
.
Parameters
res |
The GAsyncResult obtained from the GAsyncReadyCallback passed to |
|
error |
Return location for error or |
Returns
The constructed proxy object or NULL
if error
is set.
[transfer full][type ExampleAnimalProxy]
Since 2.30
example_animal_proxy_new_sync ()
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.
Parameters
connection |
||
flags |
Flags from the GDBusProxyFlags enumeration. |
|
name |
A bus name (well-known or unique) or |
[allow-none] |
object_path |
An object path. |
|
cancellable |
A GCancellable or |
[allow-none] |
error |
Return location for error or |
Returns
The constructed proxy object or NULL
if error
is set.
[transfer full][type ExampleAnimalProxy]
Since 2.30
example_animal_proxy_new_for_bus ()
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.
Parameters
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 |
[allow-none] |
callback |
A GAsyncReadyCallback to call when the request is satisfied. |
|
user_data |
User data to pass to |
Since 2.30
example_animal_proxy_new_for_bus_finish ()
ExampleAnimal * example_animal_proxy_new_for_bus_finish (GAsyncResult *res
,GError **error
);
Finishes an operation started with example_animal_proxy_new_for_bus()
.
Parameters
res |
The GAsyncResult obtained from the GAsyncReadyCallback passed to |
|
error |
Return location for error or |
Returns
The constructed proxy object or NULL
if error
is set.
[transfer full][type ExampleAnimalProxy]
Since 2.30
example_animal_proxy_new_for_bus_sync ()
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.
Parameters
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 |
[allow-none] |
error |
Return location for error or |
Returns
The constructed proxy object or NULL
if error
is set.
[transfer full][type ExampleAnimalProxy]
Since 2.30
example_animal_skeleton_new ()
ExampleAnimal *
example_animal_skeleton_new (void
);
Creates a skeleton object for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Animal.
Since 2.30
Types and Values
ExampleAnimal
typedef struct _ExampleAnimal ExampleAnimal;
Abstract interface type for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Animal.
Since 2.30
struct ExampleAnimalIface
struct ExampleAnimalIface { GTypeInterface parent_iface; gboolean (*handle_poke) ( ExampleAnimal *object, GDBusMethodInvocation *invocation, gboolean arg_make_sad, gboolean arg_make_happy); const gchar * (*get_foo) (ExampleAnimal *object); const gchar * (*get_mood) (ExampleAnimal *object); 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.
Members
GTypeInterface |
The parent interface. |
|
Handler for the “handle-poke” signal. |
||
Getter for the “foo” property. |
||
Getter for the “mood” property. |
||
Handler for the “jumped” signal. |
||
Getter for the “bar” property. |
Since 2.30
struct ExampleAnimalProxy
struct ExampleAnimalProxy;
The ExampleAnimalProxy structure contains only private data and should only be accessed using the provided API.
Since 2.30
struct ExampleAnimalProxyClass
struct ExampleAnimalProxyClass { GDBusProxyClass parent_class; };
Class structure for ExampleAnimalProxy.
Since 2.30
struct ExampleAnimalSkeleton
struct ExampleAnimalSkeleton;
The ExampleAnimalSkeleton structure contains only private data and should only be accessed using the provided API.
Since 2.30
struct ExampleAnimalSkeletonClass
struct ExampleAnimalSkeletonClass { GDBusInterfaceSkeletonClass parent_class; };
Class structure for ExampleAnimalSkeleton.
Since 2.30
Property Details
The “bar”
property
“bar” gchar *
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.
Flags: Read / Write
Default value: NULL
Since 2.36
The “foo”
property
“foo” gchar *
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.
Flags: Read / Write
Default value: NULL
Since 2.30
The “mood”
property
“mood” gchar *
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.
Flags: Read / Write
Default value: NULL
Since 2.30
Signal Details
The “handle-poke”
signal
gboolean 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 order signal handlers will run. If no signal handler handles the invocation, the G_DBUS_ERROR_UNKNOWN_METHOD
error is returned.
Parameters
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. |
Flags: Run Last
Since 2.30
The “jumped”
signal
void user_function (ExampleAnimal *object, gdouble 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.
Parameters
object |
||
arg_height |
Argument. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since 2.30