1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
/* GTK - The GIMP Toolkit
* Copyright (C) 2010 Carlos Garnacho <carlosg@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/>.
*/
#pragma once
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#include <gtk/css/gtkcss.h>
#include <gtk/gtkborder.h>
#include <gtk/gtkstyleprovider.h>
#include <gtk/gtktypes.h>
G_BEGIN_DECLS
#define GTK_TYPE_STYLE_CONTEXT (gtk_style_context_get_type ())
#define GTK_STYLE_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_STYLE_CONTEXT, GtkStyleContext))
#define GTK_STYLE_CONTEXT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_STYLE_CONTEXT, GtkStyleContextClass))
#define GTK_IS_STYLE_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_STYLE_CONTEXT))
#define GTK_IS_STYLE_CONTEXT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_STYLE_CONTEXT))
#define GTK_STYLE_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_STYLE_CONTEXT, GtkStyleContextClass))
typedef struct _GtkStyleContextClass GtkStyleContextClass;
struct _GtkStyleContext
{
GObject parent_object;
};
struct _GtkStyleContextClass
{
GObjectClass parent_class;
void (* changed) (GtkStyleContext *context);
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
};
GDK_AVAILABLE_IN_ALL
GType gtk_style_context_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_IN_4_10
void gtk_style_context_add_provider (GtkStyleContext *context,
GtkStyleProvider *provider,
guint priority);
GDK_DEPRECATED_IN_4_10
void gtk_style_context_remove_provider (GtkStyleContext *context,
GtkStyleProvider *provider);
GDK_DEPRECATED_IN_4_10
void gtk_style_context_save (GtkStyleContext *context);
GDK_DEPRECATED_IN_4_10
void gtk_style_context_restore (GtkStyleContext *context);
GDK_DEPRECATED_IN_4_10
void gtk_style_context_set_state (GtkStyleContext *context,
GtkStateFlags flags);
GDK_DEPRECATED_IN_4_10
GtkStateFlags gtk_style_context_get_state (GtkStyleContext *context);
GDK_DEPRECATED_IN_4_10
void gtk_style_context_set_scale (GtkStyleContext *context,
int scale);
GDK_DEPRECATED_IN_4_10
int gtk_style_context_get_scale (GtkStyleContext *context);
GDK_DEPRECATED_IN_4_10
void gtk_style_context_add_class (GtkStyleContext *context,
const char *class_name);
GDK_DEPRECATED_IN_4_10
void gtk_style_context_remove_class (GtkStyleContext *context,
const char *class_name);
GDK_DEPRECATED_IN_4_10
gboolean gtk_style_context_has_class (GtkStyleContext *context,
const char *class_name);
GDK_DEPRECATED_IN_4_10
void gtk_style_context_set_display (GtkStyleContext *context,
GdkDisplay *display);
GDK_DEPRECATED_IN_4_10
GdkDisplay *gtk_style_context_get_display (GtkStyleContext *context);
GDK_DEPRECATED_IN_4_10
gboolean gtk_style_context_lookup_color (GtkStyleContext *context,
const char *color_name,
GdkRGBA *color);
/* Some helper functions to retrieve most common properties */
GDK_DEPRECATED_IN_4_10
void gtk_style_context_get_color (GtkStyleContext *context,
GdkRGBA *color);
GDK_DEPRECATED_IN_4_10
void gtk_style_context_get_border (GtkStyleContext *context,
GtkBorder *border);
GDK_DEPRECATED_IN_4_10
void gtk_style_context_get_padding (GtkStyleContext *context,
GtkBorder *padding);
GDK_DEPRECATED_IN_4_10
void gtk_style_context_get_margin (GtkStyleContext *context,
GtkBorder *margin);
typedef enum {
GTK_STYLE_CONTEXT_PRINT_NONE = 0,
GTK_STYLE_CONTEXT_PRINT_RECURSE = 1 << 0,
GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE = 1 << 1,
GTK_STYLE_CONTEXT_PRINT_SHOW_CHANGE = 1 << 2
} GtkStyleContextPrintFlags;
GDK_DEPRECATED_IN_4_10
char * gtk_style_context_to_string (GtkStyleContext *context,
GtkStyleContextPrintFlags flags);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkStyleContext, g_object_unref)
G_END_DECLS
|