summaryrefslogtreecommitdiff
path: root/src/meta/meta-background-image.h
blob: 137a6ff8e66d1e8a952f9ac74e64c7aa08ef4b81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
 * MetaBackgroundImageCache:
 *
 * Simple cache for background textures loaded from files
 *
 * Copyright 2014 Red Hat, Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __META_BACKGROUND_IMAGE_H__
#define __META_BACKGROUND_IMAGE_H__

#include <gio/gio.h>
#include <glib-object.h>

#include "cogl/cogl.h"
#include "meta/display.h"

#define META_TYPE_BACKGROUND_IMAGE (meta_background_image_get_type ())

META_EXPORT
G_DECLARE_FINAL_TYPE (MetaBackgroundImage,
                      meta_background_image,
                      META, BACKGROUND_IMAGE,
                      GObject)

META_EXPORT
gboolean     meta_background_image_is_loaded   (MetaBackgroundImage *image);

META_EXPORT
gboolean     meta_background_image_get_success (MetaBackgroundImage *image);

META_EXPORT
CoglTexture *meta_background_image_get_texture (MetaBackgroundImage *image);


#define META_TYPE_BACKGROUND_IMAGE_CACHE (meta_background_image_cache_get_type ())

META_EXPORT
G_DECLARE_FINAL_TYPE (MetaBackgroundImageCache,
                      meta_background_image_cache,
                      META, BACKGROUND_IMAGE_CACHE,
                      GObject)

META_EXPORT
MetaBackgroundImageCache *meta_background_image_cache_get_default (void);

META_EXPORT
MetaBackgroundImage *meta_background_image_cache_load  (MetaBackgroundImageCache *cache,
                                                        GFile                    *file);

META_EXPORT
void                 meta_background_image_cache_purge (MetaBackgroundImageCache *cache,
                                                        GFile                    *file);

#endif /* __META_BACKGROUND_IMAGE_H__ */