1divert(-1)
2
3dnl  Glib::Value specializations for fundamental types
4dnl
5dnl  Copyright 2002 The gtkmm Development Team
6dnl
7dnl  This library is free software; you can redistribute it and/or
8dnl  modify it under the terms of the GNU Lesser General Public
9dnl  License as published by the Free Software Foundation; either
10dnl  version 2.1 of the License, or (at your option) any later version.
11dnl
12dnl  This library is distributed in the hope that it will be useful,
13dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
14dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15dnl  Lesser General Public License for more details.
16dnl
17dnl  You should have received a copy of the GNU Lesser General Public
18dnl  License along with this library.  If not, see <http://www.gnu.org/licenses/>.
19
20include(template.macros.m4)
21
22dnl
23dnl GLIB_VALUE_BASIC(bool, boolean)
24dnl
25define([GLIB_VALUE_BASIC],[dnl
26LINE(]__line__[)dnl
27
28dnl Please ignore the format stuff.  I was just tired and played a little.
29/**** Glib::Value<$1> translit(format([%]eval(57-len([$1]))[s],[****/]),[ ],[*])
30
31// static
32GType Value<$1>::value_type()
33{
34  return G_TYPE_[]UPPER(ifelse($2,schar,char,$2));
35}
36
37void Value<$1>::set($1 data)
38{
39  g_value_set_$2(&gobject_, data);
40}
41
42$1 Value<$1>::get() const
43{
44  return g_value_get_$2(&gobject_);
45}
46
47GParamSpec* Value<$1>::create_param_spec(const Glib::ustring& name) const
48{
49  return create_param_spec(name, Glib::ustring(), Glib::ustring(),
50      Glib::PARAM_READWRITE);
51}
52
53GParamSpec* Value<$1>::create_param_spec(const Glib::ustring& name, const Glib::ustring& nick,
54                                         const Glib::ustring& blurb, Glib::ParamFlags flags) const
55{
56  return g_param_spec_[]ifelse($2,schar,char,$2)(
57      name.c_str(), nick.empty() ? nullptr : nick.c_str(),
58      blurb.empty() ? nullptr : blurb.c_str(), ifelse($2,pointer,,[
59      ifelse($3,,,[$3, $4, ])[]g_value_get_$2(&gobject_),])
60      static_cast<GParamFlags>(flags));
61}
62])
63
64divert[]dnl
65// This is a generated file, do not edit.  Generated from __file__
66
67/* So we can use deprecated functions in our deprecated methods */
68#undef G_DISABLE_DEPRECATED
69#define GLIB_DISABLE_DEPRECATION_WARNINGS 1
70
71#include <glibmm/value.h>
72
73namespace Glib
74{
75
76G_GNUC_EXTENSION typedef long long long_long;
77G_GNUC_EXTENSION typedef unsigned long long unsigned_long_long;
78
79GLIB_VALUE_BASIC(bool, boolean)
80#ifndef GLIBMM_DISABLE_DEPRECATED
81GLIB_VALUE_BASIC(char, char, -128, 127)
82#endif // GLIBMM_DISABLE_DEPRECATED
83GLIB_VALUE_BASIC(signed char, schar, -128, 127)
84GLIB_VALUE_BASIC(unsigned char, uchar, 0, 255)
85GLIB_VALUE_BASIC(int, int, G_MININT, G_MAXINT)
86GLIB_VALUE_BASIC(unsigned int, uint, 0, G_MAXUINT)
87GLIB_VALUE_BASIC(long, long, G_MINLONG, G_MAXLONG)
88GLIB_VALUE_BASIC(unsigned long, ulong, 0, G_MAXULONG)
89GLIB_VALUE_BASIC(long_long, int64, G_GINT64_CONSTANT[](0x8000000000000000), G_GINT64_CONSTANT[](0x7fffffffffffffff))
90GLIB_VALUE_BASIC(unsigned_long_long, uint64, G_GINT64_CONSTANT[](0U), G_GINT64_CONSTANT[](0xffffffffffffffffU))
91GLIB_VALUE_BASIC(float, float, -G_MAXFLOAT, G_MAXFLOAT)
92GLIB_VALUE_BASIC(double, double, -G_MAXDOUBLE, G_MAXDOUBLE)
93GLIB_VALUE_BASIC(void*, pointer)
94} // namespace Glib
95