Top | ![]() |
![]() |
![]() |
![]() |
gchar * | image | Read / Write |
GdkRGBA * | primary-color | Read / Write |
guint | render-type | Read / Write |
GdkRGBA * | secondary-color | Read / Write |
struct | LwBackground |
struct | LwBackgroundClass |
enum | LwBackgroundRenderType |
enum | LwBackgroundShadingType |
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:
An image (lw_background_new_from_file()
)
A color gradient (lw_background_new_from_colors()
)
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.
void lw_background_draw (LwBackground *self
,LwOutput *output
);
Draws the background to the active output.
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.
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 |
Since: 0.5
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.
path |
Name of the default background image |
|
type |
LwBackgroundRenderType to use for default background image |
Since: 0.5
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.
path |
Name of the default background image |
|
type |
LwBackgroundRenderType to use for default background image |
Since: 0.5
LwBackground * lw_background_new_from_texture (LwTexture *texture
,LwBackgroundRenderType type
);
Creates a new LwBackground from a LwTexture.
texture |
The LwTexture to use as default background |
|
type |
LwBackgroundRenderType to use for default background |
Since: 0.5
struct LwBackground;
This structure holds all required information to render a background image.
All supported types to render a background image.
Scales the image to fill the whole screen, no borders |
||
Puts the image in the center and keeps original size |
||
Scales the image to be completely on the screen, with borders |
||
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. |
||
Tiles the image and keeps original size |
“image”
property“image” gchar *
Path to use for the background image
Flags: Read / Write
Default value: NULL
“primary-color”
property“primary-color” GdkRGBA *
Left or bottom color when drawing gradients, or the solid color
Flags: Read / Write
“render-type”
property“render-type” guint
Determines how the background image is rendered
Flags: Read / Write
Allowed values: <= 4
Default value: 0
“secondary-color”
property“secondary-color” GdkRGBA *
Right or top color when drawing gradients, not used for solid color
Flags: Read / Write