= div in css
MyCSS_SELECTORS_TYPE_ELEMENT = 0x001, // tag name
= div in css
MyCSS_SELECTORS_TYPE_ID = 0x002, // #hash
MyCSS_SELECTORS_TYPE_CLASS = 0x003, // .class
MyCSS_SELECTORS_TYPE_ATTRIBUTE = 0x004, // [key=val], in html
MyCSS_SELECTORS_TYPE_PSEUDO_CLASS_FUNCTION = 0x005, // :function(...)
MyCSS_SELECTORS_TYPE_PSEUDO_CLASS = 0x006, // :pseudo
MyCSS_SELECTORS_TYPE_PSEUDO_ELEMENT_FUNCTION = 0x007, // ::function(...)
MyCSS_SELECTORS_TYPE_PSEUDO_ELEMENT = 0x008, // ::pseudo
MyCSS_SELECTORS_TYPE_LAST_ENTRY = 0x009
}
typedef mycss_selectors_type_t;
enum mycss_selectors_sub_type {
MyCSS_SELECTORS_SUB_TYPE_UNDEF = 0x00,
MyCSS_SELECTORS_SUB_TYPE_UNKNOWN = 0x01
}
typedef mycss_selectors_sub_type_t;
/* pseudo classes functions */
enum mycss_selectors_sub_type_pseudo_class_function {
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_UNDEF = 0x00,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_UNKNOWN = 0x01,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_CURRENT = 0x02,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_DIR = 0x03,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_DROP = 0x04,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_HAS = 0x05,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_LANG = 0x06,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_MATCHES = 0x07,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_NOT = 0x08,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_NTH_CHILD = 0x09,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_NTH_COLUMN = 0x0a,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_NTH_LAST_CHILD = 0x0b,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_NTH_LAST_COLUMN = 0x0c,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_NTH_LAST_OF_TYPE = 0x0d,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_NTH_OF_TYPE = 0x0e,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_CONTAINS = 0x0f,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_LAST_ENTRY = 0x10
}
typedef mycss_selectors_sub_type_pseudo_class_function_t;
/* pseudo classes */
enum mycss_selectors_sub_type_pseudo_class {
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_UNDEF = 0x00,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_UNKNOWN = 0x01,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_ACTIVE = 0x02,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_ANY_LINK = 0x03,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_BLANK = 0x04,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_CHECKED = 0x05,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_CURRENT = 0x06,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_DEFAULT = 0x07,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_DISABLED = 0x08,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_DROP = 0x09,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_EMPTY = 0x0a,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_ENABLED = 0x0b,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FIRST_CHILD = 0x0c,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FIRST_OF_TYPE = 0x0d,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FOCUS = 0x0e,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUTURE = 0x0f,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_HOVER = 0x10,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_IN_RANGE = 0x11,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_INDETERMINATE = 0x12,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_INVALID = 0x13,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_LAST_CHILD = 0x14,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_LAST_OF_TYPE = 0x15,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_LINK = 0x16,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_ONLY_CHILD = 0x17,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_ONLY_OF_TYPE = 0x18,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_OPTIONAL = 0x19,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_OUT_OF_RANGE = 0x1a,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_PAST = 0x1b,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_PLACEHOLDER_SHOWN = 0x1c,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_READ_ONLY = 0x1d,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_READ_WRITE = 0x1e,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_REQUIRED = 0x1f,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_ROOT = 0x20,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_SCOPE = 0x21,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_TARGET = 0x22,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_USER_ERROR = 0x23,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_VALID = 0x24,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_VISITED = 0x25,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_LAST_ENTRY = 0x26
}
typedef mycss_selectors_sub_type_pseudo_class_t;
/* pseudo element */
enum mycss_selectors_sub_type_pseudo_element {
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_ELEMENT_UNDEF = 0x00,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_ELEMENT_UNKNOWN = 0x01,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_ELEMENT_AFTER = 0x02,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_ELEMENT_BACKDROP = 0x03,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_ELEMENT_BEFORE = 0x04,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_ELEMENT_FIRST_LETTER = 0x05,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_ELEMENT_FIRST_LINE = 0x06,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_ELEMENT_GRAMMAR_ERROR = 0x07,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_ELEMENT_MARKER = 0x08,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_ELEMENT_PLACEHOLDER = 0x09,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_ELEMENT_SELECTION = 0x0a,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_ELEMENT_SPELLING_ERROR = 0x0b,
MyCSS_SELECTORS_SUB_TYPE_PSEUDO_ELEMENT_LAST_ENTRY = 0x0c
}
typedef mycss_selectors_sub_type_pseudo_element_t;
enum mycss_selectors_function_drop_type {
MyCSS_SELECTORS_FUNCTION_DROP_TYPE_UNDEF = 0x000,
MyCSS_SELECTORS_FUNCTION_DROP_TYPE_ACTIVE = 0x001,
MyCSS_SELECTORS_FUNCTION_DROP_TYPE_VALID = 0x002,
MyCSS_SELECTORS_FUNCTION_DROP_TYPE_INVALID = 0x004,
}
typedef mycss_selectors_function_drop_type_t;
struct mycss_selectors_specificity {
unsigned int a;
unsigned int b;
unsigned int c;
};
struct mycss_selectors {
// refs
mycss_entry_t* ref_entry;
mycss_selectors_entry_t** entry;
mycss_selectors_entry_t* entry_last;
mycss_selectors_list_t** list;
mycss_selectors_list_t* list_last;
mycss_selectors_specificity_t* specificity;
mycss_selectors_combinator_t* combinator;
mycss_token_type_t ending_token;
mcobject_t* mcobject_entries;
mcobject_t* mcobject_list_entries;
};
struct mycss_selectors_entry {
mycss_selectors_type_t type;
unsigned int sub_type;
mycss_selectors_flags_t flags;
mycss_namespace_entry_t* ns_entry;
mycore_string_t* key;
void* value;
mycss_selectors_combinator_t combinator;
mycss_selectors_entry_t* next;
mycss_selectors_entry_t* prev;
};
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MyHTML_MyCSS_SELECTORS_MYOSI_H */