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.3 2003/06/15 18:00:30 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 #define G_BEGIN_DECLS 00039 typedef struct _CRSelector CRSelector ; 00040 00041 /** 00042 *Abstracts a CSS2 selector as defined in the right part 00043 *of the 'ruleset" production in the appendix D.1 of the 00044 *css2 spec. 00045 *It is actually the abstraction of a comma separated list 00046 *of simple selectors list. 00047 *In a css2 file, a selector is a list of simple selectors 00048 *separated by a comma. 00049 *e.g: sel0, sel1, sel2 ... 00050 *Each seln is a simple selector 00051 */ 00052 struct _CRSelector 00053 { 00054 /** 00055 *A Selection expression. 00056 *It is a list of basic selectors. 00057 *Each basic selector can be either an element 00058 *selector, an id selector, a class selector, an 00059 *attribute selector, an universal selector etc ... 00060 */ 00061 CRSimpleSel *simple_sel ; 00062 00063 /**The next selector list element*/ 00064 CRSelector *next ; 00065 CRSelector *prev ; 00066 00067 glong ref_count ; 00068 }; 00069 00070 CRSelector* 00071 cr_selector_new (CRSimpleSel *a_sel_expr) ; 00072 00073 CRSelector * 00074 cr_selector_parse_from_buf (const guchar * a_char_buf, 00075 enum CREncoding a_enc) ; 00076 00077 CRSelector* 00078 cr_selector_append (CRSelector *a_this, CRSelector *a_new) ; 00079 00080 CRSelector* 00081 cr_selector_append_simple_sel (CRSelector *a_this, 00082 CRSimpleSel *a_simple_sel) ; 00083 00084 CRSelector* 00085 cr_selector_prepend (CRSelector *a_this, CRSelector *a_new) ; 00086 00087 guchar * 00088 cr_selector_to_string (CRSelector *a_this) ; 00089 00090 void 00091 cr_selector_dump (CRSelector *a_this, FILE *a_fp) ; 00092 00093 void 00094 cr_selector_ref (CRSelector *a_this) ; 00095 00096 gboolean 00097 cr_selector_unref (CRSelector *a_this) ; 00098 00099 void 00100 cr_selector_destroy (CRSelector *a_this) ; 00101 00102 #define G_END_DECLS 00103 00104 #endif /*__CR_SELECTOR_H__*/