[libchamplainmm] Wrap ChamplainFileTileSource



commit 4bd26fc1db40bd68a1e5d4f8db197b8eda013338
Author: Juan R. García Blanco <juanrgar gmail com>
Date:   Fri Aug 1 22:44:27 2014 +0200

    Wrap ChamplainFileTileSource
    
        * champlain/champlainmm.h: Add file-tile-source.h.
        * champlain/champlainmm/.gitignore: Ignore file-tile-source.*.
        * champlain/src/filelist.am: Add file-tile-source.hg.
        * champlain/src/file-tile-source.[ccg|hg]: New files.
        * tools/extradefs/generate_extra_defs_libchamplain.cc: Add
        CHAMPLAIN_TYPE_FILE_TILE_SOURCE.

 champlain/champlainmm.h                            |    1 +
 champlain/champlainmm/.gitignore                   |    1 +
 champlain/src/champlain_signals.defs               |    2 +
 champlain/src/file-tile-source.ccg                 |   23 +++++++
 champlain/src/file-tile-source.hg                  |   66 ++++++++++++++++++++
 champlain/src/filelist.am                          |    1 +
 .../extradefs/generate_extra_defs_libchamplain.cc  |    1 +
 7 files changed, 95 insertions(+), 0 deletions(-)
---
diff --git a/champlain/champlainmm.h b/champlain/champlainmm.h
index e7430b0..8ab52b2 100644
--- a/champlain/champlainmm.h
+++ b/champlain/champlainmm.h
@@ -28,6 +28,7 @@
 #include <champlainmm/debug.h>
 #include <champlainmm/defines.h>
 #include <champlainmm/file-cache.h>
+#include <champlainmm/file-tile-source.h>
 #include <champlainmm/layer.h>
 #include <champlainmm/license.h>
 #include <champlainmm/map-source-desc.h>
diff --git a/champlain/champlainmm/.gitignore b/champlain/champlainmm/.gitignore
index d227eef..0b761d8 100644
--- a/champlain/champlainmm/.gitignore
+++ b/champlain/champlainmm/.gitignore
@@ -2,6 +2,7 @@ bounding-box.*
 coordinate.*
 defines.*
 file-cache.*
+file-tile-source.*
 label.*
 layer.*
 license.*
diff --git a/champlain/src/champlain_signals.defs b/champlain/src/champlain_signals.defs
index 159883d..a8e2fba 100644
--- a/champlain/src/champlain_signals.defs
+++ b/champlain/src/champlain_signals.defs
@@ -22,6 +22,8 @@
   (construct-only #t)
 )
 
+;; From ChamplainFileTileSource
+
 ;; From ChamplainLabel
 
 (define-property image
diff --git a/champlain/src/file-tile-source.ccg b/champlain/src/file-tile-source.ccg
new file mode 100644
index 0000000..98e7f82
--- /dev/null
+++ b/champlain/src/file-tile-source.ccg
@@ -0,0 +1,23 @@
+/* Copyright (c) 2014  Juan R. García Blanco <juanrgar gmail com>
+ *
+ * This file is part of libchamplainmm.
+ *
+ * libchamplainmm is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 2.1 of the License,
+ * or (at your option) any later version.
+ *
+ * libchamplainmm 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <champlain/champlain.h>
+
+namespace Champlain
+{
+} // namespace Champlain
diff --git a/champlain/src/file-tile-source.hg b/champlain/src/file-tile-source.hg
new file mode 100644
index 0000000..062dbf7
--- /dev/null
+++ b/champlain/src/file-tile-source.hg
@@ -0,0 +1,66 @@
+/* Copyright (c) 2014  Juan R. García Blanco <juanrgar gmail com>
+ *
+ * This file is part of libchamplainmm.
+ *
+ * libchamplainmm is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 2.1 of the License,
+ * or (at your option) any later version.
+ *
+ * libchamplainmm 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <champlainmm/map-source.h>
+#include <champlainmm/renderer.h>
+#include <champlainmm/tile-source.h>
+
+_DEFS(champlainmm,champlain)
+_PINCLUDE(champlainmm/private/tile-source_p.h)
+
+namespace Champlain
+{
+
+/** A map source that loads tile data from a file.
+ *
+ * This tile source loads local <ulink role="online-location"
+ * url="http://wiki.openstreetmap.org/wiki/.osm";>
+ * OpenStreetMap XML data files</ulink> (*.osm).
+ *
+ * @newin{0,8}
+ */
+class FileTileSource : public TileSource
+{
+  _CLASS_GOBJECT(FileTileSource, ChamplainFileTileSource, CHAMPLAIN_FILE_TILE_SOURCE, TileSource, 
ChamplainTileSource)
+
+protected:
+  _WRAP_CTOR(FileTileSource(const std::string& id,
+                            const Glib::ustring& name,
+                            const Glib::ustring& license,
+                            const Glib::ustring& license_uri,
+                            guint min_zoom,
+                            guint max_zoom,
+                            guint tile_size,
+                            MapProjection projection,
+                            const Glib::RefPtr<Renderer>& renderer), champlain_file_tile_source_new_full)
+
+public:
+  _WRAP_CREATE(const std::string& id,
+               const Glib::ustring& name,
+               const Glib::ustring& license,
+               const Glib::ustring& license_uri,
+               guint min_zoom,
+               guint max_zoom,
+               guint tile_size,
+               MapProjection projection,
+               const Glib::RefPtr<Renderer>& renderer)
+
+  _WRAP_METHOD(void load_map_data(const std::string& map_path), champlain_file_tile_source_load_map_data)
+};
+
+} // namespace Champlain
diff --git a/champlain/src/filelist.am b/champlain/src/filelist.am
index d2f21cf..bd99432 100644
--- a/champlain/src/filelist.am
+++ b/champlain/src/filelist.am
@@ -15,6 +15,7 @@ files_hg  =                                   \
        marker.hg                               \
        defines.hg                              \
        file-cache.hg                           \
+       file-tile-source.hg                             \
        layer.hg                                \
        license.hg                              \
        location.hg                             \
diff --git a/tools/extradefs/generate_extra_defs_libchamplain.cc 
b/tools/extradefs/generate_extra_defs_libchamplain.cc
index 86bb17f..22c2a0f 100644
--- a/tools/extradefs/generate_extra_defs_libchamplain.cc
+++ b/tools/extradefs/generate_extra_defs_libchamplain.cc
@@ -29,6 +29,7 @@ main(int argc, char *argv[])
   std::cout << get_defs(CHAMPLAIN_TYPE_BOUNDING_BOX)
             << get_defs(CHAMPLAIN_TYPE_COORDINATE)
             << get_defs(CHAMPLAIN_TYPE_FILE_CACHE)
+            << get_defs(CHAMPLAIN_TYPE_FILE_TILE_SOURCE)
             << get_defs(CHAMPLAIN_TYPE_LABEL)
             << get_defs(CHAMPLAIN_TYPE_LAYER)
             << get_defs(CHAMPLAIN_TYPE_LICENSE)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]