mate-desktop 1.29.2
Library with common API for various MATE modules
Loading...
Searching...
No Matches
mate-bg.h File Reference
View source
#include <glib.h>
#include <gdk/gdk.h>
#include <gio/gio.h>
#include "mate-desktop-thumbnail.h"
#include "mate-bg-crossfade.h"
Include dependency graph for mate-bg.h:
This graph shows which files directly or indirectly include this file:

Macros

#define MATE_TYPE_BG   (mate_bg_get_type ())
 
#define MATE_BG(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATE_TYPE_BG, MateBG))
 
#define MATE_BG_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), MATE_TYPE_BG, MateBGClass))
 
#define MATE_IS_BG(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MATE_TYPE_BG))
 
#define MATE_IS_BG_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), MATE_TYPE_BG))
 
#define MATE_BG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), MATE_TYPE_BG, MateBGClass))
 
#define MATE_BG_SCHEMA   "org.mate.background"
 
#define MATE_BG_KEY_DRAW_BACKGROUND   "draw-background"
 
#define MATE_BG_KEY_SHOW_DESKTOP   "show-desktop-icons"
 
#define MATE_BG_KEY_BACKGROUND_FADE   "background-fade"
 
#define MATE_BG_KEY_PRIMARY_COLOR   "primary-color"
 
#define MATE_BG_KEY_SECONDARY_COLOR   "secondary-color"
 
#define MATE_BG_KEY_COLOR_TYPE   "color-shading-type"
 
#define MATE_BG_KEY_PICTURE_PLACEMENT   "picture-options"
 
#define MATE_BG_KEY_PICTURE_OPACITY   "picture-opacity"
 
#define MATE_BG_KEY_PICTURE_FILENAME   "picture-filename"
 

Typedefs

typedef struct _MateBG MateBG
 
typedef struct _MateBGClass MateBGClass
 

Enumerations

enum  MateBGColorType { MATE_BG_COLOR_SOLID , MATE_BG_COLOR_H_GRADIENT , MATE_BG_COLOR_V_GRADIENT }
 
enum  MateBGPlacement {
  MATE_BG_PLACEMENT_TILED , MATE_BG_PLACEMENT_ZOOMED , MATE_BG_PLACEMENT_CENTERED , MATE_BG_PLACEMENT_SCALED ,
  MATE_BG_PLACEMENT_FILL_SCREEN , MATE_BG_PLACEMENT_SPANNED
}
 

Functions

GType mate_bg_get_type (void)
 
MateBG * mate_bg_new (void)
 
void mate_bg_load_from_preferences (MateBG *bg)
 
void mate_bg_load_from_system_preferences (MateBG *bg)
 
void mate_bg_load_from_system_gsettings (MateBG *bg, GSettings *settings, gboolean reset_apply)
 
void mate_bg_load_from_gsettings (MateBG *bg, GSettings *settings)
 
void mate_bg_save_to_preferences (MateBG *bg)
 
void mate_bg_save_to_gsettings (MateBG *bg, GSettings *settings)
 
void mate_bg_set_filename (MateBG *bg, const char *filename)
 
void mate_bg_set_placement (MateBG *bg, MateBGPlacement placement)
 
void mate_bg_set_color (MateBG *bg, MateBGColorType type, GdkRGBA *primary, GdkRGBA *secondary)
 
void mate_bg_set_draw_background (MateBG *bg, gboolean draw_background)
 
gboolean mate_bg_get_draw_background (MateBG *bg)
 
MateBGPlacement mate_bg_get_placement (MateBG *bg)
 
void mate_bg_get_color (MateBG *bg, MateBGColorType *type, GdkRGBA *primary, GdkRGBA *secondary)
 
const gchar * mate_bg_get_filename (MateBG *bg)
 
void mate_bg_draw (MateBG *bg, GdkPixbuf *dest, GdkScreen *screen, gboolean is_root)
 
cairo_surface_t * mate_bg_create_surface (MateBG *bg, GdkWindow *window, int width, int height, gboolean root)
 mate_bg_create_surface: @bg: MateBG @window: @width: @height: @root:
 
cairo_surface_t * mate_bg_create_surface_scale (MateBG *bg, GdkWindow *window, int width, int height, int scale, gboolean root)
 mate_bg_create_surface_scale: @bg: MateBG @window: @width: @height: @scale: @root:
 
gboolean mate_bg_get_image_size (MateBG *bg, MateDesktopThumbnailFactory *factory, int best_width, int best_height, int *width, int *height)
 
