Debian Codegraph @

libgnome-desktop/gnome-bg/gnome-bg.h

raw symbols SCIP
1 /* gnome-bg.h: Desktop background API
2 *
3 * SPDX-FileCopyrightText: 2007, Red Hat, Inc.
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 *
6 * Author: Soren Sandmann <[email protected]>
7 */
8
9 #pragma once
10
11 #ifndef GNOME_DESKTOP_USE_UNSTABLE_API
12 # error GnomeBG is unstable API. You must define GNOME_DESKTOP_USE_UNSTABLE_API before including gnome-bg.h
13 #endif
14
15 #include <gdk/gdk.h>
16 #include <gio/gio.h>
17 #include <gdesktop-enums.h>
18 #include <libgnome-desktop/gnome-desktop-thumbnail.h>
19 #include <gdesktop-enums.h>
20
21 G_BEGIN_DECLS
22
23 #define GNOME_TYPE_BG (gnome_bg_get_type ())
24 #define GNOME_BG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_BG, GnomeBG))
25 #define GNOME_BG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_BG, GnomeBGClass))
26 #define GNOME_IS_BG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_TYPE_BG))
27 #define GNOME_IS_BG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_BG))
28 #define GNOME_BG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_TYPE_BG, GnomeBGClass))
29
30 typedef struct _GnomeBG GnomeBG;
31 typedef struct _GnomeBGClass GnomeBGClass;
32
33 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomeBG, g_object_unref)
34
35 GType gnome_bg_get_type (void);
36 GnomeBG * gnome_bg_new (void);
37 void gnome_bg_load_from_preferences (GnomeBG *bg,
38 GSettings *settings);
39 void gnome_bg_save_to_preferences (GnomeBG *bg,
40 GSettings *settings);
41 /* Setters */
42 void gnome_bg_set_filename (GnomeBG *bg,
43 const char *filename);
44 void gnome_bg_set_placement (GnomeBG *bg,
45 GDesktopBackgroundStyle placement);
46 void gnome_bg_set_rgba (GnomeBG *bg,
47 GDesktopBackgroundShading type,
48 GdkRGBA *primary,
49 GdkRGBA *secondary);
50
51 /* Getters */
52 GDesktopBackgroundStyle gnome_bg_get_placement (GnomeBG *bg);
53 void gnome_bg_get_rgba (GnomeBG *bg,
54 GDesktopBackgroundShading *type,
55 GdkRGBA *primary,
56 GdkRGBA *secondary);
57 const gchar * gnome_bg_get_filename (GnomeBG *bg);
58
59 /* Drawing and thumbnailing */
60 void gnome_bg_draw (GnomeBG *bg,
61 GdkPixbuf *dest);
62 cairo_surface_t *gnome_bg_create_surface (GnomeBG *bg,
63 GdkSurface *window,
64 int width,
65 int height);
66 gboolean gnome_bg_get_image_size (GnomeBG *bg,
67 GnomeDesktopThumbnailFactory *factory,
68 int best_width,
69 int best_height,
70 int *width,
71 int *height);
72 GdkPixbuf * gnome_bg_create_thumbnail (GnomeBG *bg,
73 GnomeDesktopThumbnailFactory *factory,
74 const cairo_rectangle_int_t *screen_area,
75 int dest_width,
76 int dest_height);
77 gboolean gnome_bg_is_dark (GnomeBG *bg,
78 int dest_width,
79 int dest_height);
80 gboolean gnome_bg_has_multiple_sizes (GnomeBG *bg);
81 gboolean gnome_bg_changes_with_time (GnomeBG *bg);
82 GdkPixbuf * gnome_bg_create_frame_thumbnail (GnomeBG *bg,
83 GnomeDesktopThumbnailFactory *factory,
84 const cairo_rectangle_int_t *screen_area,
85 int dest_width,
86 int dest_height,
87 int frame_num);
88
89 G_END_DECLS