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-10-01 11:49:01 +00:00
|
|
|
typedef GskRenderNode * (* GtkSnapshotCollectFunc) (GtkSnapshot *snapshot,
|
|
|
|
GtkSnapshotState *state,
|
2017-01-11 10:21:27 +00:00
|
|
|
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 {
|
2016-12-13 01:33:15 +00:00
|
|
|
char *name;
|
2017-10-01 12:28:11 +00:00
|
|
|
guint start_node_index;
|
|
|
|
guint n_nodes;
|
2016-11-07 18:10:49 +00:00
|
|
|
|
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;
|
2017-09-03 03:50:39 +00:00
|
|
|
struct {
|
|
|
|
double radius;
|
|
|
|
} blur;
|
2017-01-11 10:21:27 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2018-03-18 18:21:33 +00:00
|
|
|
/* This is a nasty little hack. We typedef GtkSnapshot to the fake object GdkSnapshot
|
|
|
|
* so that we don't need to typecast between them.
|
|
|
|
* After all, the GdkSnapshot only exist so poor language bindings don't trip. Hardcore
|
|
|
|
* C code can just blatantly ignore such layering violations with a typedef.
|
|
|
|
*/
|
2018-02-16 05:30:48 +00:00
|
|
|
struct _GdkSnapshot {
|
2018-03-18 18:21:33 +00:00
|
|
|
GObject parent_instance; /* it's really GdkSnapshot, but don't tell anyone! */
|
|
|
|
|
2017-01-11 09:08:58 +00:00
|
|
|
gboolean record_names;
|
2017-10-01 11:49:01 +00:00
|
|
|
GArray *state_stack;
|
2017-10-01 12:28:11 +00:00
|
|
|
GPtrArray *nodes;
|
2016-11-17 00:55:26 +00:00
|
|
|
};
|
|
|
|
|
2018-03-18 18:21:33 +00:00
|
|
|
struct _GtkSnapshotClass {
|
|
|
|
GObjectClass parent_class; /* it's really GdkSnapshotClass, but don't tell anyone! */
|
|
|
|
};
|
|
|
|
|
2018-03-31 15:52:47 +00:00
|
|
|
GtkSnapshot * gtk_snapshot_new_child (GtkSnapshot *parent,
|
|
|
|
const char *name,
|
|
|
|
...) G_GNUC_PRINTF (2, 3);
|
|
|
|
void gtk_snapshot_append_node_internal (GtkSnapshot *snapshot,
|
|
|
|
GskRenderNode *node);
|
2018-03-20 03:33:58 +00:00
|
|
|
|
2016-11-07 18:10:49 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GTK_SNAPSHOT_PRIVATE_H__ */
|