Libcroco
Functions
cr-stylesheet.c File Reference
#include "string.h"
#include "cr-stylesheet.h"

Go to the source code of this file.

Functions

CRStyleSheetcr_stylesheet_new (CRStatement *a_stmts)
 Constructor of the CRStyleSheet class. More...
 
gchar * cr_stylesheet_to_string (CRStyleSheet const *a_this)
 
void cr_stylesheet_dump (CRStyleSheet const *a_this, FILE *a_fp)
 Dumps the current css2 stylesheet to a file. More...
 
gint cr_stylesheet_nr_rules (CRStyleSheet const *a_this)
 Return the number of rules in the stylesheet. More...
 
CRStatementcr_stylesheet_statement_get_from_list (CRStyleSheet *a_this, int itemnr)
 Use an index to get a CRStatement from the rules in a given stylesheet. More...
 
void cr_stylesheet_ref (CRStyleSheet *a_this)
 
gboolean cr_stylesheet_unref (CRStyleSheet *a_this)
 
void cr_stylesheet_destroy (CRStyleSheet *a_this)
 Destructor of the CRStyleSheet class. More...
 

Detailed Description

The definition of the CRStyleSheet class

Definition in file cr-stylesheet.c.

Function Documentation

◆ cr_stylesheet_destroy()

void cr_stylesheet_destroy ( CRStyleSheet a_this)

Destructor of the CRStyleSheet class.

Parameters
a_thisthe current instance of the CRStyleSheet class.

Definition at line 169 of file cr-stylesheet.c.

References cr_statement_destroy(), and _CRStyleSheet::statements.

Referenced by cr_stylesheet_unref().

◆ cr_stylesheet_dump()

void cr_stylesheet_dump ( CRStyleSheet const *  a_this,
FILE *  a_fp 
)

Dumps the current css2 stylesheet to a file.

Parameters
a_thisthe current instance of CRStyleSheet.
a_fpthe destination file

Definition at line 98 of file cr-stylesheet.c.

References cr_stylesheet_to_string().

◆ cr_stylesheet_new()

CRStyleSheet* cr_stylesheet_new ( CRStatement a_stmts)

Constructor of the CRStyleSheet class.

Parameters
theinitial list of css statements.
Returns
the newly built css2 stylesheet, or NULL in case of error.

Definition at line 37 of file cr-stylesheet.c.

References cr_utils_trace_info, and _CRStyleSheet::statements.

◆ cr_stylesheet_nr_rules()

gint cr_stylesheet_nr_rules ( CRStyleSheet const *  a_this)

Return the number of rules in the stylesheet.

Parameters
a_thisthe current instance of CRStyleSheet.
Returns
number of rules in the stylesheet.

Definition at line 118 of file cr-stylesheet.c.

References cr_statement_nr_rules(), and _CRStyleSheet::statements.

◆ cr_stylesheet_ref()

void cr_stylesheet_ref ( CRStyleSheet a_this)

Definition at line 141 of file cr-stylesheet.c.

References _CRStyleSheet::ref_count.

Referenced by cr_cascade_set_sheet().

◆ cr_stylesheet_statement_get_from_list()

CRStatement* cr_stylesheet_statement_get_from_list ( CRStyleSheet a_this,
int  itemnr 
)

Use an index to get a CRStatement from the rules in a given stylesheet.

Parameters
a_thisthe current instance of CRStatement.
itemnrthe index into the rules.
Returns
CRStatement at position itemnr, if itemnr > number of rules - 1, it will return NULL.

Definition at line 133 of file cr-stylesheet.c.

References cr_statement_get_from_list(), and _CRStyleSheet::statements.

◆ cr_stylesheet_to_string()

gchar* cr_stylesheet_to_string ( CRStyleSheet const *  a_this)
Parameters
a_thisthe current instance of CRStyleSheet
Returns
the serialized stylesheet.

Definition at line 60 of file cr-stylesheet.c.

References cr_statement_to_string(), _CRStatement::next, _CRStatement::prev, and _CRStyleSheet::statements.

Referenced by cr_stylesheet_dump().

◆ cr_stylesheet_unref()

gboolean cr_stylesheet_unref ( CRStyleSheet a_this)