#include <canvas.h>
Inheritance diagram for Gnome::Canvas::Canvas:
Public Member Functions | |
virtual | ~Canvas () |
GnomeCanvas * | gobj () |
Provides access to the underlying C GtkObject. | |
const GnomeCanvas * | gobj () const |
Provides access to the underlying C GtkObject. | |
Canvas () | |
Group * | root () const |
Queries the root group of a canvas. | |
void | set_scroll_region (double x1, double y1, double x2, double y2) |
Sets the scrolling region of a canvas to the specified rectangle. | |
void | get_scroll_region (double &x1, double &y1, double &x2, double &y2) const |
Queries the scrolling region of a canvas. | |
void | set_center_scroll_region (bool center) |
When the scrolling region of the canvas is smaller than the canvas window, e.g. the allocation of the canvas, it can be either centered on the window or simply made to be on the upper-left corner on the window. | |
bool | get_center_scroll_region () const |
Returns whether the canvas is set to center the scrolling region in the window if the former is smaller than the canvas' allocation. | |
void | set_pixels_per_unit (double n=1.0) |
Sets the zooming factor of a canvas by specifying the number of pixels that correspond to one canvas unit. | |
void | scroll_to (int x, int y) |
Makes a canvas scroll to the specified offsets, given in canvas pixel units. | |
void | get_scroll_offsets (int &cx, int &cy) const |
Queries the scrolling offsets of a canvas. | |
void | update_now () |
Forces an immediate update and redraw of a canvas. | |
Item * | get_item_at (double x, double y) const |
Looks for the item that is under the specified position, which must be specified in world coordinates. | |
void | request_redraw (int x1, int y1, int x2, int y2) |
Convenience function that informs a canvas that the specified rectangle needs to be repainted. | |
void | request_redraw (ArtUta *uta) |
Informs a canvas that the specified area, given as a microtile array, needs to be repainted. | |
Art::AffineTrans | w2c_affine () const |
void | w2c (double wx, double wy, int &cx, int &cy) const |
Converts world coordinates into canvas pixel coordinates. | |
void | w2c (double wx, double wy, double &cx, double &cy) const |
Converts world coordinates into canvas pixel coordinates. | |
void | c2w (int cx, int cy, double &wx, double &wy) const |
Converts canvas pixel coordinates to world coordinates. | |
void | window_to_world (double winx, double winy, double &worldx, double &worldy) const |
Converts window-relative coordinates into world coordinates. | |
void | world_to_window (double worldx, double worldy, double &winx, double &winy) const |
Converts world coordinates into window-relative coordinates. | |
bool | get_color (const Glib::ustring &spec, Gdk::Color &color) const |
gulong | get_color_pixel (guint rgba) const |
Allocates a color from the RGBA value passed into this function. | |
void | set_stipple_origin (const Glib::RefPtr< Gdk::GC > &gc) |
Sets the stipple origin of the specified GC as is appropriate for the canvas, so that it will be aligned with other stipple patterns used by canvas items. | |
void | set_dither (GdkRgbDither dither) |
Controls dithered rendering for antialiased canvases. | |
GdkRgbDither | get_dither () const |
Returns the type of dithering used to render an antialiased canvas. | |
void | update_svp (ArtSVP **p_svp, ArtSVP *new_svp) |
Sets the svp to the new value, requesting repaint on what's changed. | |
void | update_svp_clip (ArtSVP **p_svp, ArtSVP *new_svp, ArtSVP *clip_svp) |
Sets the svp to the new value, clipping if necessary, and requesting repaint on what's changed. | |
double | get_pixels_per_unit () const |
Glib::SignalProxy5< void, const Glib::RefPtr< Gdk::Drawable > &, int, int, int, int > | signal_draw_background () |
Glib::SignalProxy1< void, GnomeCanvasBuf * > | signal_render_background () |
Glib::PropertyProxy< bool > | property_aa () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Protected Member Functions | |
virtual void | request_update_vfunc () |
virtual void | on_draw_background (const Glib::RefPtr< Gdk::Drawable > &drawable, int x, int y, int width, int height) |
virtual void | on_render_background (GnomeCanvasBuf *buf) |
Related Functions | |
(Note that these are not member functions.) | |
Gnome::Canvas::Canvas * | wrap (GnomeCanvas *object, bool take_copy=false) |
There are functions to transform from one to the other.
|
|
|
|
|
Converts canvas pixel coordinates to world coordinates.
|
|
Returns whether the canvas is set to center the scrolling region in the window if the former is smaller than the canvas' allocation.
|
|
|
|
Allocates a color from the RGBA value passed into this function. The alpha opacity value is discarded, since normal X colors do not support it.
|
|
Returns the type of dithering used to render an antialiased canvas.
|
|
Looks for the item that is under the specified position, which must be specified in world coordinates.
|
|
|
|
Queries the scrolling offsets of a canvas. The values are returned in canvas pixel units.
|
|
Queries the scrolling region of a canvas.
|
|
Provides access to the underlying C GtkObject.
|
|
Provides access to the underlying C GtkObject.
|
|
|
|
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Informs a canvas that the specified area, given as a microtile array, needs to be repainted. To be used only by item implementations.
|
|
Convenience function that informs a canvas that the specified rectangle needs to be repainted. This function converts the rectangle to a microtile array and feeds it to request_redraw_uta(). The rectangle includes and , but not and . To be used only by item implementations.
|
|
|
|
Queries the root group of a canvas.
|
|
Makes a canvas scroll to the specified offsets, given in canvas pixel units. The canvas will adjust the view so that it is not outside the scrolling region. This function is typically not used, as it is better to hook scrollbars to the canvas layout's scrolling adjusments.
|
|
When the scrolling region of the canvas is smaller than the canvas window, e.g. the allocation of the canvas, it can be either centered on the window or simply made to be on the upper-left corner on the window. This function lets you configure this property.
|
|
Controls dithered rendering for antialiased canvases. The value of dither should be Gdk::RGB_DITHER_NONE, Gdk::RGB_DITHER_NORMAL, or Gdk::RGB_DITHER_MAX. The default canvas setting is Gdk::RGB_DITHER_NORMAL.
|
|
Sets the zooming factor of a canvas by specifying the number of pixels that correspond to one canvas unit. The anchor point for zooming, i.e. the point that stays fixed and all others zoom inwards or outwards from it, depends on whether the canvas is set to center the scrolling region or not. You can control this using the set_center_scroll_region() function. If the canvas is set to center the scroll region, then the center of the canvas window is used as the anchor point for zooming. Otherwise, the upper-left corner of the canvas window is used as the anchor point.
|
|
Sets the scrolling region of a canvas to the specified rectangle. The canvas will then be able to scroll only within this region. The view of the canvas is adjusted as appropriate to display as much of the new region as possible.
|
|
Sets the stipple origin of the specified GC as is appropriate for the canvas, so that it will be aligned with other stipple patterns used by canvas items. This is typically only needed by item implementations.
|
|
|
|
|
|
Forces an immediate update and redraw of a canvas. If the canvas does not have any pending update or redraw requests, then no action is taken. This is typically only used by applications that need explicit control of when the display is updated, like games. It is not needed by normal applications. |
|
Sets the svp to the new value, requesting repaint on what's changed. This function takes responsibility for freeing new_svp.
|
|
Sets the svp to the new value, clipping if necessary, and requesting repaint on what's changed. This function takes responsibility for freeing new_svp.
|
|
Converts world coordinates into canvas pixel coordinates. This version
|
|
Converts world coordinates into canvas pixel coordinates.
|
|
|
|
Converts window-relative coordinates into world coordinates. You can use this when you need to convert mouse coordinates into world coordinates, for example.
|
|
Converts world coordinates into window-relative coordinates.
|
|
|