00001 /* -*- Mode: C; indent-tabs-mode: ni; c-basic-offset: 8 -*- */ 00002 00003 /* 00004 * This file is part of The Croco Library 00005 * 00006 * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org> 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of version 2.1 of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00020 * USA 00021 */ 00022 00023 /* 00024 *$Id: cr-selector.h,v 1.5 2004/01/24 19:24:02 dodji Exp $ 00025 */ 00026 #ifndef __CR_SELECTOR_H__ 00027 #define __CR_SELECTOR_H__ 00028 00029 #include <stdio.h> 00030 #include "cr-utils.h" 00031 #include "cr-simple-sel.h" 00032 00033 /** 00034 *@file 00035 *The declaration file of the #CRSelector file. 00036 */ 00037 00038 G_BEGIN_DECLS 00039 00040 typedef struct _CRSelector CRSelector ; 00041 00042 /** 00043 *Abstracts a CSS2 selector as defined in the right part 00044 *of the 'ruleset" production in the appendix D.1 of the 00045 *css2 spec. 00046 *It is actually the abstraction of a comma separated list 00047 *of simple selectors list. 00048 *In a css2 file, a selector is a list of simple selectors 00049 *separated by a comma. 00050 *e.g: sel0, sel1, sel2 ... 00051 *Each seln is a simple selector 00052 */ 00053 struct _CRSelector 00054 { 00055 /** 00056 *A Selection expression. 00057 *It is a list of basic selectors. 00058 *Each basic selector can be either an element 00059 *selector, an id selector, a class selector, an 00060 *attribute selector, an universal selector etc ... 00061 */ 00062 CRSimpleSel *simple_sel ; 00063 00064 /**The next selector list element*/ 00065 CRSelector *next ; 00066 CRSelector *prev ; 00067 00068 glong ref_count ; 00069 }; 00070 00071 CRSelector* 00072 cr_selector_new (CRSimpleSel *a_sel_expr) ; 00073 00074 CRSelector * 00075 cr_selector_parse_from_buf (const guchar * a_char_buf, 00076 enum CREncoding a_enc) ; 00077 00078 CRSelector* 00079 cr_selector_append (CRSelector *a_this, CRSelector *a_new) ; 00080 00081 CRSelector* 00082 cr_selector_append_simple_sel (CRSelector *a_this, 00083 CRSimpleSel *a_simple_sel) ; 00084 00085 CRSelector* 00086 cr_selector_prepend (CRSelector *a_this, CRSelector *a_new) ; 00087 00088 guchar * 00089 cr_selector_to_string (CRSelector *a_this) ; 00090 00091 void 00092 cr_selector_dump (CRSelector *a_this, FILE *a_fp) ; 00093 00094 void 00095 cr_selector_ref (CRSelector *a_this) ; 00096 00097 gboolean 00098 cr_selector_unref (CRSelector *a_this) ; 00099 00100 void 00101 cr_selector_destroy (CRSelector *a_this) ; 00102 00103 G_END_DECLS 00104 00105 #endif /*__CR_SELECTOR_H__*/
1.3.5