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 #include "vikmapsourcedefault.h"
22 static guint8 map_source_get_uniq_id (VikMapSource *self);
23 static guint16 map_source_get_tilesize_x (VikMapSource *self);
24 static guint16 map_source_get_tilesize_y (VikMapSource *self);
25 static VikViewportDrawMode map_source_get_drawmode (VikMapSource *self);
27 typedef struct _VikMapSourceDefaultPrivate VikMapSourceDefaultPrivate;
28 struct _VikMapSourceDefaultPrivate
33 VikViewportDrawMode drawmode;
36 #define VIK_MAP_SOURCE_DEFAULT_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIK_TYPE_MAP_SOURCE_DEFAULT, VikMapSourceDefaultPrivate))
39 G_DEFINE_TYPE_EXTENDED (VikMapSourceDefault, vik_map_source_default, VIK_TYPE_MAP_SOURCE, (GTypeFlags)G_TYPE_FLAG_ABSTRACT,);
42 vik_map_source_default_init (VikMapSourceDefault *object)
44 /* TODO: Add initialization code here */
48 vik_map_source_default_finalize (GObject *object)
50 /* TODO: Add deinitalization code here */
52 G_OBJECT_CLASS (vik_map_source_default_parent_class)->finalize (object);
56 vik_map_source_default_class_init (VikMapSourceDefaultClass *klass)
58 GObjectClass* object_class = G_OBJECT_CLASS (klass);
59 VikMapSourceClass* parent_class = VIK_MAP_SOURCE_CLASS (klass);
61 /* Overiding methods */
62 parent_class->get_uniq_id = map_source_get_uniq_id;
63 parent_class->get_tilesize_x = map_source_get_tilesize_x;
64 parent_class->get_tilesize_y = map_source_get_tilesize_y;
65 parent_class->get_drawmode = map_source_get_drawmode;
67 g_type_class_add_private (klass, sizeof (VikMapSourceDefaultPrivate));
69 object_class->finalize = vik_map_source_default_finalize;
73 map_source_get_uniq_id (VikMapSource *self)
75 VikMapSourceDefaultPrivate *priv = VIK_MAP_SOURCE_DEFAULT_PRIVATE(self);
76 g_return_val_if_fail (priv != NULL, (guint8 )0);
82 map_source_get_tilesize_x (VikMapSource *self)
84 VikMapSourceDefaultPrivate *priv = VIK_MAP_SOURCE_DEFAULT_PRIVATE(self);
85 g_return_val_if_fail (self != NULL, (guint16 )0);
87 return priv->tilesize_x;
91 map_source_get_tilesize_y (VikMapSource *self)
93 VikMapSourceDefaultPrivate *priv = VIK_MAP_SOURCE_DEFAULT_PRIVATE(self);
94 g_return_val_if_fail (self != NULL, (guint16 )0);
96 return priv->tilesize_y;
99 static VikViewportDrawMode
100 map_source_get_drawmode (VikMapSource *self)
102 VikMapSourceDefaultPrivate *priv = VIK_MAP_SOURCE_DEFAULT_PRIVATE(self);
103 g_return_val_if_fail (self != NULL, (VikViewportDrawMode )0);
105 return priv->drawmode;