CinnamonDesktop.BG

g CinnamonDesktop.BG CinnamonDesktop.BG GObject.Object GObject.Object GObject.Object->CinnamonDesktop.BG

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_surface_from_root (screen)

class

new ()

class

set_accountsservice_background (background)

class

set_surface_as_root (screen, surface)

class

set_surface_as_root_with_crossfade (screen, surface)

changes_with_time ()

create_and_set_gtk_image (image, width, height)

create_and_set_surface_as_root (root_window, screen)

create_frame_thumbnail (factory, screen, dest_width, dest_height, frame_num)

create_surface (window, width, height, root)

create_thumbnail (factory, screen, dest_width, dest_height)

draw (dest, screen, is_root)

get_color (type, primary, secondary)

get_filename ()

get_image_size (factory, best_width, best_height, width, height)

get_placement ()

has_multiple_sizes ()

is_dark (dest_width, dest_height)

load_from_preferences (settings)

save_to_preferences (settings)

set_color (type, primary, secondary)

set_filename (filename)

set_placement (placement)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

changed

transitioned

Fields

Inherited:

GObject.Object (1)

Class Details

class CinnamonDesktop.BG(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

CinnamonDesktop.BGClass

classmethod get_surface_from_root(screen)
Parameters:

screen (Gdk.Screen) – a Gdk.Screen

Returns:

a cairo.Surface if successful or None

Return type:

cairo.Surface

This function queries the _XROOTPMAP_ID property from the root window associated with screen to determine the current root window background pixmap and returns a copy of it. If the _XROOTPMAP_ID is not set, then a black surface is returned.

classmethod new()
Return type:

CinnamonDesktop.BG

classmethod set_accountsservice_background(background)
Parameters:

background (str) –

classmethod set_surface_as_root(screen, surface)
Parameters:

Set the root pixmap, and properties pointing to it. We do this atomically with a server grab to make sure that we won’t leak the pixmap if somebody else it setting it at the same time. (This assumes that they follow the same conventions we do). surface should come from a call to CinnamonDesktop.BG.create_surface().

classmethod set_surface_as_root_with_crossfade(screen, surface)
Parameters:
Returns:

a CinnamonDesktop.BGCrossfade object

Return type:

CinnamonDesktop.BGCrossfade

Set the root pixmap, and properties pointing to it. This function differs from CinnamonDesktop.BG.set_surface_as_root() in that it adds a subtle crossfade animation from the current root pixmap to the new one.

changes_with_time()
Return type:

bool

create_and_set_gtk_image(image, width, height)
Parameters:
create_and_set_surface_as_root(root_window, screen)
Parameters:
create_frame_thumbnail(factory, screen, dest_width, dest_height, frame_num)
Parameters:
Returns:

the newly created thumbnail or or None if frame_num is out of bounds.

Return type:

GdkPixbuf.Pixbuf

Creates a thumbnail for a certain frame, where ‘frame’ is somewhat vaguely defined as ‘suitable point to show while single-stepping through the slideshow’.

create_surface(window, width, height, root)
Parameters:
Returns:

None on error (e.g. out of X connections)

Return type:

cairo.Surface

Create a surface that can be set as background for window. If is_root is True, the surface created will be created by a temporary X server connection so that if someone calls XKillClient on it, it won’t affect the application who created it.

create_thumbnail(factory, screen, dest_width, dest_height)
Parameters:
Returns:

a GdkPixbuf.Pixbuf showing the background as a thumbnail

Return type:

GdkPixbuf.Pixbuf

draw(dest, screen, is_root)
Parameters:
get_color(type, primary, secondary)
Parameters:
get_filename()
Return type:

str

get_image_size(factory, best_width, best_height, width, height)
Parameters:
Return type:

bool

get_placement()
Return type:

CDesktopEnums.BackgroundStyle

has_multiple_sizes()
Return type:

bool

is_dark(dest_width, dest_height)
Parameters:
  • dest_width (int) –

  • dest_height (int) –

Return type:

bool

load_from_preferences(settings)
Parameters:

settings (Gio.Settings) –

save_to_preferences(settings)
Parameters:

settings (Gio.Settings) –

set_color(type, primary, secondary)
Parameters:
set_filename(filename)
Parameters:

filename (str) –

set_placement(placement)
Parameters:

placement (CDesktopEnums.BackgroundStyle) –

Signal Details

CinnamonDesktop.BG.signals.changed(b_g)
Signal Name:

changed

Flags:

RUN_LAST

Parameters:

b_g (CinnamonDesktop.BG) – The object which received the signal

CinnamonDesktop.BG.signals.transitioned(b_g)
Signal Name:

transitioned

Flags:

RUN_LAST

Parameters:

b_g (CinnamonDesktop.BG) – The object which received the signal