diff options
Diffstat (limited to 'eel/eel-background.h')
-rw-r--r-- | eel/eel-background.h | 102 |
1 files changed, 52 insertions, 50 deletions
diff --git a/eel/eel-background.h b/eel/eel-background.h index 1c2218f3..74d370e7 100644 --- a/eel/eel-background.h +++ b/eel/eel-background.h @@ -3,6 +3,7 @@ eel-background.h: Object for the background of a widget. Copyright (C) 2000 Eazel, Inc. + Copyright (C) 2012 Jasmine Hassan <[email protected]> This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -20,6 +21,7 @@ Boston, MA 02110-1301, USA. Authors: Darin Adler <[email protected]> + Jasmine Hassan <[email protected]> */ #ifndef EEL_BACKGROUND_H @@ -45,6 +47,9 @@ #include <gdk-pixbuf/gdk-pixbuf.h> +#define MATE_DESKTOP_USE_UNSTABLE_API +#include <libmateui/mate-bg.h> + typedef struct EelBackground EelBackground; typedef struct EelBackgroundClass EelBackgroundClass; @@ -60,74 +65,71 @@ typedef struct EelBackgroundClass EelBackgroundClass; #define EEL_BACKGROUND_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EEL_TYPE_BACKGROUND, EelBackgroundClass)) -typedef enum -{ - EEL_BACKGROUND_TILED = 0, /* zero makes this the default placement */ - EEL_BACKGROUND_CENTERED, - EEL_BACKGROUND_SCALED, - EEL_BACKGROUND_SCALED_ASPECT, - EEL_BACKGROUND_ZOOM, - EEL_BACKGROUND_SPANNED -} EelBackgroundImagePlacement; - -GType eel_background_get_type (void); -EelBackground * eel_background_new (void); +GType eel_background_get_type (void); +EelBackground * eel_background_new (void); /* Calls to change a background. */ -void eel_background_set_use_base (EelBackground *background, - gboolean use_base); -void eel_background_set_color (EelBackground *background, - const char *color_or_gradient); -void eel_background_set_image_uri (EelBackground *background, - const char *image_uri); - -void eel_background_reset (EelBackground *background); -void eel_background_set_image_placement (EelBackground *background, - EelBackgroundImagePlacement placement); +void eel_background_set_use_base (EelBackground *self, + gboolean use_base); +void eel_background_set_color (EelBackground *self, + const gchar *color_or_gradient); +void eel_background_set_image_uri (EelBackground *self, + const gchar *image_uri); +void eel_background_reset (EelBackground *self); +void eel_bg_set_placement (EelBackground *self, + MateBGPlacement placement); /* Should be TRUE for desktop background */ -void eel_background_set_desktop (EelBackground *background, - GtkWidget *widget, - gboolean is_desktop); -gboolean eel_background_is_desktop (EelBackground *background); +gboolean eel_background_is_desktop (EelBackground *self); +void eel_background_set_desktop (EelBackground *self, + GtkWidget *widget, + gboolean is_desktop); /* Calls to interrogate the current state of a background. */ -char * eel_background_get_color (EelBackground *background); -char * eel_background_get_image_uri (EelBackground *background); -EelBackgroundImagePlacement eel_background_get_image_placement (EelBackground *background); -gboolean eel_background_is_dark (EelBackground *background); -gboolean eel_background_is_set (EelBackground *background); +gchar * eel_bg_get_desktop_color (EelBackground *self); +gchar * eel_background_get_color (EelBackground *self); +gchar * eel_background_get_image_uri (EelBackground *self); +gboolean eel_background_is_dark (EelBackground *self); +gboolean eel_background_is_set (EelBackground *self); /* Helper function for widgets using EelBackground */ +void eel_background_draw (GtkWidget *widget, #if GTK_CHECK_VERSION (3, 0, 0) -void eel_background_draw (GtkWidget *widget, - cairo_t *cr) + cairo_t *cr) #else -void eel_background_expose (GtkWidget *widget, - GdkEventExpose *event); + GdkEventExpose *event); #endif /* Handles a dragged color being dropped on a widget to change the background color. */ -void eel_background_receive_dropped_color (EelBackground *background, - GtkWidget *widget, - GdkDragAction action, - int drop_location_x, - int drop_location_y, - const GtkSelectionData *dropped_color); +void eel_background_set_dropped_color (EelBackground *self, + GtkWidget *widget, + GdkDragAction action, + int drop_location_x, + int drop_location_y, + const GtkSelectionData + *dropped_color); /* Handles a special-case image name that means "reset to default background" too. */ -void eel_background_receive_dropped_background_image (EelBackground *background, - GdkDragAction action, - const char *image_uri); +void eel_background_set_dropped_image (EelBackground *self, + GdkDragAction action, + const gchar *image_uri); /* Gets or creates a background so that it's attached to a widget. */ -EelBackground * eel_get_widget_background (GtkWidget *widget); -void eel_background_save_to_settings (EelBackground *background); +EelBackground * eel_get_widget_background (GtkWidget *widget); + +/* Thin-wrappers around mate_bg gsettings functions */ +void eel_bg_save_to_gsettings (EelBackground *self, + GSettings *settings); +void eel_bg_load_from_gsettings (EelBackground *self, + GSettings *settings); +void eel_bg_load_from_system_gsettings (EelBackground *self, + GSettings *settings, + gboolean apply); -/* Set activity status of background. Inactive backgrounds are drawn in the theme's INSENSITIVE color. */ -void eel_background_set_active (EelBackground *background, - gboolean is_active); +/* Set bg's activity status. Inactive backgrounds are drawn in the theme's INSENSITIVE color. */ +void eel_background_set_active (EelBackground *self, + gboolean is_active); typedef struct EelBackgroundDetails EelBackgroundDetails; @@ -155,7 +157,7 @@ struct EelBackgroundClass /* This signal is emitted when image loading is over - whether it * was successfully loaded or not. */ - void (* image_loading_done) (EelBackground *background, gboolean successful_load); + void (* image_loading_done) (EelBackground *self, gboolean successful_load); /* This signal is emitted when the background is reset by receiving the reset property from a drag |