GdkPixbuf * mate_bg_create_thumbnail (MateBG *bg, MateDesktopThumbnailFactory *factory, GdkScreen *screen, int dest_width, int dest_height)
 mate_bg_create_thumbnail:
 
gboolean mate_bg_is_dark (MateBG *bg, int dest_width, int dest_height)
 
gboolean mate_bg_has_multiple_sizes (MateBG *bg)
 
gboolean mate_bg_changes_with_time (MateBG *bg)
 
GdkPixbuf * mate_bg_create_frame_thumbnail (MateBG *bg, MateDesktopThumbnailFactory *factory, GdkScreen *screen, int dest_width, int dest_height, int frame_num)
 mate_bg_create_frame_thumbnail:
 
void mate_bg_set_surface_as_root (GdkScreen *screen, cairo_surface_t *surface)
 mate_bg_set_surface_as_root: @screen: the #GdkScreen to change root background on @surface: the #cairo_surface_t to set root background from.
 
MateBGCrossfade * mate_bg_set_surface_as_root_with_crossfade (GdkScreen *screen, cairo_surface_t *surface)
 mate_bg_set_surface_as_root_with_crossfade: @screen: the #GdkScreen to change root background on @surface: the cairo xlib surface to set root background from
 
cairo_surface_t * mate_bg_get_surface_from_root (GdkScreen *screen)
 mate_bg_get_surface_from_root: @screen: a #GdkScreen
 

Macro Definition Documentation

◆ MATE_BG

#define MATE_BG (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATE_TYPE_BG, MateBG))

◆ MATE_BG_CLASS

#define MATE_BG_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), MATE_TYPE_BG, MateBGClass))

◆ MATE_BG_GET_CLASS

#define MATE_BG_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), MATE_TYPE_BG, MateBGClass))

◆ MATE_BG_KEY_BACKGROUND_FADE

#define MATE_BG_KEY_BACKGROUND_FADE   "background-fade"

◆ MATE_BG_KEY_COLOR_TYPE

#define MATE_BG_KEY_COLOR_TYPE   "color-shading-type"

◆ MATE_BG_KEY_DRAW_BACKGROUND

#define MATE_BG_KEY_DRAW_BACKGROUND   "draw-background"

◆ MATE_BG_KEY_PICTURE_FILENAME

#define MATE_BG_KEY_PICTURE_FILENAME   "picture-filename"

◆ MATE_BG_KEY_PICTURE_OPACITY

#define MATE_BG_KEY_PICTURE_OPACITY   "picture-opacity"

◆ MATE_BG_KEY_PICTURE_PLACEMENT

#define MATE_BG_KEY_PICTURE_PLACEMENT   "picture-options"

◆ MATE_BG_KEY_PRIMARY_COLOR

#define MATE_BG_KEY_PRIMARY_COLOR   "primary-color"

◆ MATE_BG_KEY_SECONDARY_COLOR

#define MATE_BG_KEY_SECONDARY_COLOR   "secondary-color"

◆ MATE_BG_KEY_SHOW_DESKTOP

#define MATE_BG_KEY_SHOW_DESKTOP   "show-desktop-icons"

◆ MATE_BG_SCHEMA

#define MATE_BG_SCHEMA   "org.mate.background"

◆ MATE_IS_BG

#define MATE_IS_BG (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MATE_TYPE_BG))

◆ MATE_IS_BG_CLASS

#define MATE_IS_BG_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), MATE_TYPE_BG))

◆ MATE_TYPE_BG

#define MATE_TYPE_BG   (mate_bg_get_type ())

Typedef Documentation

◆ MateBG

typedef struct _MateBG MateBG

◆ MateBGClass

typedef struct _MateBGClass MateBGClass

Enumeration Type Documentation

◆ MateBGColorType

Enumerator
MATE_BG_COLOR_SOLID 
MATE_BG_COLOR_H_GRADIENT 
MATE_BG_COLOR_V_GRADIENT 

◆ MateBGPlacement

Enumerator
MATE_BG_PLACEMENT_TILED 
MATE_BG_PLACEMENT_ZOOMED 
MATE_BG_PLACEMENT_CENTERED 
MATE_BG_PLACEMENT_SCALED 
MATE_BG_PLACEMENT_FILL_SCREEN 
MATE_BG_PLACEMENT_SPANNED 

Function Documentation

◆ mate_bg_changes_with_time()

