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

cr-cascade.h File Reference

the declaration of the CRCascade class. More...

#include "cr-stylesheet.h"

Go to the source code of this file.

Data Structures

struct  _CRCascade

Typedefs

typedef _CRCascade CRCascade
 An abstraction of the "Cascade" defined in the css2 spec, chapter 6.4.

Functions

CRCascadecr_cascade_new (CRStyleSheet *a_author_sheet, CRStyleSheet *a_user_sheet, CRStyleSheet *a_ua_sheet)
 Constructor of the CRCascade class.
CRStyleSheetcr_cascade_get_sheet (CRCascade *a_this, enum CRStyleOrigin a_origin)
 Gets a given origin sheet.
enum CRStatus cr_cascade_set_sheet (CRCascade *a_this, CRStyleSheet *a_sheet, enum CRStyleOrigin a_origin)
 Sets a stylesheet in the cascade.
void cr_cascade_ref (CRCascade *a_this)
 Increases the reference counter of the current instance of CRCascade.
void cr_cascade_unref (CRCascade *a_this)
 Decrements the reference counter associated to this instance of CRCascade.
void cr_cascade_destroy (CRCascade *a_this)
 Destructor of CRCascade.

Variables

typedefG_BEGIN_DECLS struct
_CRCascadePriv 
CRCascadePriv


Detailed Description

the declaration of the CRCascade class.

Definition in file cr-cascade.h.


Typedef Documentation

typedef struct _CRCascade CRCascade
 

An abstraction of the "Cascade" defined in the css2 spec, chapter 6.4.

Definition at line 47 of file cr-cascade.h.

Referenced by cr_cascade_destroy(), cr_cascade_get_sheet(), cr_cascade_new(), cr_cascade_ref(), cr_cascade_set_sheet(), cr_cascade_unref(), cr_om_parser_parse_paths_to_cascade(), cr_om_parser_simply_parse_paths_to_cascade(), cr_sel_eng_get_matched_properties_from_cascade(), and cr_sel_eng_get_matched_style().


Function Documentation

void cr_cascade_destroy CRCascade a_this  ) 
 

Destructor of CRCascade.

Definition at line 179 of file cr-cascade.c.

References cr_stylesheet_unref(), CRCascade, and PRIVATE.

Referenced by cr_cascade_unref().

CRStyleSheet* cr_cascade_get_sheet CRCascade a_this,
enum CRStyleOrigin  a_origin
 

Gets a given origin sheet.

Note that the returned stylesheet is refcounted so if the caller wants to manage it's lifecycle, it must use cr_stylesheet_ref()/cr_stylesheet_unref() instead of the cr_stylesheet_destroy() method.

Parameters:
a_this the current instance of CRCascade.
a_origin the origin of the style sheet as defined in the css2 spec in chapter 6.4.
Returns:
the style sheet, or NULL if it does not exist.

Definition at line 107 of file cr-cascade.c.

References CRCascade, NB_ORIGINS, ORIGIN_UA, and PRIVATE.

Referenced by cr_sel_eng_get_matched_properties_from_cascade().

CRCascade* cr_cascade_new CRStyleSheet a_author_sheet,
CRStyleSheet a_user_sheet,
CRStyleSheet a_ua_sheet
 

Constructor of the CRCascade class.

Note that all three parameters of this method are ref counted and their refcount is increased. Their refcount will be decreased at the destruction of the instance of CRCascade. So the caller should not call their destructor. The caller should call their ref/unref method instead if it wants

Parameters:
a_author_sheet the autor origin style sheet
a_user_sheet the user origin style sheet.
a_ua_sheet the user agent origin style sheet.
Returns:
the newly built instance of CRCascade or NULL if an error arose during constrution.

Definition at line 61 of file cr-cascade.c.

References cr_cascade_set_sheet(), cr_utils_trace_info, CRCascade, CRCascadePriv, CRStyleSheet, ORIGIN_AUTHOR, ORIGIN_UA, ORIGIN_USER, and PRIVATE.

Referenced by cr_om_parser_parse_paths_to_cascade().

void cr_cascade_ref CRCascade a_this  ) 
 

Increases the reference counter of the current instance of CRCascade.

Parameters:
a_this the current instance of CRCascade

Definition at line 148 of file cr-cascade.c.

References CRCascade, PRIVATE, and _CRStyleSheet::ref_count.

enum CRStatus cr_cascade_set_sheet CRCascade a_this,
CRStyleSheet a_sheet,
enum CRStyleOrigin  a_origin
 

Sets a stylesheet in the cascade.

Parameters:
a_this the current instance of CRCascade.
a_sheet the stylesheet to set.
a_origin the origin of the stylesheet.
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 125 of file cr-cascade.c.

References CR_BAD_PARAM_ERROR, cr_stylesheet_ref(), cr_stylesheet_unref(), CRCascade, CRStyleSheet, NB_ORIGINS, ORIGIN_UA, and PRIVATE.

Referenced by cr_cascade_new().

void cr_cascade_unref CRCascade a_this  ) 
 

Decrements the reference counter associated to this instance of CRCascade.

If the reference counter reaches zero, the instance is destroyed using cr_cascade_destroy()

Parameters:
a_this the current instance of CRCascade.

Definition at line 164 of file cr-cascade.c.

References cr_cascade_destroy(), CRCascade, PRIVATE, and _CRStyleSheet::ref_count.


Variable Documentation

typedefG_BEGIN_DECLS struct _CRCascadePriv CRCascadePriv
 

Definition at line 41 of file cr-cascade.h.

Referenced by cr_cascade_new().


Generated on Fri Oct 29 08:29:13 2004 for Libcroco by  doxygen 1.3.9.1