Ardour  9.0-pre0-384-ga76afae0e9
Gdk::Region Class Reference

#include <region.h>

Public Member Functions

 Region ()
 
 Region (GdkRegion *castitem, bool make_a_copy=false)
 
 Region (const Region &src)
 
Regionoperator= (const Region &src)
 
 ~Region ()
 
GdkRegiongobj ()
 
const GdkRegiongobj () const
 
GdkRegiongobj_copy () const
 Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs. More...
 
 Region (const Glib::ArrayHandle< Gdk::Point > &points, FillRule fill_rule)
 
 Region (const Rectangle &rectangle)
 
void get_clipbox (const Rectangle &rectangle)
 
Glib::ArrayHandle< Rectangleget_rectangles () const
 
bool empty ()
 
bool point_in (int x, int y)
 
OverlapType rect_in (const Rectangle &rect)
 
void offset (int dx, int dy)
 
void shrink (int dx, int dy)
 
void union_with_rect (const Rectangle &rect)
 
void intersect (const Region &source2)
 
void union_ (const Region &source2)
 
void subtract (const Region &source2)
 
void xor_ (const Region &source2)
 
void spans_intersect_foreach (GdkSpan *spans, int n_spans, bool sorted, GdkSpanFunc function, gpointer data)
 

Protected Attributes

GdkRegiongobject_
 

Related Functions

(Note that these are not member functions.)

bool operator== (const Region &lhs, const Region &rhs)
 
bool operator!= (const Region &lhs, const Region &rhs)
 
Gdk::Region wrap (GdkRegion *object, bool take_copy=false)
 

Detailed Description

This is an opaque data type holding a set of arbitrary pixels, and is usually used for clipping graphical operations (see Gdk::GC::set_clip_region()).

Definition at line 144 of file tk/ydkmm/ydkmm/gdkmm/region.h.

Constructor & Destructor Documentation

◆ Region() [1/5]

Gdk::Region::Region ( )

Constructs an invalid object. E.g. for output arguments to methods. There is not much you can do with the object before it has been assigned a valid value.

◆ Region() [2/5]

Gdk::Region::Region ( GdkRegion castitem,
bool  make_a_copy = false 
)
explicit

◆ Region() [3/5]

Gdk::Region::Region ( const Region src)

◆ ~Region()

Gdk::Region::~Region ( )

◆ Region() [4/5]

Gdk::Region::Region ( const Glib::ArrayHandle< Gdk::Point > &  points,
FillRule  fill_rule 
)

◆ Region() [5/5]

Gdk::Region::Region ( const Rectangle rectangle)
explicit

Member Function Documentation

◆ empty()

bool Gdk::Region::empty ( )

Finds out if the Gdk::Region is empty.

Returns
true if region is empty.

◆ get_clipbox()

void Gdk::Region::get_clipbox ( const Rectangle rectangle)

Obtains the smallest rectangle which includes the entire Gdk::Region.

Parameters
rectangleReturn location for the clipbox.

◆ get_rectangles()

Glib::ArrayHandle<Rectangle> Gdk::Region::get_rectangles ( ) const

◆ gobj() [1/2]

GdkRegion* Gdk::Region::gobj ( )
inline

Definition at line 166 of file tk/ydkmm/ydkmm/gdkmm/region.h.

◆ gobj() [2/2]

const GdkRegion* Gdk::Region::gobj ( ) const
inline

Definition at line 167 of file tk/ydkmm/ydkmm/gdkmm/region.h.

◆ gobj_copy()

GdkRegion* Gdk::Region::gobj_copy ( ) const

Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.

◆ intersect()

void Gdk::Region::intersect ( const Region source2)

Sets the area of source1 to the intersection of the areas of source1 and source2. The resulting area is the set of pixels contained in both source1 and source2.

Parameters
source2Another Gdk::Region.

◆ offset()

void Gdk::Region::offset ( int  dx,
int  dy 
)

Moves a region the specified distance.

Parameters
dxThe distance to move the region horizontally.
dyThe distance to move the region vertically.

◆ operator=()

Region& Gdk::Region::operator= ( const Region src)

◆ point_in()

bool Gdk::Region::point_in ( int  x,
int  y 
)

Finds out if a point is in a region.

Parameters
xThe x coordinate of a point.
yThe y coordinate of a point.
Returns
true if the point is in region.

◆ rect_in()

OverlapType Gdk::Region::rect_in ( const Rectangle rect)

Tests whether a rectangle is within a region.

Parameters
rectA Gdk::Rectangle.
Returns
Gdk::OVERLAP_RECTANGLE_IN, Gdk::OVERLAP_RECTANGLE_OUT, or Gdk::OVERLAP_RECTANGLE_PART, depending on whether the rectangle is inside, outside, or partly inside the Gdk::Region, respectively.

◆ shrink()

void Gdk::Region::shrink ( int  dx,
int  dy 
)

Resizes a region by the specified amount. Positive values shrink the region. Negative values expand it.

Deprecated: 2.22: There is no replacement for this function.

Parameters
dxThe number of pixels to shrink the region horizontally.
dyThe number of pixels to shrink the region vertically.

◆ spans_intersect_foreach()

void Gdk::Region::spans_intersect_foreach ( GdkSpan spans,
int  n_spans,
bool  sorted,
GdkSpanFunc  function,
gpointer  data 
)

Calls a function on each span in the intersection of region and spans.

Deprecated: 2.22: There is no replacement.

Parameters
spansAn array of Gdk::Spans.
n_spansThe length of spans.
sortedtrue if spans is sorted wrt. the y coordinate.
functionFunction to call on each span in the intersection.
dataData to pass to function.

◆ subtract()

void Gdk::Region::subtract ( const Region source2)

Subtracts the area of source2 from the area source1. The resulting area is the set of pixels contained in source1 but not in source2.

Parameters
source2Another Gdk::Region.

◆ union_()

void Gdk::Region::union_ ( const Region source2)

Sets the area of source1 to the union of the areas of source1 and source2. The resulting area is the set of pixels contained in either source1 or source2.

Parameters
source2A Gdk::Region.

◆ union_with_rect()

void Gdk::Region::union_with_rect ( const Rectangle rect)

Sets the area of region to the union of the areas of region and rect. The resulting area is the set of pixels contained in either region or rect.

Parameters
rectA Gdk::Rectangle.

◆ xor_()

void Gdk::Region::xor_ ( const Region source2)

Sets the area of source1 to the exclusive-OR of the areas of source1 and source2. The resulting area is the set of pixels contained in one or the other of the two sources but not in both.

Parameters
source2Another Gdk::Region.

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( const Region lhs,
const Region rhs 
)
related
Parameters
lhsThe left-hand side
rhsThe right-hand side
Returns
The result

◆ operator==()

bool operator== ( const Region lhs,
const Region rhs 
)
related
Parameters
lhsThe left-hand side
rhsThe right-hand side
Returns
The result

◆ wrap()

Gdk::Region wrap ( GdkRegion object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.

Member Data Documentation

◆ gobject_

GdkRegion* Gdk::Region::gobject_
protected

Definition at line 173 of file tk/ydkmm/ydkmm/gdkmm/region.h.


The documentation for this class was generated from the following file: