1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gdk.Rectangle; 26 27 private import gdk.c.functions; 28 public import gdk.c.types; 29 public import gtkc.gdktypes; 30 31 32 /** 33 * Defines the position and size of a rectangle. It is identical to 34 * #cairo_rectangle_int_t. 35 */ 36 37 /** 38 * Checks if the two given rectangles are equal. 39 * 40 * Params: 41 * rect2 = a #GdkRectangle 42 * 43 * Returns: %TRUE if the rectangles are equal. 44 * 45 * Since: 3.20 46 */ 47 public bool equal(GdkRectangle* rect1, GdkRectangle* rect2) 48 { 49 return gdk_rectangle_equal(rect1, rect2) != 0; 50 } 51 52 /** 53 * Calculates the intersection of two rectangles. It is allowed for 54 * @dest to be the same as either @src1 or @src2. If the rectangles 55 * do not intersect, @dest’s width and height is set to 0 and its x 56 * and y values are undefined. If you are only interested in whether 57 * the rectangles intersect, but not in the intersecting area itself, 58 * pass %NULL for @dest. 59 * 60 * Params: 61 * src2 = a #GdkRectangle 62 * dest = return location for the 63 * intersection of @src1 and @src2, or %NULL 64 * 65 * Returns: %TRUE if the rectangles intersect. 66 */ 67 public bool intersect(GdkRectangle* src1, GdkRectangle* src2, out GdkRectangle dest) 68 { 69 return gdk_rectangle_intersect(src1, src2, &dest) != 0; 70 } 71 72 /** 73 * Calculates the union of two rectangles. 74 * The union of rectangles @src1 and @src2 is the smallest rectangle which 75 * includes both @src1 and @src2 within it. 76 * It is allowed for @dest to be the same as either @src1 or @src2. 77 * 78 * Note that this function does not ignore 'empty' rectangles (ie. with 79 * zero width or height). 80 * 81 * Params: 82 * src2 = a #GdkRectangle 83 * dest = return location for the union of @src1 and @src2 84 */ 85 public void unio(GdkRectangle* src1, GdkRectangle* src2, out GdkRectangle dest) 86 { 87 gdk_rectangle_union(src1, src2, &dest); 88 }