cr-simple-sel.h revision 6b15695578f07a3f72c4c9475c1a261a3021472a
/* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
/*
* This file is part of The Croco Library
*
* modify it under the terms of version 2.1 of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Author: Dodji Seketeli
* See COPYRIGHTS file for copyright information.
*/
#ifndef __CR_SEL_H__
#define __CR_SEL_H__
#include <stdio.h>
#include <glib.h>
#include "cr-additional-sel.h"
#include "cr-parsing-location.h"
/**
*@file
*the declaration of the #CRSimpleSel class.
*
*/
enum Combinator
{
COMB_WS,/*whitesape*/
COMB_GT/*greater than*/
} ;
enum SimpleSelectorType
{
NO_SELECTOR_TYPE = 0,
UNIVERSAL_SELECTOR = 1,
} ;
typedef struct _CRSimpleSel CRSimpleSel ;
/**
*The abstraction of a css2 simple selection list
*as defined by the right part of the "selector" production in the
*appendix D.1 of the css2 spec.
*It is basically a list of simple selector, each
*simple selector being separated by a combinator.
*
*In the libcroco's implementation, each simple selector
*is made of at most two parts:
*
*1/An element name or 'type selector' (which can hold a '*' and
*then been called 'universal selector')
*
*2/An additional selector that "specializes" the preceding type or
*universal selector. The additionnal selector can be either
*an id selector, or a class selector, or an attribute selector.
*/
struct _CRSimpleSel
{
enum SimpleSelectorType type_mask ;
/**
*The combinator that separates
*this simple selector from the previous
*one.
*/
enum Combinator combinator ;
/**
*The additional selector list of the
*current simple selector.
*An additional selector may
*be a class selector, an id selector,
*or an attribute selector.
*Note that this field is a linked list.
*/
/*
*the specificity as specified by
*chapter 6.4.3 of the spec.
*/
CRSimpleSel *next ;
CRSimpleSel *prev ;
} ;
CRSimpleSel * cr_simple_sel_new (void) ;
CRSimpleSel *a_sel) ;
CRSimpleSel *a_sel) ;
#endif /*__CR_SIMPLE_SEL_H__*/