[libchamplainmm] Wrap ChamplainKineticScrollView



commit a3e80fd932f361e20270495273d2c3b54786ed94
Author: Juan R. García Blanco <juanrgar gmail com>
Date:   Sun Aug 3 17:47:55 2014 +0200

    Wrap ChamplainKineticScrollView
    
        * champlain/champlainmm.h: Add kinetic-scroll-view.h.
        * champlain/champlainmm/.gitignore: Ignore
        kinetic-scroll-view.*.
        * champlain/src/champlain_signals.defs: Add "panning-completed"
        signal; add "mode", "decel-rate", and "motion-buffer"
        properties.
        * champlain/src/filelist.am: Add kinetic-scroll-view.hg.
        * champlain/src/kinetic-scroll-view.[hg|ccg]: New files.
        * tools/extradefs/generate_extra_defs_libchamplain.cc: Add
        CHAMPLAIN_TYPE_KINETIC_SCROLL_VIEW, and include specific header.
        * tools/m4/convert_libchamplain.m4: Add conversion from 'const
        Glib::RefPtr<Viewport>&' to 'ChamplainViewport*'.

 champlain/champlainmm.h                            |    1 +
 champlain/champlainmm/.gitignore                   |    1 +
 champlain/src/champlain_signals.defs               |   35 ++++++++++++++
 champlain/src/filelist.am                          |    1 +
 champlain/src/kinetic-scroll-view.ccg              |   24 +++++++++
 champlain/src/kinetic-scroll-view.hg               |   50 ++++++++++++++++++++
 .../extradefs/generate_extra_defs_libchamplain.cc  |    2 +
 tools/m4/convert_libchamplain.m4                   |    3 +
 8 files changed, 117 insertions(+), 0 deletions(-)
---
diff --git a/champlain/champlainmm.h b/champlain/champlainmm.h
index fdd522f..cbbc5cc 100644
--- a/champlain/champlainmm.h
+++ b/champlain/champlainmm.h
@@ -31,6 +31,7 @@
 #include <champlainmm/file-cache.h>
 #include <champlainmm/file-tile-source.h>
 #include <champlainmm/image-renderer.h>
+#include <champlainmm/kinetic-scroll-view.h>
 #include <champlainmm/label.h>
 #include <champlainmm/layer.h>
 #include <champlainmm/license.h>
diff --git a/champlain/champlainmm/.gitignore b/champlain/champlainmm/.gitignore
index 08dac94..5c1707c 100644
--- a/champlain/champlainmm/.gitignore
+++ b/champlain/champlainmm/.gitignore
@@ -6,6 +6,7 @@ error-tile-renderer.*
 file-cache.*
 file-tile-source.*
 image-renderer.*
+kinetic-scroll-view.*
 label.*
 layer.*
 license.*
diff --git a/champlain/src/champlain_signals.defs b/champlain/src/champlain_signals.defs
index 2f93091..5c766c4 100644
--- a/champlain/src/champlain_signals.defs
+++ b/champlain/src/champlain_signals.defs
@@ -81,6 +81,41 @@
 
 ;; From ChamplainImageRenderer
 
