Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gdk::Point Class Reference

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

`#include <inti/gdk/types.h>`

List of all members.

## Public Member Functions

Constructors

- Point ()
    Construct a new point (0, 0).
- Point (int x, int y)
    Construct a new point from two ints.
- Point (double x, double y)
    Construct a new point form two doubles.
- Point (const GdkPoint &point)
    Construct a new point from an existing GdkPoint.

Accessors

- GdkPoint * gdk_point () const
    Get a pointer to the GdkPoint structure.
- operator GdkPoint * () const
    Conversion operator; safely converts a Point to a GdkPoint pointer.
- int x () const
    Returns the X coordinate of the point.
- int y () const
    Returns the Y coordinate of the point.
- bool operator== (const Point &other) const
    Equality operator.
- bool operator!= (const Point &other) const
    Inequality operator.

Methods

- void set_x (int x)
    Set the x coordinate for the point.
- void set_x (double x)
    Set the x coordinate for the point.
- void set_y (int y)
    Set the y coordinate for the point.
- void set_y (double y)
    Set the y coordinate for the point.
- void set (int x, int y)
    Set the coordinates for the point.
- void set (double x, double y)
    Set the coordinates for the point.
- Point & offset (int dx, int dy)
    Move the point.
- Point & operator+= (int increment)
    Move the x, y coordinates of the point by increment pixels in a positive direction.
- Point & operator+= (const Point &other)
    Move the x, y coordinates of the point by the other.x and other.y.
- Point & operator-= (int decrement)
    Move the x, y coordinates of the point by decrement pixels in a negative direction.
- Point & operator-= (const Point &other)
    Move the x, y coordinates of the point by the -other.x and -other.y.
- Point & operator++ ()
    Move the x, y coordinates of the point by one pixel in a positive direction.
- Point & operator-- ()
    Move the x, y coordinates of the point by one pixel in a negative direction.

Methods returning a new Point

- Point offset_by (int dx, int dy)
    Calculates a new point whose value is x + dx and y + dy.
- Point operator+ (const Point &other) const
    Calculates a new point whose value is x + other.x and y + other.y.
- Point operator- (const Point &other) const
    Calculates a new point whose value is x - other.x and y - other.y.

## 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

Inti::Gdk::Point::Point | ( | int | x,
|  | int | y
| ) |

Construct a new point from two ints.

Parameters:

  x | The X coordinate of the point.
  y | The Y coordinate of the point.

Inti::Gdk::Point::Point | ( | double | x,
|  | double | y
| ) |

Construct a new point form two doubles.

Parameters:

  x | The X coordinate of the point.
  y | The Y coordinate of the point.

Inti::Gdk::Point::Point | ( | const GdkPoint & | point | ) |

Construct a new point from an existing GdkPoint.

Parameters:

  point | A GdkPoint.

## Member Function Documentation

Point& Inti::Gdk::Point::offset | ( | int | dx,
|  | int | dy
| ) |

Move the point.

Parameters:

  dx | The number of pixels to move the X coordinate of the point.
  dy | The 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 Inti::Gdk::Point::offset_by | ( | int | dx,
|  | int | dy
| ) |

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

Parameters:

  dx | The number of pixels to add the X coordinate of the point.
  dy | The 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 Inti::Gdk::Point::operator!= | ( | const Point & | other | ) | const

Inequality operator.

Parameters:

  other | A Point.

Returns:
  true if this point compares unequal to other.

Point Inti::Gdk::Point::operator+ | ( | const Point & | other | ) | const

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

Parameters:

  other | A Point.

Returns:
  A new point.

Point& Inti::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& Inti::Gdk::Point::operator+= | ( | const Point & | other | ) |

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

Parameters:

  other | A Point.

Returns:
  A reference to the moved point.

Point& Inti::Gdk::Point::operator+= | ( | int | increment | ) |

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

Parameters:

  increment | The number of pixels to increment x, y by.

Returns:
  A reference to the moved point.

Point Inti::Gdk::Point::operator- | ( | const Point & | other | ) | const

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

Parameters:

  other | A Point.

Returns:
  A new point.

Point& Inti::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& Inti::Gdk::Point::operator-= | ( | const Point & | other | ) |

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

Parameters:

  other | A Point.

Returns:
  A reference to the moved point.

Point& Inti::Gdk::Point::operator-= | ( | int | decrement | ) |

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

Parameters:

  decrement | The number of pixels to decrement x, y by.

Returns:
  A reference to the moved point.

bool Inti::Gdk::Point::operator== | ( | const Point & | other | ) | const

Equality operator.

Parameters:

  other | A Point.

Returns:
  true if this point compares equal to other.

void Inti::Gdk::Point::set | ( | double | x,
|  | double | y
| ) |

Set the coordinates for the point.

Parameters:

  x | The X coordinate of the point.
  y | The Y coordinate of the point.

void Inti::Gdk::Point::set | ( | int | x,
|  | int | y
| ) |

Set the coordinates for the point.

Parameters:

  x | The X coordinate of the point.
  y | The Y coordinate of the point.

void Inti::Gdk::Point::set_x | ( | double | x | ) |

Set the x coordinate for the point.

Parameters:

  x | The X coordinate of the point.

void Inti::Gdk::Point::set_x | ( | int | x | ) |

Set the x coordinate for the point.

Parameters:

  x | The X coordinate of the point.

void Inti::Gdk::Point::set_y | ( | double | y | ) |

Set the y coordinate for the point.

Parameters:

  y | The Y coordinate of the point.

void Inti::Gdk::Point::set_y | ( | int | y | ) |

Set the y coordinate for the point.

Parameters:

  y | The Y coordinate of the point.

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

- gdk/types.h

Main Page - Footer