gnome-sharp 2.20.0.0 2.24.0.0 Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. Gtk.Layout Main canvas widget

The is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. It offers a choice of two rendering back-ends, one based on Xlib for extremely fast display, and another based on Libart, a sophisticated, antialiased, alpha-compositing engine. This widget can be used for flexible display of graphics and for creating interactive user interface elements.

To create a new GnomeCanvas widget call or for an anti-aliased mode canvas.

A widget contains one or more objects. Items consist of graphing elements like lines, ellipses, polygons, images, text, and curves. These items are organized using objects, which are themselves derived from . Since a group is an item it can be contained within other groups, forming a tree of canvas items. Certain operations, like translating and scaling, can be performed on all items in a group.

There is a special root group created by a GnomeCanvas. This is the top level group under which all items in a canvas are contained. To get the root group from a canvas, use property.

There are several different coordinate systems used by widgets. The primary system is a logical, abstract coordinate space called world coordinates. World coordinates are expressed as unbounded double floating point numbers. When it comes to rendering to a screen the canvas pixel coordinate system (also referred to as just canvas coordinates) is used. This system uses integers to specify screen pixel positions. A user defined scaling factor and offset are used to convert between world coordinates and canvas coordinates. Each item in a canvas has its own coordinate system called item coordinates. This system is specified in world coordinates but they are relative to an item (0.0, 0.0 would be the top left corner of the item). The final coordinate system of interest is window coordinates. These are like canvas coordinates but are offsets from within a window a canvas is displayed in. This last system is rarely used, but is useful when manually handling GDK events (such as drag and drop) which are specified in window coordinates (the events processed by the canvas are already converted for you).

Along with different coordinate systems comes functions to convert between them. converts world to canvas pixel coordinates and from canvas to world. is like but returns the pixel coordinates as doubles which is useful to avoid precision loss from integer rounding. To get the affine transform matrix for converting from world coordinates to canvas coordinates call . converts from window to world coordinates and converts in the other direction. There are no functions for converting between canvas and window coordinates, since this is just a matter of subtracting the canvas scrolling offset. To convert to/from item coordinates use the functions defined for objects.

To set the canvas zoom factor (canvas pixels per world unit, the scaling factor) use the property, setting this to 1.0 will cause the two coordinate systems to correspond (e.g., [5, 6] in pixel units would be [5.0, 6.0] in world units).

Defining the scrollable area of a canvas widget is done by calling and to get the current region can be used. If the window is larger than the canvas scrolling region it can optionally be centered in the window. Use the property to enable or disable this behavior. To scroll to a particular canvas pixel coordinate use (typically not used since scrollbars are usually set up to handle the scrolling), and to get the current canvas pixel scroll offset call .

- Constructor
  2.24.0.0
  Creates a new empty canvas in non-antialiased mode.

  Creates a new empty canvas in non-antialiased mode. If you wish to use the item inside this canvas, then you must push the gdk_imlib visual and colormap before calling this function, and they can be popped afterwards.

- Constructor
  2.24.0.0
  System.Obsolete
  a
  Protected Constructor.
  Chain to this constructor if you have manually registered a native value for your subclass.
- Constructor
  2.24.0.0
  if an antialiased canvas should be created.
  Constructs a canvas with or without antialiasing.
- Constructor
  2.24.0.0
  Pointer to the C object.
  Internal constructor

  This is an internal constructor, and should not be used by user code.

- Property
  2.24.0.0
  GLib.Property("aa")
  System.Boolean Whether to enable anti-aliasing mode to enable anti-aliasing

  Note that this parameter can only be set at the time of object construction. The same effect can be achieved by calling to create new non-aa canvas or for an anti-aliased canvas.

- Method
  2.24.0.0
  System.Void `` `` `` `` Canvas pixel X coordinate. Canvas pixel Y coordinate. Return value for the X world coordinate Return value for the Y world coordinate Converts canvas pixel coordinates to world coordinates.
