Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Member Functions
Xfc::Gdk::Point Class Reference

A GdkPoint C++ wrapper class. More...

#include <xfc/gdk/types.hh>

List of all members.

Public Member Functions

Constructors

Detailed Description

A GdkPoint C++ wrapper class.

Point is a simple object containing the x and y coordinate of a point. Point uses default copy, assignment and destruction.


Constructor & Destructor Documentation

Xfc::Gdk::Point::Point ( int  x,
int  y 
)

Construct a new point from two ints.

Parameters:
xThe X coordinate of the point.
yThe Y coordinate of the point.
Xfc::Gdk::Point::Point ( double  x,
double  y 
)

Construct a new point form two doubles.

Parameters:
xThe X coordinate of the point.
yThe Y coordinate of the point.
Xfc::Gdk::Point::Point ( const GdkPoint &  point)

Construct a new point from an existing GdkPoint.

Parameters:
pointA GdkPoint.

Member Function Documentation

Point& Xfc::Gdk::Point::offset ( int  dx,
int  dy 
)

Move the point.

Parameters:
dxThe number of pixels to move the X coordinate of the point.
dyThe number of pixels to move the Y coordinate of the point.
Returns:
A reference to the offset point.

dx and dy can be a positive or negative value.

Point Xfc::Gdk::Point::offset_by ( int  dx,
int  dy 
)

Calculates a new point whose value is x + dx and y + dy.

Parameters:
dxThe number of pixels to add the X coordinate of the point.
dyThe number of pixels to add the Y coordinate of the point.
Returns:
A new point.

dx and dy can be a positive or negative value.

bool Xfc::Gdk::Point::operator!= ( const Point other) const

Inequality operator.

Parameters:
otherA Point.
Returns:
true if this point compares unequal to other.
Point Xfc::Gdk::Point::operator+ ( const Point other) const

Calculates a new point whose value is x + other.x and y + other.y.

Parameters:
otherA Point.
Returns:
A new point.
Point& Xfc::Gdk::Point::operator++ ( )

Move the x, y coordinates of the point by one pixel in a positive direction.

Returns:
A reference to the moved point.
Point& Xfc::Gdk::Point::operator+= ( int  increment)

Move the x, y coordinates of the point by increment pixels in a positive direction.

Parameters:
incrementThe number of pixels to increment x, y by.
Returns:
A reference to the moved point.
Point& Xfc::Gdk::Point::operator+= ( const Point other)

Move the x, y coordinates of the point by the other.x and other.y.

Parameters:
otherA Point.
Returns:
A reference to the moved point.
Point Xfc::Gdk::Point::operator- ( const Point other) const

Calculates a new point whose value is x - other.x and y - other.y.

Parameters:
otherA Point.
Returns:
A new point.
Point& Xfc::Gdk::Point::operator-- ( )

Move the x, y coordinates of the point by one pixel in a negative direction.

Returns:
A reference to the moved point.
Point& Xfc::Gdk::Point::operator-= ( int  decrement)

Move the x, y coordinates of the point by decrement pixels in a negative direction.

Parameters:
decrementThe number of pixels to decrement x, y by.
Returns:
A reference to the moved point.
Point& Xfc::Gdk::Point::operator-= ( const Point other)

Move the x, y coordinates of the point by the -other.x and -other.y.

Parameters:
otherA Point.
Returns:
A reference to the moved point.
bool Xfc::Gdk::Point::operator== ( const Point other) const

Equality operator.

Parameters:
otherA Point.
Returns:
true if this point compares equal to other.
void Xfc::Gdk::Point::set ( int  x,
int  y 
)

Set the coordinates for the point.

Parameters:
xThe X coordinate of the point.
yThe Y coordinate of the point.
void Xfc::Gdk::Point::set ( double  x,
double  y 
)

Set the coordinates for the point.

Parameters:
xThe X coordinate of the point.
yThe Y coordinate of the point.
void Xfc::Gdk::Point::set_x ( int  x)

Set the x coordinate for the point.

Parameters:
xThe X coordinate of the point.
void Xfc::Gdk::Point::set_x ( double  x)

Set the x coordinate for the point.

Parameters:
xThe X coordinate of the point.
void Xfc::Gdk::Point::set_y ( int  y)

Set the y coordinate for the point.

Parameters:
yThe Y coordinate of the point.
void Xfc::Gdk::Point::set_y ( double  y)

Set the y coordinate for the point.

Parameters:
yThe Y coordinate of the point.

The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC