AppStream.Icon

g AppStream.Icon AppStream.Icon GObject.Object GObject.Object GObject.Object->AppStream.Icon

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_filename ()

get_height ()

get_kind ()

get_name ()

get_scale ()

get_url ()

get_width ()

set_filename (filename)

set_height (height)

set_kind (kind)

set_name (name)

set_scale (scale)

set_url (url)

set_width (width)

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.Icon(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

AppStream.IconClass

classmethod new()
Returns:

a AppStream.Icon

Return type:

AppStream.Icon

Creates a new AppStream.Icon.

get_filename()
Returns:

The absolute path for the icon on disk. This is only set for icons of kind AppStream.IconKind.LOCAL or AppStream.IconKind.CACHED.

Return type:

str

get_height()
Returns:

The icon height in pixels, or 0 if unknown.

Return type:

int

get_kind()
Returns:

the AppStream.IconKind

Return type:

AppStream.IconKind

Gets the icon kind.

get_name()
Returns:

the stock name of the icon. In case the icon is not of kind “stock”, the basename of the icon filename or URL is returned.

Return type:

str

get_scale()
Returns:

The icon scaling factor.

Return type:

int

New in version 0.11.0.

get_url()
Returns:

the URL

Return type:

str

Gets the icon URL, pointing at a remote location. HTTPS and FTP urls are allowed. This property is only set for icons of type AppStream.IconKind.REMOTE

get_width()
Returns:

The icon width in pixels, or 0 if unknown.

Return type:

int

set_filename(filename)
Parameters:

filename (str) – the new icon URL.

Sets the icon absolute filename.

set_height(height)
Parameters:

height (int) – the height in pixels.

Sets the icon height.

set_kind(kind)
Parameters:

kind (AppStream.IconKind) – the AppStream.IconKind, e.g. AppStream.IconKind.CACHED.

Sets the icon kind.

set_name(name)
Parameters:

name (str) – the icon stock name, e.g. “gwenview”

Sets the stock name or basename to use for the icon.

set_scale(scale)
Parameters:

scale (int) – the icon scaling factor.

Sets the icon scaling factor used for HiDPI displays.

New in version 0.11.0.

set_url(url)
Parameters:

url (str) – the new icon URL.

Sets the icon URL.

set_width(width)
Parameters:

width (int) – the width in pixels.

Sets the icon width.