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"
|
|
|
|
|
2019-02-19 07:24:59 +00:00
|
|
|
#include "gsk/gskrendernodeprivate.h"
|
|
|
|
|
2016-11-07 18:10:49 +00:00
|
|
|
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,
|
2018-04-24 01:17:23 +00:00
|
|
|
guint n_nodes);
|
2016-12-13 08:40:24 +00:00
|
|
|
|
2016-11-17 00:55:26 +00:00
|
|
|
struct _GtkSnapshotState {
|
2017-10-01 12:28:11 +00:00
|
|
|
guint start_node_index;
|
|
|
|
guint n_nodes;
|
2016-11-07 18:10:49 +00:00
|
|
|
|
2019-02-28 08:52:49 +00:00
|
|
|
GskTransform * transform;
|
2016-12-13 08:40:24 +00:00
|
|
|
|
|
|
|
GtkSnapshotCollectFunc collect_func;
|
2017-01-11 10:21:27 +00:00
|
|
|
union {
|
|
|
|
struct {
|
2019-03-01 05:35:55 +00:00
|
|
|
double opacity;
|
2017-01-11 10:21:27 +00:00
|
|
|
} opacity;
|
2017-09-03 03:50:39 +00:00
|
|
|
struct {
|
2019-03-01 05:35:55 +00:00
|
|
|
double radius;
|
2017-09-03 03:50:39 +00:00
|
|
|
} 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;
|
2018-04-24 01:17:23 +00:00
|
|
|
struct {
|
|
|
|
char *message;
|
|
|
|
} debug;
|
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! */
|
|
|
|
|
2018-06-19 17:52:52 +00:00
|
|
|
GArray *state_stack;
|
2017-10-01 12:28:11 +00:00
|
|
|
GPtrArray *nodes;
|
2019-01-16 07:30:42 +00:00
|
|
|
|
|
|
|
guint from_parent : 1;
|
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
|
|
|
void gtk_snapshot_append_node_internal (GtkSnapshot *snapshot,
|
|
|
|
GskRenderNode *node);
|
2018-03-20 03:33:58 +00:00
|
|
|
|
2019-01-16 07:30:42 +00:00
|
|
|
GtkSnapshot * gtk_snapshot_new_with_parent (GtkSnapshot *parent_snapshot);
|
|
|
|
|
2019-02-21 02:07:14 +00:00
|
|
|
void gtk_snapshot_append_text (GtkSnapshot *snapshot,
|
|
|
|
PangoFont *font,
|
|
|
|
PangoGlyphString *glyphs,
|
|
|
|
const GdkRGBA *color,
|
|
|
|
float x,
|
|
|
|
float y);
|
2016-11-07 18:10:49 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GTK_SNAPSHOT_PRIVATE_H__ */
|