1
/* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
4
* This file is part of The Croco Library
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.
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.
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
20
* Author: Dodji Seketeli
21
* See COPYRIGHTS file for copyright information.
30
#include "cr-additional-sel.h"
31
#include "cr-parsing-location.h"
37
*the declaration of the #CRSimpleSel class.
45
COMB_GT/*greater than*/
48
enum SimpleSelectorType
51
UNIVERSAL_SELECTOR = 1,
52
TYPE_SELECTOR = 1 << 1
55
typedef struct _CRSimpleSel CRSimpleSel ;
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.
64
*In the libcroco's implementation, each simple selector
65
*is made of at most two parts:
67
*1/An element name or 'type selector' (which can hold a '*' and
68
*then been called 'universal selector')
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.
76
enum SimpleSelectorType type_mask ;
77
gboolean is_case_sentive ;
80
*The combinator that separates
81
*this simple selector from the previous
84
enum Combinator combinator ;
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.
94
CRAdditionalSel *add_sel ;
97
*the specificity as specified by
98
*chapter 6.4.3 of the spec.
104
CRParsingLocation location ;
107
CRSimpleSel * cr_simple_sel_new (void) ;
109
CRSimpleSel * cr_simple_sel_append_simple_sel (CRSimpleSel *a_this,
110
CRSimpleSel *a_sel) ;
112
CRSimpleSel * cr_simple_sel_prepend_simple_sel (CRSimpleSel *a_this,
113
CRSimpleSel *a_sel) ;
115
guchar * cr_simple_sel_to_string (CRSimpleSel *a_this) ;
117
guchar * cr_simple_sel_one_to_string (CRSimpleSel * a_this) ;
119
enum CRStatus cr_simple_sel_dump (CRSimpleSel *a_this, FILE *a_fp) ;
121
enum CRStatus cr_simple_sel_dump_attr_sel_list (CRSimpleSel *a_this) ;
123
enum CRStatus cr_simple_sel_compute_specificity (CRSimpleSel *a_this) ;
125
void cr_simple_sel_destroy (CRSimpleSel *a_this) ;
130
#endif /*__CR_SIMPLE_SEL_H__*/