diff options
author | Benjamin Otte <otte@redhat.com> | 2011-06-17 02:02:24 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-08-26 16:26:27 +0200 |
commit | 00d14e35157d7512ec9892bcc5eebdc186ad52e3 (patch) | |
tree | f6883587bb7116d7369db6b7c12a99c907a7693e /gtk/gtkcsssection.h | |
parent | c8fdd5e847181997cf8f366a1d47bff53d0d7976 (diff) | |
download | gtk+-00d14e35157d7512ec9892bcc5eebdc186ad52e3.tar.gz |
API: css: Add GtkCssSection
This struct keeps track of an area of text in a CSS file and uses it
when specifying information. Also, the cssprovider keeps track of
sections when parsing a file.
Diffstat (limited to 'gtk/gtkcsssection.h')
-rw-r--r-- | gtk/gtkcsssection.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/gtk/gtkcsssection.h b/gtk/gtkcsssection.h new file mode 100644 index 0000000000..761ebd1102 --- /dev/null +++ b/gtk/gtkcsssection.h @@ -0,0 +1,82 @@ +/* GTK - The GIMP Toolkit + * Copyright (C) 2011 Red Hat, Inc. + * + * 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, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GTK_CSS_SECTION_H__ +#define __GTK_CSS_SECTION_H__ + +#include <gio/gio.h> + +G_BEGIN_DECLS + +#define GTK_TYPE_CSS_SECTION (gtk_css_section_get_type ()) + +/** + * GtkCssSection: + * @GTK_CSS_SECTION_DOCUMENT: The section describes a complete document. + * This section time is the only one where gtk_css_section_get_parent() + * might return %NULL. + * @GTK_CSS_SECTION_IMPORT: The section defines an import rule. + * @GTK_CSS_SECTION_COLOR_DEFINITION: The section defines a color. This + * is a GTK extension to CSS. + * @GTK_CSS_SECTION_BINDING_SET: The section defines a binding set. This + * is a GTK extension to CSS. + * @GTK_CSS_SECTION_RULESET: The section defines a CSS ruleset. + * @GTK_CSS_SECTION_SELECTOR: The section defines a CSS selector. + * @GTK_CSS_SECTION_DECLARATION: The section defines the declaration of + * a CSS variable. + * + * The different types of sections indicate parts of a CSS document as + * parsed by GTK's CSS parser. They are oriented towards the CSS grammar + * <ulink url="http://www.w3.org/TR/CSS21/grammar.html">CSS grammer</ulink>, + * but may contain extensions. + * + * More types might be added in the future as the parser incorporates + * more features. + * + * Since: 3.2 + */ +typedef enum +{ + GTK_CSS_SECTION_DOCUMENT, + GTK_CSS_SECTION_IMPORT, + GTK_CSS_SECTION_COLOR_DEFINITION, + GTK_CSS_SECTION_BINDING_SET, + GTK_CSS_SECTION_RULESET, + GTK_CSS_SECTION_SELECTOR, + GTK_CSS_SECTION_DECLARATION, +} GtkCssSectionType; + +typedef struct _GtkCssSection GtkCssSection; + +GType gtk_css_section_get_type (void) G_GNUC_CONST; + +GtkCssSection * gtk_css_section_ref (GtkCssSection *section); +void gtk_css_section_unref (GtkCssSection *section); + +GtkCssSectionType gtk_css_section_get_section_type (const GtkCssSection *section); +GtkCssSection * gtk_css_section_get_parent (const GtkCssSection *section); +GFile * gtk_css_section_get_file (const GtkCssSection *section); +guint gtk_css_section_get_start_line (const GtkCssSection *section); +guint gtk_css_section_get_start_position (const GtkCssSection *section); +guint gtk_css_section_get_end_line (const GtkCssSection *section); +guint gtk_css_section_get_end_position (const GtkCssSection *section); + +G_END_DECLS + +#endif /* __GTK_CSS_SECTION_H__ */ |