gboolean mate_bg_changes_with_time ( MateBG *  bg)

References _MateBG::filename, get_as_slideshow(), _SlideShow::slides, and slideshow_unref().

Here is the call graph for this function:

◆ mate_bg_create_frame_thumbnail()

GdkPixbuf * mate_bg_create_frame_thumbnail ( MateBG *  bg,
MateDesktopThumbnailFactory *  factory,
GdkScreen *  screen,
int  dest_width,
int  dest_height,
int  frame_num 
)

mate_bg_create_frame_thumbnail:

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

Returns: (transfer full): the newly created thumbnail or or NULL if frame_num is out of bounds.

References create_img_thumbnail(), draw_color(), draw_image_for_thumb(), _MateBG::filename, _Slide::fixed, get_as_slideshow(), and _SlideShow::slides.

Here is the call graph for this function:

◆ mate_bg_create_surface()

cairo_surface_t * mate_bg_create_surface ( MateBG *  bg,
GdkWindow *  window,
int  width,
int  height,
gboolean  root 
)

mate_bg_create_surface: @bg: MateBG @window: @width: @height: @root:

Create a surface that can be set as background for @window. If @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.

References mate_bg_create_surface_scale().

Here is the call graph for this function:

◆ mate_bg_create_surface_scale()

cairo_surface_t * mate_bg_create_surface_scale ( MateBG *  bg,
GdkWindow *  window,
int  width,
int  height,
int  scale,
gboolean  root 
)

mate_bg_create_surface_scale: @bg: MateBG @window: @width: @height: @scale: @root:

Create a scaled surface that can be set as background for @window. If @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.

References _MateBG::color_type, _MateBG::filename, make_root_pixmap(), MATE_BG_COLOR_SOLID, mate_bg_draw(), mate_bg_get_pixmap_size(), _MateBG::pixbuf_cache, and _MateBG::primary.

Referenced by mate_bg_create_surface().

Here is the call graph for this function:

◆ mate_bg_create_thumbnail()

GdkPixbuf * mate_bg_create_thumbnail ( MateBG *  bg,
MateDesktopThumbnailFactory *  factory,
GdkScreen *  screen,
int  dest_width,
int  dest_height 
)

mate_bg_create_thumbnail:

Returns: (transfer full): a #GdkPixbuf showing the background as a thumbnail

References create_img_thumbnail(), draw_color(), draw_image_for_thumb(), and _MateBG::filename.

Here is the call graph for this function:

◆ mate_bg_draw()

void mate_bg_draw ( MateBG *  bg,
GdkPixbuf *  dest,
GdkScreen *  screen,
gboolean  is_root 
)

References draw_color(), draw_color_each_monitor(), draw_each_monitor(), draw_once(), _MateBG::filename, MATE_BG_PLACEMENT_SPANNED, and _MateBG::placement.

Referenced by mate_bg_create_surface_scale().

Here is the call graph for this function:

◆ mate_bg_get_color()

void mate_bg_get_color ( MateBG *  bg,
MateBGColorType *  type,
GdkRGBA *  primary,
GdkRGBA *  secondary 
)

◆ mate_bg_get_draw_background()

gboolean mate_bg_get_draw_background ( MateBG *  bg)

References _MateBG::is_enabled.

◆ mate_bg_get_filename()

const gchar * mate_bg_get_filename ( MateBG *  bg)

References _MateBG::filename.

◆ mate_bg_get_image_size()

gboolean mate_bg_get_image_size ( MateBG *  bg,
MateDesktopThumbnailFactory *  factory,
int  best_width,
int  best_height,
int *  width,
int *  height 
)

References create_thumbnail_for_filename(), _MateBG::filename, get_filename_for_size(), get_original_size(), and get_thumb_annotations().

Here is the call graph for this function:

◆ mate_bg_get_placement()

MateBGPlacement mate_bg_get_placement ( MateBG *  bg)

References _MateBG::placement.

◆ mate_bg_get_surface_from_root()

cairo_surface_t * mate_bg_get_surface_from_root ( GdkScreen *  screen)

mate_bg_get_surface_from_root: @screen: a #GdkScreen

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

Return value: a #cairo_surface_t if successful or NULL

Referenced by mate_bg_set_surface_as_root_with_crossfade().

◆ mate_bg_get_type()

GType mate_bg_get_type ( void  )

◆ mate_bg_has_multiple_sizes()

gboolean mate_bg_has_multiple_sizes ( MateBG *  bg)

