Libcroco
cr-selector.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  *
21  * Author: Dodji Seketeli
22  * See COPYRIGHTS file for copyright information.
23  */
24 
25 #ifndef __CR_SELECTOR_H__
26 #define __CR_SELECTOR_H__
27 
28 #include <stdio.h>
29 #include "cr-utils.h"
30 #include "cr-simple-sel.h"
31 #include "cr-parsing-location.h"
32 
33 /**
34  *@file
35  *The declaration file of the #CRSelector file.
36  */
37 
38 G_BEGIN_DECLS
39 
40 typedef struct _CRSelector CRSelector ;
41 
42 /**
43  *Abstracts a CSS2 selector as defined in the right part
44  *of the 'ruleset" production in the appendix D.1 of the
45  *css2 spec.
46  *It is actually the abstraction of a comma separated list
47  *of simple selectors list.
48  *In a css2 file, a selector is a list of simple selectors
49  *separated by a comma.
50  *e.g: sel0, sel1, sel2 ...
51  *Each seln is a simple selector
52  */
54 {
55  /**
56  *A Selection expression.
57  *It is a list of basic selectors.
58  *Each basic selector can be either an element
59  *selector, an id selector, a class selector, an
60  *attribute selector, an universal selector etc ...
61  */
63 
64  /**The next selector list element*/
68  glong ref_count ;
69 };
70 
71 CRSelector* cr_selector_new (CRSimpleSel *a_sel_expr) ;
72 
73 CRSelector * cr_selector_parse_from_buf (const guchar * a_char_buf,
74  enum CREncoding a_enc) ;
75 
77 
79  CRSimpleSel *a_simple_sel) ;
80 
82 
83 guchar * cr_selector_to_string (CRSelector const *a_this) ;
84 
85 void cr_selector_dump (CRSelector const *a_this, FILE *a_fp) ;
86 
87 void cr_selector_ref (CRSelector *a_this) ;
88 
89 gboolean cr_selector_unref (CRSelector *a_this) ;
90 
91 void cr_selector_destroy (CRSelector *a_this) ;
92 
93 G_END_DECLS
94 
95 #endif /*__CR_SELECTOR_H__*/
cr_selector_new
CRSelector * cr_selector_new(CRSimpleSel *a_sel_expr)
cr_selector_new:
Definition: cr-selector.c:39
_CRSelector::prev
CRSelector * prev
Definition: cr-selector.h:66
cr_selector_to_string
guchar * cr_selector_to_string(CRSelector const *a_this)
Definition: cr-selector.c:141
_CRSelector::simple_sel
CRSimpleSel * simple_sel
A Selection expression.
Definition: cr-selector.h:62
cr-simple-sel.h
cr_selector_parse_from_buf
CRSelector * cr_selector_parse_from_buf(const guchar *a_char_buf, enum CREncoding a_enc)
Definition: cr-selector.c:54
cr_selector_dump
void cr_selector_dump(CRSelector const *a_this, FILE *a_fp)
cr_selector_dump:
Definition: cr-selector.c:191
cr_selector_prepend
CRSelector * cr_selector_prepend(CRSelector *a_this, CRSelector *a_new)
cr_selector_prepend:
Definition: cr-selector.c:106
_CRSelector::location
CRParsingLocation location
Definition: cr-selector.h:67
cr_selector_append_simple_sel
CRSelector * cr_selector_append_simple_sel(CRSelector *a_this, CRSimpleSel *a_simple_sel)
cr_selector_append_simple_sel:
Definition: cr-selector.c:129
_CRParsingLocation
Definition: cr-parsing-location.h:39
_CRSelector::next
CRSelector * next
The next selector list element.
Definition: cr-selector.h:65
cr_selector_unref
gboolean cr_selector_unref(CRSelector *a_this)
cr_selector_unref:
Definition: cr-selector.c:235
_CRSimpleSel
The abstraction of a css2 simple selection list as defined by the right part of the "selector" produc...
Definition: cr-simple-sel.h:74
cr_selector_destroy
void cr_selector_destroy(CRSelector *a_this)
cr_selector_destroy:
Definition: cr-selector.c:259
cr_selector_append
CRSelector * cr_selector_append(CRSelector *a_this, CRSelector *a_new)
cr_selector_append:
Definition: cr-selector.c:78
cr-parsing-location.h
CREncoding
CREncoding
Encoding values.
Definition: cr-utils.h:84
_CRSelector::ref_count
glong ref_count
Definition: cr-selector.h:68
CRSelector
typedefG_BEGIN_DECLS struct _CRSelector CRSelector
Definition: cr-selector.h:40
cr-utils.h
cr_selector_ref
void cr_selector_ref(CRSelector *a_this)
cr_selector_ref:
Definition: cr-selector.c:214
_CRSelector
Abstracts a CSS2 selector as defined in the right part of the 'ruleset" production in the appendix D....
Definition: cr-selector.h:53