Libcroco
cr-declaration.h
Go to the documentation of this file.
1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
2 
3 /*
4  * This file is part of The Croco Library
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of version 2.1 of the GNU Lesser General Public
8  * License as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18  * USA
19  *
20  * See the COPYRIGHTS file for copyright information.
21  */
22 
23 #ifndef __CR_DECLARATION_H__
24 #define __CR_DECLARATION_H__
25 
26 #include <stdio.h>
27 #include "cr-utils.h"
28 #include "cr-term.h"
29 #include "cr-parsing-location.h"
30 
31 G_BEGIN_DECLS
32 
33 /**
34  *@file
35  *The declaration of the #CRDeclaration class.
36  */
37 
38 /*forward declaration of what is defined in cr-statement.h*/
39 typedef struct _CRStatement CRStatement ;
40 
41 /**
42  *The abstraction of a css declaration defined by the
43  *css2 spec in chapter 4.
44  *It is actually a chained list of property/value pairs.
45  */
46 typedef struct _CRDeclaration CRDeclaration ;
48 {
49  /**The property.*/
51 
52  /**The value of the property.*/
54 
55  /*the ruleset that contains this declaration*/
57 
58  /*the next declaration*/
60 
61  /*the previous one declaration*/
63 
64  /*does the declaration have the important keyword ?*/
65  gboolean important ;
66 
67  glong ref_count ;
68 
70  /*reserved for future usage*/
71  gpointer rfu0 ;
72  gpointer rfu1 ;
73  gpointer rfu2 ;
74  gpointer rfu3 ;
75 } ;
76 
77 
79  CRString *a_property,
80  CRTerm *a_value) ;
81 
82 
84  const guchar *a_str,
85  enum CREncoding a_enc) ;
86 
88  enum CREncoding a_enc) ;
89 
91  CRDeclaration *a_new) ;
92 
94  CRString *a_prop,
95  CRTerm *a_value) ;
96 
98  CRDeclaration *a_new) ;
99 
101 
102 void
103 cr_declaration_dump (CRDeclaration const *a_this,
104  FILE *a_fp, glong a_indent,
105  gboolean a_one_per_line) ;
106 
107 void cr_declaration_dump_one (CRDeclaration const *a_this,
108  FILE *a_fp, glong a_indent) ;
109 
110 gint cr_declaration_nr_props (CRDeclaration const *a_this) ;
111 
113  int itemnr) ;
114 
116  const guchar *a_str) ;
117 
118 gchar * cr_declaration_to_string (CRDeclaration const *a_this,
119  gulong a_indent) ;
120 
121 guchar * cr_declaration_list_to_string (CRDeclaration const *a_this,
122  gulong a_indent) ;
123 
124 guchar * cr_declaration_list_to_string2 (CRDeclaration const *a_this,
125  gulong a_indent,
126  gboolean a_one_decl_per_line) ;
127 
128 void cr_declaration_ref (CRDeclaration *a_this) ;
129 
130 gboolean cr_declaration_unref (CRDeclaration *a_this) ;
131 
132 void cr_declaration_destroy (CRDeclaration *a_this) ;
133 
134 G_END_DECLS
135 
136 #endif /*__CR_DECLARATION_H__*/
CRDeclaration * cr_declaration_append(CRDeclaration *a_this, CRDeclaration *a_new)
cr_declaration_append: @a_this: the current declaration list.
CRDeclaration * cr_declaration_new(CRStatement *a_statement, CRString *a_property, CRTerm *a_value)
cr_declaration_new: @a_statement: the statement this declaration belongs to.
CRDeclaration * prev
CRDeclaration * cr_declaration_get_from_list(CRDeclaration *a_this, int itemnr)
cr_declaration_get_from_list: @a_this: the current instance of CRDeclaration.
CRDeclaration * cr_declaration_append2(CRDeclaration *a_this, CRString *a_prop, CRTerm *a_value)
cr_declaration_append2: @a_this: the current declaration list.
The Croco library basic types definitions And global definitions.
CRTerm * value
The value of the property.
The declaration of the CRParsingLocation object.
CREncoding
Encoding values.
Definition: cr-utils.h:84
CRParsingLocation location
gint cr_declaration_nr_props(CRDeclaration const *a_this)
cr_declaration_nr_props: @a_this: the current instance of CRDeclaration.
CRDeclaration * cr_declaration_parse_list_from_buf(const guchar *a_str, enum CREncoding a_enc)
cr_declaration_parse_list_from_buf: @a_str: the input buffer that contains the list of declaration to...
CRDeclaration * cr_declaration_prepend(CRDeclaration *a_this, CRDeclaration *a_new)
cr_declaration_prepend: @a_this: the current declaration list.
gboolean cr_declaration_unref(CRDeclaration *a_this)
cr_declaration_unref: @a_this: the current instance of CRDeclaration.
CRDeclaration * cr_declaration_get_by_prop_name(CRDeclaration *a_this, const guchar *a_str)
cr_declaration_get_by_prop_name: @a_this: the current instance of CRDeclaration.
The abstraction of css statement as defined in the chapter 4 and appendix D.1 of the css2 spec.
Definition: cr-statement.h:182
gchar * cr_declaration_to_string(CRDeclaration const *a_this, gulong a_indent)
cr_declaration_to_string: @a_this: the current instance of CRDeclaration.
CRString * property
The property.
CRStatement * parent_statement
typedefG_BEGIN_DECLS struct _CRString CRString
Definition: cr-string.h:37
void cr_declaration_dump(CRDeclaration const *a_this, FILE *a_fp, glong a_indent, gboolean a_one_per_line)
cr_declaration_dump: @a_this: the current instance of CRDeclaration.
CRDeclaration * next
void cr_declaration_destroy(CRDeclaration *a_this)
cr_declaration_destroy: @a_this: the current instance of CRDeclaration.
An abstraction of a css2 term as defined in the CSS2 spec in appendix D.1: term ::= [ NUMBER S* | PER...
Definition: cr-term.h:82
CRDeclaration * cr_declaration_unlink(CRDeclaration *a_decl)
cr_declaration_unlink: @a_decls: the declaration to unlink.
gboolean important
CRDeclaration * cr_declaration_parse_from_buf(CRStatement *a_statement, const guchar *a_str, enum CREncoding a_enc)
cr_declaration_parse_from_buf: @a_statement: the parent css2 statement of this this declaration.
Declaration of the #CRTem class.
void cr_declaration_ref(CRDeclaration *a_this)
cr_declaration_ref: @a_this: the current instance of CRDeclaration.
guchar * cr_declaration_list_to_string2(CRDeclaration const *a_this, gulong a_indent, gboolean a_one_decl_per_line)
cr_declaration_list_to_string2: @a_this: the current instance of CRDeclaration.
void cr_declaration_dump_one(CRDeclaration const *a_this, FILE *a_fp, glong a_indent)
cr_declaration_dump_one: @a_this: the current instance of CRDeclaration.
guchar * cr_declaration_list_to_string(CRDeclaration const *a_this, gulong a_indent)
cr_declaration_list_to_string: @a_this: the current instance of CRDeclaration.