1/* GTK - The GIMP Toolkit
2 * Copyright (C) 2016 Benjamin Otte <otte@gnome.org>
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 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
18/*
19 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
20 * file for a list of people on the GTK+ Team. See the ChangeLog
21 * files for a list of changes. These files are distributed with
22 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23 */
24
25#ifndef __GTK_SNAPSHOT_H__
26#define __GTK_SNAPSHOT_H__
27
28
29#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
30#error "Only <gtk/gtk.h> can be included directly."
31#endif
32
33#include <gsk/gsk.h>
34
35#include <gtk/gtktypes.h>
36
37G_BEGIN_DECLS
38
39typedef struct _GtkSnapshotClass GtkSnapshotClass;
40
41#define GTK_TYPE_SNAPSHOT (gtk_snapshot_get_type ())
42
43#define GTK_SNAPSHOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SNAPSHOT, GtkSnapshot))
44#define GTK_IS_SNAPSHOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SNAPSHOT))
45
46G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSnapshot, g_object_unref)
47
48
49
50GDK_AVAILABLE_IN_ALL
51GType gtk_snapshot_get_type (void) G_GNUC_CONST;
52
53GDK_AVAILABLE_IN_ALL
54GtkSnapshot * gtk_snapshot_new (void);
55GDK_AVAILABLE_IN_ALL
56GskRenderNode * gtk_snapshot_free_to_node (GtkSnapshot *snapshot);
57GDK_AVAILABLE_IN_ALL
58GdkPaintable * gtk_snapshot_free_to_paintable (GtkSnapshot *snapshot,
59 const graphene_size_t *size);
60
61GDK_AVAILABLE_IN_ALL
62GskRenderNode * gtk_snapshot_to_node (GtkSnapshot *snapshot);
63GDK_AVAILABLE_IN_ALL
64GdkPaintable * gtk_snapshot_to_paintable (GtkSnapshot *snapshot,
65 const graphene_size_t *size);
66
67GDK_AVAILABLE_IN_ALL
68void gtk_snapshot_push_debug (GtkSnapshot *snapshot,
69 const char *message,
70 ...) G_GNUC_PRINTF (2, 3);
71GDK_AVAILABLE_IN_ALL
72void gtk_snapshot_push_opacity (GtkSnapshot *snapshot,
73 double opacity);
74GDK_AVAILABLE_IN_ALL
75void gtk_snapshot_push_blur (GtkSnapshot *snapshot,
76 double radius);
77GDK_AVAILABLE_IN_ALL
78void gtk_snapshot_push_color_matrix (GtkSnapshot *snapshot,
79 const graphene_matrix_t*color_matrix,
80 const graphene_vec4_t *color_offset);
81GDK_AVAILABLE_IN_ALL
82void gtk_snapshot_push_repeat (GtkSnapshot *snapshot,
83 const graphene_rect_t *bounds,
84 const graphene_rect_t *child_bounds);
85GDK_AVAILABLE_IN_ALL
86void gtk_snapshot_push_clip (GtkSnapshot *snapshot,
87 const graphene_rect_t *bounds);
88GDK_AVAILABLE_IN_ALL
89void gtk_snapshot_push_rounded_clip (GtkSnapshot *snapshot,
90 const GskRoundedRect *bounds);
91GDK_AVAILABLE_IN_ALL
92void gtk_snapshot_push_shadow (GtkSnapshot *snapshot,
93 const GskShadow *shadow,
94 gsize n_shadows);
95GDK_AVAILABLE_IN_ALL
96void gtk_snapshot_push_blend (GtkSnapshot *snapshot,
97 GskBlendMode blend_mode);
98GDK_AVAILABLE_IN_ALL
99void gtk_snapshot_push_cross_fade (GtkSnapshot *snapshot,
100 double progress);
101GDK_AVAILABLE_IN_ALL
102void gtk_snapshot_push_gl_shader (GtkSnapshot *snapshot,
103 GskGLShader *shader,
104 const graphene_rect_t *bounds,
105 GBytes *take_args);
106GDK_AVAILABLE_IN_ALL
107void gtk_snapshot_gl_shader_pop_texture (GtkSnapshot *snapshot);
108GDK_AVAILABLE_IN_ALL
109void gtk_snapshot_pop (GtkSnapshot *snapshot);
110GDK_AVAILABLE_IN_ALL
111void gtk_snapshot_save (GtkSnapshot *snapshot);
112GDK_AVAILABLE_IN_ALL
113void gtk_snapshot_restore (GtkSnapshot *snapshot);
114GDK_AVAILABLE_IN_ALL
115void gtk_snapshot_transform (GtkSnapshot *snapshot,
116 GskTransform *transform);
117GDK_AVAILABLE_IN_ALL
118void gtk_snapshot_transform_matrix (GtkSnapshot *snapshot,
119 const graphene_matrix_t*matrix);
120GDK_AVAILABLE_IN_ALL
121void gtk_snapshot_translate (GtkSnapshot *snapshot,
122 const graphene_point_t *point);
123GDK_AVAILABLE_IN_ALL
124void gtk_snapshot_translate_3d (GtkSnapshot *snapshot,
125 const graphene_point3d_t*point);
126GDK_AVAILABLE_IN_ALL
127void gtk_snapshot_rotate (GtkSnapshot *snapshot,
128 float angle);
129GDK_AVAILABLE_IN_ALL
130void gtk_snapshot_rotate_3d (GtkSnapshot *snapshot,
131 float angle,
132 const graphene_vec3_t *axis);
133GDK_AVAILABLE_IN_ALL
134void gtk_snapshot_scale (GtkSnapshot *snapshot,
135 float factor_x,
136 float factor_y);
137GDK_AVAILABLE_IN_ALL
138void gtk_snapshot_scale_3d (GtkSnapshot *snapshot,
139 float factor_x,
140 float factor_y,
141 float factor_z);
142GDK_AVAILABLE_IN_ALL
143void gtk_snapshot_perspective (GtkSnapshot *snapshot,
144 float depth);
145GDK_AVAILABLE_IN_ALL
146void gtk_snapshot_append_node (GtkSnapshot *snapshot,
147 GskRenderNode *node);
148GDK_AVAILABLE_IN_ALL
149cairo_t * gtk_snapshot_append_cairo (GtkSnapshot *snapshot,
150 const graphene_rect_t *bounds);
151GDK_AVAILABLE_IN_ALL
152void gtk_snapshot_append_texture (GtkSnapshot *snapshot,
153 GdkTexture *texture,
154 const graphene_rect_t *bounds);
155GDK_AVAILABLE_IN_ALL
156void gtk_snapshot_append_color (GtkSnapshot *snapshot,
157 const GdkRGBA *color,
158 const graphene_rect_t *bounds);
159GDK_AVAILABLE_IN_ALL
160void gtk_snapshot_append_linear_gradient (GtkSnapshot *snapshot,
161 const graphene_rect_t *bounds,
162 const graphene_point_t *start_point,
163 const graphene_point_t *end_point,
164 const GskColorStop *stops,
165 gsize n_stops);
166GDK_AVAILABLE_IN_ALL
167void gtk_snapshot_append_repeating_linear_gradient (GtkSnapshot *snapshot,
168 const graphene_rect_t *bounds,
169 const graphene_point_t *start_point,
170 const graphene_point_t *end_point,
171 const GskColorStop *stops,
172 gsize n_stops);
173GDK_AVAILABLE_IN_ALL
174void gtk_snapshot_append_radial_gradient (GtkSnapshot *snapshot,
175 const graphene_rect_t *bounds,
176 const graphene_point_t *center,
177 float hradius,
178 float vradius,
179 float start,
180 float end,
181 const GskColorStop *stops,
182 gsize n_stops);
183GDK_AVAILABLE_IN_ALL
184void gtk_snapshot_append_repeating_radial_gradient (GtkSnapshot *snapshot,
185 const graphene_rect_t *bounds,
186 const graphene_point_t *center,
187 float hradius,
188 float vradius,
189 float start,
190 float end,
191 const GskColorStop *stops,
192 gsize n_stops);
193GDK_AVAILABLE_IN_ALL
194void gtk_snapshot_append_conic_gradient (GtkSnapshot *snapshot,
195 const graphene_rect_t *bounds,
196 const graphene_point_t *center,
197 float rotation,
198 const GskColorStop *stops,
199 gsize n_stops);
200GDK_AVAILABLE_IN_ALL
201void gtk_snapshot_append_border (GtkSnapshot *snapshot,
202 const GskRoundedRect *outline,
203 const float border_width[4],
204 const GdkRGBA border_color[4]);
205GDK_AVAILABLE_IN_ALL
206void gtk_snapshot_append_inset_shadow (GtkSnapshot *snapshot,
207 const GskRoundedRect *outline,
208 const GdkRGBA *color,
209 float dx,
210 float dy,
211 float spread,
212 float blur_radius);
213GDK_AVAILABLE_IN_ALL
214void gtk_snapshot_append_outset_shadow (GtkSnapshot *snapshot,
215 const GskRoundedRect *outline,
216 const GdkRGBA *color,
217 float dx,
218 float dy,
219 float spread,
220 float blur_radius);
221/* next function implemented in gskpango.c */
222GDK_AVAILABLE_IN_ALL
223void gtk_snapshot_append_layout (GtkSnapshot *snapshot,
224 PangoLayout *layout,
225 const GdkRGBA *color);
226
227
228GDK_AVAILABLE_IN_ALL
229void gtk_snapshot_render_background (GtkSnapshot *snapshot,
230 GtkStyleContext *context,
231 double x,
232 double y,
233 double width,
234 double height);
235GDK_AVAILABLE_IN_ALL
236void gtk_snapshot_render_frame (GtkSnapshot *snapshot,
237 GtkStyleContext *context,
238 double x,
239 double y,
240 double width,
241 double height);
242GDK_AVAILABLE_IN_ALL
243void gtk_snapshot_render_focus (GtkSnapshot *snapshot,
244 GtkStyleContext *context,
245 double x,
246 double y,
247 double width,
248 double height);
249GDK_AVAILABLE_IN_ALL
250void gtk_snapshot_render_layout (GtkSnapshot *snapshot,
251 GtkStyleContext *context,
252 double x,
253 double y,
254 PangoLayout *layout);
255GDK_AVAILABLE_IN_ALL /* in gtkstylecontext.c */
256void gtk_snapshot_render_insertion_cursor (GtkSnapshot *snapshot,
257 GtkStyleContext *context,
258 double x,
259 double y,
260 PangoLayout *layout,
261 int index,
262 PangoDirection direction);
263
264
265G_END_DECLS
266
267#endif /* __GTK_SNAPSHOT_H__ */
268

source code of gtk/gtk/gtksnapshot.h