I've no idea here...
[gtkD.git] / src / gdk / GdkCairo.d
blobfe32b9c85af1b71dce944ddd157601e281dfe8de
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gdk-Cairo-Interaction.html
26 * outPack = gdk
27 * outFile = GdkCairo
28 * strct =
29 * realStrct=
30 * ctorStrct=
31 * clss = GdkCairo
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gdk_cairo_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - cairoLib.Cairo
45 * - gdk.Drawable
46 * - gdk.Color
47 * - gdk.Pixbuf
48 * - gdk.Pixmap
49 * - gdk.Rectangle
50 * - gdk.Region
51 * structWrap:
52 * - GdkColor* -> Color
53 * - GdkDrawable* -> Drawable
54 * - GdkPixbuf* -> Pixbuf
55 * - GdkPixmap* -> Pixmap
56 * - GdkRectangle* -> Rectangle
57 * - GdkRegion* -> Region
58 * - cairo_t* -> Cairo
59 * local aliases:
62 module gdk.GdkCairo;
64 private import gdk.gdktypes;
66 private import lib.gdk;
68 private import cairoLib.Cairo;
69 private import gdk.Drawable;
70 private import gdk.Color;
71 private import gdk.Pixbuf;
72 private import gdk.Pixmap;
73 private import gdk.Rectangle;
74 private import gdk.Region;
76 /**
77 * Description
78 * Cairo is a graphics
79 * library that supports vector graphics and image compositing that
80 * can be used with GDK. Since 2.8, GTK+ does most of its drawing
81 * using Cairo.
82 * GDK does not wrap the Cairo API, instead it allows to create Cairo
83 * contexts which can be used to draw on GDK drawables. Additional
84 * functions allow to convert GDK's rectangles and regions into
85 * Cairo paths and to use pixbufs as sources for drawing operations.
87 public class GdkCairo
90 /**
93 /**
94 * Creates a Cairo context for drawing to drawable.
95 * drawable:
96 * a GdkDrawable
97 * Returns:
98 * A newly created Cairo context. Free with
99 * cairo_destroy() when you are done drawing.
100 * Since 2.8
102 public static Cairo create(Drawable drawable)
104 // cairo_t* gdk_cairo_create (GdkDrawable *drawable);
105 return new Cairo( gdk_cairo_create((drawable is null) ? null : drawable.getDrawableStruct()) );
109 * Sets the specified GdkColor as the source color of cr.
110 * cr:
111 * a cairo_t
112 * color:
113 * a GdkColor
114 * Since 2.8
116 public static void setSourceColor(Cairo cr, Color color)
118 // void gdk_cairo_set_source_color (cairo_t *cr, GdkColor *color);
119 gdk_cairo_set_source_color((cr is null) ? null : cr.getCairoStruct(), (color is null) ? null : color.getColorStruct());
123 * Sets the given pixbuf as the source pattern for the Cairo context.
124 * The pattern has an extend mode of CAIRO_EXTEND_NONE and is aligned
125 * so that the origin of pixbuf is pixbuf_x, pixbuf_y
126 * cr:
127 * a Cairo context
128 * pixbuf:
129 * a GdkPixbuf
130 * pixbuf_x:
131 * X coordinate of location to place upper left corner of pixbuf
132 * pixbuf_y:
133 * Y coordinate of location to place upper left corner of pixbuf
134 * Since 2.8
136 public static void setSourcePixbuf(Cairo cr, Pixbuf pixbuf, double pixbufX, double pixbufY)
138 // void gdk_cairo_set_source_pixbuf (cairo_t *cr, GdkPixbuf *pixbuf, double pixbuf_x, double pixbuf_y);
139 gdk_cairo_set_source_pixbuf((cr is null) ? null : cr.getCairoStruct(), (pixbuf is null) ? null : pixbuf.getPixbufStruct(), pixbufX, pixbufY);
143 * Sets the given pixmap as the source pattern for the Cairo context.
144 * The pattern has an extend mode of CAIRO_EXTEND_NONE and is aligned
145 * so that the origin of pixbuf is pixbuf_x, pixbuf_y
146 * cr:
147 * a Cairo context
148 * pixmap:
149 * a GdkPixmap
150 * pixmap_x:
151 * X coordinate of location to place upper left corner of pixmap
152 * pixmap_y:
153 * Y coordinate of location to place upper left corner of pixmap
154 * Since 2.10
156 public static void setSourcePixmap(Cairo cr, Pixmap pixmap, double pixmapX, double pixmapY)
158 // void gdk_cairo_set_source_pixmap (cairo_t *cr, GdkPixmap *pixmap, double pixmap_x, double pixmap_y);
159 gdk_cairo_set_source_pixmap((cr is null) ? null : cr.getCairoStruct(), (pixmap is null) ? null : pixmap.getPixmapStruct(), pixmapX, pixmapY);
163 * Adds the given rectangle to the current path of cr.
164 * cr:
165 * a cairo_t
166 * rectangle:
167 * a GdkRectangle
168 * Since 2.8
170 public static void rectangle(Cairo cr, Rectangle rectangle)
172 // void gdk_cairo_rectangle (cairo_t *cr, GdkRectangle *rectangle);
173 gdk_cairo_rectangle((cr is null) ? null : cr.getCairoStruct(), (rectangle is null) ? null : rectangle.getRectangleStruct());
177 * Adds the given region to the current path of cr.
178 * cr:
179 * a cairo_t
180 * region:
181 * a GdkRegion
182 * Since 2.8
184 public static void region(Cairo cr, Region region)
186 // void gdk_cairo_region (cairo_t *cr, GdkRegion *region);
187 gdk_cairo_region((cr is null) ? null : cr.getCairoStruct(), (region is null) ? null : region.getRegionStruct());