AppStream.Screenshot

g AppStream.Screenshot AppStream.Screenshot GObject.Object GObject.Object GObject.Object->AppStream.Screenshot

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_image (image)

add_video (video)

clear_images ()

get_caption ()

get_context ()

get_environment ()

get_image (width, height, scale)

get_images ()

get_images_all ()

get_kind ()

get_media_kind ()

get_videos ()

get_videos_all ()

is_valid ()

set_caption (caption, locale)

set_context (context)

set_environment (env_id)

set_kind (kind)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class AppStream.Screenshot(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

AppStream.ScreenshotClass

classmethod new()
Returns:

a AppStream.Screenshot

Return type:

AppStream.Screenshot

Creates a new AppStream.Screenshot.

add_image(image)
Parameters:

image (AppStream.Image) – a AppStream.Image instance.

Adds an image to the screenshot.

add_video(video)
Parameters:

video (AppStream.Video) – a AppStream.Video instance.

Adds a video to the screenshot.

clear_images()

Remove all images associated with this screenshot.

New in version 0.15.4.

get_caption()
Returns:

the caption

Return type:

str

Gets the image caption

get_context()
Returns:

the AppStream.Context used by this screenshot.

Return type:

AppStream.Context or None

Returns the AppStream.Context associated with this screenshot. This function may return None if no context is set.

New in version 0.11.2.

get_environment()
Returns:

The GUI environment ID the screenshot was recorded in, or None if none set.

Return type:

str or None

Get the GUI environment ID of this screenshot, if any is associated with it. E.g. “plasma-mobile” or “gnome:dark”.

get_image(width, height, scale)
Parameters:
  • width (int) – target width

  • height (int) – target height

  • scale (int) – the target scaling factor.

Returns:

an AppStream.Image, or None

Return type:

AppStream.Image or None

Gets the AppStream.Image closest to the target size. The AppStream.Image may not actually be the requested size, and the application may have to pad / rescale the image to make it fit. Only images for the current active locale (or fallback, if images are not localized) are considered.

New in version 0.14.0.

get_images()
Returns:

an array

Return type:

[AppStream.Image]

Gets the images for this screenshots. Only images valid for the current language are returned. We return all sizes.

get_images_all()
Returns:

an array

Return type:

[AppStream.Image]

Returns an array of all images we have, regardless of their size and language.

New in version 0.10.

get_kind()
Returns:

a AppStream.ScreenshotKind

Return type:

AppStream.ScreenshotKind

Gets the screenshot kind.

get_media_kind()
Returns:

a AppStream.ScreenshotMediaKind

Return type:

AppStream.ScreenshotMediaKind

Gets the screenshot media kind.

get_videos()
Returns:

an array

Return type:

[AppStream.Video]

Gets the videos for this screenshots. Only videos valid for the current language selection are returned. We return all sizes.

get_videos_all()
Returns:

an array

Return type:

[AppStream.Video]

Returns an array of all screencast videos we have, regardless of their size and locale.

is_valid()
Returns:

True if the screenshot is a complete AppStream.Screenshot

Return type:

bool

Performs a quick validation on this screenshot

set_caption(caption, locale)
Parameters:
  • caption (str) – the caption text.

  • locale (str) –

Sets a caption on the screenshot

set_context(context)
Parameters:

context (AppStream.Context) – the AppStream.Context.

Sets the document context this screenshot is associated with.

New in version 0.11.2.

set_environment(env_id)
Parameters:

env_id (str or None) – the GUI environment ID, e.g. “plasma-mobile” or “gnome:dark”

Sets the GUI environment ID of this screenshot.

set_kind(kind)
Parameters:

kind (AppStream.ScreenshotKind) – the AppStream.ScreenshotKind.

Sets the screenshot kind.