Distributors provide a service like
debshots. They can either use the original
debshots
service, which does not only work for Debian but also any other distribution, or they can set up their own service which mimicks the
debshots
API.
In future, it is planned to allow applications to specify own screenshots via their AppData files.
In order to make a new screenshot service known to software-centers, distributors need to place information about their webservice in the config file of libappstream
, whis is usually located at /etc/appstream.conf
.
Software center applications can access the screenshot service either directly, or via the libappstream
API. Simple example:
#include <glib.h>
#include <appstream.h>
gchar* get_screenshot_url (const gchar* pkgname, gboolean thumbnail) {
AppstreamScreenshotService *scrservice;
gchar *url;
scrservice = appstream_screenshot_service_new ();
if (thumbnail)
url = appstream_screenshot_service_get_thumbnail_url (scrservice, pkgname);
else
url = appstream_screenshot_service_get_screenshot_url (scrservice, pkgname);
g_object_unref (scrservice);
return url;
}