LwBackground

LwBackground — background image

Functions

Properties

gchar * image Read / Write
GdkRGBA * primary-color Read / Write
guint render-type Read / Write
GdkRGBA * secondary-color Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── LwBackground

Description

The LwBackground object represents a static background image or color gradient.

To use LwBackground a plugin has to specify a default background. There are two types of default backgrounds:

Then the background is ready to be drawn. Use lw_background_draw() to draw the background to the current output. This is usually done before all other things will be drawn.

In addition to this, LwBackground provides support for custom background images. If the user checked the "use-custom-bg" key inside the configurator, LwBackground will show the user defined background image instead of the default background. It is not possible to deactivate this behaviour at the moment.

Functions

lw_background_draw ()

void
lw_background_draw (LwBackground *self,
                    LwOutput *output);

Draws the background to the active output.

Parameters

self

A LwBackground

 

output

The active output

 

lw_background_new_from_colors ()

LwBackground *
lw_background_new_from_colors (GdkColor *primary_color,
                               GdkColor *secondary_color,
                               LwBackgroundShadingType type);

Creates a new LwBackground with an color gradient as default background.

Parameters

primary_color

Left or bottom color when drawing gradients, or the solid color

 

secondary_color

Right or top color when drawing gradients, not used for solid color

 

type

The type of color gradient

 

Returns

A new LwBackground. Use g_object_unref() to free the LwBackground.

Since: 0.5


lw_background_new_from_file ()

LwBackground *
lw_background_new_from_file (const gchar *path,
                             LwBackgroundRenderType type);

Creates a new LwBackground with an default background image. Note that the background you set won't be necessary the one displayed, it can be overrided by the user's configuration.

Parameters

path

Name of the default background image

 

type

LwBackgroundRenderType to use for default background image

 

Returns

A new LwBackground. Use g_object_unref() to free the LwBackground.

Since: 0.5


lw_background_new_from_resource ()

LwBackground *
lw_background_new_from_resource (const gchar *path,
                                 LwBackgroundRenderType type);

Creates a new LwBackground with an default background image. Note that the background you set won't be necessary the one displayed, it can be overrided by the user's configuration.

Parameters

path

Name of the default background image

 

type

LwBackgroundRenderType to use for default background image

 

Returns

A new LwBackground. Use g_object_unref() to free the LwBackground.

Since: 0.5


lw_background_new_from_texture ()

LwBackground *
lw_background_new_from_texture (LwTexture *texture,
                                LwBackgroundRenderType type);

Creates a new LwBackground from a LwTexture.

Parameters

texture

The LwTexture to use as default background

 

type

LwBackgroundRenderType to use for default background

 

Returns

A new LwBackground. Use g_object_unref() to free the LwBackground.

Since: 0.5

Types and Values

struct LwBackground

struct LwBackground;

This structure holds all required information to render a background image.


struct LwBackgroundClass

struct LwBackgroundClass {
};

enum LwBackgroundRenderType

All supported types to render a background image.

Members

LwBackgroundZoom

Scales the image to fill the whole screen, no borders

 

LwBackgroundCentered

Puts the image in the center and keeps original size

 

LwBackgroundScaled

Scales the image to be completely on the screen, with borders

 

LwBackgroundStretched

Stretches the image to fill the whole screen, won't keep the aspect ratio. This is the value if "Fill" is chosen inside the configurator.

 

LwBackgroundTiled

Tiles the image and keeps original size

 

enum LwBackgroundShadingType

All supported shading types of LwBackground.

Members

LwBackgroundHorizontal

Horizontal color gradient

 

LwBackgroundVertical

Vertical color gradient

 

LwBackgroundSolid

Solid color

 

Property Details

The “image” property

  “image”                    gchar *

Path to use for the background image

Flags: Read / Write

Default value: NULL


The “primary-color” property

  “primary-color”            GdkRGBA *

Left or bottom color when drawing gradients, or the solid color

Flags: Read / Write


The “render-type” property

  “render-type”              guint

Determines how the background image is rendered

Flags: Read / Write

Allowed values: <= 4

Default value: 0


The “secondary-color” property

  “secondary-color”          GdkRGBA *

Right or top color when drawing gradients, not used for solid color

Flags: Read / Write