[libchamplainmm] Wrap ChamplainAdjustment



commit 05871520fe8691d062149f12807f4757743c5bb7
Author: Juan R. García Blanco <juanrgar gmail com>
Date:   Sun Aug 3 16:43:55 2014 +0200

    Wrap ChamplainAdjustment
    
        * champlain/champlainmm.h: Add adjustment.h.
        * champlain/champlainmm/.gitignore: Ignore adjustment.*.
        * champlain/src/champlain_signals.defs: Add "changed" signal;
        add "lower", "upper", "value", and "step-increment"
        properties.
        * champlain/src/filelist.am: Add adjustment.hg.
        * champlain/src/adjustment.[hg|ccg]: New files.
        * tools/extradefs/generate_extra_defs_libchamplain.cc: Add
        CHAMPLAIN_TYPE_ADJUSTMENT and specific header.

 champlain/champlainmm.h                            |    1 +
 champlain/champlainmm/.gitignore                   |    1 +
 champlain/src/adjustment.ccg                       |   24 ++++++++
 champlain/src/adjustment.hg                        |   58 ++++++++++++++++++++
 champlain/src/champlain_signals.defs               |   44 +++++++++++++++
 champlain/src/filelist.am                          |    1 +
 .../extradefs/generate_extra_defs_libchamplain.cc  |    4 +-
 7 files changed, 132 insertions(+), 1 deletions(-)
---
diff --git a/champlain/champlainmm.h b/champlain/champlainmm.h
index abecacc..e139d93 100644
--- a/champlain/champlainmm.h
+++ b/champlain/champlainmm.h
@@ -22,6 +22,7 @@
 #include <champlainmmconfig.h>
 
 #include <champlainmm/init.h>
+#include <champlainmm/adjustment.h>
 #include <champlainmm/bounding-box.h>
 #include <champlainmm/coordinate.h>
 #include <champlainmm/debug.h>
diff --git a/champlain/champlainmm/.gitignore b/champlain/champlainmm/.gitignore
index 7e0002f..5d7768b 100644
--- a/champlain/champlainmm/.gitignore
+++ b/champlain/champlainmm/.gitignore
@@ -1,3 +1,4 @@
+adjustment.*
 bounding-box.*
 coordinate.*
 defines.*
diff --git a/champlain/src/adjustment.ccg b/champlain/src/adjustment.ccg
new file mode 100644
index 0000000..ef9b01c
--- /dev/null
+++ b/champlain/src/adjustment.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-adjustment.h>
+
+namespace Champlain
+{
+} // namespace Champlain
diff --git a/champlain/src/adjustment.hg b/champlain/src/adjustment.hg
new file mode 100644
index 0000000..bb7514e
--- /dev/null
+++ b/champlain/src/adjustment.hg
@@ -0,0 +1,58 @@
+/* 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 <glibmm/object.h>
+
+_DEFS(champlainmm,champlain)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Champlain
+{
+
+/** 
+ */
+class Adjustment : public Glib::Object
+{
+  _CLASS_GOBJECT(Adjustment, ChamplainAdjustment, CHAMPLAIN_ADJUSTMENT, Glib::Object, GObject)
+
+protected:
+  _WRAP_CTOR(Adjustment(double value, double lower, double upper, double step_increment), 
champlain_adjustment_new)
+
+public:
+  _WRAP_CREATE(double value, double lower, double upper, double step_increment)
+
+  _WRAP_METHOD(double get_value() const, champlain_adjustment_get_value)
+  _WRAP_METHOD(void set_value(double value), champlain_adjustment_set_value)
+
+  _WRAP_METHOD(void set_values(double value, double lower, double upper, double step_increment), 
champlain_adjustment_set_values)
+  _WRAP_METHOD(void get_values(double& value, double& lower, double& upper, double& step_increment), 
champlain_adjustment_get_values)
+
+  _WRAP_METHOD(void interpolate(double value, guint n_frames, guint fps), champlain_adjustment_interpolate)
+  _WRAP_METHOD(void interpolate_stop(), champlain_adjustment_interpolate_stop)
+
+  _WRAP_METHOD(bool clamp(bool interpolate, guint n_frames, guint fps), champlain_adjustment_clamp)
+
+  _WRAP_PROPERTY("lower", double)
+  _WRAP_PROPERTY("upper", double)
+  _WRAP_PROPERTY("value", double)
+  _WRAP_PROPERTY("step-increment", double)
+
+  _WRAP_SIGNAL(void changed(), "changed")
+};
+
+} // namespace Champlain
diff --git a/champlain/src/champlain_signals.defs b/champlain/src/champlain_signals.defs
index 5105fae..420bb50 100644
--- a/champlain/src/champlain_signals.defs
+++ b/champlain/src/champlain_signals.defs
@@ -1,3 +1,47 @@
+;; From ChamplainAdjustment
+
+(define-signal changed
+  (of-object "ChamplainAdjustment")
+  (return-type "void")
+  (when "last")
+)
+
+(define-property lower
+  (of-object "ChamplainAdjustment")
+  (prop-type "GParamDouble")
+  (docs "Lower bound")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property upper
+  (of-object "ChamplainAdjustment")
+  (prop-type "GParamDouble")
+  (docs "Upper bound")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property value
+  (of-object "ChamplainAdjustment")
+  (prop-type "GParamDouble")
+  (docs "Current value")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property step-increment
+  (of-object "ChamplainAdjustment")
+  (prop-type "GParamDouble")
+  (docs "Step increment")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
 ;; ChamplainBoundingBox is neither a GObject nor a GInterface. Not checked for signals and properties.
 
 ;; From ChamplainCoordinate
diff --git a/champlain/src/filelist.am b/champlain/src/filelist.am
index 9b8ae84..fdc6cd2 100644
--- a/champlain/src/filelist.am
+++ b/champlain/src/filelist.am
@@ -10,6 +10,7 @@ files_defs =                                  \
        champlain_docs_override.xml
 
 files_hg  =                                    \
+       adjustment.hg                           \
        bounding-box.hg                         \
        coordinate.hg                           \
        marker.hg                               \
diff --git a/tools/extradefs/generate_extra_defs_libchamplain.cc 
b/tools/extradefs/generate_extra_defs_libchamplain.cc
index b88a063..2e6581a 100644
--- a/tools/extradefs/generate_extra_defs_libchamplain.cc
+++ b/tools/extradefs/generate_extra_defs_libchamplain.cc
@@ -20,13 +20,15 @@
 
 #include <glibmm_generate_extra_defs/generate_extra_defs.h>
 #include <champlain/champlain.h>
+#include <champlain/champlain-adjustment.h>
 
 int
 main(int argc, char *argv[])
 {
   clutter_init(&argc, &argv);
 
-  std::cout << get_defs(CHAMPLAIN_TYPE_BOUNDING_BOX)
+  std::cout << get_defs(CHAMPLAIN_TYPE_ADJUSTMENT)
+            << get_defs(CHAMPLAIN_TYPE_BOUNDING_BOX)
             << get_defs(CHAMPLAIN_TYPE_COORDINATE)
             << get_defs(CHAMPLAIN_TYPE_ERROR_TILE_RENDERER)
             << get_defs(CHAMPLAIN_TYPE_FILE_CACHE)


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