gdk.Cairo

Undocumented in source.

Public Imports

gdk.c.types
public import gdk.c.types;
gtkc.gdktypes
public import gtkc.gdktypes;

Members

Functions

createContext
Context createContext(Window window)

Creates a Cairo context for drawing to window.

drawFromGl
void drawFromGl(Context cr, Window window, int source, int sourceType, int bufferScale, int x, int y, int width, int height)

This is the main way to draw GL content in GTK+. It takes a render buffer ID (source_type == GL_RENDERBUFFER) or a texture id (source_type == GL_TEXTURE) and draws it onto cr with an OVER operation, respecting the current clip. The top left corner of the rectangle specified by x, y, width and height will be drawn at the current (0,0) position of the cairo_t.

getClipRectangle
bool getClipRectangle(Context cr, GdkRectangle rect)

This is a convenience function around cairo_clip_extents(). It rounds the clip extents to integer coordinates and returns a boolean indicating if a clip area exists.

getDrawingContext
DrawingContext getDrawingContext(Context cr)

Retrieves the gdk.DrawingContext that created the Cairo context cr.

rectangle
void rectangle(Context cr, GdkRectangle* rectangle)

Adds the given rectangle to the current path of cr.

region
void region(Context cr, Region region)

Adds the given region to the current path of cr.

regionCreateFromSurface
Region regionCreateFromSurface(Surface surface)

Creates region that describes covers the area where the given surface is more than 50% opaque.

setSourceColor
void setSourceColor(Context cr, Color color)

Sets the specified gdk.Color as the source color of cr.

setSourcePixbuf
void setSourcePixbuf(Context cr, Pixbuf pixbuf, double pixbufX, double pixbufY)

Sets the given pixbuf as the source pattern for cr.

setSourceRgba
void setSourceRgba(Context cr, RGBA rgba)

Sets the specified gdk.RGBA as the source color of cr.

setSourceWindow
void setSourceWindow(Context cr, Window window, double x, double y)

Sets the given window as the source pattern for cr.

surfaceCreateFromPixbuf
Surface surfaceCreateFromPixbuf(Pixbuf pixbuf, int scale, Window forWindow)

Creates an image surface with the same contents as the pixbuf.