|
mate-desktop 1.29.2
Library with common API for various MATE modules
|
#include <glib.h>#include <gdk/gdk.h>#include <gio/gio.h>#include "mate-desktop-thumbnail.h"#include "mate-bg-crossfade.h"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 |
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 | |
| #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_BG_GET_CLASS | ( | obj | ) | (G_TYPE_INSTANCE_GET_CLASS ((obj), MATE_TYPE_BG, MateBGClass)) |
| #define MATE_BG_KEY_BACKGROUND_FADE "background-fade" |
| #define MATE_BG_KEY_COLOR_TYPE "color-shading-type" |
| #define MATE_BG_KEY_DRAW_BACKGROUND "draw-background" |
| #define MATE_BG_KEY_PICTURE_FILENAME "picture-filename" |
| #define MATE_BG_KEY_PICTURE_OPACITY "picture-opacity" |
| #define MATE_BG_KEY_PICTURE_PLACEMENT "picture-options" |
| #define MATE_BG_KEY_PRIMARY_COLOR "primary-color" |
| #define MATE_BG_KEY_SECONDARY_COLOR "secondary-color" |
| #define MATE_BG_KEY_SHOW_DESKTOP "show-desktop-icons" |
| #define MATE_BG_SCHEMA "org.mate.background" |
| #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_TYPE_BG (mate_bg_get_type ()) |
| typedef struct _MateBGClass MateBGClass |
| enum MateBGColorType |
| enum MateBGPlacement |
| gboolean mate_bg_changes_with_time | ( | MateBG * | bg | ) |
References _MateBG::filename, get_as_slideshow(), _SlideShow::slides, and slideshow_unref().
| 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.
| 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().
| 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().
| 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.
| 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().
| void mate_bg_get_color | ( | MateBG * | bg, |
| MateBGColorType * | type, | ||
| GdkRGBA * | primary, | ||
| GdkRGBA * | secondary | ||
| ) |
References _MateBG::color_type, _MateBG::primary, and _MateBG::secondary.
| gboolean mate_bg_get_draw_background | ( | MateBG * | bg | ) |
References _MateBG::is_enabled.
| const gchar * mate_bg_get_filename | ( | MateBG * | bg | ) |
References _MateBG::filename.
| 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().
| MateBGPlacement mate_bg_get_placement | ( | MateBG * | bg | ) |
References _MateBG::placement.
| 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().
| GType mate_bg_get_type | ( | void | ) |
| gboolean mate_bg_has_multiple_sizes | ( | MateBG * | bg | ) |
References _MateBG::filename, get_as_slideshow(), slideshow_has_multiple_sizes(), and slideshow_unref().
| 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.
| void mate_bg_load_from_gsettings | ( | MateBG * | bg, |
| GSettings * | settings | ||
| ) |
References color_from_string(), _MateBG::is_enabled, MATE_BG_KEY_COLOR_TYPE, MATE_BG_KEY_DRAW_BACKGROUND, MATE_BG_KEY_PICTURE_FILENAME, MATE_BG_KEY_PICTURE_PLACEMENT, MATE_BG_KEY_PRIMARY_COLOR, MATE_BG_KEY_SECONDARY_COLOR, mate_bg_set_color(), mate_bg_set_filename(), mate_bg_set_placement(), and MATE_IS_BG.
Referenced by mate_bg_load_from_preferences(), and mate_bg_load_from_system_gsettings().
| void mate_bg_load_from_preferences | ( | MateBG * | bg | ) |
References mate_bg_load_from_gsettings(), MATE_BG_SCHEMA, and queue_changed().
| 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().
| void mate_bg_load_from_system_preferences | ( | MateBG * | bg | ) |
References mate_bg_load_from_system_gsettings(), and MATE_BG_SCHEMA.
| MateBG * mate_bg_new | ( | void | ) |
References MATE_TYPE_BG.
| void mate_bg_save_to_gsettings | ( | MateBG * | bg, |
| GSettings * | settings | ||
| ) |
References color_to_string(), _MateBG::color_type, _MateBG::filename, _MateBG::is_enabled, MATE_BG_KEY_COLOR_TYPE, MATE_BG_KEY_DRAW_BACKGROUND, MATE_BG_KEY_PICTURE_FILENAME, MATE_BG_KEY_PICTURE_PLACEMENT, MATE_BG_KEY_PRIMARY_COLOR, MATE_BG_KEY_SECONDARY_COLOR, MATE_IS_BG, _MateBG::placement, _MateBG::primary, and _MateBG::secondary.
Referenced by mate_bg_save_to_preferences().
| void mate_bg_save_to_preferences | ( | MateBG * | bg | ) |
References mate_bg_save_to_gsettings(), and MATE_BG_SCHEMA.
| 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().
| void mate_bg_set_draw_background | ( | MateBG * | bg, |
| gboolean | draw_background | ||
| ) |
References draw_background(), _MateBG::is_enabled, and queue_changed().
| 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().
| void mate_bg_set_placement | ( | MateBG * | bg, |
| MateBGPlacement | placement | ||
| ) |
References _MateBG::placement, and queue_changed().
Referenced by mate_bg_load_from_gsettings().
| 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().
| 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().