1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gsk.c.types;
26 
27 public import cairo.c.types;
28 public import gdk.c.types;
29 public import glib.c.types;
30 public import gobject.c.types;
31 public import graphene.c.types;
32 public import pango.c.types;
33 
34 
35 /**
36  * The blend modes available for render nodes.
37  *
38  * The implementation of each blend mode is deferred to the
39  * rendering pipeline.
40  *
41  * See https://www.w3.org/TR/compositing-1/#blending for more information
42  * on blending and blend modes.
43  */
44 public enum GskBlendMode
45 {
46 	/**
47 	 * The default blend mode, which specifies no blending
48 	 */
49 	DEFAULT = 0,
50 	/**
51 	 * The source color is multiplied by the destination
52 	 * and replaces the destination
53 	 */
54 	MULTIPLY = 1,
55 	/**
56 	 * Multiplies the complements of the destination and source
57 	 * color values, then complements the result.
58 	 */
59 	SCREEN = 2,
60 	/**
61 	 * Multiplies or screens the colors, depending on the
62 	 * destination color value. This is the inverse of hard-list
63 	 */
64 	OVERLAY = 3,
65 	/**
66 	 * Selects the darker of the destination and source colors
67 	 */
68 	DARKEN = 4,
69 	/**
70 	 * Selects the lighter of the destination and source colors
71 	 */
72 	LIGHTEN = 5,
73 	/**
74 	 * Brightens the destination color to reflect the source color
75 	 */
76 	COLOR_DODGE = 6,
77 	/**
78 	 * Darkens the destination color to reflect the source color
79 	 */
80 	COLOR_BURN = 7,
81 	/**
82 	 * Multiplies or screens the colors, depending on the source color value
83 	 */
84 	HARD_LIGHT = 8,
85 	/**
86 	 * Darkens or lightens the colors, depending on the source color value
87 	 */
88 	SOFT_LIGHT = 9,
89 	/**
90 	 * Subtracts the darker of the two constituent colors from the lighter color
91 	 */
92 	DIFFERENCE = 10,
93 	/**
94 	 * Produces an effect similar to that of the difference mode but lower in contrast
95 	 */
96 	EXCLUSION = 11,
97 	/**
98 	 * Creates a color with the hue and saturation of the source color and the luminosity of the destination color
99 	 */
100 	COLOR = 12,
101 	/**
102 	 * Creates a color with the hue of the source color and the saturation and luminosity of the destination color
103 	 */
104 	HUE = 13,
105 	/**
106 	 * Creates a color with the saturation of the source color and the hue and luminosity of the destination color
107 	 */
108 	SATURATION = 14,
109 	/**
110 	 * Creates a color with the luminosity of the source color and the hue and saturation of the destination color
111 	 */
112 	LUMINOSITY = 15,
113 }
114 alias GskBlendMode BlendMode;
115 
116 /**
117  * The corner indices used by #GskRoundedRect.
118  */
119 public enum GskCorner
120 {
121 	/**
122 	 * The top left corner
123 	 */
124 	TOP_LEFT = 0,
125 	/**
126 	 * The top right corner
127 	 */
128 	TOP_RIGHT = 1,
129 	/**
130 	 * The bottom right corner
131 	 */
132 	BOTTOM_RIGHT = 2,
133 	/**
134 	 * The bottom left corner
135 	 */
136 	BOTTOM_LEFT = 3,
137 }
138 alias GskCorner Corner;
139 
140 /**
141  * This defines the types of the uniforms that `GskGLShaders`
142  * declare.
143  *
144  * It defines both what the type is called in the GLSL shader
145  * code, and what the corresponding C type is on the Gtk side.
146  */
147 public enum GskGLUniformType
148 {
149 	/**
150 	 * No type, used for uninitialized or unspecified values.
151 	 */
152 	NONE = 0,
153 	/**
154 	 * A float uniform
155 	 */
156 	FLOAT = 1,
157 	/**
158 	 * A GLSL int / gint32 uniform
159 	 */
160 	INT = 2,
161 	/**
162 	 * A GLSL uint / guint32 uniform
163 	 */
164 	UINT = 3,
165 	/**
166 	 * A GLSL bool / gboolean uniform
167 	 */
168 	BOOL = 4,
169 	/**
170 	 * A GLSL vec2 / graphene_vec2_t uniform
171 	 */
172 	VEC2 = 5,
173 	/**
174 	 * A GLSL vec3 / graphene_vec3_t uniform
175 	 */
176 	VEC3 = 6,
177 	/**
178 	 * A GLSL vec4 / graphene_vec4_t uniform
179 	 */
180 	VEC4 = 7,
181 }
182 alias GskGLUniformType GLUniformType;
183 
184 /**
185  * The type of a node determines what the node is rendering.
186  */
187 public enum GskRenderNodeType
188 {
189 	/**
190 	 * Error type. No node will ever have this type.
191 	 */
192 	NOT_A_RENDER_NODE = 0,
193 	/**
194 	 * A node containing a stack of children
195 	 */
196 	CONTAINER_NODE = 1,
197 	/**
198 	 * A node drawing a #cairo_surface_t
199 	 */
200 	CAIRO_NODE = 2,
201 	/**
202 	 * A node drawing a single color rectangle
203 	 */
204 	COLOR_NODE = 3,
205 	/**
206 	 * A node drawing a linear gradient
207 	 */
208 	LINEAR_GRADIENT_NODE = 4,
209 	/**
210 	 * A node drawing a repeating linear gradient
211 	 */
212 	REPEATING_LINEAR_GRADIENT_NODE = 5,
213 	/**
214 	 * A node drawing a radial gradient
215 	 */
216 	RADIAL_GRADIENT_NODE = 6,
217 	/**
218 	 * A node drawing a repeating radial gradient
219 	 */
220 	REPEATING_RADIAL_GRADIENT_NODE = 7,
221 	/**
222 	 * A node drawing a conic gradient
223 	 */
224 	CONIC_GRADIENT_NODE = 8,
225 	/**
226 	 * A node stroking a border around an area
227 	 */
228 	BORDER_NODE = 9,
229 	/**
230 	 * A node drawing a #GdkTexture
231 	 */
232 	TEXTURE_NODE = 10,
233 	/**
234 	 * A node drawing an inset shadow
235 	 */
236 	INSET_SHADOW_NODE = 11,
237 	/**
238 	 * A node drawing an outset shadow
239 	 */
240 	OUTSET_SHADOW_NODE = 12,
241 	/**
242 	 * A node that renders its child after applying a matrix transform
243 	 */
244 	TRANSFORM_NODE = 13,
245 	/**
246 	 * A node that changes the opacity of its child
247 	 */
248 	OPACITY_NODE = 14,
249 	/**
250 	 * A node that applies a color matrix to every pixel
251 	 */
252 	COLOR_MATRIX_NODE = 15,
253 	/**
254 	 * A node that repeats the child's contents
255 	 */
256 	REPEAT_NODE = 16,
257 	/**
258 	 * A node that clips its child to a rectangular area
259 	 */
260 	CLIP_NODE = 17,
261 	/**
262 	 * A node that clips its child to a rounded rectangle
263 	 */
264 	ROUNDED_CLIP_NODE = 18,
265 	/**
266 	 * A node that draws a shadow below its child
267 	 */
268 	SHADOW_NODE = 19,
269 	/**
270 	 * A node that blends two children together
271 	 */
272 	BLEND_NODE = 20,
273 	/**
274 	 * A node that cross-fades between two children
275 	 */
276 	CROSS_FADE_NODE = 21,
277 	/**
278 	 * A node containing a glyph string
279 	 */
280 	TEXT_NODE = 22,
281 	/**
282 	 * A node that applies a blur
283 	 */
284 	BLUR_NODE = 23,
285 	/**
286 	 * Debug information that does not affect the rendering
287 	 */
288 	DEBUG_NODE = 24,
289 	/**
290 	 * A node that uses OpenGL fragment shaders to render
291 	 */
292 	GL_SHADER_NODE = 25,
293 }
294 alias GskRenderNodeType RenderNodeType;
295 
296 /**
297  * The filters used when scaling texture data.
298  *
299  * The actual implementation of each filter is deferred to the
300  * rendering pipeline.
301  */
302 public enum GskScalingFilter
303 {
304 	/**
305 	 * linear interpolation filter
306 	 */
307 	LINEAR = 0,
308 	/**
309 	 * nearest neighbor interpolation filter
310 	 */
311 	NEAREST = 1,
312 	/**
313 	 * linear interpolation along each axis,
314 	 * plus mipmap generation, with linear interpolation along the mipmap
315 	 * levels
316 	 */
317 	TRILINEAR = 2,
318 }
319 alias GskScalingFilter ScalingFilter;
320 
321 /**
322  * Errors that can happen during (de)serialization.
323  */
324 public enum GskSerializationError
325 {
326 	/**
327 	 * The format can not be
328 	 * identified
329 	 */
330 	UNSUPPORTED_FORMAT = 0,
331 	/**
332 	 * The version of the data
333 	 * is not understood
334 	 */
335 	UNSUPPORTED_VERSION = 1,
336 	/**
337 	 * The given data may not exist in
338 	 * a proper serialization
339 	 */
340 	INVALID_DATA = 2,
341 }
342 alias GskSerializationError SerializationError;
343 
344 /**
345  * The categories of matrices relevant for GSK and GTK.
346  *
347  * Note that any category includes matrices of all later categories.
348  * So if you want to for example check if a matrix is a 2D matrix,
349  * `category >= GSK_TRANSFORM_CATEGORY_2D` is the way to do this.
350  *
351  * Also keep in mind that rounding errors may cause matrices to not
352  * conform to their categories. Otherwise, matrix operations done via
353  * multiplication will not worsen categories. So for the matrix
354  * multiplication `C = A * B`, `category(C) = MIN (category(A), category(B))`.
355  */
356 public enum GskTransformCategory
357 {
358 	/**
359 	 * The category of the matrix has not been
360 	 * determined.
361 	 */
362 	UNKNOWN = 0,
363 	/**
364 	 * Analyzing the matrix concluded that it does
365 	 * not fit in any other category.
366 	 */
367 	ANY = 1,
368 	/**
369 	 * The matrix is a 3D matrix. This means that
370 	 * the w column (the last column) has the values (0, 0, 0, 1).
371 	 */
372 	_3D = 2,
373 	/**
374 	 * The matrix is a 2D matrix. This is equivalent
375 	 * to graphene_matrix_is_2d() returning %TRUE. In particular, this
376 	 * means that Cairo can deal with the matrix.
377 	 */
378 	_2D = 3,
379 	/**
380 	 * The matrix is a combination of 2D scale
381 	 * and 2D translation operations. In particular, this means that any
382 	 * rectangle can be transformed exactly using this matrix.
383 	 */
384 	_2D_AFFINE = 4,
385 	/**
386 	 * The matrix is a 2D translation.
387 	 */
388 	_2D_TRANSLATE = 5,
389 	/**
390 	 * The matrix is the identity matrix.
391 	 */
392 	IDENTITY = 6,
393 }
394 alias GskTransformCategory TransformCategory;
395 
396 struct GskBlendNode;
397 
398 struct GskBlurNode;
399 
400 struct GskBorderNode;
401 
402 struct GskBroadwayRenderer;
403 
404 struct GskBroadwayRendererClass;
405 
406 struct GskCairoNode;
407 
408 struct GskCairoRenderer;
409 
410 struct GskCairoRendererClass;
411 
412 struct GskClipNode;
413 
414 struct GskColorMatrixNode;
415 
416 struct GskColorNode;
417 
418 /**
419  * A color stop in a gradient node.
420  */
421 struct GskColorStop
422 {
423 	/**
424 	 * the offset of the color stop
425 	 */
426 	float offset;
427 	/**
428 	 * the color at the given offset
429 	 */
430 	GdkRGBA color;
431 }
432 
433 struct GskConicGradientNode;
434 
435 struct GskContainerNode;
436 
437 struct GskCrossFadeNode;
438 
439 struct GskDebugNode;
440 
441 struct GskGLRenderer;
442 
443 struct GskGLRendererClass;
444 
445 struct GskGLShader;
446 
447 struct GskGLShaderClass
448 {
449 	GObjectClass parentClass;
450 }
451 
452 struct GskGLShaderNode;
453 
454 struct GskInsetShadowNode;
455 
456 struct GskLinearGradientNode;
457 
458 struct GskNglRenderer;
459 
460 struct GskNglRendererClass;
461 
462 struct GskOpacityNode;
463 
464 struct GskOutsetShadowNode;
465 
466 /**
467  * A location in a parse buffer.
468  */
469 struct GskParseLocation
470 {
471 	/**
472 	 * the offset of the location in the parse buffer, as bytes
473 	 */
474 	size_t bytes;
475 	/**
476 	 * the offset of the location in the parse buffer, as characters
477 	 */
478 	size_t chars;
479 	/**
480 	 * the line of the location in the parse buffer
481 	 */
482 	size_t lines;
483 	/**
484 	 * the position in the line, as bytes
485 	 */
486 	size_t lineBytes;
487 	/**
488 	 * the position in the line, as characters
489 	 */
490 	size_t lineChars;
491 }
492 
493 struct GskRadialGradientNode;
494 
495 struct GskRenderNode;
496 
497 struct GskRenderer;
498 
499 struct GskRendererClass;
500 
501 struct GskRepeatNode;
502 
503 struct GskRepeatingLinearGradientNode;
504 
505 struct GskRepeatingRadialGradientNode;
506 
507 struct GskRoundedClipNode;
508 
509 struct GskRoundedRect
510 {
511 	/**
512 	 * the bounds of the rectangle
513 	 */
514 	graphene_rect_t bounds;
515 	/**
516 	 * the size of the 4 rounded corners
517 	 */
518 	graphene_size_t[4] corner;
519 }
520 
521 struct GskShaderArgsBuilder;
522 
523 /**
524  * The shadow parameters in a shadow node.
525  */
526 struct GskShadow
527 {
528 	/**
529 	 * the color of the shadow
530 	 */
531 	GdkRGBA color;
532 	/**
533 	 * the horizontal offset of the shadow
534 	 */
535 	float dx;
536 	/**
537 	 * the vertical offset of the shadow
538 	 */
539 	float dy;
540 	/**
541 	 * the radius of the shadow
542 	 */
543 	float radius;
544 }
545 
546 struct GskShadowNode;
547 
548 struct GskTextNode;
549 
550 struct GskTextureNode;
551 
552 struct GskTransform;
553 
554 struct GskTransformNode;
555 
556 struct GskVulkanRenderer;
557 
558 struct GskVulkanRendererClass;
559 
560 /**
561  * Type of callback that is called when an error occurs
562  * during node deserialization.
563  *
564  * Params:
565  *     start = start of the error location
566  *     end = end of the error location
567  *     error = the error
568  *     userData = user data
569  */
570 public alias extern(C) void function(GskParseLocation* start, GskParseLocation* end, GError* error, void* userData) GskParseErrorFunc;