- Method
  2.24.0.0
  Art.PathStrokeCapType `` a cap type, represented in GDK format Convert from GDK line cap specifier to the libart format. The line cap specifier in libart format.
- Property
  2.24.0.0
  System.Boolean Whether the canvas is set to center the scrolling region in the window if the former is smaller than the canvas' allocation. Whether the scroll region is being centered in the canvas window.

  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.

- Property
  2.24.0.0
  Gdk.RgbDither The type of dithering used to render an antialiased canvas. The type of dithering used to render an antialiased canvas.
- Event
  2.24.0.0
  GLib.Signal("draw_background")
  Gnome.DrawBackgroundHandler Emitted to draw the background for non-antialiased mode canvas widgets. The default method uses the canvas widget's style to draw the background.
- Property
  2.24.0.0
  GLib.Property("focused_item")
  Gnome.CanvasItem To be added. To be added. To be added.
- Method
  2.24.0.0
  System.Void `` `` `` `` `` `` `` `` `` `` X coordinate of first point in the line Y cooordinate of first point in the line X coordinate of second point (endpoint) of the line Y coordinate of second point (endpoint) of the line Width of the line Whether the butt points should project out by width/2 distance Return value of the X coordinate of first butt point Return value of the Y coordinate of first butt point Return value of the X coordinate of second butt point Return value of the Y coordinate of second butt point Computes the butt points of a line segment.
- Method
  2.24.0.0
  System.Boolean `` `` X color specification, or for"transparent". Return value the allocated color. Allocates a color based on the specified X color specification. if spec is non-NULL and the color is allocated. If spec is , then returns . To be added
- Method
  2.24.0.0
  System.UInt64 `` RGBA color specification. Allocates a color from the RGBA value passed into this function. Allocated pixel value corresponding to the specified color.

  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.

- Method
  2.24.0.0
  Gnome.CanvasItem `` `` X position in world coordinates. Y position in world coordinates. Looks for the item that is under the specified position. The requested item, or if no item is at the specified coordinates.
