1/* GTK - The GIMP Toolkit
2 * Copyright (C) 2011 Red Hat, Inc.
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#ifndef __GTK_CSS_SECTION_H__
19#define __GTK_CSS_SECTION_H__
20
21#include <gio/gio.h>
22#include <gdk/gdk.h>
23
24G_BEGIN_DECLS
25
26#define GTK_TYPE_CSS_SECTION (gtk_css_section_get_type ())
27
28/**
29 * GtkCssSectionType:
30 * @GTK_CSS_SECTION_DOCUMENT: The section describes a complete document.
31 * This section time is the only one where gtk_css_section_get_parent()
32 * might return %NULL.
33 * @GTK_CSS_SECTION_IMPORT: The section defines an import rule.
34 * @GTK_CSS_SECTION_COLOR_DEFINITION: The section defines a color. This
35 * is a GTK extension to CSS.
36 * @GTK_CSS_SECTION_BINDING_SET: The section defines a binding set. This
37 * is a GTK extension to CSS.
38 * @GTK_CSS_SECTION_RULESET: The section defines a CSS ruleset.
39 * @GTK_CSS_SECTION_SELECTOR: The section defines a CSS selector.
40 * @GTK_CSS_SECTION_DECLARATION: The section defines the declaration of
41 * a CSS variable.
42 * @GTK_CSS_SECTION_VALUE: The section defines the value of a CSS declaration.
43 * @GTK_CSS_SECTION_KEYFRAMES: The section defines keyframes. See [CSS
44 * Animations](http://dev.w3.org/csswg/css3-animations/#keyframes) for details. Since 3.6
45 *
46 * The different types of sections indicate parts of a CSS document as
47 * parsed by GTK’s CSS parser. They are oriented towards the
48 * [CSS Grammar](http://www.w3.org/TR/CSS21/grammar.html),
49 * but may contain extensions.
50 *
51 * More types might be added in the future as the parser incorporates
52 * more features.
53 *
54 * Since: 3.2
55 */
56typedef enum
57{
58 GTK_CSS_SECTION_DOCUMENT,
59 GTK_CSS_SECTION_IMPORT,
60 GTK_CSS_SECTION_COLOR_DEFINITION,
61 GTK_CSS_SECTION_BINDING_SET,
62 GTK_CSS_SECTION_RULESET,
63 GTK_CSS_SECTION_SELECTOR,
64 GTK_CSS_SECTION_DECLARATION,
65 GTK_CSS_SECTION_VALUE,
66 GTK_CSS_SECTION_KEYFRAMES
67} GtkCssSectionType;
68
69/**
70 * GtkCssSection:
71 *
72 * Defines a part of a CSS document. Because sections are nested into
73 * one another, you can use gtk_css_section_get_parent() to get the
74 * containing region.
75 *
76 * Since: 3.2
77 */
78typedef struct _GtkCssSection GtkCssSection;
79
80GDK_AVAILABLE_IN_3_2
81GType gtk_css_section_get_type (void) G_GNUC_CONST;
82
83GDK_AVAILABLE_IN_3_2
84GtkCssSection * gtk_css_section_ref (GtkCssSection *section);
85GDK_AVAILABLE_IN_3_2
86void gtk_css_section_unref (GtkCssSection *section);
87
88GDK_AVAILABLE_IN_3_2
89GtkCssSectionType gtk_css_section_get_section_type (const GtkCssSection *section);
90GDK_AVAILABLE_IN_3_2
91GtkCssSection * gtk_css_section_get_parent (const GtkCssSection *section);
92GDK_AVAILABLE_IN_3_2
93GFile * gtk_css_section_get_file (const GtkCssSection *section);
94GDK_AVAILABLE_IN_3_2
95guint gtk_css_section_get_start_line (const GtkCssSection *section);
96GDK_AVAILABLE_IN_3_2
97guint gtk_css_section_get_start_position (const GtkCssSection *section);
98GDK_AVAILABLE_IN_3_2
99guint gtk_css_section_get_end_line (const GtkCssSection *section);
100GDK_AVAILABLE_IN_3_2
101guint gtk_css_section_get_end_position (const GtkCssSection *section);
102
103G_END_DECLS
104
105#endif /* __GTK_CSS_SECTION_H__ */
106

source code of include/gtk-3.0/gtk/gtkcsssection.h