References _MateBG::filename, get_as_slideshow(), slideshow_has_multiple_sizes(), and slideshow_unref().

Here is the call graph for this function:

◆ mate_bg_is_dark()

gboolean mate_bg_is_dark ( MateBG *  bg,
int  dest_width,
int  dest_height 
)

References _MateBG::color_type, get_pixbuf_for_size(), MATE_BG_COLOR_SOLID, pixbuf_average_value(), _MateBG::primary, and _MateBG::secondary.

Here is the call graph for this function:

◆ mate_bg_load_from_gsettings()

void mate_bg_load_from_gsettings ( MateBG *  bg,
GSettings *  settings 
)

◆ mate_bg_load_from_preferences()

void mate_bg_load_from_preferences ( MateBG *  bg)

References mate_bg_load_from_gsettings(), MATE_BG_SCHEMA, and queue_changed().

Here is the call graph for this function:

◆ mate_bg_load_from_system_gsettings()

void mate_bg_load_from_system_gsettings ( MateBG *  bg,
GSettings *  settings,
gboolean  reset_apply 
)

References mate_bg_load_from_gsettings(), and MATE_IS_BG.

Referenced by mate_bg_load_from_system_preferences().

Here is the call graph for this function:

◆ mate_bg_load_from_system_preferences()

void mate_bg_load_from_system_preferences ( MateBG *  bg)

References mate_bg_load_from_system_gsettings(), and MATE_BG_SCHEMA.

Here is the call graph for this function:

◆ mate_bg_new()

MateBG * mate_bg_new ( void  )

References MATE_TYPE_BG.

◆ mate_bg_save_to_gsettings()

void mate_bg_save_to_gsettings ( MateBG *  bg,
GSettings *  settings 
)

◆ mate_bg_save_to_preferences()

void mate_bg_save_to_preferences ( MateBG *  bg)

References mate_bg_save_to_gsettings(), and MATE_BG_SCHEMA.

Here is the call graph for this function:

◆ mate_bg_set_color()

void mate_bg_set_color ( MateBG *  bg,
MateBGColorType  type,
GdkRGBA *  primary,
GdkRGBA *  secondary 
)

References _MateBG::color_type, _MateBG::primary, queue_changed(), and _MateBG::secondary.

Referenced by mate_bg_load_from_gsettings().

Here is the call graph for this function:

◆ mate_bg_set_draw_background()

void mate_bg_set_draw_background ( MateBG *  bg,
gboolean  draw_background 
)

References draw_background(), _MateBG::is_enabled, and queue_changed().

Here is the call graph for this function:

◆ mate_bg_set_filename()

void mate_bg_set_filename ( MateBG *  bg,
const char *  filename 
)

References clear_cache(), file_changed(), _MateBG::file_monitor, _MateBG::file_mtime, _MateBG::filename, get_mtime(), is_different(), and queue_changed().

Referenced by mate_bg_load_from_gsettings().

Here is the call graph for this function:

◆ mate_bg_set_placement()

void mate_bg_set_placement ( MateBG *  bg,
MateBGPlacement  placement 
)

References _MateBG::placement, and queue_changed().

Referenced by mate_bg_load_from_gsettings().

Here is the call graph for this function:

◆ mate_bg_set_surface_as_root()

void mate_bg_set_surface_as_root ( GdkScreen *  screen,
cairo_surface_t *  surface 
)

mate_bg_set_surface_as_root: @screen: the #GdkScreen to change root background on @surface: the #cairo_surface_t to set root background from.

Must be an xlib surface backing a pixmap.

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 mate_bg_create_surface().

References mate_bg_set_root_pixmap_id().

Referenced by mate_bg_set_surface_as_root_with_crossfade().

Here is the call graph for this function:

◆ mate_bg_set_surface_as_root_with_crossfade()

MateBGCrossfade * mate_bg_set_surface_as_root_with_crossfade ( GdkScreen *  screen,
cairo_surface_t *  surface 
)

mate_bg_set_surface_as_root_with_crossfade: @screen: the #GdkScreen to change root background on @surface: the cairo xlib surface to set root background from

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

Return value: (transfer full): a MateBGCrossfade object

References mate_bg_crossfade_new(), mate_bg_crossfade_set_end_surface(), mate_bg_crossfade_set_start_surface(), mate_bg_crossfade_start(), mate_bg_get_surface_from_root(), and mate_bg_set_surface_as_root().

Here is the call graph for this function: