1/* GTK - The GIMP Toolkit
2 * Copyright (C) 2014 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#include "config.h"
19
20#include "gtkcsstransientnodeprivate.h"
21#include "gtkprivate.h"
22
23G_DEFINE_TYPE (GtkCssTransientNode, gtk_css_transient_node, GTK_TYPE_CSS_NODE)
24
25static GtkCssStyle *
26gtk_css_transient_node_update_style (GtkCssNode *cssnode,
27 const GtkCountingBloomFilter *filter,
28 GtkCssChange change,
29 gint64 timestamp,
30 GtkCssStyle *style)
31{
32 /* This should get rid of animations */
33 return GTK_CSS_NODE_CLASS (gtk_css_transient_node_parent_class)->update_style (cssnode, filter, change, 0, style);
34}
35
36static void
37gtk_css_transient_node_class_init (GtkCssTransientNodeClass *klass)
38{
39 GtkCssNodeClass *node_class = GTK_CSS_NODE_CLASS (klass);
40
41 node_class->update_style = gtk_css_transient_node_update_style;
42}
43
44static void
45gtk_css_transient_node_init (GtkCssTransientNode *cssnode)
46{
47 gtk_css_node_set_visible (GTK_CSS_NODE (cssnode), FALSE);
48}
49
50GtkCssNode *
51gtk_css_transient_node_new (GtkCssNode *parent)
52{
53 GtkCssNode *result;
54
55 gtk_internal_return_val_if_fail (GTK_IS_CSS_NODE (parent), NULL);
56
57 result = g_object_new (GTK_TYPE_CSS_TRANSIENT_NODE, NULL);
58 gtk_css_node_declaration_unref (decl: result->decl);
59 result->decl = gtk_css_node_declaration_ref (decl: parent->decl);
60
61 return result;
62}
63
64

source code of gtk/gtk/gtkcsstransientnode.c