Applications using libacounts-glib should supply a manifest: a simple XML file describing the application and the services that it will use. An example is shown below:
Example 4. Application manifest for a gallery application
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<?xml version="1.0" encoding="UTF-8"?> <application id="Gallery"> <description>Image gallery</description> <desktop-entry>gallery</desktop-entry> <translations>gallery</translations> <services> <service id="OtherService"> <description>Publish images on OtherService</description> </service> </services> <service-types> <service-type id="sharing"> <description>Share your images with your friends</description> </service-type> </service-types> </application> |
The example application manifest describes an application called
Gallery
, indicated by the
id
attribute on the
application
element. The
description
is a string that
describes the application in general, and is also used for specific services
and service types. The
desktop-entry
element is only
required if the basename of the desktop file is different than the basename of
the application manifest, where the basename is the filename excluding any file
extension. The translations
element is used to indicate the gettext translation domain for the
name
and
description
elements, to be used
by applications when showing those elements in a UI. The
services
element contains
individual service
elements, with
an id
attribute that
corresponds to an installed service. Finally, a
service-types
element contains
individual service-type
elements,
which act in the same way as for services.
It is only useful to list services in the manifest if a separate description is desired for each service, such as if some special features are supported by the application, beyond those suggested by the general description and the service type.
Application manifest filenames should end in
.application
and be installed to
${prefix}/share/accounts/applications
,
which normally expands to
/usr/share/accounts/applications
. The
path can be queried with pkg-config by checking the
applicationfilesdir
variable of the libaccounts-glib
pkg-config file, for example:
1 |
pkg-config --variable=applicationfilesdir libaccounts-glib |