[glibmm/gmmproc-refactor] Update test C library and C++ wrapper for wrap_init stuff.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/gmmproc-refactor] Update test C library and C++ wrapper for wrap_init stuff.
- Date: Sun, 24 Jun 2012 19:52:22 +0000 (UTC)
commit a54adc9efc21fbe4e4b96d2b561e60c8004de54c
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Mon Jun 25 01:16:19 2012 +0200
Update test C library and C++ wrapper for wrap_init stuff.
.gitignore | 1 +
tools/Makefile.am | 22 +++++++++++++++-----
tools/pm/tests/libgm/gm/gm.h | 29 ++++++++++++++++++++++++++++
tools/pm/tests/libgmmm/gm/gmmm/init.cc | 22 +++++++++++++++++++++
tools/pm/tests/libgmmm/gm/gmmm/init.h | 6 +++++
tools/pm/tests/libgmmm/gm/gmmm/wrap_init.h | 6 +++++
6 files changed, 80 insertions(+), 6 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 6bc70bb..45270d9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -166,3 +166,4 @@ giommconfig.h
/tools/pm/tests/libgmmm/gm/gmmm/other.cc
/tools/pm/tests/libgmmm/proc/.proc-stamp
/tools/pm/tests/libgmmm/proc/type_infos_gmmm_generated
+/tools/pm/tests/libgmmm/gm/gmmm/wrap_init.cc
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 228872e..91ef0f3 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -18,11 +18,18 @@ c_files = \
cxx_lib = \
pm/tests/libgmmm/gm/gmmm/libgmmm.la
-cxx_files = \
+gen_cxx_files = \
pm/tests/libgmmm/gm/gmmm/obj.cc \
pm/tests/libgmmm/gm/gmmm/obj.h \
pm/tests/libgmmm/gm/gmmm/other.cc \
- pm/tests/libgmmm/gm/gmmm/other.h
+ pm/tests/libgmmm/gm/gmmm/other.h \
+ pm/tests/libgmmm/gm/gmmm/wrap_init.cc
+
+cxx_files = \
+ $(gen_cxx_files) \
+ pm/tests/libgmmm/gm/gmmm/init.cc \
+ pm/tests/libgmmm/gm/gmmm/init.h \
+ pm/tests/libgmmm/gm/gmmm/wrap_init.h
cxx_templates = \
pm/tests/libgmmm/gm/src/obj.ccg \
@@ -49,7 +56,10 @@ pm_tests_libgm_gm_libgm_la_CFLAGS = \
$(GLIBMM_WXXFLAGS)
$(gir_file): $(INTROSPECTION_SCANNER) $(c_lib)
-pm_tests_libgm_gm_Gm_1_0_gir_SCANNERFLAGS =
+pm_tests_libgm_gm_Gm_1_0_gir_SCANNERFLAGS = \
+ -I$(top_srcdir) \
+ --c-include=gm/gm.h \
+ --warn-all
pm_tests_libgm_gm_Gm_1_0_gir_INCLUDES = \
GObject-2.0
pm_tests_libgm_gm_Gm_1_0_gir_CFLAGS = \
@@ -71,7 +81,7 @@ pm_tests_libgmmm_gm_gmmm_libgmmm_la_CPPFLAGS = \
pm_tests_libgmmm_gm_gmmm_libgmmm_la_CXXFLAGS = \
$(GLIBMM_WXXFLAGS)
-$(cxx_files): $(proc_stamp_file)
+$(gen_cxx_files): $(proc_stamp_file)
inc1 = @abs_top_srcdir@/tools/pm/tests
inc2 = @abs_top_srcdir@/tools/pm
@@ -80,7 +90,7 @@ dest = @abs_top_builddir@/tools/pm/tests/libgmmm/gm/gmmm
gmminc = @abs_top_srcdir@/tools/pm/tests/libgmmm/proc
$(proc_stamp_file): $(gir_file) $(cxx_templates) gmmproc
- perl -I$(inc1) -I$(inc2) ./gmmproc --source $(source) --destination $(dest) --gir Gm-1.0.gir --mm-module gmmm --include $(gmminc) $(cxx_gm_templates)
+ perl -I$(inc1) -I$(inc2) ./gmmproc --source $(source) --destination $(dest) --gir Gm-1.0.gir --mm-module gmmm --include $(gmminc) --wrap-init-namespace Gm $(cxx_gm_templates)
touch $(proc_stamp_file)
-CLEANFILES = $(cxx_files) $(gir_file) $(proc_stamp_file)
+CLEANFILES = $(gen_cxx_files) $(gir_file) $(proc_stamp_file)
diff --git a/tools/pm/tests/libgm/gm/gm.h b/tools/pm/tests/libgm/gm/gm.h
new file mode 100644
index 0000000..108d863
--- /dev/null
+++ b/tools/pm/tests/libgm/gm/gm.h
@@ -0,0 +1,29 @@
+/* -*- Mode: C; indent-tabs-mode: nil; c-file-style: "bsd"; tab-width: 2; c-basic-offset: 2 -*- */
+/*
+ * gmobj.h
+ * This file is part of glibmm
+ *
+ * Copyright 2012 - Krzesimir Nowak <qdlacz gmail com>
+ *
+ * This library 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.
+ *
+ * This library 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 library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef GLIBMM_TEST_GM_H
+#define GLIBMM_TEST_GM_H
+
+#include <gm/gm-obj.h>
+#include <gm/gm-other.h>
+
+#endif // GLIBMM_TEST_GM_H
diff --git a/tools/pm/tests/libgmmm/gm/gmmm/init.cc b/tools/pm/tests/libgmmm/gm/gmmm/init.cc
new file mode 100644
index 0000000..975f9bc
--- /dev/null
+++ b/tools/pm/tests/libgmmm/gm/gmmm/init.cc
@@ -0,0 +1,22 @@
+#include <glibmm/init.h>
+
+#include "init.h"
+#include "wrap_init.h"
+
+namespace Gm
+{
+
+void
+init ()
+{
+ static bool s_init = false;
+
+ if (!s_init)
+ {
+ Glib::init ();
+ Gm::wrap_init ();
+ s_init = true;
+ }
+}
+
+} // namespace Gm
diff --git a/tools/pm/tests/libgmmm/gm/gmmm/init.h b/tools/pm/tests/libgmmm/gm/gmmm/init.h
new file mode 100644
index 0000000..9b60f15
--- /dev/null
+++ b/tools/pm/tests/libgmmm/gm/gmmm/init.h
@@ -0,0 +1,6 @@
+namespace Gm
+{
+
+void init ();
+
+} // namespace Gm
diff --git a/tools/pm/tests/libgmmm/gm/gmmm/wrap_init.h b/tools/pm/tests/libgmmm/gm/gmmm/wrap_init.h
new file mode 100644
index 0000000..e200fad
--- /dev/null
+++ b/tools/pm/tests/libgmmm/gm/gmmm/wrap_init.h
@@ -0,0 +1,6 @@
+namespace Gm
+{
+
+void wrap_init ();
+
+} // namespace Gm
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]