source: branches/client-library-split/memphis-renderer.h @ 97

Last change on this file since 97 was 97, checked in by simon, 5 years ago

use finalizers everywhere, some code cleanup

File size: 3.7 KB
Line 
1/*
2 * Memphis - Cairo Rederer for OSM in C
3 * Copyright (C) 2009  Simon Wenner <simon@wenner.ch>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 */
19
20#ifndef __MEMPHIS_RENDERER_H__
21#define __MEMPHIS_RENDERER_H__
22
23#include <glib-object.h>
24#include <cairo.h>
25#include <stdio.h>
26#include "memphis.h"
27
28/*
29 * Type macros.
30 */
31#define MEMPHIS_TYPE_RENDERER                  (memphis_renderer_get_type ())
32#define MEMPHIS_RENDERER(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), MEMPHIS_TYPE_RENDERER, MemphisRenderer))
33#define MEMPHIS_IS_RENDERER(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MEMPHIS_TYPE_RENDERER))
34#define MEMPHIS_RENDERER_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), MEMPHIS_TYPE_RENDERER, MemphisRendererClass))
35#define MEMPHIS_IS_RENDERER_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), MEMPHIS_TYPE_RENDERER))
36#define MEMPHIS_RENDERER_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), MEMPHIS_TYPE_RENDERER, MemphisRendererClass))
37
38typedef struct _MemphisRenderer        MemphisRenderer;
39typedef struct _MemphisRendererClass   MemphisRendererClass;
40typedef struct _MemphisRendererPrivate MemphisRendererPrivate;
41
42struct _MemphisRenderer
43{
44  GObject parent_instance;
45};
46
47struct _MemphisRendererClass
48{
49  GObjectClass parent_class;
50};
51
52GType memphis_renderer_get_type (void);
53
54/*
55 * Method definitions.
56 */
57MemphisRenderer* memphis_renderer_new ();
58MemphisRenderer* memphis_renderer_new_full (MemphisRuleSet *rules,
59    MemphisMap *map);
60void memphis_renderer_free (MemphisRenderer *renderer);
61
62void memphis_renderer_set_resolution (MemphisRenderer *renderer,
63    guint resolution);
64void memphis_renderer_set_zoom_level (MemphisRenderer *renderer,
65    guint zoom_level);
66void memphis_renderer_set_debug_level (MemphisRenderer *renderer,
67    gint8 debug_level);
68void memphis_renderer_set_map (MemphisRenderer *renderer,
69    MemphisMap* map);
70void memphis_renderer_set_rules_set (MemphisRenderer *renderer,
71    MemphisRuleSet* rules);
72
73guint memphis_renderer_get_resolution (MemphisRenderer *renderer);
74guint memphis_renderer_get_zoom_level (MemphisRenderer *renderer);
75gint8 memphis_renderer_get_debug_level (MemphisRenderer *renderer);
76MemphisMap* memphis_renderer_get_map (MemphisRenderer *renderer);
77MemphisRuleSet* memphis_renderer_get_rule_set (MemphisRenderer *renderer);
78
79void memphis_renderer_draw_png (MemphisRenderer *renderer,
80    gchar *filename);
81
82void memphis_renderer_draw_tile (MemphisRenderer *renderer,
83    cairo_t *cr,
84    guint x,
85    guint y);
86
87gint memphis_renderer_get_row_count (MemphisRenderer *renderer);
88gint memphis_renderer_get_column_count (MemphisRenderer *renderer);
89gint memphis_renderer_get_min_x_tile (MemphisRenderer *renderer);
90gint memphis_renderer_get_max_x_tile (MemphisRenderer *renderer);
91gint memphis_renderer_get_min_y_tile (MemphisRenderer *renderer);
92gint memphis_renderer_get_max_y_tile (MemphisRenderer *renderer);
93gboolean memphis_renderer_tile_has_data (MemphisRenderer *renderer,
94    gint x, gint y);
95
96#endif /* __MEMPHIS_RENDERER_H__ */
Note: See TracBrowser for help on using the repository browser.