AppStreamGlib.Icon

g AppStreamGlib.Icon AppStreamGlib.Icon GObject.Object GObject.Object GObject.Object->AppStreamGlib.Icon

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

error_quark ()

class

kind_from_string (icon_kind)

class

kind_to_string (icon_kind)

class

new ()

convert_to_kind (kind)

get_filename ()

get_height ()

get_kind ()

get_name ()

get_pixbuf ()

get_prefix ()

get_scale ()

get_url ()

get_width ()

load (flags)

set_filename (filename)

set_height (height)

set_kind (kind)

set_name (name)

set_pixbuf (pixbuf)

set_prefix (prefix)

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

GObject.Object

Abstract:

No

Structure:

AppStreamGlib.IconClass

classmethod error_quark()[source]
Returns:

An error quark.

Return type:

int

New in version 0.3.1.

classmethod kind_from_string(icon_kind)[source]
Parameters:

icon_kind (str) – the string.

Returns:

a AppStreamGlib.IconKind or AppStreamGlib.IconKind.UNKNOWN for unknown

Return type:

AppStreamGlib.IconKind

Converts the text representation to an enumerated value.

New in version 0.1.0.

classmethod kind_to_string(icon_kind)[source]
Parameters:

icon_kind (AppStreamGlib.IconKind) – the AsIconKind.

Returns:

string version of icon_kind

Return type:

str

Converts the enumerated value to an text representation.

New in version 0.1.0.

classmethod new()[source]
Returns:

a AppStreamGlib.Icon

Return type:

AppStreamGlib.Icon

Creates a new AppStreamGlib.Icon.

New in version 0.3.1.

convert_to_kind(kind)[source]
Parameters:

kind (AppStreamGlib.IconKind) – a AppStreamGlib.IconKind, e.g. AppStreamGlib.IconKind.EMBEDDED

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Converts the icon from one kind to another.

New in version 0.3.1.

get_filename()[source]
Returns:

the absolute filename on disk

Return type:

str

Gets the absolute path on disk of the icon. NOTE: This is only set for icons of type AppStreamGlib.IconKind.LOCAL

New in version 0.3.2.

get_height()[source]
Returns:

height in pixels

Return type:

int

Gets the icon height.

New in version 0.3.1.

get_kind()[source]
Returns:

the AppStreamGlib.IconKind

Return type:

AppStreamGlib.IconKind

Gets the icon kind.

New in version 0.3.1.

get_name()[source]
Returns:

the basename of the icon

Return type:

str

Gets the name of the icon, e.g. “epiphany.png”

New in version 0.3.1.

get_pixbuf()[source]
Returns:

the GdkPixbuf.Pixbuf, or None

Return type:

GdkPixbuf.Pixbuf

Gets the icon pixbuf if set.

New in version 0.3.1.

get_prefix()[source]
Returns:

filename

Return type:

str

Gets the suggested prefix of the icon.

New in version 0.1.6.

get_scale()[source]
Returns:

scale factor

Return type:

int

Gets the icon scale.

New in version 0.6.13.

get_url()[source]
Returns:

the fully qualified URL

Return type:

str

Gets the full qualified URL for the icon, usually pointing at some mirror. NOTE: This is only set for icons of type AppStreamGlib.IconKind.REMOTE

New in version 0.3.2.

get_width()[source]
Returns:

width in pixels

Return type:

int

Gets the icon width.

New in version 0.3.1.

load(flags)[source]
Parameters:

flags (AppStreamGlib.IconLoadFlags) – a AppStreamGlib.IconLoadFlags, e.g. AppStreamGlib.IconLoadFlags.SEARCH_SIZE

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Loads the icon into a local pixbuf.

New in version 0.3.1.

set_filename(filename)[source]
Parameters:

filename (str) – the new icon URL.

Sets the icon absolute filename.

New in version 0.3.2.

set_height(height)[source]
Parameters:

height (int) – the height in pixels.

Sets the icon height.

New in version 0.3.1.

set_kind(kind)[source]
Parameters:

kind (AppStreamGlib.IconKind) – the AppStreamGlib.IconKind, e.g. AppStreamGlib.IconKind.STOCK.

Sets the icon kind.

New in version 0.3.1.

set_name(name)[source]
Parameters:

name (str) – the icon name, e.g. “gimp.png”

Sets the basename to use for the icon.

New in version 0.3.1.

set_pixbuf(pixbuf)[source]
Parameters:

pixbuf (GdkPixbuf.Pixbuf) – the GdkPixbuf.Pixbuf, or None

Sets the icon pixbuf.

New in version 0.3.1.

set_prefix(prefix)[source]
Parameters:

prefix (str) – the new filename prefix.

Sets the icon prefix filename.

New in version 0.1.6.

set_scale(scale)[source]
Parameters:

scale (int) – the scale as a factor.

Sets the icon scale.

New in version 0.6.13.

set_url(url)[source]
Parameters:

url (str) – the new icon URL.

Sets the icon URL.

New in version 0.3.2.

set_width(width)[source]
Parameters:

width (int) – the width in pixels.

Sets the icon width.

New in version 0.3.1.