+;; From ChamplainKineticScrollView
+
+(define-signal panning-completed
+  (of-object "ChamplainKineticScrollView")
+  (return-type "void")
+  (when "last")
+)
+
+(define-property mode
+  (of-object "ChamplainKineticScrollView")
+  (prop-type "GParamBoolean")
+  (docs "Scrolling mode")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property decel-rate
+  (of-object "ChamplainKineticScrollView")
+  (prop-type "GParamDouble")
+  (docs "Rate at which the view will decelerate in kinetic mode.")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property motion-buffer
+  (of-object "ChamplainKineticScrollView")
+  (prop-type "GParamUInt")
+  (docs "Amount of motion events to buffer")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
 ;; From ChamplainLabel
 
 (define-property image
diff --git a/champlain/src/filelist.am b/champlain/src/filelist.am
index 8f8d956..982c037 100644
--- a/champlain/src/filelist.am
+++ b/champlain/src/filelist.am
@@ -19,6 +19,7 @@ files_hg  =                                   \
        file-cache.hg                           \
        file-tile-source.hg                             \
        image-renderer.hg                               \
+       kinetic-scroll-view.hg                          \
        layer.hg                                \
        license.hg                              \
        location.hg                             \
diff --git a/champlain/src/kinetic-scroll-view.ccg b/champlain/src/kinetic-scroll-view.ccg
new file mode 100644
index 0000000..09566de
--- /dev/null
+++ b/champlain/src/kinetic-scroll-view.ccg
@@ -0,0 +1,24 @@
+/* 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>
+#include <champlain/champlain-kinetic-scroll-view.h>
+
+namespace Champlain
+{
+} // namespace Champlain
diff --git a/champlain/src/kinetic-scroll-view.hg b/champlain/src/kinetic-scroll-view.hg
new file mode 100644
index 0000000..2d9bfd2
--- /dev/null
+++ b/champlain/src/kinetic-scroll-view.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/viewport.h>
+#include <cluttermm/actor.h>
+
+_DEFS(champlainmm,champlain)
+_PINCLUDE(cluttermm/private/actor_p.h)
+
+namespace Champlain
+{
+
+/**
+ */
+class KineticScrollView : public Clutter::Actor
+{
+  _CLASS_GOBJECT(KineticScrollView, ChamplainKineticScrollView, CHAMPLAIN_KINETIC_SCROLL_VIEW, 
Clutter::Actor, ClutterActor)
+
+protected:
+  _WRAP_CTOR(KineticScrollView(const Glib::RefPtr<Viewport>& viewport{viewport}, bool kinetic{kinetic} = 
true), champlain_kinetic_scroll_view_new)
+
+public:
+//  _WRAP_CREATE(const Glib::RefPtr<Viewport>& viewport{viewport}, bool kinetic{kinetic} = true)
+  _WRAP_CREATE(const Glib::RefPtr<Viewport>& viewport, bool kinetic = true)
+
+  _WRAP_METHOD(void stop(), champlain_kinetic_scroll_view_stop)
+
+  _WRAP_PROPERTY("mode", bool)
+  _WRAP_PROPERTY("decel-rate", double)
+  _WRAP_PROPERTY("motion-buffer", guint)
+
+  _WRAP_SIGNAL(void panning_completed(), "panning-completed", no_default_handler)
+};
+
+} // namespace Champlain
diff --git a/tools/extradefs/generate_extra_defs_libchamplain.cc 
b/tools/extradefs/generate_extra_defs_libchamplain.cc
index 46dadb7..3b3d937 100644
--- a/tools/extradefs/generate_extra_defs_libchamplain.cc
+++ b/tools/extradefs/generate_extra_defs_libchamplain.cc
@@ -22,6 +22,7 @@
 #include <champlain/champlain.h>
 #include <champlain/champlain-adjustment.h>
 #include <champlain/champlain-viewport.h>
+#include <champlain/champlain-kinetic-scroll-view.h>
 
 int
 main(int argc, char *argv[])
@@ -35,6 +36,7 @@ main(int argc, char *argv[])
             << get_defs(CHAMPLAIN_TYPE_FILE_CACHE)
             << get_defs(CHAMPLAIN_TYPE_FILE_TILE_SOURCE)
             << get_defs(CHAMPLAIN_TYPE_IMAGE_RENDERER)
+            << get_defs(CHAMPLAIN_TYPE_KINETIC_SCROLL_VIEW)
             << get_defs(CHAMPLAIN_TYPE_LABEL)
             << get_defs(CHAMPLAIN_TYPE_LAYER)
             << get_defs(CHAMPLAIN_TYPE_LICENSE)
diff --git a/tools/m4/convert_libchamplain.m4 b/tools/m4/convert_libchamplain.m4
index bfdc70c..717dc09 100644
--- a/tools/m4/convert_libchamplain.m4
+++ b/tools/m4/convert_libchamplain.m4
@@ -78,3 +78,6 @@ _CONVERSION(`ChamplainTileCache*',`Glib::RefPtr<TileCache>',`Glib::wrap($3)')
 # View
 _CONVERSION(`const Glib::RefPtr<View>&',`ChamplainView*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`ChamplainView*',`const Glib::RefPtr<View>&',`Glib::wrap($3)')
+
+# Viewport
+_CONVERSION(`const Glib::RefPtr<Viewport>&',`ChamplainViewport*',__CONVERT_REFPTR_TO_P)


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