1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 * Copyright (C) Guilhem Bonnefille 2009 <guilhem.bonnefille@gmail.com>
6 * viking is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * viking is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _VIK_MAP_SOURCE_H_
21 #define _VIK_MAP_SOURCE_H_
23 #include <glib-object.h>
25 #include "vikviewport.h"
31 #define VIK_TYPE_MAP_SOURCE (vik_map_source_get_type ())
32 #define VIK_MAP_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIK_TYPE_MAP_SOURCE, VikMapSource))
33 #define VIK_MAP_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIK_TYPE_MAP_SOURCE, VikMapSourceClass))
34 #define VIK_IS_MAP_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIK_TYPE_MAP_SOURCE))
35 #define VIK_IS_MAP_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIK_TYPE_MAP_SOURCE))
36 #define VIK_MAP_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIK_TYPE_MAP_SOURCE, VikMapSourceClass))
38 typedef struct _VikMapSourceClass VikMapSourceClass
;
39 typedef struct _VikMapSource VikMapSource
;
41 struct _VikMapSourceClass
43 GObjectClass parent_class
;
45 guint8 (* get_uniq_id
) (VikMapSource
* self
);
46 const gchar
* (* get_label
) (VikMapSource
* self
);
47 guint16 (* get_tilesize_x
) (VikMapSource
* self
);
48 guint16 (* get_tilesize_y
) (VikMapSource
* self
);
49 VikViewportDrawMode (* get_drawmode
) (VikMapSource
* self
);
50 gboolean (* supports_if_modified_since
) (VikMapSource
* self
);
51 gboolean (* coord_to_mapcoord
) (VikMapSource
* self
, const VikCoord
* src
, gdouble xzoom
, gdouble yzoom
, MapCoord
* dest
);
52 void (* mapcoord_to_center_coord
) (VikMapSource
* self
, MapCoord
* src
, VikCoord
* dest
);
53 int (* download
) (VikMapSource
* self
, MapCoord
* src
, const gchar
* dest_fn
);
58 GObject parent_instance
;
61 GType
vik_map_source_get_type (void) G_GNUC_CONST
;
63 guint8
vik_map_source_get_uniq_id (VikMapSource
* self
);
64 const gchar
*vik_map_source_get_label (VikMapSource
* self
);
65 guint16
vik_map_source_get_tilesize_x (VikMapSource
* self
);
66 guint16
vik_map_source_get_tilesize_y (VikMapSource
* self
);
67 VikViewportDrawMode
vik_map_source_get_drawmode (VikMapSource
* self
);
68 gboolean
vik_map_source_supports_if_modified_since (VikMapSource
* self
);
69 gboolean
vik_map_source_coord_to_mapcoord (VikMapSource
* self
, const VikCoord
*src
, gdouble xzoom
, gdouble yzoom
, MapCoord
*dest
);
70 void vik_map_source_mapcoord_to_center_coord (VikMapSource
* self
, MapCoord
*src
, VikCoord
*dest
);
71 int vik_map_source_download (VikMapSource
* self
, MapCoord
* src
, const gchar
* dest_fn
);
75 #endif /* _VIK_MAP_SOURCE_H_ */