[libchamplainmm] Wrap ChamplainErrorTileRenderer
- From: Juan R. Garcia Blanco <juanrgar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplainmm] Wrap ChamplainErrorTileRenderer
- Date: Sat, 2 Aug 2014 10:21:18 +0000 (UTC)
commit b75bdec6474f93af67003bbc9acc1a737736b047
Author: Juan R. García Blanco <juanrgar gmail com>
Date: Sat Aug 2 12:19:06 2014 +0200
Wrap ChamplainErrorTileRenderer
* champlain/champlainmm.h: Add error-tile-renderer.h.
* champlain/champlainmm/.gitignore: Ignore
error-tile-renderer.*.
* champlain/src/champlain_signals.defs: Add "tile-size"
property.
* champlain/src/filelist.am: Add error-tile-renderer.hg.
* champlain/src/error-tile-renderer.[hg|ccg]: New files.
* tools/extradefs/generate_extra_defs_libchamplain.cc: Add
CHAMPLAIN_TYPE_ERROR_TILE_RENDERER.
champlain/champlainmm.h | 1 +
champlain/champlainmm/.gitignore | 1 +
champlain/src/champlain_signals.defs | 11 ++++
champlain/src/error-tile-renderer.ccg | 23 +++++++++
champlain/src/error-tile-renderer.hg | 50 ++++++++++++++++++++
champlain/src/filelist.am | 1 +
.../extradefs/generate_extra_defs_libchamplain.cc | 1 +
7 files changed, 88 insertions(+), 0 deletions(-)
---
diff --git a/champlain/champlainmm.h b/champlain/champlainmm.h
index 6505cc5..a13aa67 100644
--- a/champlain/champlainmm.h
+++ b/champlain/champlainmm.h
@@ -27,6 +27,7 @@
#include <champlainmm/coordinate.h>
#include <champlainmm/debug.h>
#include <champlainmm/defines.h>
+#include <champlainmm/error-tile-renderer.h>
#include <champlainmm/file-cache.h>
#include <champlainmm/file-tile-source.h>
#include <champlainmm/image-renderer.h>
diff --git a/champlain/champlainmm/.gitignore b/champlain/champlainmm/.gitignore
index 6849607..7e0002f 100644
--- a/champlain/champlainmm/.gitignore
+++ b/champlain/champlainmm/.gitignore
@@ -1,6 +1,7 @@
bounding-box.*
coordinate.*
defines.*
+error-tile-renderer.*
file-cache.*
file-tile-source.*
image-renderer.*
diff --git a/champlain/src/champlain_signals.defs b/champlain/src/champlain_signals.defs
index b939ca7..5105fae 100644
--- a/champlain/src/champlain_signals.defs
+++ b/champlain/src/champlain_signals.defs
@@ -2,6 +2,17 @@
;; From ChamplainCoordinate
+;; From ChamplainErrorTileRenderer
+
+(define-property tile-size
+ (of-object "ChamplainErrorTileRenderer")
+ (prop-type "GParamUInt")
+ (docs "The size of the rendered tile")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
;; From ChamplainFileCache
(define-property size-limit
diff --git a/champlain/src/error-tile-renderer.ccg b/champlain/src/error-tile-renderer.ccg
new file mode 100644
index 0000000..98e7f82
--- /dev/null
+++ b/champlain/src/error-tile-renderer.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/error-tile-renderer.hg b/champlain/src/error-tile-renderer.hg
new file mode 100644
index 0000000..2508f1c
--- /dev/null
+++ b/champlain/src/error-tile-renderer.hg
@@ -0,0 +1,50 @@
+/* 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/renderer.h>
+
+_DEFS(champlainmm,champlain)
+_PINCLUDE(champlainmm/private/renderer_p.h)
+
+namespace Champlain
+{
+
+/** A renderer that renders error tiles independently of input data.
+ *
+ * ErrorTileRenderer always renders error tiles (tiles that indicate that the real tile could
+ * not be loaded) no matter what input data is used.
+ *
+ * @newin{0,8}
+ */
+class ErrorTileRenderer : public Renderer
+{
+ _CLASS_GOBJECT(ErrorTileRenderer, ChamplainErrorTileRenderer, CHAMPLAIN_ERROR_TILE_RENDERER, Renderer,
ChamplainRenderer)
+
+protected:
+ _WRAP_CTOR(ErrorTileRenderer(guint tile_size), champlain_error_tile_renderer_new)
+
+public:
+ _WRAP_CREATE(guint tile_size)
+
+ _WRAP_METHOD(void set_tile_size(guint size), champlain_error_tile_renderer_set_tile_size)
+ _WRAP_METHOD(guint get_tile_size() const, champlain_error_tile_renderer_get_tile_size)
+
+ _WRAP_PROPERTY("tile-size", guint)
+};
+
+} // namespace Champlain
diff --git a/champlain/src/filelist.am b/champlain/src/filelist.am
index 5f1e38a..9b8ae84 100644
--- a/champlain/src/filelist.am
+++ b/champlain/src/filelist.am
@@ -14,6 +14,7 @@ files_hg = \
coordinate.hg \
marker.hg \
defines.hg \
+ error-tile-renderer.hg \
file-cache.hg \
file-tile-source.hg \
image-renderer.hg \
diff --git a/tools/extradefs/generate_extra_defs_libchamplain.cc
b/tools/extradefs/generate_extra_defs_libchamplain.cc
index ab8e9cd..b88a063 100644
--- a/tools/extradefs/generate_extra_defs_libchamplain.cc
+++ b/tools/extradefs/generate_extra_defs_libchamplain.cc
@@ -28,6 +28,7 @@ main(int argc, char *argv[])
std::cout << get_defs(CHAMPLAIN_TYPE_BOUNDING_BOX)
<< get_defs(CHAMPLAIN_TYPE_COORDINATE)
+ << get_defs(CHAMPLAIN_TYPE_ERROR_TILE_RENDERER)
<< get_defs(CHAMPLAIN_TYPE_FILE_CACHE)
<< get_defs(CHAMPLAIN_TYPE_FILE_TILE_SOURCE)
<< get_defs(CHAMPLAIN_TYPE_IMAGE_RENDERER)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]