2016-11-07 18:10:49 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* Copyright (C) 2016 Benjamin Otte <otte@gnome.org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GTK_SNAPSHOT_PRIVATE_H__
|
|
|
|
#define __GTK_SNAPSHOT_PRIVATE_H__
|
|
|
|
|
|
|
|
#include "gtksnapshot.h"
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2016-11-17 00:55:26 +00:00
|
|
|
typedef struct _GtkSnapshotState GtkSnapshotState;
|
|
|
|
|
2017-01-11 10:21:27 +00:00
|
|
|
typedef GskRenderNode * (* GtkSnapshotCollectFunc) (GtkSnapshotState *state,
|
|
|
|
GskRenderNode **nodes,
|
|
|
|
guint n_nodes,
|
|
|
|
const char *name);
|
2016-12-13 08:40:24 +00:00
|
|
|
|
2016-11-17 00:55:26 +00:00
|
|
|
struct _GtkSnapshotState {
|
|
|
|
GtkSnapshotState *parent;
|
2017-01-11 10:41:46 +00:00
|
|
|
GtkSnapshotState *cached_state; /* A cleared state object we can (re)use */
|
2016-11-17 00:55:26 +00:00
|
|
|
|
2016-12-13 01:33:15 +00:00
|
|
|
char *name;
|
|
|
|
GPtrArray *nodes;
|
2016-11-07 18:10:49 +00:00
|
|
|
|
2016-12-13 00:44:52 +00:00
|
|
|
cairo_region_t *clip_region;
|
2017-01-11 15:14:03 +00:00
|
|
|
int translate_x;
|
|
|
|
int translate_y;
|
2016-12-13 08:40:24 +00:00
|
|
|
|
|
|
|
GtkSnapshotCollectFunc collect_func;
|
2017-01-11 10:21:27 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
graphene_matrix_t transform;
|
|
|
|
} transform;
|
|
|
|
struct {
|
|
|
|
double opacity;
|
|
|
|
} opacity;
|
|
|
|
struct {
|
|
|
|
graphene_matrix_t matrix;
|
|
|
|
graphene_vec4_t offset;
|
|
|
|
} color_matrix;
|
|
|
|
struct {
|
|
|
|
graphene_rect_t bounds;
|
|
|
|
graphene_rect_t child_bounds;
|
|
|
|
} repeat;
|
|
|
|
struct {
|
|
|
|
graphene_rect_t bounds;
|
|
|
|
} clip;
|
|
|
|
struct {
|
|
|
|
GskRoundedRect bounds;
|
|
|
|
} rounded_clip;
|
|
|
|
struct {
|
|
|
|
gsize n_shadows;
|
|
|
|
GskShadow *shadows;
|
|
|
|
GskShadow a_shadow; /* Used if n_shadows == 1 */
|
|
|
|
} shadow;
|
2017-01-12 22:20:31 +00:00
|
|
|
struct {
|
|
|
|
GskBlendMode blend_mode;
|
|
|
|
GskRenderNode *bottom_node;
|
|
|
|
} blend;
|
2017-01-12 21:00:38 +00:00
|
|
|
struct {
|
|
|
|
double progress;
|
|
|
|
GskRenderNode *start_node;
|
|
|
|
} cross_fade;
|
2017-01-11 10:21:27 +00:00
|
|
|
} data;
|
2016-11-07 18:10:49 +00:00
|
|
|
};
|
|
|
|
|
2016-11-17 00:55:26 +00:00
|
|
|
struct _GtkSnapshot {
|
|
|
|
GtkSnapshotState *state;
|
2017-01-11 09:08:58 +00:00
|
|
|
gboolean record_names;
|
2016-11-17 00:55:26 +00:00
|
|
|
GskRenderer *renderer;
|
|
|
|
};
|
|
|
|
|
2016-11-07 18:10:49 +00:00
|
|
|
void gtk_snapshot_init (GtkSnapshot *state,
|
2016-11-17 01:14:10 +00:00
|
|
|
GskRenderer *renderer,
|
2017-01-11 09:08:58 +00:00
|
|
|
gboolean record_names,
|
2016-12-09 20:33:38 +00:00
|
|
|
const cairo_region_t *clip,
|
|
|
|
const char *name,
|
2017-01-11 09:08:58 +00:00
|
|
|
...) G_GNUC_PRINTF (5, 6);
|
2016-11-11 23:37:54 +00:00
|
|
|
GskRenderNode * gtk_snapshot_finish (GtkSnapshot *state);
|
2016-11-07 18:10:49 +00:00
|
|
|
|
2016-12-13 04:08:40 +00:00
|
|
|
GskRenderer * gtk_snapshot_get_renderer (const GtkSnapshot *snapshot);
|
|
|
|
|
2016-11-07 18:10:49 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GTK_SNAPSHOT_PRIVATE_H__ */
|