Libcroco
|
Go to the source code of this file.
Data Structures | |
struct | CRPseudoClassSelHandlerEntry |
struct | _CRSelEngPriv |
Macros | |
#define | PRIVATE(a_this) (a_this)->priv |
@CRSelEng: More... | |
#define | strqcmp(str, lit, lit_len) (strlen (str) != (lit_len) || memcmp (str, lit, lit_len)) |
Functions | |
CRSelEng * | cr_sel_eng_new (void) |
cr_sel_eng_new: Creates a new instance of CRSelEng. More... | |
enum CRStatus | cr_sel_eng_register_pseudo_class_sel_handler (CRSelEng *a_this, guchar *a_name, enum CRPseudoType a_type, CRPseudoClassSelectorHandler a_handler) |
cr_sel_eng_register_pseudo_class_sel_handler: @a_this: the current instance of CRSelEng @a_pseudo_class_sel_name: the name of the pseudo class selector. More... | |
enum CRStatus | cr_sel_eng_unregister_pseudo_class_sel_handler (CRSelEng *a_this, guchar *a_name, enum CRPseudoType a_type) |
enum CRStatus | cr_sel_eng_unregister_all_pseudo_class_sel_handlers (CRSelEng *a_this) |
cr_sel_eng_unregister_all_pseudo_class_sel_handlers: @a_this: the current instance of CRSelEng . More... | |
enum CRStatus | cr_sel_eng_get_pseudo_class_selector_handler (CRSelEng *a_this, guchar *a_name, enum CRPseudoType a_type, CRPseudoClassSelectorHandler *a_handler) |
enum CRStatus | cr_sel_eng_matches_node (CRSelEng *a_this, CRSimpleSel *a_sel, xmlNode *a_node, gboolean *a_result) |
cr_sel_eng_matches_node: @a_this: the selection engine. More... | |
enum CRStatus | cr_sel_eng_get_matched_rulesets (CRSelEng *a_this, CRStyleSheet *a_sheet, xmlNode *a_node, CRStatement ***a_rulesets, gulong *a_len) |
cr_sel_eng_get_matched_rulesets: @a_this: the current instance of the selection engine. More... | |
enum CRStatus | cr_sel_eng_get_matched_properties_from_cascade (CRSelEng *a_this, CRCascade *a_cascade, xmlNode *a_node, CRPropList **a_props) |
enum CRStatus | cr_sel_eng_get_matched_style (CRSelEng *a_this, CRCascade *a_cascade, xmlNode *a_node, CRStyle *a_parent_style, CRStyle **a_style, gboolean a_set_props_to_initial_values) |
void | cr_sel_eng_destroy (CRSelEng *a_this) |
cr_sel_eng_destroy: @a_this: the current instance of the selection engine. More... | |
#define PRIVATE | ( | a_this | ) | (a_this)->priv |
@CRSelEng:
The definition of the CRSelEng class. The CRSelEng is actually the "Selection Engine" class. This is highly experimental for at the moment and its api is very likely to change in a near future.
Definition at line 36 of file cr-sel-eng.c.
#define strqcmp | ( | str, | |
lit, | |||
lit_len | |||
) | (strlen (str) != (lit_len) || memcmp (str, lit, lit_len)) |
Definition at line 109 of file cr-sel-eng.c.
void cr_sel_eng_destroy | ( | CRSelEng * | a_this | ) |
cr_sel_eng_destroy: @a_this: the current instance of the selection engine.
The destructor of CRSelEng
Definition at line 1562 of file cr-sel-eng.c.
References cr_sel_eng_unregister_all_pseudo_class_sel_handlers(), and PRIVATE.
enum CRStatus cr_sel_eng_get_matched_properties_from_cascade | ( | CRSelEng * | a_this, |
CRCascade * | a_cascade, | ||
xmlNode * | a_node, | ||
CRPropList ** | a_props | ||
) |
Definition at line 1414 of file cr-sel-eng.c.
References CR_BAD_PARAM_ERROR, cr_cascade_get_sheet(), CR_ERROR, CR_OK, cr_utils_trace_info, NB_ORIGINS, and ORIGIN_UA.
Referenced by cr_sel_eng_get_matched_style().
enum CRStatus cr_sel_eng_get_matched_rulesets | ( | CRSelEng * | a_this, |
CRStyleSheet * | a_sheet, | ||
xmlNode * | a_node, | ||
CRStatement *** | a_rulesets, | ||
gulong * | a_len | ||
) |
cr_sel_eng_get_matched_rulesets: @a_this: the current instance of the selection engine.
@a_sheet: the stylesheet that holds the selectors. @a_node: the xml node to consider during the walk thru the stylesheet. @a_rulesets: out parameter. A pointer to an array of rulesets statement pointers. *a_rulesets is allocated by this function and must be freed by the caller. However, the caller must not alter the rulesets statements pointer because they point to statements that are still in the css stylesheet. @a_len: the length of *a_ruleset.
Returns an array of pointers to selectors that matches the xml node given in parameter.
Returns CR_OK upon sucessfull completion, an error code otherwise.
Definition at line 1348 of file cr-sel-eng.c.
References CR_BAD_PARAM_ERROR, CR_ERROR, CR_OK, and cr_utils_trace_info.
enum CRStatus cr_sel_eng_get_matched_style | ( | CRSelEng * | a_this, |
CRCascade * | a_cascade, | ||
xmlNode * | a_node, | ||
CRStyle * | a_parent_style, | ||
CRStyle ** | a_style, | ||
gboolean | a_set_props_to_initial_values | ||
) |
Definition at line 1515 of file cr-sel-eng.c.
References CR_BAD_PARAM_ERROR, CR_ERROR, CR_OK, cr_sel_eng_get_matched_properties_from_cascade(), cr_style_new(), cr_style_set_props_to_default_values(), and cr_style_set_props_to_initial_values().
enum CRStatus cr_sel_eng_get_pseudo_class_selector_handler | ( | CRSelEng * | a_this, |
guchar * | a_name, | ||
enum CRPseudoType | a_type, | ||
CRPseudoClassSelectorHandler * | a_handler | ||
) |
Definition at line 1266 of file cr-sel-eng.c.
References CR_BAD_PARAM_ERROR, CR_OK, CR_PSEUDO_CLASS_SEL_HANDLER_NOT_FOUND_ERROR, CRPseudoClassSelHandlerEntry::handler, CRPseudoClassSelHandlerEntry::name, PRIVATE, and CRPseudoClassSelHandlerEntry::type.
enum CRStatus cr_sel_eng_matches_node | ( | CRSelEng * | a_this, |
CRSimpleSel * | a_sel, | ||
xmlNode * | a_node, | ||
gboolean * | a_result | ||
) |
cr_sel_eng_matches_node: @a_this: the selection engine.
@a_sel: the simple selector against which the xml node is going to be matched. @a_node: the node against which the selector is going to be matched. @a_result: out parameter. The result of the match. Is set to TRUE if the selector matches the node, FALSE otherwise. This value is considered if and only if this functions returns CR_OK.
Evaluates a chained list of simple selectors (known as a css2 selector). Says wheter if this selector matches the xml node given in parameter or not.
Returns the CR_OK if the selection ran correctly, an error code otherwise.
Definition at line 1312 of file cr-sel-eng.c.
References CR_BAD_PARAM_ERROR, CR_OK, and PRIVATE.
CRSelEng* cr_sel_eng_new | ( | void | ) |
cr_sel_eng_new: Creates a new instance of CRSelEng.
Returns the newly built instance of CRSelEng of NULL if an error occurs.
Definition at line 1121 of file cr-sel-eng.c.
References cr_sel_eng_register_pseudo_class_sel_handler(), cr_utils_trace_info, IDENT_PSEUDO, and PRIVATE.
enum CRStatus cr_sel_eng_register_pseudo_class_sel_handler | ( | CRSelEng * | a_this, |
guchar * | a_name, | ||
enum CRPseudoType | a_type, | ||
CRPseudoClassSelectorHandler | a_handler | ||
) |
cr_sel_eng_register_pseudo_class_sel_handler: @a_this: the current instance of CRSelEng @a_pseudo_class_sel_name: the name of the pseudo class selector.
@a_pseudo_class_type: the type of the pseudo class selector. @a_handler: the actual handler or callback to be called during the selector evaluation process.
Adds a new handler entry in the handlers entry table.
Returns CR_OK, upon successful completion, an error code otherwise.
Definition at line 1164 of file cr-sel-eng.c.
References CR_BAD_PARAM_ERROR, CR_OK, CR_OUT_OF_MEMORY_ERROR, CRPseudoClassSelHandlerEntry::handler, CRPseudoClassSelHandlerEntry::name, PRIVATE, and CRPseudoClassSelHandlerEntry::type.
Referenced by cr_sel_eng_new().
cr_sel_eng_unregister_all_pseudo_class_sel_handlers: @a_this: the current instance of CRSelEng .
Unregisters all the pseudo class sel handlers and frees all the associated allocated datastructures.
Returns CR_OK upon succesful completion, an error code otherwise.
Definition at line 1239 of file cr-sel-eng.c.
References CR_BAD_PARAM_ERROR, CR_OK, CRPseudoClassSelHandlerEntry::name, and PRIVATE.
Referenced by cr_sel_eng_destroy().
enum CRStatus cr_sel_eng_unregister_pseudo_class_sel_handler | ( | CRSelEng * | a_this, |
guchar * | a_name, | ||
enum CRPseudoType | a_type | ||
) |
Definition at line 1195 of file cr-sel-eng.c.
References CR_BAD_PARAM_ERROR, CR_OK, CR_PSEUDO_CLASS_SEL_HANDLER_NOT_FOUND_ERROR, CRPseudoClassSelHandlerEntry::name, PRIVATE, and CRPseudoClassSelHandlerEntry::type.