1 // Generated by gmmproc 2.40.0 -- DO NOT MODIFY!
2 
3 
4 #include <glibmm.h>
5 
6 #include <cluttermm/types.h>
7 #include <cluttermm/private/types_p.h>
8 
9 #include <cstring> // std::memset()
10 #include <cstring> // std::memset()
11 
12 /* Copyright (C) 2007 The cluttermm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Lesser General Public
16  * License as published by the Free Software Foundation; either
17  * version 2.1 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22  * Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28 
29 #include <clutter/clutter.h>
30 
31 namespace Clutter
32 {
33 
Knot()34 Knot::Knot()
35 {
36   ClutterKnot tmp = {0, 0};
37   gobject_ = clutter_knot_copy(&tmp);
38 }
39 
Knot(int x,int y)40 Knot::Knot(int x, int y)
41 {
42   ClutterKnot tmp = {x, y};
43   gobject_ = clutter_knot_copy(&tmp);
44 }
45 
set_x(int x)46 void Knot::set_x(int x)
47 {
48   gobject_->x = x;
49 }
50 
set_y(int y)51 void Knot::set_y(int y)
52 {
53   gobject_->y = y;
54 }
55 
set_xy(int x,int y)56 void Knot::set_xy(int x, int y)
57 {
58   gobject_->x = x;
59   gobject_->y = y;
60 }
61 
Vertex(float x,float y,float z)62 Vertex::Vertex(float x, float y, float z)
63 {
64   gobject_.x = x;
65   gobject_.y = y;
66   gobject_.z = z;
67 }
68 
Geometry(int x,int y,guint width,guint height)69 Geometry::Geometry(int x, int y, guint width, guint height)
70 {
71   gobject_.x = x;
72   gobject_.y = y;
73   gobject_.width  = width;
74   gobject_.height = height;
75 }
76 
set_x(int x)77 void Geometry::set_x(int x)
78 {
79   gobject_.x = x;
80 }
81 
set_y(int y)82 void Geometry::set_y(int y)
83 {
84   gobject_.y = y;
85 }
86 
set_xy(int x,int y)87 void Geometry::set_xy(int x, int y)
88 {
89   gobject_.x = x;
90   gobject_.y = y;
91 }
92 
set_width(guint width)93 void Geometry::set_width(guint width)
94 {
95   gobject_.width = width;
96 }
97 
set_height(guint height)98 void Geometry::set_height(guint height)
99 {
100   gobject_.height = height;
101 }
102 
set_size(guint width,guint height)103 void Geometry::set_size(guint width, guint height)
104 {
105   gobject_.width  = width;
106   gobject_.height = height;
107 }
108 
Rect(float x,float y,float width,float height)109 Rect::Rect(float x, float y, float width, float height)
110 {
111   gobject_ = clutter_rect_alloc();
112   clutter_rect_init(gobject_, x, y, width, height);;
113 }
114 
cluttermm_rect_equals(const ClutterRect * a,const ClutterRect * b)115 static gboolean cluttermm_rect_equals(const ClutterRect* a, const ClutterRect* b)
116 {
117   return clutter_rect_equals(const_cast<ClutterRect*>(a), const_cast<ClutterRect*>(b));
118 }
119 
get_centre() const120 Point Rect::get_centre() const
121 {
122   ClutterPoint* p = clutter_point_alloc();
123   clutter_rect_get_center(const_cast<ClutterRect*>(gobj()), p);
124   const Point result = Glib::wrap(p);
125   clutter_point_free(p);
126   return result;
127 }
128 
rect_union(const Rect & b) const129 Rect Rect::rect_union(const Rect& b) const
130 {
131   ClutterRect* crect = clutter_rect_alloc();
132   clutter_rect_union(const_cast<ClutterRect*>(gobj()), const_cast<ClutterRect*>(b.gobj()), crect);
133   const Rect result = Glib::wrap(crect);
134   clutter_rect_free(crect);
135   return result;
136 }
137 
138 
Point(float x,float y)139 Point::Point(float x, float y)
140 {
141   ClutterPoint* point = clutter_point_alloc();
142   point = clutter_point_init(point, x, y);
143   gobject_ = clutter_point_copy(point);
144 }
145 
Point(int x,int y)146 Point::Point(int x, int y)
147 {
148   ClutterPoint* point = clutter_point_alloc();
149   point = clutter_point_init(point, x, y);
150   gobject_ = clutter_point_copy(point);
151 }
152 
Point(double x,double y)153 Point::Point(double x, double y)
154 {
155   ClutterPoint* point = clutter_point_alloc();
156   point = clutter_point_init(point, x, y);
157   gobject_ = clutter_point_copy(point);
158 }
159 
160 } // namespace Clutter
161 
162 namespace
163 {
164 } // anonymous namespace
165 
166 
InitError(Clutter::InitError::Code error_code,const Glib::ustring & error_message)167 Clutter::InitError::InitError(Clutter::InitError::Code error_code, const Glib::ustring& error_message)
168 :
169   Glib::Error (CLUTTER_INIT_ERROR, error_code, error_message)
170 {}
171 
InitError(GError * gobject)172 Clutter::InitError::InitError(GError* gobject)
173 :
174   Glib::Error (gobject)
175 {}
176 
code() const177 Clutter::InitError::Code Clutter::InitError::code() const
178 {
179   return static_cast<Code>(Glib::Error::code());
180 }
181 
throw_func(GError * gobject)182 void Clutter::InitError::throw_func(GError* gobject)
183 {
184   throw Clutter::InitError(gobject);
185 }
186 
187 // static
value_type()188 GType Glib::Value<Clutter::InitError::Code>::value_type()
189 {
190   return clutter_init_error_get_type();
191 }
192 
193 // static
value_type()194 GType Glib::Value<Clutter::AnimationMode>::value_type()
195 {
196   return clutter_animation_mode_get_type();
197 }
198 
199 // static
value_type()200 GType Glib::Value<Clutter::RotateDirection>::value_type()
201 {
202   return clutter_rotate_direction_get_type();
203 }
204 
205 // static
value_type()206 GType Glib::Value<Clutter::RotateAxis>::value_type()
207 {
208   return clutter_rotate_axis_get_type();
209 }
210 
211 // static
value_type()212 GType Glib::Value<Clutter::Gravity>::value_type()
213 {
214   return clutter_gravity_get_type();
215 }
216 
217 // static
value_type()218 GType Glib::Value<Clutter::RequestMode>::value_type()
219 {
220   return clutter_request_mode_get_type();
221 }
222 
223 // static
value_type()224 GType Glib::Value<Clutter::FontFlags>::value_type()
225 {
226   return clutter_font_flags_get_type();
227 }
228 
229 // static
value_type()230 GType Glib::Value<Clutter::ScalingFilter>::value_type()
231 {
232   return clutter_scaling_filter_get_type();
233 }
234 
235 // static
value_type()236 GType Glib::Value<Clutter::TextDirection>::value_type()
237 {
238   return clutter_text_direction_get_type();
239 }
240 
241 
242 namespace Glib
243 {
244 
wrap(ClutterVertex * object)245 Clutter::Vertex& wrap(ClutterVertex* object)
246 {
247   return *reinterpret_cast<Clutter::Vertex*>(object);
248 }
249 
wrap(const ClutterVertex * object)250 const Clutter::Vertex& wrap(const ClutterVertex* object)
251 {
252   return *reinterpret_cast<const Clutter::Vertex*>(object);
253 }
254 
255 } // namespace Glib
256 
257 
258 namespace Clutter
259 {
260 
261 
262 // static
get_type()263 GType Vertex::get_type()
264 {
265   return clutter_vertex_get_type();
266 }
267 
Vertex()268 Vertex::Vertex()
269 {
270   std::memset(&gobject_, 0, sizeof(ClutterVertex));
271 }
272 
Vertex(const ClutterVertex * gobject)273 Vertex::Vertex(const ClutterVertex* gobject)
274 {
275   if(gobject)
276     gobject_ = *gobject;
277   else
278     std::memset(&gobject_, 0, sizeof(ClutterVertex));
279 }
280 
281 
get_x() const282  float Vertex::get_x() const
283 {
284   return gobj()->x;
285 }
286 
set_x(const float & value)287  void Vertex::set_x(const float& value)
288 {
289   gobj()->x = value;
290 }
291 
get_y() const292  float Vertex::get_y() const
293 {
294   return gobj()->y;
295 }
296 
set_y(const float & value)297  void Vertex::set_y(const float& value)
298 {
299   gobj()->y = value;
300 }
301 
get_z() const302  float Vertex::get_z() const
303 {
304   return gobj()->z;
305 }
306 
set_z(const float & value)307  void Vertex::set_z(const float& value)
308 {
309   gobj()->z = value;
310 }
311 
312 
313 } // namespace Clutter
314 
315 
316 namespace Glib
317 {
318 
wrap(ClutterGeometry * object)319 Clutter::Geometry& wrap(ClutterGeometry* object)
320 {
321   return *reinterpret_cast<Clutter::Geometry*>(object);
322 }
323 
wrap(const ClutterGeometry * object)324 const Clutter::Geometry& wrap(const ClutterGeometry* object)
325 {
326   return *reinterpret_cast<const Clutter::Geometry*>(object);
327 }
328 
329 } // namespace Glib
330 
331 
332 namespace Clutter
333 {
334 
335 
336 // static
get_type()337 GType Geometry::get_type()
338 {
339   return clutter_geometry_get_type();
340 }
341 
Geometry()342 Geometry::Geometry()
343 {
344   std::memset(&gobject_, 0, sizeof(ClutterGeometry));
345 }
346 
Geometry(const ClutterGeometry * gobject)347 Geometry::Geometry(const ClutterGeometry* gobject)
348 {
349   if(gobject)
350     gobject_ = *gobject;
351   else
352     std::memset(&gobject_, 0, sizeof(ClutterGeometry));
353 }
354 
get_x() const355  int Geometry::get_x() const
356 {
357   return gobj()->x;
358 }
359 
get_y() const360  int Geometry::get_y() const
361 {
362   return gobj()->y;
363 }
364 
get_width() const365  guint Geometry::get_width() const
366 {
367   return gobj()->width;
368 }
369 
get_height() const370  guint Geometry::get_height() const
371 {
372   return gobj()->height;
373 }
374 
375 
376 } // namespace Clutter
377 
378 
379 namespace Glib
380 {
381 
wrap(ClutterPoint * object,bool take_copy)382 Clutter::Point wrap(ClutterPoint* object, bool take_copy)
383 {
384   return Clutter::Point(object, take_copy);
385 }
386 
387 } // namespace Glib
388 
389 
390 namespace Clutter
391 {
392 
393 
394 // static
get_type()395 GType Point::get_type()
396 {
397   return clutter_point_get_type();
398 }
399 
400 
Point(const Point & other)401 Point::Point(const Point& other)
402 :
403   gobject_ ((other.gobject_) ? clutter_point_copy(other.gobject_) : 0)
404 {}
405 
Point(ClutterPoint * gobject,bool make_a_copy)406 Point::Point(ClutterPoint* gobject, bool make_a_copy)
407 :
408   // For BoxedType wrappers, make_a_copy is true by default.  The static
409   // BoxedType wrappers must always take a copy, thus make_a_copy = true
410   // ensures identical behaviour if the default argument is used.
411   gobject_ ((make_a_copy && gobject) ? clutter_point_copy(gobject) : gobject)
412 {}
413 
operator =(const Point & other)414 Point& Point::operator=(const Point& other)
415 {
416   Point temp (other);
417   swap(temp);
418   return *this;
419 }
420 
~Point()421 Point::~Point()
422 {
423   if(gobject_)
424     clutter_point_free(gobject_);
425 }
426 
swap(Point & other)427 void Point::swap(Point& other)
428 {
429   ClutterPoint *const temp = gobject_;
430   gobject_ = other.gobject_;
431   other.gobject_ = temp;
432 }
433 
gobj_copy() const434 ClutterPoint* Point::gobj_copy() const
435 {
436   return clutter_point_copy(gobject_);
437 }
438 
439 
operator ==(const Point & lhs,const Point & rhs)440 bool operator==(const Point& lhs, const Point& rhs)
441 {
442   return (clutter_point_equals(lhs.gobj(), rhs.gobj()) != 0);
443 }
444 
operator !=(const Point & lhs,const Point & rhs)445 bool operator!=(const Point& lhs, const Point& rhs)
446 {
447   return (clutter_point_equals(lhs.gobj(), rhs.gobj()) == 0);
448 }
449 
450 
distance(const Point & b,float & x_distance,float & y_distance) const451 float Point::distance(const Point& b, float& x_distance, float& y_distance) const
452 {
453   return clutter_point_distance(const_cast<ClutterPoint*>(gobj()), (b).gobj(), &(x_distance), &(y_distance));
454 }
455 
get_x() const456  float Point::get_x() const
457 {
458   return gobj()->x;
459 }
460 
get_y() const461  float Point::get_y() const
462 {
463   return gobj()->y;
464 }
465 
set_x(const float & value)466  void Point::set_x(const float& value)
467 {
468   gobj()->x = value;
469 }
470 
set_y(const float & value)471  void Point::set_y(const float& value)
472 {
473   gobj()->y = value;
474 }
475 
476 
477 } // namespace Clutter
478 
479 
480 namespace Glib
481 {
482 
wrap(ClutterRect * object,bool take_copy)483 Clutter::Rect wrap(ClutterRect* object, bool take_copy)
484 {
485   return Clutter::Rect(object, take_copy);
486 }
487 
488 } // namespace Glib
489 
490 
491 namespace Clutter
492 {
493 
494 
495 // static
get_type()496 GType Rect::get_type()
497 {
498   return clutter_rect_get_type();
499 }
500 
501 
Rect(const Rect & other)502 Rect::Rect(const Rect& other)
503 :
504   gobject_ ((other.gobject_) ? clutter_rect_copy(other.gobject_) : 0)
505 {}
506 
Rect(ClutterRect * gobject,bool make_a_copy)507 Rect::Rect(ClutterRect* gobject, bool make_a_copy)
508 :
509   // For BoxedType wrappers, make_a_copy is true by default.  The static
510   // BoxedType wrappers must always take a copy, thus make_a_copy = true
511   // ensures identical behaviour if the default argument is used.
512   gobject_ ((make_a_copy && gobject) ? clutter_rect_copy(gobject) : gobject)
513 {}
514 
operator =(const Rect & other)515 Rect& Rect::operator=(const Rect& other)
516 {
517   Rect temp (other);
518   swap(temp);
519   return *this;
520 }
521 
~Rect()522 Rect::~Rect()
523 {
524   if(gobject_)
525     clutter_rect_free(gobject_);
526 }
527 
swap(Rect & other)528 void Rect::swap(Rect& other)
529 {
530   ClutterRect *const temp = gobject_;
531   gobject_ = other.gobject_;
532   other.gobject_ = temp;
533 }
534 
gobj_copy() const535 ClutterRect* Rect::gobj_copy() const
536 {
537   return clutter_rect_copy(gobject_);
538 }
539 
540 
operator ==(const Rect & lhs,const Rect & rhs)541 bool operator==(const Rect& lhs, const Rect& rhs)
542 {
543   return (cluttermm_rect_equals(lhs.gobj(), rhs.gobj()) != 0);
544 }
545 
operator !=(const Rect & lhs,const Rect & rhs)546 bool operator!=(const Rect& lhs, const Rect& rhs)
547 {
548   return (cluttermm_rect_equals(lhs.gobj(), rhs.gobj()) == 0);
549 }
550 
551 
normalise()552 Rect Rect::normalise()
553 {
554   return Glib::wrap(clutter_rect_normalize(gobj()));
555 }
556 
contains_point(const Point & point) const557 bool Rect::contains_point(const Point& point) const
558 {
559   return clutter_rect_contains_point(const_cast<ClutterRect*>(gobj()), const_cast<ClutterPoint*>((point).gobj()));
560 }
561 
contains_rect(const Rect & b) const562 bool Rect::contains_rect(const Rect& b) const
563 {
564   return clutter_rect_contains_rect(const_cast<ClutterRect*>(gobj()), const_cast<ClutterRect*>((b).gobj()));
565 }
566 
intersection(const Rect & b,Rect & res) const567 bool Rect::intersection(const Rect& b, Rect& res) const
568 {
569   ClutterRect g_res = ClutterRect();
570   bool retvalue = clutter_rect_intersection(const_cast<ClutterRect*>(gobj()), const_cast<ClutterRect*>((b).gobj()), &g_res);
571 res = Glib::wrap(&(g_res));
572   return retvalue;
573 }
574 
offset(float d_x,float d_y)575 void Rect::offset(float d_x, float d_y)
576 {
577   clutter_rect_offset(gobj(), d_x, d_y);
578 }
579 
inset(float d_x,float d_y)580 void Rect::inset(float d_x, float d_y)
581 {
582   clutter_rect_inset(gobj(), d_x, d_y);
583 }
584 
clamp_to_pixel()585 void Rect::clamp_to_pixel()
586 {
587   clutter_rect_clamp_to_pixel(gobj());
588 }
589 
get_x() const590 float Rect::get_x() const
591 {
592   return clutter_rect_get_x(const_cast<ClutterRect*>(gobj()));
593 }
594 
get_y() const595 float Rect::get_y() const
596 {
597   return clutter_rect_get_y(const_cast<ClutterRect*>(gobj()));
598 }
599 
get_width() const600 float Rect::get_width() const
601 {
602   return clutter_rect_get_width(const_cast<ClutterRect*>(gobj()));
603 }
604 
get_height() const605 float Rect::get_height() const
606 {
607   return clutter_rect_get_height(const_cast<ClutterRect*>(gobj()));
608 }
609 
610 
611 } // namespace Clutter
612 
613 
614 namespace Glib
615 {
616 
wrap(ClutterKnot * object,bool take_copy)617 Clutter::Knot wrap(ClutterKnot* object, bool take_copy)
618 {
619   return Clutter::Knot(object, take_copy);
620 }
621 
622 } // namespace Glib
623 
624 
625 namespace Clutter
626 {
627 
628 
629 // static
get_type()630 GType Knot::get_type()
631 {
632   return clutter_knot_get_type();
633 }
634 
635 
Knot(const Knot & other)636 Knot::Knot(const Knot& other)
637 :
638   gobject_ ((other.gobject_) ? clutter_knot_copy(other.gobject_) : 0)
639 {}
640 
Knot(ClutterKnot * gobject,bool make_a_copy)641 Knot::Knot(ClutterKnot* gobject, bool make_a_copy)
642 :
643   // For BoxedType wrappers, make_a_copy is true by default.  The static
644   // BoxedType wrappers must always take a copy, thus make_a_copy = true
645   // ensures identical behaviour if the default argument is used.
646   gobject_ ((make_a_copy && gobject) ? clutter_knot_copy(gobject) : gobject)
647 {}
648 
operator =(const Knot & other)649 Knot& Knot::operator=(const Knot& other)
650 {
651   Knot temp (other);
652   swap(temp);
653   return *this;
654 }
655 
~Knot()656 Knot::~Knot()
657 {
658   if(gobject_)
659     clutter_knot_free(gobject_);
660 }
661 
swap(Knot & other)662 void Knot::swap(Knot& other)
663 {
664   ClutterKnot *const temp = gobject_;
665   gobject_ = other.gobject_;
666   other.gobject_ = temp;
667 }
668 
gobj_copy() const669 ClutterKnot* Knot::gobj_copy() const
670 {
671   return clutter_knot_copy(gobject_);
672 }
673 
get_x() const674  int Knot::get_x() const
675 {
676   return gobj()->x;
677 }
678 
get_y() const679  int Knot::get_y() const
680 {
681   return gobj()->y;
682 }
683 
684 
operator ==(const Knot & lhs,const Knot & rhs)685 bool operator==(const Knot& lhs, const Knot& rhs)
686 {
687   return (clutter_knot_equal(lhs.gobj(), rhs.gobj()) != 0);
688 }
689 
operator !=(const Knot & lhs,const Knot & rhs)690 bool operator!=(const Knot& lhs, const Knot& rhs)
691 {
692   return (clutter_knot_equal(lhs.gobj(), rhs.gobj()) == 0);
693 }
694 
695 
696 } // namespace Clutter
697 
698 
699