W Wrapl, The Programming Language

Libraries:Gtk:Gdk:Cairo

Functions

Create(drawable @ Gtk.Gdk.Drawable.T) : Gtk.Cairo.Cairo.T

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.



Rectangle(cr @ Gtk.Cairo.Cairo.T, rectangle @ Gtk.Gdk.Rectangle.T) : Std.Object.T

Adds the given rectangle to the current path of cr.



Region(cr @ Gtk.Cairo.Cairo.T, region @ Gtk.Gdk.Region.T) : Std.Object.T

Adds the given region to the current path of cr.



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.



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.



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