3 dnl $Id: value_basictypes.cc.m4 779 2009-01-19 17:58:50Z murrayc $
5 dnl Glib::Value specializations for fundamental types
7 dnl Copyright 2002 The gtkmm Development Team
9 dnl This library is free software; you can redistribute it and/or
10 dnl modify it under the terms of the GNU Lesser General Public
11 dnl License as published by the Free Software Foundation; either
12 dnl version 2.1 of the License, or (at your option) any later version.
14 dnl This library is distributed in the hope that it will be useful,
15 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
16 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 dnl Lesser General Public License for more details.
19 dnl You should have received a copy of the GNU Lesser General Public
20 dnl License along with this library; if not, write to the Free
21 dnl Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 include(template.macros.m4)
26 dnl GLIB_VALUE_BASIC(bool, boolean)
28 define([GLIB_VALUE_BASIC],[dnl
31 dnl Please ignore the format stuff. I was just tired and played a little.
32 /**** Glib::Value<$1> translit(format([%]eval(57-len([$1]))[s],[****/]),[ ],[*])
35 GType Value<$1>::value_type()
37 return G_TYPE_[]UPPER($2);
40 void Value<$1>::set($1 data)
42 g_value_set_$2(&gobject_, data);
45 $1 Value<$1>::get() const
47 return g_value_get_$2(&gobject_);
50 GParamSpec* Value<$1>::create_param_spec(const Glib::ustring& name) const
52 return g_param_spec_$2(
53 name.c_str(), 0, 0,ifelse($2,pointer,,[
54 ifelse($3,,,[$3, $4, ])[]g_value_get_$2(&gobject_),])
55 GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE));
61 // This is a generated file, do not edit. Generated from __file__
63 #include <glibmm/value.h>
68 G_GNUC_EXTENSION typedef long long long_long;
69 G_GNUC_EXTENSION typedef unsigned long long unsigned_long_long;
71 GLIB_VALUE_BASIC(bool, boolean)
72 GLIB_VALUE_BASIC(char, char, -128, 127)
73 GLIB_VALUE_BASIC(unsigned char, uchar, 0, 255)
74 GLIB_VALUE_BASIC(int, int, G_MININT, G_MAXINT)
75 GLIB_VALUE_BASIC(unsigned int, uint, 0, G_MAXUINT)
76 GLIB_VALUE_BASIC(long, long, G_MINLONG, G_MAXLONG)
77 GLIB_VALUE_BASIC(unsigned long, ulong, 0, G_MAXULONG)
78 GLIB_VALUE_BASIC(long_long, int64, G_GINT64_CONSTANT[](0x8000000000000000), G_GINT64_CONSTANT[](0x7fffffffffffffff))
79 GLIB_VALUE_BASIC(unsigned_long_long, uint64, G_GINT64_CONSTANT[](0U), G_GINT64_CONSTANT[](0xffffffffffffffffU))
80 GLIB_VALUE_BASIC(float, float, -G_MAXFLOAT, G_MAXFLOAT)
81 GLIB_VALUE_BASIC(double, double, -G_MAXDOUBLE, G_MAXDOUBLE)
82 GLIB_VALUE_BASIC(void*, pointer)