3
Copyright 2007, Red Hat, Inc.
5
This file is part of the Gnome Library.
7
The Gnome Library is free software; you can redistribute it and/or
8
modify it under the terms of the GNU Library General Public License as
9
published by the Free Software Foundation; either version 2 of the
10
License, or (at your option) any later version.
12
The Gnome Library is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
Library General Public License for more details.
17
You should have received a copy of the GNU Library General Public
18
License along with the Gnome Library; see the file COPYING.LIB. If not,
19
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
Boston, MA 02110-1301, USA.
22
Author: Soren Sandmann <sandmann@redhat.com>
25
#ifndef __GNOME_BG_H__
26
#define __GNOME_BG_H__
28
#ifndef GNOME_DESKTOP_USE_UNSTABLE_API
29
#error GnomeBG is unstable API. You must define GNOME_DESKTOP_USE_UNSTABLE_API before including gnome-bg.h
34
#include <gdesktop-enums.h>
35
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
36
#include <libgnome-desktop/gnome-bg-crossfade.h>
37
#include <gdesktop-enums.h>
41
#define GNOME_TYPE_BG (gnome_bg_get_type ())
42
#define GNOME_BG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_BG, GnomeBG))
43
#define GNOME_BG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_BG, GnomeBGClass))
44
#define GNOME_IS_BG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_TYPE_BG))
45
#define GNOME_IS_BG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_BG))
46
#define GNOME_BG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_TYPE_BG, GnomeBGClass))
48
typedef struct _GnomeBG GnomeBG;
49
typedef struct _GnomeBGClass GnomeBGClass;
51
GType gnome_bg_get_type (void);
52
GnomeBG * gnome_bg_new (void);
53
void gnome_bg_load_from_preferences (GnomeBG *bg,
55
void gnome_bg_save_to_preferences (GnomeBG *bg,
58
void gnome_bg_set_filename (GnomeBG *bg,
59
const char *filename);
60
void gnome_bg_set_placement (GnomeBG *bg,
61
GDesktopBackgroundStyle placement);
62
void gnome_bg_set_color (GnomeBG *bg,
63
GDesktopBackgroundShading type,
68
GDesktopBackgroundStyle gnome_bg_get_placement (GnomeBG *bg);
69
void gnome_bg_get_color (GnomeBG *bg,
70
GDesktopBackgroundShading *type,
73
const gchar * gnome_bg_get_filename (GnomeBG *bg);
75
/* Drawing and thumbnailing */
76
void gnome_bg_draw (GnomeBG *bg,
80
cairo_surface_t *gnome_bg_create_surface (GnomeBG *bg,
85
gboolean gnome_bg_get_image_size (GnomeBG *bg,
86
GnomeDesktopThumbnailFactory *factory,
91
GdkPixbuf * gnome_bg_create_thumbnail (GnomeBG *bg,
92
GnomeDesktopThumbnailFactory *factory,
96
gboolean gnome_bg_is_dark (GnomeBG *bg,
99
gboolean gnome_bg_has_multiple_sizes (GnomeBG *bg);
100
gboolean gnome_bg_changes_with_time (GnomeBG *bg);
101
GdkPixbuf * gnome_bg_create_frame_thumbnail (GnomeBG *bg,
102
GnomeDesktopThumbnailFactory *factory,
108
/* Set a surface as root - not a GnomeBG method. At some point
109
* if we decide to stabilize the API then we may want to make
110
* these object methods, drop gnome_bg_create_surface, etc.
112
void gnome_bg_set_surface_as_root (GdkScreen *screen,
113
cairo_surface_t *surface);
115
GnomeBGCrossfade *gnome_bg_set_surface_as_root_with_crossfade (GdkScreen *screen,
116
cairo_surface_t *surface);
117
cairo_surface_t *gnome_bg_get_surface_from_root (GdkScreen *screen);