| AppStream-glib Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <appstream-glib.h> enum AsScreenshotKind; AsScreenshot * as_screenshot_new (void); AsScreenshotKind as_screenshot_kind_from_string (const gchar *kind); const gchar * as_screenshot_kind_to_string (AsScreenshotKind kind); AsScreenshotKind as_screenshot_get_kind (AsScreenshot *screenshot); gint as_screenshot_get_priority (AsScreenshot *screenshot); const gchar * as_screenshot_get_caption (AsScreenshot *screenshot,const gchar *locale); GPtrArray * as_screenshot_get_images (AsScreenshot *screenshot); AsImage * as_screenshot_get_image (AsScreenshot *screenshot,guint width,guint height); AsImage * as_screenshot_get_source (AsScreenshot *screenshot); void as_screenshot_set_kind (AsScreenshot *screenshot,AsScreenshotKind kind); void as_screenshot_set_priority (AsScreenshot *screenshot,gint priority); void as_screenshot_set_caption (AsScreenshot *screenshot,const gchar *locale,const gchar *caption,gsize caption_len); void as_screenshot_add_image (AsScreenshot *screenshot,AsImage *image);
Screenshots have a localized caption and also contain a number of images of different resolution.
See also: AsImage
typedef enum {
AS_SCREENSHOT_KIND_UNKNOWN,
AS_SCREENSHOT_KIND_NORMAL,
AS_SCREENSHOT_KIND_DEFAULT,
} AsScreenshotKind;
The screenshot type.
AsScreenshot * as_screenshot_new (void);
Creates a new AsScreenshot.
Returns : |
a AsScreenshot. [transfer full] |
Since 0.1.0
AsScreenshotKind as_screenshot_kind_from_string (const gchar *kind);
Converts the text representation to an enumerated value.
|
the string. |
Returns : |
a AsScreenshotKind, or
AS_SCREENSHOT_KIND_UNKNOWN if not known. [transfer full]
|
Since 0.1.0
const gchar * as_screenshot_kind_to_string (AsScreenshotKind kind);
Converts the enumerated value to an text representation.
|
the AsScreenshotKind. |
Returns : |
string version of kind
|
Since 0.1.0
AsScreenshotKind as_screenshot_get_kind (AsScreenshot *screenshot);
Gets the screenshot kind.
|
a AsScreenshot instance. |
Returns : |
a AsScreenshotKind |
Since 0.1.0
gint as_screenshot_get_priority (AsScreenshot *screenshot);
Gets the screenshot priority.
|
a AsScreenshot instance. |
Returns : |
a priority value |
Since 0.3.1
const gchar * as_screenshot_get_caption (AsScreenshot *screenshot,const gchar *locale);
Gets the image caption for a specific locale.
|
a AsScreenshot instance. |
|
the locale, or NULL. e.g. "en_GB" |
Returns : |
the caption |
Since 0.1.0
GPtrArray * as_screenshot_get_images (AsScreenshot *screenshot);
Gets the image sizes included in the screenshot.
|
a AsScreenshot instance. |
Returns : |
an array. [element-type AsImage][transfer none] |
Since 0.1.0
AsImage * as_screenshot_get_image (AsScreenshot *screenshot,guint width,guint height);
Gets the AsImage closest to the target size. The AsImage may not actually be the requested size, and the application may have to pad / rescale the image to make it fit.
|
a AsScreenshot instance. |
|
target width |
|
target height |
Returns : |
an AsImage, or NULL. [transfer none]
|
Since 0.2.2
AsImage * as_screenshot_get_source (AsScreenshot *screenshot);
Gets the source image (the unscaled version) for the screenshot
|
a AsScreenshot instance. |
Returns : |
an AsImage, or NULL. [transfer none]
|
Since 0.1.6
void as_screenshot_set_kind (AsScreenshot *screenshot,AsScreenshotKind kind);
Sets the screenshot kind.
|
a AsScreenshot instance. |
|
the AsScreenshotKind. |
Since 0.1.0
void as_screenshot_set_priority (AsScreenshot *screenshot,gint priority);
Sets the screenshot priority. Higher numbers are better.
|
a AsScreenshot instance. |
|
the priority value. |
Since 0.3.1
void as_screenshot_set_caption (AsScreenshot *screenshot,const gchar *locale,const gchar *caption,gsize caption_len);
Sets a caption on the screenshot for a specific locale.
|
a AsScreenshot instance. |
|
the locale, or NULL. e.g. "en_GB" |
|
the caption text. |
|
the size of caption, or -1 if NULL-terminated. |
Since 0.1.0