summaryrefslogtreecommitdiff
path: root/libs/libgnomecanvasmm/libgnomecanvasmm/path-def.cc
blob: 528c3f8153f3ca5bbf5ce485f161683a77a40d5a (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
// Generated by gtkmmproc -- DO NOT MODIFY!

#include <libgnomecanvasmm/path-def.h>
#include <libgnomecanvasmm/private/path-def_p.h>

/* path-def.cc
 *
 * Copyright (C) 2002 The libgnomecanvasmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */


namespace Gnome
{

namespace Canvas
{
Gnome::Art::Point PathDef::currentpoint() const
{
  Gnome::Art::Point point;
  gnome_canvas_path_def_currentpoint(gobj(), point.gobj());
  return point;
}


} /* namespace Canvas */

} /* namespace Gnome */

namespace
{
} // anonymous namespace


/* Why reinterpret_cast<PathDef*>(gobject) is needed:
 *
 * A PathDef instance is in fact always a GnomeCanvasPathDef instance.
 * Unfortunately, GnomeCanvasPathDef cannot be a member of PathDef,
 * because it is an opaque struct.  Also, the C interface does not provide
 * any hooks to install a destroy notification handler, thus we cannot
 * wrap it dynamically either.
 *
 * The cast works because PathDef does not have any member data, and
 * it is impossible to derive from it.  This is ensured by not implementing
 * the (protected) default constructor.  The ctor is protected rather than
 * private just to avoid a compile warning.
 */

namespace Glib
{

Glib::RefPtr<Gnome::Canvas::PathDef> wrap(GnomeCanvasPathDef* object, bool take_copy)
{
  if(take_copy && object)
    gnome_canvas_path_def_duplicate(object);

  // See the comment at the top of this file, if you want to know why the cast works.
  return Glib::RefPtr<Gnome::Canvas::PathDef>(reinterpret_cast<Gnome::Canvas::PathDef*>(object));
}

} // namespace Glib


namespace Gnome
{

namespace Canvas
{


// static
Glib::RefPtr<PathDef> PathDef::create()
{
  // See the comment at the top of this file, if you want to know why the cast works.
  return Glib::RefPtr<PathDef>(reinterpret_cast<PathDef*>(gnome_canvas_path_def_new()));
}

void PathDef::reference() const
{
  // See the comment at the top of this file, if you want to know why the cast works.
  gnome_canvas_path_def_duplicate(reinterpret_cast<GnomeCanvasPathDef*>(const_cast<PathDef*>(this)));
}

void PathDef::unreference() const
{
  // See the comment at the top of this file, if you want to know why the cast works.
  gnome_canvas_path_def_unref(reinterpret_cast<GnomeCanvasPathDef*>(const_cast<PathDef*>(this)));
}

GnomeCanvasPathDef* PathDef::gobj()
{
  // See the comment at the top of this file, if you want to know why the cast works.
  return reinterpret_cast<GnomeCanvasPathDef*>(this);
}

const GnomeCanvasPathDef* PathDef::gobj() const
{
  // See the comment at the top of this file, if you want to know why the cast works.
  return reinterpret_cast<const GnomeCanvasPathDef*>(this);
}

GnomeCanvasPathDef* PathDef::gobj_copy() const
{
  // See the comment at the top of this file, if you want to know why the cast works.
  GnomeCanvasPathDef *const gobject = reinterpret_cast<GnomeCanvasPathDef*>(const_cast<PathDef*>(this));
  gnome_canvas_path_def_duplicate(gobject);
  return gobject;
}


Glib::RefPtr<PathDef> PathDef::create(int length)
{
  return Glib::wrap(gnome_canvas_path_def_new_sized(length));
}

Glib::RefPtr<PathDef> PathDef::create(ArtBpath& bpath)
{
  return Glib::wrap(gnome_canvas_path_def_new_from_bpath(&(bpath)));
}

Glib::RefPtr<PathDef> PathDef::open_parts()
{
  return Glib::wrap(gnome_canvas_path_def_open_parts(gobj()));
}

Glib::RefPtr<PathDef> PathDef::closed_parts()
{
  return Glib::wrap(gnome_canvas_path_def_closed_parts(gobj()));
}

Glib::RefPtr<PathDef> PathDef::close_all()
{
  return Glib::wrap(gnome_canvas_path_def_close_all(gobj()));
}

void PathDef::finish()
{
  gnome_canvas_path_def_finish(gobj());
}

void PathDef::ensure_space(int space)
{
  gnome_canvas_path_def_ensure_space(gobj(), space);
}

void PathDef::reset()
{
  gnome_canvas_path_def_reset(gobj());
}

void PathDef::moveto(double x, double y)
{
  gnome_canvas_path_def_moveto(gobj(), x, y);
}

void PathDef::lineto(double x, double y)
{
  gnome_canvas_path_def_lineto(gobj(), x, y);
}

void PathDef::lineto_moving(double x, double y)
{
  gnome_canvas_path_def_lineto_moving(gobj(), x, y);
}

void PathDef::curveto(double x1, double y1, double x2, double y2, double x3, double y3)
{
  gnome_canvas_path_def_curveto(gobj(), x1, y1, x2, y2, x3, y3);
}

void PathDef::closepath()
{
  gnome_canvas_path_def_closepath(gobj());
}

void PathDef::closepath_current()
{
  gnome_canvas_path_def_closepath_current(gobj());
}

ArtBpath* PathDef::get_bpath() const
{
  return gnome_canvas_path_def_bpath(const_cast<GnomeCanvasPathDef*>(gobj()));
}

ArtBpath* PathDef::first_bpath() const
{
  return gnome_canvas_path_def_first_bpath(const_cast<GnomeCanvasPathDef*>(gobj()));
}

ArtBpath* PathDef::last_bpath() const
{
  return gnome_canvas_path_def_last_bpath(const_cast<GnomeCanvasPathDef*>(gobj()));
}

bool PathDef::is_empty() const
{
  return gnome_canvas_path_def_is_empty(const_cast<GnomeCanvasPathDef*>(gobj()));
}

int PathDef::length() const
{
  return gnome_canvas_path_def_length(const_cast<GnomeCanvasPathDef*>(gobj()));
}

bool PathDef::has_currentpoint() const
{
  return gnome_canvas_path_def_has_currentpoint(const_cast<GnomeCanvasPathDef*>(gobj()));
}

bool PathDef::any_open() const
{
  return gnome_canvas_path_def_any_open(const_cast<GnomeCanvasPathDef*>(gobj()));
}

bool PathDef::all_open() const
{
  return gnome_canvas_path_def_all_open(const_cast<GnomeCanvasPathDef*>(gobj()));
}

bool PathDef::any_closed() const
{
  return gnome_canvas_path_def_any_closed(const_cast<GnomeCanvasPathDef*>(gobj()));
}

bool PathDef::all_closed() const
{
  return gnome_canvas_path_def_all_closed(const_cast<GnomeCanvasPathDef*>(gobj()));
}


} // namespace Canvas

} // namespace Gnome