summaryrefslogtreecommitdiff
path: root/glib/src/value_basictypes.cc.m4
blob: b9a4b6dca3a6e421792d01cd7d6b3a1b6a5ebcef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
divert(-1)

dnl $Id$

dnl  Glib::Value specializations for fundamental types
dnl
dnl  Copyright 2002 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 Library General Public
dnl  License as published by the Free Software Foundation; either
dnl  version 2 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  Library General Public License for more details.
dnl
dnl  You should have received a copy of the GNU Library 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_VALUE_BASIC(bool, boolean)
dnl
define([GLIB_VALUE_BASIC],[dnl
LINE(]__line__[)dnl

dnl Please ignore the format stuff.  I was just tired and played a little.
/**** Glib::Value<$1> translit(format([%]eval(57-len([$1]))[s],[****/]),[ ],[*])

// static
GType Value<$1>::value_type()
{
  return G_TYPE_[]UPPER($2);
}

void Value<$1>::set($1 data)
{
  g_value_set_$2(&gobject_, data);
}

$1 Value<$1>::get() const
{
  return g_value_get_$2(&gobject_);
}

GParamSpec* Value<$1>::create_param_spec(const Glib::ustring& name) const
{
  return g_param_spec_$2(
      name.c_str(), 0, 0,ifelse($2,pointer,,[
      ifelse($3,,,[$3, $4, ])[]g_value_get_$2(&gobject_),])
      GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE));
}
])

divert[]dnl
// -*- c++ -*-
// This is a generated file, do not edit.  Generated from __file__

#include <glibmm/value.h>

namespace Glib
{

G_GNUC_EXTENSION typedef long long long_long;
G_GNUC_EXTENSION typedef unsigned long long unsigned_long_long;

GLIB_VALUE_BASIC(bool, boolean)
GLIB_VALUE_BASIC(char, char, -128, 127)
GLIB_VALUE_BASIC(unsigned char, uchar, 0, 255)
GLIB_VALUE_BASIC(int, int, G_MININT, G_MAXINT)
GLIB_VALUE_BASIC(unsigned int, uint, 0, G_MAXUINT)
GLIB_VALUE_BASIC(long, long, G_MINLONG, G_MAXLONG)
GLIB_VALUE_BASIC(unsigned long, ulong, 0, G_MAXULONG)
GLIB_VALUE_BASIC(long_long, int64, G_GINT64_CONSTANT[](0x8000000000000000), G_GINT64_CONSTANT[](0x7fffffffffffffff))
GLIB_VALUE_BASIC(unsigned_long_long, uint64, G_GINT64_CONSTANT[](0U), G_GINT64_CONSTANT[](0xffffffffffffffffU))
GLIB_VALUE_BASIC(float, float, G_MINFLOAT, G_MAXFLOAT)
GLIB_VALUE_BASIC(double, double, G_MINDOUBLE, G_MAXDOUBLE)
GLIB_VALUE_BASIC(void*, pointer)
} // namespace Glib