]> Pileus Git - ~andy/gtk/blob - gtk/gtkcsssection.h
742abeb96d27318bd84202a90991d71192b20bb5
[~andy/gtk] / gtk / gtkcsssection.h
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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __GTK_CSS_SECTION_H__
21 #define __GTK_CSS_SECTION_H__
22
23 #include <gio/gio.h>
24 #include <gdk/gdk.h>
25
26 G_BEGIN_DECLS
27
28 #define GTK_TYPE_CSS_SECTION         (gtk_css_section_get_type ())
29
30 /**
31  * GtkCssSection:
32  * @GTK_CSS_SECTION_DOCUMENT: The section describes a complete document.
33  *   This section time is the only one where gtk_css_section_get_parent()
34  *   might return %NULL.
35  * @GTK_CSS_SECTION_IMPORT: The section defines an import rule.
36  * @GTK_CSS_SECTION_COLOR_DEFINITION: The section defines a color. This
37  *   is a GTK extension to CSS.
38  * @GTK_CSS_SECTION_BINDING_SET: The section defines a binding set. This
39  *   is a GTK extension to CSS.
40  * @GTK_CSS_SECTION_RULESET: The section defines a CSS ruleset.
41  * @GTK_CSS_SECTION_SELECTOR: The section defines a CSS selector.
42  * @GTK_CSS_SECTION_DECLARATION: The section defines the declaration of
43  *   a CSS variable.
44  * @GTK_CSS_SECTION_VALUE: The section defines the value of a CSS declaration.
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 CSS grammar
48  * <ulink url="http://www.w3.org/TR/CSS21/grammar.html">CSS grammer</ulink>,
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  */
56 typedef 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 } GtkCssSectionType;
67
68 typedef struct _GtkCssSection GtkCssSection;
69
70 GDK_AVAILABLE_IN_3_2
71 GType              gtk_css_section_get_type            (void) G_GNUC_CONST;
72
73 GDK_AVAILABLE_IN_3_2
74 GtkCssSection *    gtk_css_section_ref                 (GtkCssSection        *section);
75 GDK_AVAILABLE_IN_3_2
76 void               gtk_css_section_unref               (GtkCssSection        *section);
77
78 GDK_AVAILABLE_IN_3_2
79 GtkCssSectionType  gtk_css_section_get_section_type    (const GtkCssSection  *section);
80 GDK_AVAILABLE_IN_3_2
81 GtkCssSection *    gtk_css_section_get_parent          (const GtkCssSection  *section);
82 GDK_AVAILABLE_IN_3_2
83 GFile *            gtk_css_section_get_file            (const GtkCssSection  *section);
84 GDK_AVAILABLE_IN_3_2
85 guint              gtk_css_section_get_start_line      (const GtkCssSection  *section);
86 GDK_AVAILABLE_IN_3_2
87 guint              gtk_css_section_get_start_position  (const GtkCssSection  *section);
88 GDK_AVAILABLE_IN_3_2
89 guint              gtk_css_section_get_end_line        (const GtkCssSection  *section);
90 GDK_AVAILABLE_IN_3_2
91 guint              gtk_css_section_get_end_position    (const GtkCssSection  *section);
92
93 G_END_DECLS
94
95 #endif /* __GTK_CSS_SECTION_H__ */