~ubuntu-branches/ubuntu/wily/clutter-perl/wily

« back to all changes in this revision

Viewing changes to xs/CoglPath.xs

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Starr-Bochicchio
  • Date: 2009-09-25 14:21:14 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090925142114-r1uvxq7zytn04s0p
Tags: 1.0.1-0ubuntu1
* New upstream release.
* Clutter 0.8 -> 1.0 transition. (LP: #364630)
* debian/control:
 - Bump libclutter build dep,
 - Drop deprecated clutter-gst, clutter-gtk, and 
   clutter-cairo build deps.
* debian/patches/10_notify-osd_by_default.patch:
 - Disable POD generation to fix FTBFS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "clutter-perl-private.h"
 
2
 
 
3
MODULE = Clutter::Cogl::Path    PACKAGE = Clutter::Cogl::Path   PREFIX = cogl_path_
 
4
 
 
5
=for object Clutter::Cogl::Path - Path primitives for Cogl
 
6
=cut
 
7
 
 
8
=for position DESCRIPTION
 
9
 
 
10
=head1 DESCRIPTION
 
11
 
 
12
There are three levels on which drawing with Clutter::Cogl can be used.
 
13
The highest level functions construct various simple primitive shapes
 
14
to be either filled or stroked. Using a lower-level set of functions
 
15
more complex and arbitrary paths can be constructed by concatenating
 
16
straight line, bezier curve and arc segments. Additionally there
 
17
are utility functions that draw the most common primitives - rectangles
 
18
and trapezoids - in a maximaly optimized fashion.
 
19
 
 
20
When constructing arbitrary paths, the current pen location is
 
21
initialized using the C< move_to > command. The subsequent path segments
 
22
implicitly use the last pen location as their first vertex and move
 
23
the pen location to the last vertex they produce at the end. Also
 
24
there are special versions of functions that allow specifying the
 
25
vertices of the path segments relative to the last pen location
 
26
rather then in the absolute coordinates.
 
27
 
 
28
=cut
 
29
 
 
30
=for apidoc
 
31
Fills the constructed shape using the current drawing color
 
32
=cut
 
33
void
 
34
cogl_path_fill (class=NULL)
 
35
    C_ARGS:
 
36
        /* void */
 
37
 
 
38
=for apidoc
 
39
Fills the constructed shape using the current drawing color and
 
40
preserves the path to be used again.
 
41
=cut
 
42
void
 
43
cogl_path_fill_preserve (class=NULL)
 
44
    C_ARGS:
 
45
        /* void */
 
46
 
 
47
=for apidoc
 
48
Strokes the constructed shape using the current drawing color
 
49
and a width of 1 pixel (regardless of the current transformation
 
50
matrix)
 
51
=cut
 
52
void
 
53
cogl_path_stroke (class=NULL)
 
54
    C_ARGS:
 
55
        /* void */
 
56
 
 
57
=for apidoc
 
58
Strokes the constructed shape using the current drawing color and
 
59
preserves the path to be used again.
 
60
=cut
 
61
void
 
62
cogl_path_stroke_preserve (class=NULL)
 
63
    C_ARGS:
 
64
        /* void */
 
65
 
 
66
=for apidoc
 
67
Clears the current path and starts a new one.
 
68
=cut
 
69
void
 
70
cogl_path_clear (class=NULL)
 
71
    CODE:
 
72
        cogl_path_new ();
 
73
 
 
74
=for apidoc
 
75
Clears the previously constructed shape and begins a new path
 
76
contour by moving the pen to the given coordinates
 
77
=cut
 
78
void
 
79
cogl_path_move_to (class=NULL, float x, float y)
 
80
    C_ARGS:
 
81
        x, y
 
82
 
 
83
=for apidoc
 
84
Clears the previously constructed shape and begins a new path
 
85
contour by moving the pen to the given coordinates relative
 
86
to the current pen location
 
87
=cut
 
88
void
 
89
cogl_path_rel_move_to (class=NULL, float x, float y)
 
90
    C_ARGS:
 
91
        x, y
 
92
 
 
93
=for apidoc
 
94
Adds a straight line segment to the current path that ends at the
 
95
given coordinates
 
96
=cut
 
97
void
 
98
cogl_path_line_to (class=NULL, float x, float y)
 
99
    C_ARGS:
 
100
        x, y
 
101
 
 
102
=for apidoc
 
103
Adds a straight line segment to the current path that ends at the
 
104
given coordinates relative to the current pen location
 
105
=cut
 
106
void
 
107
cogl_path_rel_line_to (class=NULL, float x, float y)
 
108
    C_ARGS:
 
109
        x, y
 
110
 
 
111
=for apidoc
 
112
Adds an elliptical arc segment to the current path. A straight line
 
113
segment will link the current pen location with the first vertex
 
114
of the arc. If you perform a I<move_to> to the arc start just before
 
115
drawing it you create a free standing arc.
 
116
=cut
 
117
void
 
118
cogl_path_arc (class=NULL, center_x, center_y, radius_x, radius_y, angle_start, angle_end)
 
119
        float center_x
 
120
        float center_y
 
121
        float radius_x
 
122
        float radius_y
 
123
        float angle_start
 
124
        float angle_end
 
125
    C_ARGS:
 
126
        center_x, center_y, radius_x, radius_y, angle_start, angle_end
 
127
 
 
128
=for apidoc
 
129
Adds a cubic bezier curve segment to the current path with the given
 
130
second, third and fourth control points and using current pen location
 
131
as the first control point.
 
132
=cut
 
133
void
 
134
cogl_path_curve_to (class=NULL, x1, y1, x2, y2, x3, y3)
 
135
        float x1
 
136
        float y1
 
137
        float x2
 
138
        float y2
 
139
        float x3
 
140
        float y3
 
141
    C_ARGS:
 
142
        x1, y1, x2, y2, x3, y3
 
143
 
 
144
=for apidoc
 
145
Adds a cubic bezier curve segment to the current path with the given
 
146
second, third and fourth control points and using current pen location
 
147
as the first control point. The given coordinates are relative to the
 
148
current pen location
 
149
=cut
 
150
void
 
151
cogl_path_rel_curve_to (class=NULL, x1, y1, x2, y2, x3, y3)
 
152
        float x1
 
153
        float y1
 
154
        float x2
 
155
        float y2
 
156
        float x3
 
157
        float y3
 
158
    C_ARGS:
 
159
        x1, y1, x2, y2, x3, y3
 
160
 
 
161
=for apidoc
 
162
Closes the path being constructed by adding a straight line segment
 
163
to it that ends at the first vertex of the path
 
164
=cut
 
165
void
 
166
cogl_path_close (class=NULL)
 
167
    C_ARGS:
 
168
        /* void */
 
169
 
 
170
=for apidoc
 
171
Clears the previously constructed shape and constructs a straight
 
172
line shape start and ending at the given coordinates
 
173
=cut
 
174
void
 
175
cogl_path_line (class=NULL, float x1, float y1, float x2, float y2)
 
176
    C_ARGS:
 
177
        x1, y1, x2, y2
 
178
 
 
179
##=for apidoc
 
180
##Clears the previously constructed shape and constructs a series of straight
 
181
##line segments, starting from the first given vertex coordinate. Each
 
182
##subsequent segment stars where the previous one ended and ends at the next
 
183
##given vertex coordinate.
 
184
##
 
185
##I<coords> is a reference to an array containing the X and Y coordinates of
 
186
##each vertex.
 
187
##
 
188
##C<scalar @coords - 1> lines will be constructed.
 
189
##=cut
 
190
##void
 
191
##cogl_path_polyline (class=NULL, SV *coords)
 
192
 
 
193
##=for apidoc
 
194
##Clears the previously constructed shape and constructs a polygonal
 
195
##shape of the given number of vertices.
 
196
##
 
197
##I<coords> is a reference to an array containing the X and Y coordinates of
 
198
##each vertex.
 
199
##
 
200
##C<scalar @coords> lines will be constructed.
 
201
##=cut
 
202
##void
 
203
##cogl_path_polygon (class=NULL, SV *coords)
 
204
 
 
205
=for apidoc
 
206
Clears the previously constructed shape and constructs a rectangular
 
207
shape at the given coordinates
 
208
=cut
 
209
void
 
210
cogl_path_rectangle (class=NULL, float x1, float y1, float x2, float y2)
 
211
     C_ARGS:
 
212
        x1, y1, x2, y2
 
213
 
 
214
=for apidoc
 
215
Clears the previously constructed shape and constructs an ellipse shape
 
216
=cut
 
217
void
 
218
cogl_path_ellipse (class=NULL, float center_x, float center_y, float radius_x, float radius_y)
 
219
    C_ARGS:
 
220
        center_x, center_y, radius_x, radius_y
 
221
 
 
222
=for apidoc
 
223
Clears the previously constructed shape and constructs a rectangular
 
224
shape with rounded corners
 
225
=cut
 
226
void
 
227
cogl_path_round_rectangle (class=NULL, x1, y1, x2, y2, radius, arc_step)
 
228
        float x1
 
229
        float y1
 
230
        float x2
 
231
        float y2
 
232
        float radius
 
233
        float arc_step
 
234
    C_ARGS:
 
235
        x1, y1, x2, y2, radius, arc_step