vikcoord.c vikcoord.h \
mapcache.c mapcache.h \
vikmapsource.c vikmapsource.h \
+ vikmapsourcedefault.c vikmapsourcedefault.h \
vikmapslayer.c vikmapslayer.h \
vikmapslayer_compat.c vikmapslayer_compat.h \
- vik-map-type-default.c vik-map-type-default.h \
- old-vik-map-type.c old-vik-map-type.h \
+ vikmaptype.c vikmaptype.h \
slippy-map-type-abstract.c slippy-map-type-abstract.h \
slippy-map-type.c slippy-map-type.h \
gpx.c gpx.h \
preferences.c preferences.h
BUILT_SOURCES += \
- vik-map-type-default.c vik-map-type-default.h \
slippy-map-type-abstract.c slippy-map-type-abstract.h \
- slippy-map-type.c slippy-map-type.h \
- old-vik-map-type.c old-vik-map-type.h
+ slippy-map-type.c slippy-map-type.h
if GOOGLE
libviking_a_SOURCES += \
#include "vikcoord.h"
#include "mapcoord.h"
-#include "vik-map-type-default.h"
+#include "vikmapsourcedefault.h"
#include "download.h"
%}
%}
-class Slippy:Map:Type:Abstract from Vik:Map:Type:Default {
+class Slippy:Map:Type:Abstract from Vik:Map:Source:Default {
init (self) {
/* initialize the object here */
- VIK_MAP_TYPE_DEFAULT(self)->tilesize_x = 256;
- VIK_MAP_TYPE_DEFAULT(self)->tilesize_y = 256;
- VIK_MAP_TYPE_DEFAULT(self)->drawmode = VIK_VIEWPORT_DRAWMODE_MERCATOR;
+ // FIXME VIK_MAP_SOURCE_DEFAULT(self)->tilesize_x = 256;
+ // FIXME VIK_MAP_SOURCE_DEFAULT(self)->tilesize_y = 256;
+ // FIXME VIK_MAP_SOURCE_DEFAULT(self)->drawmode = VIK_VIEWPORT_DRAWMODE_MERCATOR;
}
virtual gchar *
init (self) {
/* initialize the object here */
- VIK_MAP_TYPE_DEFAULT(self)->tilesize_x = 256;
- VIK_MAP_TYPE_DEFAULT(self)->tilesize_y = 256;
- VIK_MAP_TYPE_DEFAULT(self)->drawmode = VIK_VIEWPORT_DRAWMODE_MERCATOR;
+ // FIXME VIK_MAP_SOURCE_DEFAULT(self)->tilesize_x = 256;
+ // FIXME VIK_MAP_SOURCE_DEFAULT(self)->tilesize_y = 256;
+ // FIXME VIK_MAP_SOURCE_DEFAULT(self)->drawmode = VIK_VIEWPORT_DRAWMODE_MERCATOR;
}
public GObject *
new_with_id (guint8 id, const gchar *hostname, const gchar *url) {
SlippyMapType *ret = GET_NEW;
- VIK_MAP_TYPE_DEFAULT(ret)->uniq_id = id;
+ // FIXME VIK_MAP_SOURCE_DEFAULT(ret)->uniq_id = id;
ret->_priv->hostname = g_strdup(hostname);
ret->_priv->url = g_strdup(url);
return G_OBJECT (ret);
#include "vikcoord.h"
#include "mapcoord.h"
-#include "vik-map-type-default.h"
+#include "vikmapsourcedefault.h"
%}
%{
%}
-class Terraserver:Map:Type from Vik:Map:Type:Default {
+class Terraserver:Map:Type from Vik:Map:Source:Default {
private int type;
init (self) {
/* initialize the object here */
- VIK_MAP_TYPE_DEFAULT(self)->tilesize_x = 200;
- VIK_MAP_TYPE_DEFAULT(self)->tilesize_y = 200;
- VIK_MAP_TYPE_DEFAULT(self)->drawmode = VIK_VIEWPORT_DRAWMODE_UTM;
+ // FIXME VIK_MAP_SOURCE_DEFAULT(self)->tilesize_x = 200;
+ // FIXME VIK_MAP_SOURCE_DEFAULT(self)->tilesize_y = 200;
+ // FIXME VIK_MAP_SOURCE_DEFAULT(self)->drawmode = VIK_VIEWPORT_DRAWMODE_UTM;
}
public GObject *
new_with_id (guint8 id, int type) {
TerraserverMapType *ret = GET_NEW;
- VIK_MAP_TYPE_DEFAULT(ret)->uniq_id = id;
+ // FIXME VIK_MAP_SOURCE_DEFAULT(ret)->uniq_id = id;
ret->_priv->type = type;
return G_OBJECT (ret);
}
+++ /dev/null
-%headertop{
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "vikmapsource.h"
-#include "vikviewport.h"
-#include "vikcoord.h"
-#include "mapcoord.h"
-%}
-
-class Vik:Map:Type:Default from Vik:Map:Source(abstract) {
- public guint8 uniq_id;
- public guint16 tilesize_x;
- public guint16 tilesize_y;
- public VikViewportDrawMode drawmode;
-
- override (Vik:Map:Source) guint8
- get_uniq_id ( Vik:Map:Source *self )
- {
- return SELF(self)->uniq_id;
- }
-
- override (Vik:Map:Source) guint16
- get_tilesize_x ( Vik:Map:Source *self )
- {
- return SELF(self)->tilesize_x;
- }
-
- override (Vik:Map:Source) guint16
- get_tilesize_y ( Vik:Map:Source *self )
- {
- return SELF(self)->tilesize_y;
- }
-
- override (Vik:Map:Source) VikViewportDrawMode
- get_drawmode ( Vik:Map:Source *self )
- {
- return SELF(self)->drawmode;
- }
-
-}
-
--- /dev/null
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * viking
+ * Copyright (C) Guilhem Bonnefille 2009 <guilhem.bonnefille@gmail.com>
+ *
+ * viking 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * viking 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/>.
+ */
+
+#include "vikmapsourcedefault.h"
+
+static guint8 map_source_get_uniq_id (VikMapSource *self);
+static guint16 map_source_get_tilesize_x (VikMapSource *self);
+static guint16 map_source_get_tilesize_y (VikMapSource *self);
+static VikViewportDrawMode map_source_get_drawmode (VikMapSource *self);
+
+typedef struct _VikMapSourceDefaultPrivate VikMapSourceDefaultPrivate;
+struct _VikMapSourceDefaultPrivate
+{
+ guint8 uniq_id;
+ guint16 tilesize_x;
+ guint16 tilesize_y;
+ VikViewportDrawMode drawmode;
+};
+
+#define VIK_MAP_SOURCE_DEFAULT_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VIK_TYPE_MAP_SOURCE_DEFAULT, VikMapSourceDefaultPrivate))
+
+
+G_DEFINE_TYPE_EXTENDED (VikMapSourceDefault, vik_map_source_default, VIK_TYPE_MAP_SOURCE, (GTypeFlags)G_TYPE_FLAG_ABSTRACT,);
+
+static void
+vik_map_source_default_init (VikMapSourceDefault *object)
+{
+ /* TODO: Add initialization code here */
+}
+
+static void
+vik_map_source_default_finalize (GObject *object)
+{
+ /* TODO: Add deinitalization code here */
+
+ G_OBJECT_CLASS (vik_map_source_default_parent_class)->finalize (object);
+}
+
+static void
+vik_map_source_default_class_init (VikMapSourceDefaultClass *klass)
+{
+ GObjectClass* object_class = G_OBJECT_CLASS (klass);
+ VikMapSourceClass* parent_class = VIK_MAP_SOURCE_CLASS (klass);
+
+ /* Overiding methods */
+ parent_class->get_uniq_id = map_source_get_uniq_id;
+ parent_class->get_tilesize_x = map_source_get_tilesize_x;
+ parent_class->get_tilesize_y = map_source_get_tilesize_y;
+ parent_class->get_drawmode = map_source_get_drawmode;
+
+ g_type_class_add_private (klass, sizeof (VikMapSourceDefaultPrivate));
+
+ object_class->finalize = vik_map_source_default_finalize;
+}
+
+static guint8
+map_source_get_uniq_id (VikMapSource *self)
+{
+ VikMapSourceDefaultPrivate *priv = VIK_MAP_SOURCE_DEFAULT_PRIVATE(self);
+ g_return_val_if_fail (priv != NULL, (guint8 )0);
+
+ return priv->uniq_id;
+}
+
+static guint16
+map_source_get_tilesize_x (VikMapSource *self)
+{
+ VikMapSourceDefaultPrivate *priv = VIK_MAP_SOURCE_DEFAULT_PRIVATE(self);
+ g_return_val_if_fail (self != NULL, (guint16 )0);
+
+ return priv->tilesize_x;
+}
+
+static guint16
+map_source_get_tilesize_y (VikMapSource *self)
+{
+ VikMapSourceDefaultPrivate *priv = VIK_MAP_SOURCE_DEFAULT_PRIVATE(self);
+ g_return_val_if_fail (self != NULL, (guint16 )0);
+
+ return priv->tilesize_y;
+}
+
+static VikViewportDrawMode
+map_source_get_drawmode (VikMapSource *self)
+{
+ VikMapSourceDefaultPrivate *priv = VIK_MAP_SOURCE_DEFAULT_PRIVATE(self);
+ g_return_val_if_fail (self != NULL, (VikViewportDrawMode )0);
+
+ return priv->drawmode;
+}
--- /dev/null
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * viking
+ * Copyright (C) Guilhem Bonnefille 2009 <guilhem.bonnefille@gmail.com>
+ *
+ * viking 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * viking 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 _VIK_MAP_SOURCE_DEFAULT_H_
+#define _VIK_MAP_SOURCE_DEFAULT_H_
+
+#include <glib-object.h>
+
+#include "vikmapsource.h"
+
+G_BEGIN_DECLS
+
+#define VIK_TYPE_MAP_SOURCE_DEFAULT (vik_map_source_default_get_type ())
+#define VIK_MAP_SOURCE_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIK_TYPE_MAP_SOURCE_DEFAULT, VikMapSourceDefault))
+#define VIK_MAP_SOURCE_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIK_TYPE_MAP_SOURCE_DEFAULT, VikMapSourceDefaultClass))
+#define VIK_IS_MAP_SOURCE_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIK_TYPE_MAP_SOURCE_DEFAULT))
+#define VIK_IS_MAP_SOURCE_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIK_TYPE_MAP_SOURCE_DEFAULT))
+#define VIK_MAP_SOURCE_DEFAULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIK_TYPE_MAP_SOURCE_DEFAULT, VikMapSourceDefaultClass))
+
+typedef struct _VikMapSourceDefaultClass VikMapSourceDefaultClass;
+typedef struct _VikMapSourceDefault VikMapSourceDefault;
+
+struct _VikMapSourceDefaultClass
+{
+ VikMapSourceClass parent_class;
+};
+
+struct _VikMapSourceDefault
+{
+ VikMapSource parent_instance;
+};
+
+GType vik_map_source_default_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* _VIK_MAP_SOURCE_DEFAULT_H_ */