diff options
author | José Alburquerque <jaalburqu@svn.gnome.org> | 2010-06-18 20:43:30 -0400 |
---|---|---|
committer | José Alburquerque <jaalburqu@svn.gnome.org> | 2010-06-18 20:43:30 -0400 |
commit | 94e8523ba4e3ca3583a1fb224004c05e1d1fdb82 (patch) | |
tree | 1997c76c6d84b25255764767434c318e4fc9eaf3 /glib/src/variant_basictypes.cc.m4 | |
parent | 9190c6a2c3352bfdd9edb574de8c0490be3905e2 (diff) | |
download | glibmm-94e8523ba4e3ca3583a1fb224004c05e1d1fdb82.tar.gz |
Preliminary implementation of Glib::Variant<> classes.
* glib/glibmm/variant.cc:
* glib/glibmm/variant.h:
* glib/src/variant_basictypes.cc.m4:
* glib/src/variant_basictypes.h.m4: Add an initial implementation of
of the Glib::Variant<> classes which wrap glib's GVariant API.
Diffstat (limited to 'glib/src/variant_basictypes.cc.m4')
-rw-r--r-- | glib/src/variant_basictypes.cc.m4 | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/glib/src/variant_basictypes.cc.m4 b/glib/src/variant_basictypes.cc.m4 new file mode 100644 index 00000000..dc345d88 --- /dev/null +++ b/glib/src/variant_basictypes.cc.m4 @@ -0,0 +1,68 @@ +divert(-1) + +dnl $Id$ + +dnl Glib::Variant specializations for fundamental types +dnl +dnl Copyright 2010 The gtkmm Development Team +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free +dnl Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +include(template.macros.m4) + +dnl +dnl GLIB_VARIANT_BASIC(bool, boolean) +dnl +define([GLIB_VARIANT_BASIC],[dnl +LINE(]__line__[)dnl + +dnl Please ignore the format stuff. I was just tired and played a little. +/**** Glib::Variant<$1> translit(format([%]eval(57-len([$1]))[s],[****/]),[ ],[*]) + +// static +const GVariantType* Variant<$1>::variant_type() +{ + return G_VARIANT_TYPE_[]UPPER($2); +} + +Variant<$1> Variant<$1>::create($1 data) +{ + return Variant<$1>(g_variant_new_$2(data)); +} + +$1 Variant<$1>::get() const +{ + return g_variant_get_$2(gobject_); +} +]) + +divert[]dnl +// This is a generated file, do not edit. Generated from __file__ + +#include <glibmm/variant.h> + +namespace Glib +{ +GLIB_VARIANT_BASIC(bool, boolean) +dnl GLIB_VARIANT_BASIC(unsigned char, byte) +GLIB_VARIANT_BASIC(gint16, int16) +GLIB_VARIANT_BASIC(guint16, uint16) +GLIB_VARIANT_BASIC(gint32, int32) +GLIB_VARIANT_BASIC(guint32, uint32) +GLIB_VARIANT_BASIC(gint64, int64) +GLIB_VARIANT_BASIC(guint64, uint64) +dnl GLIB_VARIANT_BASIC(gint32, handle) +GLIB_VARIANT_BASIC(double, double) +} // namespace Glib |