Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gskpath.h
Go to the documentation of this file.
1/*
2 * Copyright © 2020 Benjamin Otte
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library 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 GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authors: Benjamin Otte <otte@gnome.org>
18 */
19
20#pragma once
21
22#if !defined (__GSK_H_INSIDE__) && !defined (GTK_COMPILATION)
23#error "Only <gsk/gsk.h> can be included directly."
24#endif
25
26
27#include <gsk/gsktypes.h>
28
30
31/**
32 * GskPathForeachFlags:
33 * @GSK_PATH_FOREACH_ALLOW_ONLY_LINES: The default behavior, only allow lines.
34 * @GSK_PATH_FOREACH_ALLOW_QUAD: Allow emission of `GSK_PATH_QUAD` operations
35 * @GSK_PATH_FOREACH_ALLOW_CUBIC: Allow emission of `GSK_PATH_CUBIC` operations.
36 * @GSK_PATH_FOREACH_ALLOW_CONIC: Allow emission of `GSK_PATH_CONIC` operations.
37 *
38 * Flags that can be passed to gsk_path_foreach() to influence what
39 * kinds of operations the path is decomposed into.
40 *
41 * By default, [method@Gsk.Path.foreach] will only emit a path with all
42 * operations flattened to straight lines to allow for maximum compatibility.
43 * The only operations emitted will be `GSK_PATH_MOVE`, `GSK_PATH_LINE` and
44 * `GSK_PATH_CLOSE`.
45 *
46 * Since: 4.14
47 */
55
56/**
57 * GskPathForeachFunc:
58 * @op: The operation
59 * @pts: The points of the operation
60 * @n_pts: The number of points
61 * @weight: The weight for conic curves, or unused if not a conic curve
62 * @user_data: The user data provided with the function
63 *
64 * Prototype of the callback to iterate through the operations of
65 * a path.
66 *
67 * For each operation, the callback is given the @op itself, the points
68 * that the operation is applied to in @pts, and a @weight for conic
69 * curves. The @n_pts argument is somewhat redundant, since the number
70 * of points can be inferred from the operation.
71 *
72 * Each contour of the path starts with a @GSK_PATH_MOVE operation.
73 * Closed contours end with a @GSK_PATH_CLOSE operation.
74 *
75 * Returns: %TRUE to continue iterating the path, %FALSE to
76 * immediately abort and not call the function again.
77 */
79 const graphene_point_t *pts,
80 gsize n_pts,
81 float weight,
82 gpointer user_data);
83
84#define GSK_TYPE_PATH (gsk_path_get_type ())
85
88
93
96 GString *string);
99
101GskPath * gsk_path_parse (const char *string);
102
105 cairo_t *cr);
106
109
112
115 graphene_rect_t *bounds);
116
119 const GskStroke *stroke,
120 graphene_rect_t *bounds);
121
124 const graphene_point_t *point,
125 GskFillRule fill_rule);
126
129 GskPathPoint *result);
132 GskPathPoint *result);
133
136 const graphene_point_t *point,
137 float threshold,
138 GskPathPoint *result,
139 float *distance);
140
145 gpointer user_data);
146
148
struct _cairo cairo_t
Definition cairo.h:135
#define GDK_AVAILABLE_IN_4_14
unsigned long gsize
Definition glibconfig.h:83
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_CONST
Definition gmacros.h:637
#define G_DEFINE_AUTOPTR_CLEANUP_FUNC(TypeName, func)
Definition gmacros.h:1400
GskPathOperation
Definition gskenums.h:332
GskFillRule
Definition gskenums.h:242
GDK_AVAILABLE_IN_4_14 gboolean gsk_path_get_stroke_bounds(GskPath *self, const GskStroke *stroke, graphene_rect_t *bounds)
GDK_AVAILABLE_IN_4_14 GType gsk_path_get_type(void) G_GNUC_CONST
GDK_AVAILABLE_IN_4_14 gboolean gsk_path_in_fill(GskPath *self, const graphene_point_t *point, GskFillRule fill_rule)
GDK_AVAILABLE_IN_4_14 void gsk_path_print(GskPath *self, GString *string)
GDK_AVAILABLE_IN_4_14 gboolean gsk_path_get_start_point(GskPath *self, GskPathPoint *result)
GDK_AVAILABLE_IN_4_14 gboolean gsk_path_get_closest_point(GskPath *self, const graphene_point_t *point, float threshold, GskPathPoint *result, float *distance)
GDK_AVAILABLE_IN_4_14 gboolean gsk_path_foreach(GskPath *self, GskPathForeachFlags flags, GskPathForeachFunc func, gpointer user_data)
GDK_AVAILABLE_IN_4_14 void gsk_path_to_cairo(GskPath *self, cairo_t *cr)
GDK_AVAILABLE_IN_4_14 gboolean gsk_path_is_empty(GskPath *self)
gboolean(* GskPathForeachFunc)(GskPathOperation op, const graphene_point_t *pts, gsize n_pts, float weight, gpointer user_data)
Definition gskpath.h:78
GDK_AVAILABLE_IN_4_14 GskPath * gsk_path_parse(const char *string)
GskPathForeachFlags
Definition gskpath.h:49
@ GSK_PATH_FOREACH_ALLOW_QUAD
Definition gskpath.h:51
@ GSK_PATH_FOREACH_ALLOW_CUBIC
Definition gskpath.h:52
@ GSK_PATH_FOREACH_ALLOW_ONLY_LINES
Definition gskpath.h:50
@ GSK_PATH_FOREACH_ALLOW_CONIC
Definition gskpath.h:53
GDK_AVAILABLE_IN_4_14 gboolean gsk_path_is_closed(GskPath *self)
GDK_AVAILABLE_IN_4_14 gboolean gsk_path_get_bounds(GskPath *self, graphene_rect_t *bounds)
GDK_AVAILABLE_IN_4_14 gboolean gsk_path_get_end_point(GskPath *self, GskPathPoint *result)
GDK_AVAILABLE_IN_4_14 char * gsk_path_to_string(GskPath *self)
GDK_AVAILABLE_IN_4_14 GskPath * gsk_path_ref(GskPath *self)
GDK_AVAILABLE_IN_4_14 void gsk_path_unref(GskPath *self)
struct _GskStroke GskStroke
Definition gsktypes.h:35
struct _GskPath GskPath
Definition gsktypes.h:28
typedefG_BEGIN_DECLS struct _GString GString
Definition gstring.h:43
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
void * gpointer
Definition gtypes.h:109