gccv::Canvas Class Reference
the
Canvas class
More...
#include <gccv/canvas.h>
List of all members.
Detailed Description
the
Canvas class
This class is the container class for the items and is the only one interacting with the underlying Gtk+ framework. It uses a private widget derived from GtkDrawingArea.
Definition at line 54 of file canvas.h.
Constructor & Destructor Documentation
gccv::Canvas::Canvas |
( |
Client * |
client |
) |
|
- Parameters:
-
| client | the gccv::Client for the canvas or NULL. |
Constructs a canvas for
client which is mandatory if some interaction with the canvas is needed.
virtual gccv::Canvas::~Canvas |
( |
|
) |
[virtual] |
The destructor. You should not delete the canvas, as it will be destroyed with the enclosing widget. Instead, if you never show the widget in a window, use:
gtk_widget_destroy (canvas->GetWidget ());
Items are stored in an ordered tree whose top node is a gccv::Group instance which can be accessed by the GetRoot() method.
Member Function Documentation
gccv::Canvas::GetBackgroundColor |
( |
void |
|
) |
const [inline] |
- Returns:
- the background color.
Definition at line 153 of file canvas.h.
gccv::Canvas::GetGap |
( |
void |
|
) |
const [inline] |
- Returns:
- the current gap for the canvas.
Definition at line 149 of file canvas.h.
Item* gccv::Canvas::GetItemAt |
( |
double |
x, |
|
|
double |
y | |
|
) |
| | |
- Parameters:
-
| x | the x coordiante. |
| y | the y coordinate. |
Used to get the top item at or near the given position.
- Returns:
- the found item or NULL if no item is nearer than the current gap from the given position.
gccv::Canvas::GetRefGap |
( |
void |
|
) |
[inline] |
- Returns:
- the current gap for the canvas as a reference.
Definition at line 149 of file canvas.h.
gccv::Canvas::GetRoot |
( |
void |
|
) |
const [inline] |
- Returns:
- the root item.
Definition at line 131 of file canvas.h.
GtkWidget* gccv::Canvas::GetWidget |
( |
void |
|
) |
[inline] |
- Returns:
- the widget used by the canvas.
Definition at line 90 of file canvas.h.
gccv::Canvas::GetZoom |
( |
void |
|
) |
const [inline] |
- Returns:
- the current zoom level for the canvas.
Definition at line 127 of file canvas.h.
void gccv::Canvas::Invalidate |
( |
double |
x0, |
|
|
double |
y0, |
|
|
double |
x1, |
|
|
double |
y1 | |
|
) |
| | |
- Parameters:
-
| x0 | the x coordinate for the top left of the invalidated rectangle. |
| y0 | the y coordinate for the top left of the scrolling rectangle. |
| x1 | the x coordinate for the bottom right of the scrolling rectangle. |
| y1 | the y coordinate for the bottom right of the scrolling rectangle. |
void gccv::Canvas::Render |
( |
cairo_t * |
cr, |
|
|
bool |
is_vector | |
|
) |
| | |
- Parameters:
-
| cr | a cairo context. |
| is_vector | whether the cairo context is vectorial or raster. |
Renders the current canvas to the cairo context.
void gccv::Canvas::SetBackgroundColor |
( |
GOColor |
color |
) |
|
- Parameters:
-
Sets the background color for the canvas widget
gccv::Canvas::SetGap |
( |
double |
gap |
) |
[inline] |
- Parameters:
-
| gap | a distance at which an item might be from an event location to be selected for the event. |
Sets the maximum distance at which an item might be from an event location to be selected for the event. When an even as a mouse button click occurs, and if it occurs on an item, the appropriate method of the item client will be called; else if it occurs on the background, the nearest item will be used if its distance from the event location is less than
gap. If no item can be used, the event will have no associated gccv::ItemClient instance.
Definition at line 149 of file canvas.h.
void gccv::Canvas::SetZoom |
( |
double |
zoom |
) |
|
- Parameters:
-
Sets the zoom level for the canvas.
The documentation for this class was generated from the following file: