00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __CR_ADD_SEL_H__
00026 #define __CR_ADD_SEL_H__
00027
00028 #include <stdio.h>
00029 #include <glib.h>
00030 #include "cr-utils.h"
00031 #include "cr-attr-sel.h"
00032 #include "cr-pseudo.h"
00033 #include "cr-additional-sel.h"
00034
00035 G_BEGIN_DECLS
00036
00037 enum AddSelectorType
00038 {
00039 NO_ADD_SELECTOR = 0 ,
00040 CLASS_ADD_SELECTOR = 1 ,
00041 PSEUDO_CLASS_ADD_SELECTOR = 1 << 1,
00042 ID_ADD_SELECTOR = 1 << 3,
00043 ATTRIBUTE_ADD_SELECTOR = 1 << 4
00044 } ;
00045
00046 union CRAdditionalSelectorContent
00047 {
00048 CRString *class_name ;
00049 CRString *id_name ;
00050 CRPseudo *pseudo ;
00051 CRAttrSel *attr_sel ;
00052 } ;
00053
00054 typedef struct _CRAdditionalSel CRAdditionalSel ;
00055
00056 struct _CRAdditionalSel
00057 {
00058 enum AddSelectorType type ;
00059 union CRAdditionalSelectorContent content ;
00060
00061 CRAdditionalSel * next ;
00062 CRAdditionalSel * prev ;
00063 CRParsingLocation location ;
00064 } ;
00065
00066 CRAdditionalSel * cr_additional_sel_new (void) ;
00067
00068 CRAdditionalSel * cr_additional_sel_new_with_type (enum AddSelectorType a_sel_type) ;
00069
00070 CRAdditionalSel * cr_additional_sel_append (CRAdditionalSel *a_this,
00071 CRAdditionalSel *a_sel) ;
00072
00073 void cr_additional_sel_set_class_name (CRAdditionalSel *a_this,
00074 CRString *a_class_name) ;
00075
00076 void cr_additional_sel_set_id_name (CRAdditionalSel *a_this,
00077 CRString *a_id) ;
00078
00079 void cr_additional_sel_set_pseudo (CRAdditionalSel *a_this,
00080 CRPseudo *a_pseudo) ;
00081
00082 void cr_additional_sel_set_attr_sel (CRAdditionalSel *a_this,
00083 CRAttrSel *a_sel) ;
00084
00085 CRAdditionalSel * cr_additional_sel_prepend (CRAdditionalSel *a_this,
00086 CRAdditionalSel *a_sel) ;
00087
00088 guchar * cr_additional_sel_to_string (CRAdditionalSel const *a_this) ;
00089
00090 guchar * cr_additional_sel_one_to_string (CRAdditionalSel const *a_this) ;
00091
00092 void cr_additional_sel_dump (CRAdditionalSel const *a_this, FILE *a_fp) ;
00093
00094 void cr_additional_sel_destroy (CRAdditionalSel *a_this) ;
00095
00096 G_END_DECLS
00097
00098 #endif