![]() |
![]() |
![]() |
libdexterplugin Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
DexterPluginServiceDexterPluginService — Service descriptors for identifying and using Libdexter services |
#include <dexterplugin.h> #define DEXTERPLUGIN_SERVICE_ERROR enum DexterPluginServiceError; DexterPluginService; DexterPluginServiceGroup; DexterPluginService * dexterplugin_service_new (GType type
,const gchar *name
,const gchar *blurb
,const gchar *uuid
); DexterPluginService * dexterplugin_service_dup (const DexterPluginService *service
); void dexterplugin_service_copy (DexterPluginService *dest
,const DexterPluginService *source
); void dexterplugin_service_free (DexterPluginService *service
); DexterPluginServiceGroup * dexterplugin_service_group_new (guint n_services
); void dexterplugin_service_group_free (DexterPluginServiceGroup *service_group
); gboolean dexterplugin_service_group_find_uuid (DexterPluginService **service
,DexterPluginServiceGroup *service_group
,const gchar *uuid
);
Service descriptors provide identification information for Libdexter services. Collections of service descriptors are delivered to the user by Service Brokers as service groups. Each descriptor contains a universally unique identifier (uuid) to distinquish it from all other services. During service registration, each service is assigned a GType by the GTypeModule system. That type is used by GLib/GObject to instantiate objects implementing the service.
Note that the service GType is dynamic in nature and will vary. Do not use it to identify services. Use the uuid instead.
#define DEXTERPLUGIN_SERVICE_ERROR dexterplugin_service_error_quark()
The error domain of the libdexterplugin service subsystem.
typedef enum { DEXTERPLUGIN_SERVICE_ERROR_FAILED } DexterPluginServiceError;
Error codes for DexterPluginService operations.
typedef struct { GType type; gchar *name; gchar *blurb; gchar *uuid; } DexterPluginService;
A plugin service descriptor.
typedef struct { guint n_services; DexterPluginService *services; } DexterPluginServiceGroup;
A collection of plugin service descriptors.
guint |
number of services in the group. |
DexterPluginService * |
service array of size n_services . |
DexterPluginService * dexterplugin_service_new (GType type
,const gchar *name
,const gchar *blurb
,const gchar *uuid
);
Creates a new service descriptor. It must be freed with dexterplugin_service_free()
.
|
service type. |
|
service name. |
|
service description. |
|
service uuid (univerally unique identifier). |
Returns : |
DexterPluginService service descriptor. |
DexterPluginService * dexterplugin_service_dup (const DexterPluginService *service
);
Creates a duplicate of a service descriptor. It must be freed with dexterplugin_service_free()
.
|
DexterPluginService to duplicate. |
Returns : |
DexterPluginService service descriptor. |
void dexterplugin_service_copy (DexterPluginService *dest
,const DexterPluginService *source
);
Copies a service descriptor. Existing data on the destination descriptor will be freed prior to the copy.
|
destination address of a DexterPluginService. |
|
source address of a DexterPluginService. |
void dexterplugin_service_free (DexterPluginService *service
);
Frees a service descriptor.
|
address of a DexterPluginService service descriptor. |
DexterPluginServiceGroup * dexterplugin_service_group_new
(guint n_services
);
Allocates a DexterPluginServiceGroup with a DexterPluginService array of size n_services
.
The elements of the contained DexterPluginService array must be populated, e.g. with
dexterplugin_service_copy()
. The service group should be freed with dexterplugin_service_group_free()
.
Plugin writers should always use this api for allocation of service groups.
|
size of contained DexterPluginService array. |
Returns : |
DexterPluginServiceGroup service group. |
Since 0.1.4
void dexterplugin_service_group_free (DexterPluginServiceGroup *service_group
);
Frees a service group created with dexterplugin_service_group_new()
.
|
DexterPluginServiceGroup collection of service descriptors. |
gboolean dexterplugin_service_group_find_uuid (DexterPluginService **service
,DexterPluginServiceGroup *service_group
,const gchar *uuid
);
Finds a service by uuid in the service_group
. If found, the service
pointer
will be set to point into the service_group->services
array.
|
address of a pointer to a DexterPluginService service descriptor. |
|
DexterPluginServiceGroup collection of service descriptors. |
|
uuid of service to find. |
Returns : |
gboolean indicating if the service was found or not. |