/* Filename buffer */
#define BUFFER_SIZE (2048)
+/* Property IDs */
+enum {
+ PROP_NAME=1,
+ PROP_URL,
+ PROP_CACHE_DIR,
+};
+
#if 0
#define GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TILE_REPO_TYPE, TileRepoPrivate))
#endif
TileRepo *tr=TILE_REPO(object);
}
+static void
+tile_repo_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+{
+TileRepo *tr=TILE_REPO(object);
+
+switch (prop_id) {
+ case PROP_NAME:
+ case PROP_URL:
+ case PROP_CACHE_DIR:
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+}
+}
+
+static void
+tile_repo_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+TileRepo *tr=TILE_REPO(object);
+
+switch (prop_id) {
+ case PROP_NAME:
+ case PROP_URL:
+ case PROP_CACHE_DIR:
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+}
+}
+
static void
tile_repo_class_init(TileRepoClass *klass)
{
object_class->dispose=tile_repo_dispose;
object_class->finalize=tile_repo_finalize;
+object_class->set_property=tile_repo_set_property;
+object_class->get_property=tile_repo_get_property;
}
/**
tr->max_zoom=17;
tr->view_zoom_steps=1;
tr->icache=image_cache_new(64);
+tr->type=REPOTYPE_NONE;
}
/**
/* Parse name. */
token=strsep(&str, "\n\t");
if (token)
- tr->name = g_strdup(token);
+ tr->name=g_strdup(token);
/* Parse URL format. */
token=strsep(&str, "\n\t");
if (token)
- tr->url = g_strdup(token);
+ tr->url=g_strdup(token);
/* Parse cache dir. */
token=strsep(&str, "\n\t");
if (token)
- tr->cache_dir=gnome_vfs_expand_initial_tilde(token);
+ tr->cache_dir=token;
/* Parse download zoom steps. */
token=strsep(&str, "\n\t");
return tr;
}
+/**
+ * tile_repo_get_string:
+ *
+ * Returns a string representation of the tile repository. Caller must free the returned string.
+ *
+ */
+gchar *
+tile_repo_get_string(TileRepo *tr)
+{
+return g_strdup_printf("%s\t%s\t%s\t%d\t%d\t%d\t%d",
+ tr->name, tr->url, tr->cache_dir,
+ tr->dl_zoom_steps, tr->view_zoom_steps,
+ tr->double_size, tr->nextable);
+}
+
/**
* tile_repo_free:
* @tr