Top | ![]() |
![]() |
![]() |
![]() |
The EggDBusInterface interface is used for describing remote D-Bus interfaces and dispatching messages.
const gchar * egg_dbus_interface_annotation_info_lookup (const EggDBusInterfaceAnnotationInfo *annotations
,const gchar *annotation_name
);
Looks up the value of an annotation.
const EggDBusInterfaceSignalInfo * egg_dbus_interface_info_lookup_signal_for_g_name (const EggDBusInterfaceInfo *info
,const gchar *g_name
);
Looks up information about a signal.
const EggDBusInterfacePropertyInfo * egg_dbus_interface_info_lookup_property_for_name (const EggDBusInterfaceInfo *info
,const gchar *name
);
Looks up information about a property.
const EggDBusInterfacePropertyInfo * egg_dbus_interface_info_lookup_property_for_g_name (const EggDBusInterfaceInfo *info
,const gchar *g_name
);
Looks up information about a property.
EggDBusInterfaceNodeInfo * egg_dbus_interface_new_node_info_from_xml (const gchar *xml_data
,GError **error
);
Parses xml_data
and returns a EggDBusInterfaceNodeInfo representing the data.
A EggDBusInterfaceNodeInfo structure or NULL
if error
is set. Free with
egg_dbus_interface_node_info_free()
.
void
egg_dbus_interface_node_info_free (EggDBusInterfaceNodeInfo *node_info
);
Frees node_info
. This is a deep free, all nodes of node_info
and it's children will be freed as well.
void egg_dbus_interface_info_to_xml (const EggDBusInterfaceInfo *info
,guint indent
,GString *string_builder
);
Appends an XML representation of info
(and it's children) to string_builder
.
This function is typically used for generating introspection XML documents at run-time for
handling the org.freedesktop.DBus.Introspectable.Introspect
method.
void egg_dbus_interface_node_info_to_xml (const EggDBusInterfaceNodeInfo *node_info
,guint indent
,GString *string_builder
);
Appends an XML representation of node_info
(and it's children) to string_builder
.
This function is typically used for generating introspection XML documents at run-time for
handling the org.freedesktop.DBus.Introspectable.Introspect
method.
typedef struct { GTypeInterface g_iface; const EggDBusInterfaceInfo * (*get_interface_info) (void); void (*handle_message) (EggDBusInterface *interface, EggDBusMessage *message); EggDBusInterfaceProxy * (*get_interface_proxy) (EggDBusObjectProxy *object_proxy); } EggDBusInterfaceIface;
VTable for EggDBusInterface. This GInterface is used for both interface proxies (on the client side) and when exporting D-Bus interfaces (on the server side).
When exporting a D-Bus interface (using egg_dbus_connection_register_interface()
), simply
provide GObject derived instance that implement this interface.
You need to implement the get_interface_info
vfunc to describe what the D-Bus interface
looks like (this is designed to be stored in read-only data) as well as how D-Bus signal and
property names (typically CamelCase) are mapped to GObject signal and property names (typically
lowercase using hyphens).
Incoming method calls are dispatched through the handle_message
vfunc, D-Bus properties
are get/set through the get_property()
/ set_property()
vfuncs on the GObject class and
emitted GObject signals (that matches D-Bus signals) are broadcast on the EggDBusConnection
instance(s) that the exported D-Bus interface have been registered with.
Implementing the get_interface_proxy
vfunc is optional. Typically language bindings
for static languages (such as C or C++) wants to implement this vfunc to provide a
type-safe client-side API for accessing the D-Bus interface. If implemented, then
D-Bus signals received on the client-side will be propagated from EggDBusConnection
through EggDBusObjectProxy to the handle_message
vfunc. Typically, implementations
will want to turn the EggDBusMessage into a GObject signal.
Gets introspection information about the interface. |
||
Handle an incoming message for an interface. This is used for both dispatching signals for proxies and for handling method calls invocations originating from remote processes. |
||
Gets an interface proxy that can be used to access the D-Bus interface for the remote object represented by the given EggDBusObjectProxy object. The returned instance must be derived from EggDBusInterfaceProxy and must implement the given interface. |
typedef struct { const gchar *key; const gchar *value; const EggDBusInterfaceAnnotationInfo *annotations; } EggDBusInterfaceAnnotationInfo;
Information about an annotation.
By convention, an array of annotations is always terminated by an element
where key
is NULL
.
The name of the annotation, e.g. |
||
The value of the annotation. |
||
const EggDBusInterfaceAnnotationInfo * |
A pointer to an array of annotations for the annotation or |
typedef struct { const gchar *name; const gchar *signature; const EggDBusInterfaceAnnotationInfo *annotations; } EggDBusInterfaceArgInfo;
Information about an argument for a method or a signal.
Name of the argument, e.g. |
||
D-Bus signature of the argument (a single complete type). |
||
const EggDBusInterfaceAnnotationInfo * |
A pointer to an array of annotations for the argument or |
typedef struct { const gchar *name; const gchar *in_signature; guint in_num_args; const EggDBusInterfaceArgInfo *in_args; const gchar *out_signature; guint out_num_args; const EggDBusInterfaceArgInfo *out_args; const EggDBusInterfaceAnnotationInfo *annotations; } EggDBusInterfaceMethodInfo;
Information about a method on an D-Bus interface.
The name of the D-Bus method, e.g. |
||
The combined D-Bus signature of all arguments passed to the method ( |
||
Number of arguments passed to the method. |
||
const EggDBusInterfaceArgInfo * |
A pointer to an array of |
|
The combined D-Bus signature of all arguments the method returns ( |
||
Number of arguments the method returns. |
||
const EggDBusInterfaceArgInfo * |
A pointer to an array of |
|
const EggDBusInterfaceAnnotationInfo * |
A pointer to an array of annotations for the method or |
typedef struct { const gchar *name; const gchar *g_name; const gchar *signature; guint num_args; const EggDBusInterfaceArgInfo *args; const EggDBusInterfaceAnnotationInfo *annotations; } EggDBusInterfaceSignalInfo;
Information about a signal on a D-Bus interface.
The name of the D-Bus signal, e.g. |
||
The GObject name of the D-Bus signal (in lower case with hyphens), e.g. name-owner-changed. |
||
The combined D-Bus signature of all arguments of the signal ( |
||
Number of arguments of the signal. |
||
const EggDBusInterfaceArgInfo * |
A pointer to an array of |
|
const EggDBusInterfaceAnnotationInfo * |
A pointer to an array of annotations for the signal or |
typedef struct { const gchar *name; const gchar *g_name; const gchar *signature; EggDBusInterfacePropertyInfoFlags flags; const EggDBusInterfaceAnnotationInfo *annotations; } EggDBusInterfacePropertyInfo;
Information about a D-Bus property on a D-Bus interface.
The name of the D-Bus property, e.g. |
||
The GObject name of the D-Bus property (in lower case with hyphens), e.g. supported-filesystems. |
||
The D-Bus signature of the property (a single complete type). |
||
Access control flags for the property. |
||
const EggDBusInterfaceAnnotationInfo * |
A pointer to an array of annotations for the property or |
typedef struct { const gchar *name; guint num_methods; const EggDBusInterfaceMethodInfo *methods; guint num_signals; const EggDBusInterfaceSignalInfo *signals; guint num_properties; const EggDBusInterfacePropertyInfo *properties; const EggDBusInterfaceAnnotationInfo *annotations; } EggDBusInterfaceInfo;
Information about a D-Bus interface.
The name of the D-Bus interface, e.g. |
||
Number of methods on the interface. |
||
const EggDBusInterfaceMethodInfo * |
A pointer to an array of |
|
Number of signals on the interface. |
||
const EggDBusInterfaceSignalInfo * |
A pointer to an array of |
|
Number of properties on the interface. |
||
const EggDBusInterfacePropertyInfo * |
A pointer to an array of |
|
const EggDBusInterfaceAnnotationInfo * |
A pointer to an array of annotations for the interface or |
typedef struct { const gchar *path; guint num_interfaces; const EggDBusInterfaceInfo *interfaces; guint num_nodes; const EggDBusInterfaceNodeInfo *nodes; const EggDBusInterfaceAnnotationInfo *annotations; } EggDBusInterfaceNodeInfo;
Information about nodes in a remote object hierarchy.
The path of the node or |
||
Number of interfaces of the node. |
||
const EggDBusInterfaceInfo * |
A pointer to an array of |
|
Number of child nodes. |
||
const EggDBusInterfaceNodeInfo * |
A pointer to an array of |
|
const EggDBusInterfaceAnnotationInfo * |
A pointer to an array of annotations for the node or |