| 1 |
/* |
| 2 |
* Copyright (C) 2010-2012 Jiri Techet <techet@gmail.com> |
| 3 |
* |
| 4 |
* This library is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU Lesser General Public |
| 6 |
* License as published by the Free Software Foundation; either |
| 7 |
* version 2.1 of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This library is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 |
* Lesser General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU Lesser General Public |
| 15 |
* License along with this library; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 |
*/ |
| 18 |
|
| 19 |
#if !defined (__CHAMPLAIN_CHAMPLAIN_H_INSIDE__) && !defined (CHAMPLAIN_COMPILATION) |
| 20 |
#error "Only <champlain/champlain.h> can be included directly." |
| 21 |
#endif |
| 22 |
|
| 23 |
#ifndef _CHAMPLAIN_MEMORY_CACHE_H_ |
| 24 |
#define _CHAMPLAIN_MEMORY_CACHE_H_ |
| 25 |
|
| 26 |
#include <glib-object.h> |
| 27 |
#include <champlain/champlain-tile-cache.h> |
| 28 |
|
| 29 |
G_BEGIN_DECLS |
| 30 |
|
| 31 |
#define CHAMPLAIN_TYPE_MEMORY_CACHE champlain_memory_cache_get_type () |
| 32 |
|
| 33 |
#define CHAMPLAIN_MEMORY_CACHE(obj) \ |
| 34 |
(G_TYPE_CHECK_INSTANCE_CAST ((obj), CHAMPLAIN_TYPE_MEMORY_CACHE, ChamplainMemoryCache)) |
| 35 |
|
| 36 |
#define CHAMPLAIN_MEMORY_CACHE_CLASS(klass) \ |
| 37 |
(G_TYPE_CHECK_CLASS_CAST ((klass), CHAMPLAIN_TYPE_MEMORY_CACHE, ChamplainMemoryCacheClass)) |
| 38 |
|
| 39 |
#define CHAMPLAIN_IS_MEMORY_CACHE(obj) \ |
| 40 |
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHAMPLAIN_TYPE_MEMORY_CACHE)) |
| 41 |
|
| 42 |
#define CHAMPLAIN_IS_MEMORY_CACHE_CLASS(klass) \ |
| 43 |
(G_TYPE_CHECK_CLASS_TYPE ((klass), CHAMPLAIN_TYPE_MEMORY_CACHE)) |
| 44 |
|
| 45 |
#define CHAMPLAIN_MEMORY_CACHE_GET_CLASS(obj) \ |
| 46 |
(G_TYPE_INSTANCE_GET_CLASS ((obj), CHAMPLAIN_TYPE_MEMORY_CACHE, ChamplainMemoryCacheClass)) |
| 47 |
|
| 48 |
typedef struct _ChamplainMemoryCachePrivate ChamplainMemoryCachePrivate; |
| 49 |
|
| 50 |
typedef struct _ChamplainMemoryCache ChamplainMemoryCache; |
| 51 |
typedef struct _ChamplainMemoryCacheClass ChamplainMemoryCacheClass; |
| 52 |
|
| 53 |
/** |
| 54 |
* ChamplainMemoryCache: |
| 55 |
* |
| 56 |
* The #ChamplainMemoryCache structure contains only private data |
| 57 |
* and should be accessed using the provided API |
| 58 |
* |
| 59 |
* Since: 0.8 |
| 60 |
*/ |
| 61 |
struct _ChamplainMemoryCache |
| 62 |
{ |
| 63 |
ChamplainTileCache parent_instance; |
| 64 |
|
| 65 |
ChamplainMemoryCachePrivate *priv; |
| 66 |
}; |
| 67 |
|
| 68 |
struct _ChamplainMemoryCacheClass |
| 69 |
{ |
| 70 |
ChamplainTileCacheClass parent_class; |
| 71 |
}; |
| 72 |
|
| 73 |
GType champlain_memory_cache_get_type (void); |
| 74 |
|
| 75 |
ChamplainMemoryCache *champlain_memory_cache_new_full (guint size_limit, |
| 76 |
ChamplainRenderer *renderer); |
| 77 |
|
| 78 |
guint champlain_memory_cache_get_size_limit (ChamplainMemoryCache *memory_cache); |
| 79 |
void champlain_memory_cache_set_size_limit (ChamplainMemoryCache *memory_cache, |
| 80 |
guint size_limit); |
| 81 |
|
| 82 |
void champlain_memory_cache_clean (ChamplainMemoryCache *memory_cache); |
| 83 |
|
| 84 |
G_END_DECLS |
| 85 |
|
| 86 |
#endif /* _CHAMPLAIN_MEMORY_CACHE_H_ */ |