summaryrefslogtreecommitdiff
path: root/glib/glibmm
diff options
context:
space:
mode:
authorRob Page <page.rob@gmail.com>2006-09-19 20:36:43 +0000
committerMurray Cumming <murrayc@src.gnome.org>2006-09-19 20:36:43 +0000
commit5825be4584969d60cf96d3968a5cd8884a3f8f07 (patch)
tree1be001e29e3ad84e89fa88ccb7daf2f07f061e23 /glib/glibmm
parent502ccd9a6bbc8e8acadf055fc27e059f6fadc6da (diff)
downloadglibmm-5825be4584969d60cf96d3968a5cd8884a3f8f07.tar.gz
Wraps GKeyFile (Bug #330535) Added include of keyfile.h Added keyfile.h
2006-02-20 Rob Page <page.rob@gmail.com> Wraps GKeyFile (Bug #330535) * glib/glibmm.h: Added include of keyfile.h * glib/glibmm/Makefile.am: Added keyfile.h * glib/glibmm/containerhandle_shared.h: Added a TypeTraits specialization for converting between bool and gboolean*. * glib/src/Makefile_list_of_hg.am_fragment: Added keyfile.hg to files_general_hg. * glib/src/keyfile.hg: KeyFile header * glib/src/keyfile.ccg: KeyFile implementation * tools/m4/convert_glib.m4: Added a conversion for KeyFileFlags
Diffstat (limited to 'glib/glibmm')
-rw-r--r--glib/glibmm/Makefile.am1
-rw-r--r--glib/glibmm/containerhandle_shared.h30
2 files changed, 31 insertions, 0 deletions
diff --git a/glib/glibmm/Makefile.am b/glib/glibmm/Makefile.am
index 6ef74877..e9ccf637 100644
--- a/glib/glibmm/Makefile.am
+++ b/glib/glibmm/Makefile.am
@@ -62,6 +62,7 @@ sublib_files_extra_general_h = \
i18n.h \
interface.h \
iochannel.h \
+ keyfile.h \
listhandle.h \
main.h \
miscutils.h \
diff --git a/glib/glibmm/containerhandle_shared.h b/glib/glibmm/containerhandle_shared.h
index ef557b47..4a82b69f 100644
--- a/glib/glibmm/containerhandle_shared.h
+++ b/glib/glibmm/containerhandle_shared.h
@@ -314,6 +314,36 @@ struct TypeTraits<std::string>
{ g_free(const_cast<CTypeNonConst>(str)); }
};
+/** Specialization for bool
+ * @ingroup ContHelpers
+ */
+template <>
+struct TypeTraits<bool>
+{
+ typedef bool CppType;
+ typedef gboolean* CType;
+ typedef gboolean* CTypeNonConst;
+
+ static CType to_c_type (CppType val) { return (int*)GINT_TO_POINTER(val); }
+ static CType to_c_type (CType ptr) { return ptr; }
+
+ static CppType to_cpp_type(CType ptr)
+ {
+ if(ptr)
+ {
+ //We use this for gboolean too, because it is actually an int.
+ return GPOINTER_TO_INT(ptr);
+ }
+ else
+ return CppType();
+ }
+
+ static void release_c_type(CType /* ptr */)
+ {
+
+ }
+};
+
#endif /* DOXYGEN_SHOULD_SKIP_THIS */