[gnome-builder] libidemm: wrap ApplicationAddin interface



commit 2288423c41790a714d40639c76fbf39a000e9b16
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Wed Apr 6 21:31:46 2016 +0200

    libidemm: wrap ApplicationAddin interface

 libidemm/.gitignore                 |    2 +
 libidemm/idemm.h                    |    1 +
 libidemm/idemm/wrap_init.h          |   29 ++++++++++++++++++++++++
 libidemm/src/applicationaddin.ccg   |   17 ++++++++++++++
 libidemm/src/applicationaddin.hg    |   42 +++++++++++++++++++++++++++++++++++
 libidemm/src/filelist.am            |    2 +
 libidemm/src/libide.defs            |    1 +
 libidemm/src/libide_vfuncs.defs     |   21 +++++++++++++++++
 libidemm/tools/m4/convert_libide.m4 |    5 ++++
 9 files changed, 120 insertions(+), 0 deletions(-)
---
diff --git a/libidemm/.gitignore b/libidemm/.gitignore
index 83ef409..0ad1aad 100644
--- a/libidemm/.gitignore
+++ b/libidemm/.gitignore
@@ -36,6 +36,8 @@ stamp-h2
 /idemm/private/
 /idemm/application.cc
 /idemm/application.h
+/idemm/applicationaddin.cc
+/idemm/applicationaddin.h
 /idemm/recentprojects.cc
 /idemm/recentprojects.h
 /idemm/wrap_init.cc
diff --git a/libidemm/idemm.h b/libidemm/idemm.h
index 8239c67..7c36ee0 100644
--- a/libidemm/idemm.h
+++ b/libidemm/idemm.h
@@ -2,6 +2,7 @@
 #define _IDEMM_H
 
 #include <idemm/application.h>
+#include <idemm/applicationaddin.h>
 #include <idemm/recentprojects.h>
 #include <libidemm/wrap_init.h>
 
diff --git a/libidemm/idemm/wrap_init.h b/libidemm/idemm/wrap_init.h
index e69de29..61c99dc 100644
--- a/libidemm/idemm/wrap_init.h
+++ b/libidemm/idemm/wrap_init.h
@@ -0,0 +1,29 @@
+#ifndef _IDEMM_WRAP_INIT_H
+#define _IDEMM_WRAP_INIT_H
+
+/* wrap_init.h
+ *
+ * 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/>.
+ */
+
+namespace Ide
+{
+
+void wrap_init();
+
+} // namespace Ide
+
+#endif /* _IDEMM_WRAP_INIT_H */
diff --git a/libidemm/src/applicationaddin.ccg b/libidemm/src/applicationaddin.ccg
new file mode 100644
index 0000000..0a044e5
--- /dev/null
+++ b/libidemm/src/applicationaddin.ccg
@@ -0,0 +1,17 @@
+/* applicationaddin.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/applicationaddin.hg b/libidemm/src/applicationaddin.hg
new file mode 100644
index 0000000..5a384ce
--- /dev/null
+++ b/libidemm/src/applicationaddin.hg
@@ -0,0 +1,42 @@
+/* applicationaddin.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/application.h>
+
+#include <glibmm/interface.h>
+
+#include <ide.h>
+
+_DEFS(idemm, libide)
+_PINCLUDE(glibmm/private/interface_p.h)
+
+namespace Ide {
+
+class ApplicationAddin : public Glib::Interface
+{
+  _CLASS_INTERFACE(ApplicationAddin, IdeApplicationAddin, IDE_APPLICATION_ADDIN, 
IdeApplicationAddinInterface)
+
+public:
+  _WRAP_METHOD(void load(const Glib::RefPtr<Ide::Application>& application), ide_application_addin_load)
+  _WRAP_METHOD(void unload(const Glib::RefPtr<Ide::Application>& application), ide_application_addin_load)
+
+  _WRAP_VFUNC(void load(const Glib::RefPtr<Ide::Application>& application), "load")
+  _WRAP_VFUNC(void unload(const Glib::RefPtr<Ide::Application>& application), "unload")
+};
+
+}
diff --git a/libidemm/src/filelist.am b/libidemm/src/filelist.am
index 0ba98d2..4c1f788 100644
--- a/libidemm/src/filelist.am
+++ b/libidemm/src/filelist.am
@@ -5,10 +5,12 @@ idemm_files_defs =            \
        libide_enums.defs       \
        libide_methods.defs     \
        libide_signals.defs     \
+       libide_vfuncs.defs      \
        libide_docs.xml
 
 idemm_files_hg =               \
        application.hg          \
+       applicationaddin.hg     \
        recentprojects.hg
 
 idemm_files_ccg = $(idemm_files_hg:.hg=.ccg)
diff --git a/libidemm/src/libide.defs b/libidemm/src/libide.defs
index 4121a64..e4d2168 100644
--- a/libidemm/src/libide.defs
+++ b/libidemm/src/libide.defs
@@ -1,4 +1,5 @@
 (include libide_methods.defs)
 (include libide_signals.defs)
 (include libide_enums.defs)
+(include libide_vfuncs.defs)
 
diff --git a/libidemm/src/libide_vfuncs.defs b/libidemm/src/libide_vfuncs.defs
new file mode 100644
index 0000000..f89b9e6
--- /dev/null
+++ b/libidemm/src/libide_vfuncs.defs
@@ -0,0 +1,21 @@
+;; -*- scheme -*-
+; virtual function definitions
+; define-vfunc is g*mm-specific
+; These are hand-written.
+
+; IdeApplicationAddin
+(define-vfunc load
+  (of-object "IdeApplicationAddin")
+  (return-type "void")
+  (parameters
+   '("IdeApplication*" "application")
+  )
+)
+
+(define-vfunc unload
+  (of-object "IdeApplicationAddin")
+  (return-type "void")
+  (parameters
+   '("IdeApplication*" "application")
+  )
+)
diff --git a/libidemm/tools/m4/convert_libide.m4 b/libidemm/tools/m4/convert_libide.m4
index 37e348f..6b3273b 100644
--- a/libidemm/tools/m4/convert_libide.m4
+++ b/libidemm/tools/m4/convert_libide.m4
@@ -38,3 +38,8 @@ _CONVERSION(`const Glib::ustring&',`gchararray', $3.c_str())
 
 dnl Ide::RecentProjects
 _CONVERSION(`IdeRecentProjects*',`Glib::RefPtr<Ide::RecentProjects>',`Glib::wrap($3)')
+
+dnl Ide::Application
+_CONVERSION(`const Glib::RefPtr<Ide::Application>&',`IdeApplication*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`IdeApplication*',`const Glib::RefPtr<Ide::Application>&',Glib::wrap($3))
+


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