Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

cr-sel-eng.c File Reference

The definition of the #CRSelEng class. More...

#include <string.h>
#include "cr-sel-eng.h"

Go to the source code of this file.

Data Structures

struct  _CRSelEngPriv

Defines

#define PRIVATE(a_this)   (a_this)->priv

Functions

CRSelEng * cr_sel_eng_new (void)
 Creates a new instance of #CRSelEng.

enum CRStatus cr_sel_eng_matches_node (CRSelEng *a_this, CRSimpleSel *a_sel, xmlNode *a_node, gboolean *a_result)
 Evaluates a chained list of simple selectors (known as a css2 selector).

enum CRStatus cr_sel_eng_get_matched_rulesets (CRSelEng *a_this, CRStyleSheet *a_sheet, xmlNode *a_node, CRStatement ***a_rulesets, gulong *a_len)
 Returns an array of pointers to selectors that matches the xml node given in parameter.

enum CRStatus cr_sel_eng_get_matched_properties_from_cascade (CRSelEng *a_this, CRCascade *a_cascade, xmlNode *a_node, GHashTable **a_props_hashtable)
enum CRStatus cr_sel_eng_get_matched_style (CRSelEng *a_this, CRCascade *a_cascade, xmlNode *a_node, CRStyle *a_parent_style, CRStyle **a_style)
void cr_sel_eng_destroy (CRSelEng *a_this)
 The destructor of #CRSelEng.


Detailed Description

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 in file cr-sel-eng.c.


Define Documentation

#define PRIVATE a_this   )     (a_this)->priv
 

Definition at line 36 of file cr-sel-eng.c.


Function Documentation

void cr_sel_eng_destroy CRSelEng *  a_this  ) 
 

The destructor of #CRSelEng.

Parameters:
a_this the current instance of the selection engine.

Definition at line 1203 of file cr-sel-eng.c.

References PRIVATE.

Referenced by cr_lay_eng_destroy().

enum CRStatus cr_sel_eng_get_matched_properties_from_cascade CRSelEng *  a_this,
CRCascade a_cascade,
xmlNode *  a_node,
GHashTable **  a_props_hashtable
 

Definition at line 1047 of file cr-sel-eng.c.

References CR_BAD_PARAM_ERROR, cr_cascade_get_sheet(), CR_ERROR, CR_OK, CR_OUTPUT_TOO_SHORT_ERROR, cr_utils_trace_info, CRStatus, CRStyleOrigin, NB_ORIGINS, ORIGIN_UA, _CRStatement::parent_sheet, RULESET_STMT, and _CRStatement::type.

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
 

Returns an array of pointers to selectors that matches the xml node given in parameter.

Parameters:
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:
CR_OK upon sucessfull completion, an error code otherwise.

Definition at line 976 of file cr-sel-eng.c.

References CR_BAD_PARAM_ERROR, CR_ERROR, CR_OK, CR_OUTPUT_TOO_SHORT_ERROR, cr_utils_trace_info, and CRStatus.

enum CRStatus cr_sel_eng_get_matched_style CRSelEng *  a_this,
CRCascade a_cascade,
xmlNode *  a_node,
CRStyle a_parent_style,
CRStyle **  a_style
 

Definition at line 1155 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(), and CRStatus.

enum CRStatus cr_sel_eng_matches_node CRSelEng *  a_this,
CRSimpleSel a_sel,
xmlNode *  a_node,
gboolean *  a_result
 

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.

Parameters:
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.
Returns:
the CR_OK if the selection ran correctly, an error code otherwise.

Definition at line 941 of file cr-sel-eng.c.

References CR_BAD_PARAM_ERROR, CR_OK, and PRIVATE.

CRSelEng* cr_sel_eng_new void   ) 
 

Creates a new instance of #CRSelEng.

Returns:
the newly built instance of #CRSelEng of NULL if an error occurs.

Definition at line 902 of file cr-sel-eng.c.

References cr_utils_trace_info, and PRIVATE.


Generated on Wed Oct 1 01:36:51 2003 for Libcroco by doxygen 1.3.3