Libraries:Gtk:Gdk:Cairo
Functions
Create(drawable @ Gtk.Gdk.Drawable.T) : Gtk.Cairo.Cairo.T
Rectangle(cr @ Gtk.Cairo.Cairo.T, rectangle @ Gtk.Gdk.Rectangle.T) : Std.Object.T
Adds the given rectangle to the current path of cr.
cr | a Gtk.Cairo.Cairo.T |
rectangle | a Gtk.Gdk.Rectangle.T |
Region(cr @ Gtk.Cairo.Cairo.T, region @ Gtk.Gdk.Region.T) : Std.Object.T
ResetClip(cr @ Gtk.Cairo.Cairo.T, drawable @ Gtk.Gdk.Drawable.T) : Std.Object.T
Resets the clip region for a Cairo context created by Create.
This resets the clip region to the "empty" state for the given drawable. This is required for non-native windows since a direct call to Gtk.Cairo.Cairo.ResetClip would unset the clip region inherited from the drawable (i.e. the window clip region), and thus let you e.g. draw outside your window.
This is rarely needed though, since most code just create a new cairo_t using Create each time they want to draw something.
cr | a Gtk.Cairo.Cairo.T |
drawable | a Gtk.Gdk.Drawable.T |
SetSourceColor(cr @ Gtk.Cairo.Cairo.T, color @ Gtk.Gdk.Color.T) : Std.Object.T
Sets the specified Gtk.Gdk.Color.T as the source color of cr.
cr | a Gtk.Cairo.Cairo.T |
color | a Gtk.Gdk.Color.T |
SetSourcePixbuf(cr @ Gtk.Cairo.Cairo.T, pixbuf @ Gtk.Gdk.Pixbuf.T, pixbuf_x @ Std.Real.T, pixbuf_y @ Std.Real.T) : Std.Object.T
Sets the given pixbuf as the source pattern for the Cairo context. The pattern has an extend mode of CAIRO_EXTEND_NONE and is aligned so that the origin of pixbuf is pixbuf_x, pixbuf_y
cr | a Cairo context |
pixbuf | a Gtk.Gdk.Pixbuf.T |
pixbuf_x | X coordinate of location to place upper left corner of pixbuf |
pixbuf_y | Y coordinate of location to place upper left corner of pixbuf |
SetSourcePixmap(cr @ Gtk.Cairo.Cairo.T, pixmap @ Gtk.Gdk.Pixmap.T, pixmap_x @ Std.Real.T, pixmap_y @ Std.Real.T) : Std.Object.T
Warning
SetSourcePixmap has been deprecated since version 2.24 and should not be used in newly-written code. This function is being removed in GTK+ 3 (together with Gtk.Gdk.Pixmap.T). Instead, use SetSourceWindow where appropriate.
SetSourceWindow(cr @ Gtk.Cairo.Cairo.T, window @ Gtk.Gdk.Window.T, x @ Std.Real.T, y @ Std.Real.T) : Std.Object.T
Sets the given window as the source pattern for the Cairo context. The pattern has an extend mode of CAIRO_EXTEND_NONE and is aligned so that the origin of window is x, y. The window contains all its subwindows when rendering.
Note that the contents of window are undefined outside of the visible part of window, so use this function with care.
cr | a Cairo context |
window | a Gtk.Gdk.Window.T |
x | X coordinate of location to place upper left corner of window |
y | Y coordinate of location to place upper left corner of window |
Creates a Cairo context for drawing to drawable.
Note
Note that due to double-buffering, Cairo contexts created in a GTK+ expose event handler cannot be cached and reused between different expose events.