[gnome-builder/wip/loganek/libidemm] libidemm: add bacforwardlist wrapper



commit ded1006fb9e939ed10e89a22963c8265fba4474f
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Sun Apr 10 22:18:56 2016 +0200

    libidemm: add bacforwardlist wrapper

 libidemm/.gitignore                                |    3 +
 libidemm/src/backforwardlist.ccg                   |   17 +++++++
 libidemm/src/backforwardlist.hg                    |   47 ++++++++++++++++++++
 libidemm/src/filelist.am                           |    1 +
 libidemm/src/libide_signals.defs                   |   38 ++++++++++++++++
 .../tools/extra_defs_gen/generate_defs_libide.cc   |    3 +-
 libidemm/tools/m4/convert_libide.m4                |    4 ++
 7 files changed, 112 insertions(+), 1 deletions(-)
---
diff --git a/libidemm/.gitignore b/libidemm/.gitignore
index 6b6ae5c..24f97c3 100644
--- a/libidemm/.gitignore
+++ b/libidemm/.gitignore
@@ -34,10 +34,13 @@ stamp-h2
 /idemm/Makefile
 /idemm/Makefile.in
 /idemm/private/
+
 /idemm/application.cc
 /idemm/application.h
 /idemm/applicationaddin.cc
 /idemm/applicationaddin.h
+/idemm/backforwardlist.cc
+/idemm/backforwardlist.h
 /idemm/object.cc
 /idemm/object.h
 /idemm/recentprojects.cc
diff --git a/libidemm/src/backforwardlist.ccg b/libidemm/src/backforwardlist.ccg
new file mode 100644
index 0000000..bc65ba7
--- /dev/null
+++ b/libidemm/src/backforwardlist.ccg
@@ -0,0 +1,17 @@
+/* backforwardlist.ccg
+ *
+ * Copyright (C) 2016 Marcin Kolny <marcin kolny gmail com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
diff --git a/libidemm/src/backforwardlist.hg b/libidemm/src/backforwardlist.hg
new file mode 100644
index 0000000..640e734
--- /dev/null
+++ b/libidemm/src/backforwardlist.hg
@@ -0,0 +1,47 @@
+/* backforwardlist.hg
+ *
+ * Copyright (C) 2016 Marcin Kolny <marcin kolny gmail com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <idemm/object.h>
+
+#include <ide.h>
+
+_DEFS(idemm, libide)
+_PINCLUDE(idemm/private/object_p.h)
+
+namespace Ide {
+
+class BackForwardList : public Ide::Object
+{
+protected:
+  _CLASS_GOBJECT(BackForwardList, IdeBackForwardList, IDE_BACK_FORWARD_LIST, Ide::Object, IdeObject)
+  _STRUCT_NOT_HIDDEN
+
+public:
+  _WRAP_METHOD(void go_backward(), ide_back_forward_list_go_backward)
+  _WRAP_METHOD(void go_forward(), ide_back_forward_list_go_forward)
+  _WRAP_METHOD(void get_can_go_backward() const, ide_back_forward_list_get_can_go_backward)
+  _WRAP_METHOD(void get_can_go_forward() const, ide_back_forward_list_get_can_go_forward)
+  _WRAP_METHOD(Glib::RefPtr<Ide::BackForwardList> branch(), ide_back_forward_list_branch)
+  _WRAP_METHOD(void merge(const Glib::RefPtr<Ide::BackForwardList>& branch), ide_back_forward_list_merge)
+
+  _WRAP_PROPERTY("can_go_backward", bool)
+  _WRAP_PROPERTY("can_go_forward", bool)
+  _WRAP_PROPERTY("current_item", Glib::RefPtr<Ide::Object>)
+};
+
+}
diff --git a/libidemm/src/filelist.am b/libidemm/src/filelist.am
index 2d1af9b..9c7ea01 100644
--- a/libidemm/src/filelist.am
+++ b/libidemm/src/filelist.am
@@ -11,6 +11,7 @@ idemm_files_defs =            \
 idemm_files_hg =               \
        application.hg          \
        applicationaddin.hg     \
+       backforwardlist.hg      \
        object.hg               \
        recentprojects.hg
 
diff --git a/libidemm/src/libide_signals.defs b/libidemm/src/libide_signals.defs
index a54dacf..4cff356 100644
--- a/libidemm/src/libide_signals.defs
+++ b/libidemm/src/libide_signals.defs
@@ -16,3 +16,41 @@
   (writable #t)
   (construct-only #t)
 )
+
+;; From IdeBackForwardList
+
+(define-signal navigate-to
+  (of-object "IdeBackForwardList")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("IdeBackForwardItem*" "p0")
+  )
+)
+
+(define-property can-go-backward
+  (of-object "IdeBackForwardList")
+  (prop-type "GParamBoolean")
+  (docs "If there are more backward navigation items.")
+  (readable #t)
+  (writable #f)
+  (construct-only #f)
+)
+
+(define-property can-go-forward
+  (of-object "IdeBackForwardList")
+  (prop-type "GParamBoolean")
+  (docs "If there are more forward navigation items.")
+  (readable #t)
+  (writable #f)
+  (construct-only #f)
+)
+
+(define-property current-item
+  (of-object "IdeBackForwardList")
+  (prop-type "GParamObject")
+  (docs "The current navigation item.")
+  (readable #t)
+  (writable #f)
+  (construct-only #f)
+)
diff --git a/libidemm/tools/extra_defs_gen/generate_defs_libide.cc 
b/libidemm/tools/extra_defs_gen/generate_defs_libide.cc
index f5298d4..4c4f5aa 100644
--- a/libidemm/tools/extra_defs_gen/generate_defs_libide.cc
+++ b/libidemm/tools/extra_defs_gen/generate_defs_libide.cc
@@ -29,7 +29,8 @@ int main (int argc, char *argv[])
 {
 
   std::cout << get_defs(IDE_TYPE_APPLICATION, libide_type_is_a_pointer)
-           << get_defs(IDE_TYPE_OBJECT, libide_type_is_a_pointer);
+           << get_defs(IDE_TYPE_OBJECT, libide_type_is_a_pointer)
+           << get_defs(IDE_TYPE_BACK_FORWARD_LIST, libide_type_is_a_pointer);
   
   return 0;
 }
diff --git a/libidemm/tools/m4/convert_libide.m4 b/libidemm/tools/m4/convert_libide.m4
index abc7ce7..18a09fb 100644
--- a/libidemm/tools/m4/convert_libide.m4
+++ b/libidemm/tools/m4/convert_libide.m4
@@ -45,3 +45,7 @@ _CONVERSION(`IdeApplication*',`const Glib::RefPtr<Ide::Application>&',Glib::wrap
 
 dnl Ide::Object
 _CONVERSION(`IdeObject*',`Glib::RefPtr<Ide::Object>',Glib::wrap($3, true))
+
+dnl Ide::BackForwardList
+_CONVERSION(`IdeBackForwardList*',`Glib::RefPtr<Ide::BackForwardList>',Glib::wrap($3))
+_CONVERSION(`const Glib::RefPtr<Ide::BackForwardList>&',`IdeBackForwardList*',__CONVERT_REFPTR_TO_P)


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