- Method
  2.24.0.0
  System.Boolean `` `` `` `` `` `` `` `` `` `` `` X coordinate of the first point Y coordinate of the first point X coordinate of the second (angle) point Y coordinate of the second (angle) point X coordinate of the third point Y coordinate of the third point Width of the line The return value of the X coordinate of the first miter point The return value of the Y coordinate of the first miter point The return value of the X coordinate of the second miter point The return value of the Y coordinate of the second miter point Given three points forming an angle, computes the coordinates of the inside and outside points of the mitered corner formed by a line of a given width at that angle. if the angle is less than 11 degrees (this is the same threshold as X uses. If this occurs, the return points are not modified. Otherwise, returns .
- Method
  2.24.0.0
  System.Void `` `` Return value for the horizontal scrolling offset Return value for the vertical scrolling offset Queries the scrolling offsets of a canvas. The values are returned in canvas pixel units.
- Method
  2.24.0.0
  System.Void `` `` `` `` Return value for the leftmost limit of the scrolling region Return value for the upper limit of the scrolling region Return value for the rightmost limit of the scrolling region Return value for the lower limit of the scrolling region Queries the scrolling region of a canvas.
- Property
  2.24.0.0
  GLib.GType GType Property. a Returns the native value for .
- Method
  2.24.0.0
  Art.PathStrokeJoinType `` a join type, represented in GDK format Convert from GDK line join specifier to libart. The line join specifier in libart format.
- Method
  2.24.0.0
  Gnome.Canvas Creates a new empty canvas in antialiased mode. You should push the visual and colormap before calling this functions, and they can be popped afterwards. A newly-created antialiased canvas.
- Method
  2.24.0.0
  GLib.DefaultSignalHandler(ConnectionMethod="OverrideDrawBackground", Type=typeof(Gnome.Canvas))
  System.Void `` `` `` `` `` a a a a a Default handler for the event. Override this method in a subclass to provide a default handler for the event.
- Method
  2.24.0.0
  GLib.DefaultSignalHandler(ConnectionMethod="OverrideRenderBackground", Type=typeof(Gnome.Canvas))
  System.Void `` To be added. Default handler for the event. Override this method in a subclass to provide a default handler for the event.
- Property
  2.24.0.0
  System.Double Gets or Sets the number of pixels that correspond to one canvas unit. a

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

- Event
  2.24.0.0
  GLib.Signal("render_background")
  Gnome.RenderBackgroundHandler This signal is emitted for antialiased mode canvas widgets to render the background. The buf data structure contains both a pointer to a packed 24-bit RGB array and the coordinates.
- Method
  2.24.0.0
  System.Void `` `` `` the canvas buffer to render over the vector path to render the rgba color to render Render the over the .
- Method
  2.24.0.0
  System.Void `` `` `` `` Leftmost coordinate of the rectangle to be redrawn. Upper coordinate of the rectangle to be redrawn. Rightmost coordinate of the rectangle to be redrawn, plus 1. Lower coordinate of the rectangle to be redrawn, plus 1. Convenience function that informs a canvas that the specified rectangle needs to be repainted.

  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 . The rectangle includes and , but not and . To be used only by item implementations.

- Method
  2.24.0.0
  System.Void `` Microtile array that specifies the area to be redrawn. Informs a canvas that the specified area, given as a microtile array, needs to be repainted. To be used only by item implementations.
- Method
  2.24.0.0
  Gnome.CanvasGroup Queries the root group of a canvas. The root group of the specified canvas.
- Method
  2.24.0.0
  System.Void `` `` Horizontal scrolling offset in canvas pixel units. Vertical scrolling offset in canvas pixel units. Makes a canvas scroll to the specified offsets, given in canvas pixel units.

  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.

- Method
  2.24.0.0
  System.Void `` `` `` `` Leftmost limit of the scrolling region. Upper limit of the scrolling region. Rightmost limit of the scrolling region. Lower limit of the scrolling region. Sets the scrolling region of a canvas to the specified rectangle. To be added
- Property
  2.24.0.0
  Gdk.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. To be added.

  This is typically only needed by item implementations.

- Method
  2.24.0.0
  System.Void `` `` `` `` `` The canvas item needing update Left coordinate of the new bounding box Top coordinate of the new bounding box Right coordinate of the new bounding box Bottom coordinate of the new bounding box Sets the bounding box to the new value, requesting full repaint.
- Method
  2.24.0.0
  System.Void Forces an immediate update and redraw of a canvas.

  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.

- Method
  2.24.0.0
  System.Void `` `` The existing svp The new svp Sets the svp to the new value, requesting repaint on what has changed.
- Method
  2.24.0.0
  System.Void `` `` `` the existing svp the new svp a clip path Sets the svp to the new value, clipping if necessary, and requesting repaint on what has changed.
- Method
  2.24.0.0
  System.Void `` `` `` `` World X coordinate. World Y coordinate. Return value for the X pixel coordinate Return value for the Y pixel coordinate Converts world coordinates into canvas pixel coordinates.
- Method
  2.24.0.0
  System.Void `` To be added. To be added. To be added.
- Method
  2.24.0.0
  System.Void `` `` `` `` World X coordinate. World Y coordinate. Return value for the X pixel coordinate Return value for the Y pixel coordinate Converts world coordinates into canvas pixel coordinates. This version returns coordinates in floating point coordinates, for greater precision.
- Method
  2.24.0.0
  System.Void `` `` `` `` World X coordinate. World Y coordinate. Return value for the X window-relative coordinate. Return value for the Y window-relative coordinate. Converts world coordinates into window-relative coordinates.
- Method
  2.24.0.0
  System.Void `` `` `` `` World X coordinate. World Y coordinate. Return value for the X window-relative coordinate. Return value for the Y window-relative coordinate. Converts world coordinates into window-relative coordinates.