3 #ifndef _LIBGNOMECANVASMM_CANVAS_H
4 #define _LIBGNOMECANVASMM_CANVAS_H
34 #include <libgnomecanvas/gnome-canvas.h>
36 #include <gtkmm/layout.h>
37 #include <gdkmm/color.h>
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41 typedef struct _GnomeCanvas GnomeCanvas;
42 typedef struct _GnomeCanvasClass GnomeCanvasClass;
50 {
class Canvas_Class; }
71 #ifndef DOXYGEN_SHOULD_SKIP_THIS
72 typedef Canvas CppObjectType;
73 typedef Canvas_Class CppClassType;
74 typedef GnomeCanvas BaseObjectType;
75 typedef GnomeCanvasClass BaseClassType;
80 #ifndef DOXYGEN_SHOULD_SKIP_THIS
83 friend class Canvas_Class;
84 static CppClassType canvas_class_;
91 explicit Canvas(
const Glib::ConstructParams& construct_params);
92 explicit Canvas(GnomeCanvas* castitem);
97 #ifndef DOXYGEN_SHOULD_SKIP_THIS
98 static GType get_type() G_GNUC_CONST;
99 static GType get_base_type() G_GNUC_CONST;
103 GnomeCanvas*
gobj() {
return reinterpret_cast<GnomeCanvas*
>(gobject_); }
106 const GnomeCanvas*
gobj()
const {
return reinterpret_cast<GnomeCanvas*
>(gobject_); }
111 #ifdef GLIBMM_VFUNCS_ENABLED
112 #endif //GLIBMM_VFUNCS_ENABLED
116 #ifdef GLIBMM_VFUNCS_ENABLED
117 #endif //GLIBMM_VFUNCS_ENABLED
120 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
121 virtual void on_draw_background(
const Glib::RefPtr<Gdk::Drawable>& drawable,
int x,
int y,
int width,
int height);
123 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
287 void w2c(
double wx,
double wy,
int& cx,
int& cy)
const;
296 void w2c(
double wx,
double wy,
double& cx,
double& cy)
const;
306 void c2w(
int cx,
int cy,
double& wx,
double& wy)
const;
320 void window_to_world (
double winx,
double winy,
double& worldx,
double& worldy)
const;
332 void world_to_window (
double worldx,
double worldy,
double& winx,
double& winy)
const;
335 bool get_color(
const Glib::ustring& spec, Gdk::Color& color)
const;
375 void update_svp(ArtSVP** p_svp, ArtSVP* new_svp);
383 void update_svp_clip(ArtSVP** p_svp, ArtSVP* new_svp, ArtSVP* clip_svp);
413 #ifdef GLIBMM_VFUNCS_ENABLED
415 #endif //GLIBMM_VFUNCS_ENABLED
419 #ifdef GLIBMM_PROPERTIES_ENABLED
426 Glib::PropertyProxy_ReadOnly<bool>
property_aa()
const;
427 #endif //#GLIBMM_PROPERTIES_ENABLED
438 explicit CanvasAA(GnomeCanvas* castitem);
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 ...
double get_pixels_per_unit() const
Group * root() const
Queries the root group of a canvas.
Definition: affinetrans.h:29
Art::AffineTrans w2c_affine() const
void update_now()
Forces an immediate update and redraw of a canvas.
gulong get_color_pixel(guint rgba) const
Allocates a color from the RGBA value passed into this function.
void get_scroll_region(double &x1, double &y1, double &x2, double &y2) const
Queries the scrolling region of a canvas.
Glib::PropertyProxy_ReadOnly< bool > property_aa() const
The antialiasing mode of the canvas.
Definition: affinetrans.h:36
void world_to_window(double worldx, double worldy, double &winx, double &winy) const
Converts world coordinates into window-relative coordinates.
void get_scroll_offsets(int &cx, int &cy) const
Queries the scrolling offsets of a canvas.
void update_svp(ArtSVP **p_svp, ArtSVP *new_svp)
Sets the svp to the new value, requesting repaint on what's changed.
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)
Glib::SignalProxy1< void, GnomeCanvasBuf * > signal_render_background()
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 alig...
void w2c(double wx, double wy, int &cx, int &cy) const
Converts world coordinates into canvas pixel coordinates.
virtual void request_update_vfunc()
const GnomeCanvas * gobj() const
Provides access to the underlying C GtkObject.
Definition: canvas.h:106
void set_dither(Gdk::RgbDither dither)
Controls dithered rendering for antialiased canvases.
void window_to_world(double winx, double winy, double &worldx, double &worldy) const
Converts window-relative coordinates into world coordinates.
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...
Glib::SignalProxy5< void, const Glib::RefPtr< Gdk::Drawable > &, int, int, int, int > signal_draw_background()
bool get_color(const Glib::ustring &spec, Gdk::Color &color) const
Canvas functions usually operate in either World coordinates (units for the entire canvas)...
Definition: canvas.h:68
void set_scroll_region(double x1, double y1, double x2, double y2)
Sets the scrolling region of a canvas to the specified rectangle.
GnomeCanvas * gobj()
Provides access to the underlying C GtkObject.
Definition: canvas.h:103
void scroll_to(int x, int y)
Makes a canvas scroll to the specified offsets, given in canvas pixel units.
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...
bool get_center_scroll_region() const
Returns whether the canvas is set to center the scrolling region in the window if the former is small...
void c2w(int cx, int cy, double &wx, double &wy) const
Converts canvas pixel coordinates to world coordinates.
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...
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...
Gdk::RgbDither get_dither() const
Returns the type of dithering used to render an antialiased canvas.