Libcroco
cr-simple-sel.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  * Author: Dodji Seketeli
21  * See COPYRIGHTS file for copyright information.
22  */
23 
24 
25 #ifndef __CR_SEL_H__
26 #define __CR_SEL_H__
27 
28 #include <stdio.h>
29 #include <glib.h>
30 #include "cr-additional-sel.h"
31 #include "cr-parsing-location.h"
32 
33 G_BEGIN_DECLS
34 
35 /**
36  *@file
37  *the declaration of the #CRSimpleSel class.
38  *
39  */
41 {
43  COMB_WS,/*whitespace: descendent*/
44  COMB_PLUS,/*'+': preceded by*/
45  COMB_GT/*greater than ('>'): child*/
46 } ;
47 
49 {
52  TYPE_SELECTOR = 1 << 1
53 } ;
54 
55 typedef struct _CRSimpleSel CRSimpleSel ;
56 
57 /**
58  *The abstraction of a css2 simple selection list
59  *as defined by the right part of the "selector" production in the
60  *appendix D.1 of the css2 spec.
61  *It is basically a list of simple selector, each
62  *simple selector being separated by a combinator.
63  *
64  *In the libcroco's implementation, each simple selector
65  *is made of at most two parts:
66  *
67  *1/An element name or 'type selector' (which can hold a '*' and
68  *then been called 'universal selector')
69  *
70  *2/An additional selector that "specializes" the preceding type or
71  *universal selector. The additionnal selector can be either
72  *an id selector, or a class selector, or an attribute selector.
73  */
75 {
77  gboolean is_case_sentive ;
79  /**
80  *The combinator that separates
81  *this simple selector from the previous
82  *one.
83  */
85 
86  /**
87  *The additional selector list of the
88  *current simple selector.
89  *An additional selector may
90  *be a class selector, an id selector,
91  *or an attribute selector.
92  *Note that this field is a linked list.
93  */
95 
96  /*
97  *the specificity as specified by
98  *chapter 6.4.3 of the spec.
99  */
100  gulong specificity ;
101 
105 } ;
106 
108 
110  CRSimpleSel *a_sel) ;
111 
113  CRSimpleSel *a_sel) ;
114 
115 guchar * cr_simple_sel_to_string (CRSimpleSel const *a_this) ;
116 
117 guchar * cr_simple_sel_one_to_string (CRSimpleSel const * a_this) ;
118 
119 enum CRStatus cr_simple_sel_dump (CRSimpleSel const *a_this, FILE *a_fp) ;
120 
122 
124 
125 void cr_simple_sel_destroy (CRSimpleSel *a_this) ;
126 
127 G_END_DECLS
128 
129 
130 #endif /*__CR_SIMPLE_SEL_H__*/
enum CRStatus cr_simple_sel_dump_attr_sel_list(CRSimpleSel const *a_this)
enum Combinator combinator
The combinator that separates this simple selector from the previous one.
Definition: cr-simple-sel.h:84
gboolean is_case_sentive
Definition: cr-simple-sel.h:77
The declaration of the CRParsingLocation object.
CRSimpleSel * cr_simple_sel_new(void)
cr_simple_sel_new:
Definition: cr-simple-sel.c:36
guchar * cr_simple_sel_one_to_string(CRSimpleSel const *a_this)
CRSimpleSel * prev
Combinator
Definition: cr-simple-sel.h:40
CRStatus
The status type returned by the methods of the croco library.
Definition: cr-utils.h:43
CRAdditionalSel * add_sel
The additional selector list of the current simple selector.
Definition: cr-simple-sel.h:94
CRSimpleSel * next
The abstraction of a css2 simple selection list as defined by the right part of the "selector" produc...
Definition: cr-simple-sel.h:74
SimpleSelectorType
Definition: cr-simple-sel.h:48
typedefG_BEGIN_DECLS struct _CRString CRString
Definition: cr-string.h:37
gulong specificity
CRSimpleSel * cr_simple_sel_append_simple_sel(CRSimpleSel *a_this, CRSimpleSel *a_sel)
cr_simple_sel_append_simple_sel:
Definition: cr-simple-sel.c:61
enum SimpleSelectorType type_mask
Definition: cr-simple-sel.h:76
CRSimpleSel * cr_simple_sel_prepend_simple_sel(CRSimpleSel *a_this, CRSimpleSel *a_sel)
cr_simple_sel_prepend_simple_sel:
Definition: cr-simple-sel.c:89
enum CRStatus cr_simple_sel_compute_specificity(CRSimpleSel *a_this)
cr_simple_sel_compute_specificity:
enum CRStatus cr_simple_sel_dump(CRSimpleSel const *a_this, FILE *a_fp)
cr_simple_sel_dump: @a_this: the current instance of CRSimpleSel.
guchar * cr_simple_sel_to_string(CRSimpleSel const *a_this)
void cr_simple_sel_destroy(CRSimpleSel *a_this)
cr_simple_sel_destroy:
CRString * name
Definition: cr-simple-sel.h:78
CRParsingLocation location