2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gdk-Points-Rectangles-and-Regions.html
28 * strct = GdkRectangle
47 * - GdkRectangle* -> Rectangle
53 private import gdk
.gdktypes
;
55 private import lib
.gdk
;
57 private import gdk
.Rectangle
;
61 * GDK provides the GdkPoint, GdkRectangle, GdkRegion and GdkSpan data types
62 * for representing pixels and sets of pixels on the screen.
63 * GdkPoint is a simple structure containing an x and y coordinate of a point.
64 * GdkRectangle is a structure holding the position and size of a rectangle.
65 * The intersection of two rectangles can be computed with
66 * gdk_rectangle_intersect(). To find the union of two rectangles use
67 * gdk_rectangle_union().
68 * GdkRegion is an opaque data type holding a set of arbitrary pixels, and is
69 * usually used for clipping graphical operations (see gdk_gc_set_clip_region()).
70 * GdkSpan is a structure holding a spanline. A spanline is a horizontal line that
71 * is one pixel wide. It is mainly used when rasterizing other graphics primitives.
72 * It can be intersected to regions by using gdk_region_spans_intersect_foreach().
74 public class Rectangle
77 /** the main Gtk struct */
78 protected GdkRectangle
* gdkRectangle
;
81 public GdkRectangle
* getRectangleStruct()
87 /** the main Gtk struct as a void* */
88 protected void* getStruct()
90 return cast(void*)gdkRectangle
;
94 * Sets our main struct and passes it to the parent class
96 public this (GdkRectangle
* gdkRectangle
)
98 this.gdkRectangle
= gdkRectangle
;
107 * Calculates the intersection of two rectangles.
108 * It is allowed for dest to be the same as either src1 or src2.
114 * return location for the intersection of src1 and src2
116 * TRUE if the rectangles intersect.
118 public int intersect(Rectangle src2
, Rectangle dest
)
120 // gboolean gdk_rectangle_intersect (GdkRectangle *src1, GdkRectangle *src2, GdkRectangle *dest);
121 return gdk_rectangle_intersect(gdkRectangle
, (src2
is null) ?
null : src2
.getRectangleStruct(), (dest
is null) ?
null : dest
.getRectangleStruct());
125 * Calculates the union of two rectangles.
126 * The union of rectangles src1 and src2 is the smallest rectangle which
127 * includes both src1 and src2 within it.
128 * It is allowed for dest to be the same as either src1 or src2.
134 * return location for the union of src1 and src2
136 public void unio(Rectangle src2
, Rectangle dest
)
138 // void gdk_rectangle_union (GdkRectangle *src1, GdkRectangle *src2, GdkRectangle *dest);
139 gdk_rectangle_union(gdkRectangle
, (src2
is null) ?
null : src2
.getRectangleStruct(), (dest
is null) ?
null : dest
.getRectangleStruct());