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 gtkc.gdk; 28 public import gtkc.gdktypes; 29 30 31 /** 32 * Defines the position and size of a rectangle. It is identical to 33 * #cairo_rectangle_int_t. 34 */ 35 36 /** 37 * Checks if the two given rectangles are equal. 38 * 39 * Params: 40 * rect2 = a #GdkRectangle 41 * 42 * Returns: %TRUE if the rectangles are equal. 43 * 44 * Since: 3.20 45 */ 46 public bool equal(GdkRectangle* rect1, GdkRectangle* rect2) 47 { 48 return gdk_rectangle_equal(rect1, rect2) != 0; 49 } 50 51 /** 52 * Calculates the intersection of two rectangles. It is allowed for 53 * @dest to be the same as either @src1 or @src2. If the rectangles 54 * do not intersect, @dest’s width and height is set to 0 and its x 55 * and y values are undefined. If you are only interested in whether 56 * the rectangles intersect, but not in the intersecting area itself, 57 * pass %NULL for @dest. 58 * 59 * Params: 60 * src2 = a #GdkRectangle 61 * dest = return location for the 62 * intersection of @src1 and @src2, or %NULL 63 * 64 * Returns: %TRUE if the rectangles intersect. 65 */ 66 public bool intersect(GdkRectangle* src1, GdkRectangle* src2, out GdkRectangle dest) 67 { 68 return gdk_rectangle_intersect(src1, src2, &dest) != 0; 69 } 70 71 /** 72 * Calculates the union of two rectangles. 73 * The union of rectangles @src1 and @src2 is the smallest rectangle which 74 * includes both @src1 and @src2 within it. 75 * It is allowed for @dest to be the same as either @src1 or @src2. 76 * 77 * Note that this function does not ignore 'empty' rectangles (ie. with 78 * zero width or height). 79 * 80 * Params: 81 * src2 = a #GdkRectangle 82 * dest = return location for the union of @src1 and @src2 83 */ 84 public void unio(GdkRectangle* src1, GdkRectangle* src2, out GdkRectangle dest) 85 { 86 gdk_rectangle_union(src1, src2, &dest); 87 }