/usr/include/d/gtkd-3/cairo/Region.d is in libgtkd-3-dev 3.7.5-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | /*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
/*
* Conversion parameters:
* inFile = cairo-Regions.html
* outPack = cairo
* outFile = Region
* strct = cairo_region_t
* realStrct=
* ctorStrct=
* clss = Region
* interf =
* class Code: No
* interface Code: No
* template for:
* extend =
* implements:
* prefixes:
* - cairo_region_
* omit structs:
* omit prefixes:
* omit code:
* omit signals:
* imports:
* structWrap:
* - cairo_region_t* -> Region
* module aliases:
* local aliases:
* overrides:
*/
module cairo.Region;
public import cairo.c.types;
private import cairo.c.functions;
private import glib.ConstructionException;
/**
* Regions are a simple graphical data type representing an area of
* integer-aligned rectangles. They are often used on raster surfaces
* to track areas of interest, such as change or clip areas.
*/
public class Region
{
/** the main Gtk struct */
protected cairo_region_t* cairo_region;
/** Get the main Gtk struct */
public cairo_region_t* getRegionStruct()
{
return cairo_region;
}
/** the main Gtk struct as a void* */
protected void* getStruct()
{
return cast(void*)cairo_region;
}
/**
* Sets our main struct and passes it to the parent class
*/
public this (cairo_region_t* cairo_region)
{
this.cairo_region = cairo_region;
}
/**
*/
/**
* Allocates a new empty region object.
* Since 1.10
* Returns: A newly allocated cairo_region_t. Free with cairo_region_destroy(). This function always returns a valid pointer; if memory cannot be allocated, then a special error object is returned where all operations on the object do nothing. You can check for this with cairo_region_status().
*/
public static Region create()
{
// cairo_region_t * cairo_region_create (void);
auto p = cairo_region_create();
if(p is null)
{
return null;
}
return new Region(cast(cairo_region_t*) p);
}
/**
* Allocates a new region object containing rectangle.
* Since 1.10
* Params:
* rectangle = a cairo_rectangle_int_t
* Returns: A newly allocated cairo_region_t. Free with cairo_region_destroy(). This function always returns a valid pointer; if memory cannot be allocated, then a special error object is returned where all operations on the object do nothing. You can check for this with cairo_region_status().
*/
public static Region createRectangle(ref cairo_rectangle_int_t rectangle)
{
// cairo_region_t * cairo_region_create_rectangle (const cairo_rectangle_int_t *rectangle);
auto p = cairo_region_create_rectangle(&rectangle);
if(p is null)
{
return null;
}
return new Region(cast(cairo_region_t*) p);
}
/**
* Allocates a new region object containing the union of all given rects.
* Since 1.10
* Params:
* rects = an array of count rectangles
* Returns: A newly allocated cairo_region_t. Free with cairo_region_destroy(). This function always returns a valid pointer; if memory cannot be allocated, then a special error object is returned where all operations on the object do nothing. You can check for this with cairo_region_status().
*/
public static Region createRectangles(cairo_rectangle_int_t[] rects)
{
// cairo_region_t * cairo_region_create_rectangles (const cairo_rectangle_int_t *rects, int count);
auto p = cairo_region_create_rectangles(rects.ptr, cast(int) rects.length);
if(p is null)
{
return null;
}
return new Region(cast(cairo_region_t*) p);
}
/**
* Allocates a new region object copying the area from original.
* Since 1.10
* Returns: A newly allocated cairo_region_t. Free with cairo_region_destroy(). This function always returns a valid pointer; if memory cannot be allocated, then a special error object is returned where all operations on the object do nothing. You can check for this with cairo_region_status().
*/
public Region copy()
{
// cairo_region_t * cairo_region_copy (const cairo_region_t *original);
auto p = cairo_region_copy(cairo_region);
if(p is null)
{
return null;
}
return new Region(cast(cairo_region_t*) p);
}
/**
* Increases the reference count on region by one. This prevents
* region from being destroyed until a matching call to
* cairo_region_destroy() is made.
* Since 1.10
* Returns: the referenced cairo_region_t.
*/
public Region reference()
{
// cairo_region_t * cairo_region_reference (cairo_region_t *region);
auto p = cairo_region_reference(cairo_region);
if(p is null)
{
return null;
}
return new Region(cast(cairo_region_t*) p);
}
/**
* Destroys a cairo_region_t object created with
* cairo_region_create(), cairo_region_copy(), or
* or cairo_region_create_rectangle().
* Since 1.10
*/
public void destroy()
{
// void cairo_region_destroy (cairo_region_t *region);
cairo_region_destroy(cairo_region);
}
/**
* Checks whether an error has previous occurred for this
* region object.
* Since 1.10
* Returns: CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY
*/
public cairo_status_t status()
{
// cairo_status_t cairo_region_status (const cairo_region_t *region);
return cairo_region_status(cairo_region);
}
/**
* Gets the bounding rectangle of region as a cairo_rectangle_int_t
* Since 1.10
* Params:
* extents = rectangle into which to store the extents
*/
public void getExtents(out cairo_rectangle_int_t extents)
{
// void cairo_region_get_extents (const cairo_region_t *region, cairo_rectangle_int_t *extents);
cairo_region_get_extents(cairo_region, &extents);
}
/**
* Returns the number of rectangles contained in region.
* Since 1.10
* Returns: The number of rectangles contained in region.
*/
public int numRectangles()
{
// int cairo_region_num_rectangles (const cairo_region_t *region);
return cairo_region_num_rectangles(cairo_region);
}
/**
* Stores the nth rectangle from the region in rectangle.
* Since 1.10
* Params:
* nth = a number indicating which rectangle should be returned
* rectangle = return location for a cairo_rectangle_int_t
*/
public void getRectangle(int nth, out cairo_rectangle_int_t rectangle)
{
// void cairo_region_get_rectangle (const cairo_region_t *region, int nth, cairo_rectangle_int_t *rectangle);
cairo_region_get_rectangle(cairo_region, nth, &rectangle);
}
/**
* Checks whether region is empty.
* Since 1.10
* Returns: TRUE if region is empty, FALSE if it isn't.
*/
public cairo_bool_t isEmpty()
{
// cairo_bool_t cairo_region_is_empty (const cairo_region_t *region);
return cairo_region_is_empty(cairo_region);
}
/**
* Checks whether (x, y) is contained in region.
* Since 1.10
* Params:
* x = the x coordinate of a point
* y = the y coordinate of a point
* Returns: TRUE if (x, y) is contained in region, FALSE if it is not.
*/
public cairo_bool_t containsPoint(int x, int y)
{
// cairo_bool_t cairo_region_contains_point (const cairo_region_t *region, int x, int y);
return cairo_region_contains_point(cairo_region, x, y);
}
/**
* Checks whether rectangle is inside, outside or partially contained
* in region
* Since 1.10
* Params:
* region = a cairo_region_t
* rectangle = a cairo_rectangle_int_t
* Returns: CAIRO_REGION_OVERLAP_IN if rectangle is entirely inside region, CAIRO_REGION_OVERLAP_OUT if rectangle is entirely outside region, or CAIRO_REGION_OVERLAP_PART if rectangle is partially inside and partially outside region.
*/
public cairo_region_overlap_t containsRectangle(ref cairo_rectangle_int_t rectangle)
{
// cairo_region_overlap_t cairo_region_contains_rectangle (const cairo_region_t *region, const cairo_rectangle_int_t *rectangle);
return cairo_region_contains_rectangle(cairo_region, &rectangle);
}
/**
* Compares whether region_a is equivalent to region_b. NULL as an argument
* is equal to itself, but not to any non-NULL region.
* Since 1.10
* Params:
* a = a cairo_region_t or NULL
* b = a cairo_region_t or NULL
* Returns: TRUE if both regions contained the same coverage, FALSE if it is not or any region is in an error status.
*/
public cairo_bool_t equal(Region b)
{
// cairo_bool_t cairo_region_equal (const cairo_region_t *a, const cairo_region_t *b);
return cairo_region_equal(cairo_region, (b is null) ? null : b.getRegionStruct());
}
/**
* Translates region by (dx, dy).
* Since 1.10
* Params:
* dx = Amount to translate in the x direction
* dy = Amount to translate in the y direction
*/
public void translate(int dx, int dy)
{
// void cairo_region_translate (cairo_region_t *region, int dx, int dy);
cairo_region_translate(cairo_region, dx, dy);
}
/**
* Computes the intersection of dst with other and places the result in dst
* Since 1.10
* Params:
* other = another cairo_region_t
* Returns: CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY
*/
public cairo_status_t intersect(Region other)
{
// cairo_status_t cairo_region_intersect (cairo_region_t *dst, const cairo_region_t *other);
return cairo_region_intersect(cairo_region, (other is null) ? null : other.getRegionStruct());
}
/**
* Computes the intersection of dst with rectangle and places the
* result in dst
* Since 1.10
* Params:
* rectangle = a cairo_rectangle_int_t
* Returns: CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY
*/
public cairo_status_t intersectRectangle(ref cairo_rectangle_int_t rectangle)
{
// cairo_status_t cairo_region_intersect_rectangle (cairo_region_t *dst, const cairo_rectangle_int_t *rectangle);
return cairo_region_intersect_rectangle(cairo_region, &rectangle);
}
/**
* Subtracts other from dst and places the result in dst
* Since 1.10
* Params:
* other = another cairo_region_t
* Returns: CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY
*/
public cairo_status_t subtract(Region other)
{
// cairo_status_t cairo_region_subtract (cairo_region_t *dst, const cairo_region_t *other);
return cairo_region_subtract(cairo_region, (other is null) ? null : other.getRegionStruct());
}
/**
* Subtracts rectangle from dst and places the result in dst
* Since 1.10
* Params:
* rectangle = a cairo_rectangle_int_t
* Returns: CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY
*/
public cairo_status_t subtractRectangle(ref cairo_rectangle_int_t rectangle)
{
// cairo_status_t cairo_region_subtract_rectangle (cairo_region_t *dst, const cairo_rectangle_int_t *rectangle);
return cairo_region_subtract_rectangle(cairo_region, &rectangle);
}
/**
* Computes the union of dst with other and places the result in dst
* Since 1.10
* Params:
* other = another cairo_region_t
* Returns: CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY
*/
public cairo_status_t unio(Region other)
{
// cairo_status_t cairo_region_union (cairo_region_t *dst, const cairo_region_t *other);
return cairo_region_union(cairo_region, (other is null) ? null : other.getRegionStruct());
}
/**
* Computes the union of dst with rectangle and places the result in dst.
* Since 1.10
* Params:
* rectangle = a cairo_rectangle_int_t
* Returns: CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY
*/
public cairo_status_t unionRectangle(ref cairo_rectangle_int_t rectangle)
{
// cairo_status_t cairo_region_union_rectangle (cairo_region_t *dst, const cairo_rectangle_int_t *rectangle);
return cairo_region_union_rectangle(cairo_region, &rectangle);
}
/**
* Computes the exclusive difference of dst with other and places the
* result in dst. That is, dst will be set to contain all areas that
* are either in dst or in other, but not in both.
* Since 1.10
* Params:
* other = another cairo_region_t
* Returns: CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY
*/
public cairo_status_t xor(Region other)
{
// cairo_status_t cairo_region_xor (cairo_region_t *dst, const cairo_region_t *other);
return cairo_region_xor(cairo_region, (other is null) ? null : other.getRegionStruct());
}
/**
* Computes the exclusive difference of dst with rectangle and places the
* result in dst. That is, dst will be set to contain all areas that are
* either in dst or in rectangle, but not in both.
* Since 1.10
* Params:
* rectangle = a cairo_rectangle_int_t
* Returns: CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY
*/
public cairo_status_t xorRectangle(ref cairo_rectangle_int_t rectangle)
{
// cairo_status_t cairo_region_xor_rectangle (cairo_region_t *dst, const cairo_rectangle_int_t *rectangle);
return cairo_region_xor_rectangle(cairo_region, &rectangle);
}
}
|