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

cr-declaration.h File Reference

The declaration of the CRDeclaration class. More...

#include <stdio.h>
#include "cr-utils.h"
#include "cr-term.h"

Go to the source code of this file.

Data Structures

struct  _CRDeclaration

Typedefs

typedef _CRStatement CRStatement
typedef _CRDeclaration CRDeclaration
 The abstraction of a css declaration defined by the css2 spec in chapter 4.


Functions

CRDeclarationcr_declaration_new (CRStatement *a_statement, GString *a_property, CRTerm *a_value)
 Constructor of CRDeclaration.

CRDeclarationcr_declaration_parse_from_buf (CRStatement *a_statement, const guchar *a_str, enum CREncoding a_enc)
 Parses a text buffer that contains a css declaration.

CRDeclarationcr_declaration_append (CRDeclaration *a_this, CRDeclaration *a_new)
 Appends a new declaration to the current declarations list.

CRDeclarationcr_declaration_append2 (CRDeclaration *a_this, GString *a_prop, CRTerm *a_value)
 Appends a declaration to the current declaration list.

CRDeclarationcr_declaration_prepend (CRDeclaration *a_this, CRDeclaration *a_new)
 prepends a declaration to the current declaration list.

CRDeclarationcr_declaration_unlink (CRDeclaration *a_decl)
 Unlinks the declaration from the declaration list.

void cr_declaration_dump (CRDeclaration *a_this, FILE *a_fp, glong a_indent, gboolean a_one_per_line)
 Dumps a declaration list to a file.

guchar * cr_declaration_to_string (CRDeclaration *a_this, gulong a_indent)
 Serializes the declaration into a string.

void cr_declaration_ref (CRDeclaration *a_this)
 Increases the ref count of the current instance of CRDeclaration.

gboolean cr_declaration_unref (CRDeclaration *a_this)
 Decrements the ref count of the current instance of CRDeclaration.

void cr_declaration_destroy (CRDeclaration *a_this)
 Destructor of the declaration list.


Detailed Description

The declaration of the CRDeclaration class.

Definition in file cr-declaration.h.


Typedef Documentation

typedef struct _CRDeclaration CRDeclaration
 

The abstraction of a css declaration defined by the css2 spec in chapter 4.

It is actually a chained list of property/value pairs.

Definition at line 49 of file cr-declaration.h.

typedef struct _CRStatement CRStatement
 

Definition at line 42 of file cr-declaration.h.


Function Documentation

CRDeclaration* cr_declaration_append CRDeclaration a_this,
CRDeclaration a_new
 

Appends a new declaration to the current declarations list.

Parameters:
a_this the current declaration list.
a_new the declaration to append.
Returns:
the declaration list with a_new appended to it, or NULL in case of error.

Definition at line 228 of file cr-declaration.c.

References _CRDeclaration::next, and _CRDeclaration::prev.

Referenced by cr_declaration_append2(), and cr_statement_ruleset_append_decl().

CRDeclaration* cr_declaration_append2 CRDeclaration a_this,
GString *  a_prop,
CRTerm a_value
 

Appends a declaration to the current declaration list.

Parameters:
a_this the current declaration list.
a_prop the property string of the declaration to append.
a_value the value of the declaration to append.
Returns:
the list with the new property appended to it, or NULL in case of an error.

Definition at line 361 of file cr-declaration.c.

References cr_declaration_append(), cr_declaration_new(), and _CRDeclaration::parent_statement.

Referenced by cr_statement_at_font_face_rule_add_decl(), and cr_statement_ruleset_append_decl2().

void cr_declaration_destroy CRDeclaration a_this  ) 
 

Destructor of the declaration list.

Parameters:
a_this the current instance of CRDeclaration.

Definition at line 525 of file cr-declaration.c.

References cr_term_destroy(), _CRDeclaration::next, _CRDeclaration::prev, _CRDeclaration::property, and _CRDeclaration::value.

Referenced by cr_declaration_unref(), and cr_statement_ruleset_set_decl_list().

void cr_declaration_dump CRDeclaration a_this,
FILE *  a_fp,
glong  a_indent,
gboolean  a_one_per_line
 

Dumps a declaration list to a file.

Parameters:
a_this the current instance of CRDeclaration.
a_fp the destination file.
a_indent the number of indentation white char.

Definition at line 389 of file cr-declaration.c.

References _CRDeclaration::next, and _CRDeclaration::prev.

CRDeclaration* cr_declaration_new CRStatement a_statement,
GString *  a_property,
CRTerm a_value
 

Constructor of CRDeclaration.

Parameters:
a_property the property string of the declaration
a_value the value expression of the declaration.
Returns:
the newly built instance of CRDeclaration, or NULL in case of error.

Definition at line 111 of file cr-declaration.c.

References AT_FONT_FACE_RULE_STMT, AT_PAGE_RULE_STMT, cr_term_ref(), cr_utils_trace_info, _CRDeclaration::parent_statement, _CRDeclaration::property, RULESET_STMT, _CRStatement::type, and _CRDeclaration::value.

Referenced by cr_declaration_append2(), and cr_declaration_parse_from_buf().

CRDeclaration* cr_declaration_parse_from_buf CRStatement a_statement,
const guchar *  a_str,
enum CREncoding  a_enc
 

Parses a text buffer that contains a css declaration.

Parameters:
a_statement the parent css2 statement of this this declaration. Must be non NULL and of type RULESET_STMT (must be a ruleset).
a_str the string that contains the statement.
a_enc the encoding of a_str.
Returns:
the parsed declaration, or NULL in case of error.

Definition at line 160 of file cr-declaration.c.

References cr_declaration_new(), CR_OK, cr_parser_destroy(), cr_parser_new_from_buf(), cr_parser_parse_declaration(), cr_parser_try_to_skip_spaces_and_comments(), cr_term_destroy(), CRStatus, RULESET_STMT, and _CRStatement::type.

CRDeclaration* cr_declaration_prepend CRDeclaration a_this,
CRDeclaration a_new
 

prepends a declaration to the current declaration list.

Parameters:
a_this the current declaration list.
a_new the declaration to prepend.
Returns:
the list with a_new prepended or NULL in case of error.

Definition at line 335 of file cr-declaration.c.

References _CRDeclaration::next, and _CRDeclaration::prev.

void cr_declaration_ref CRDeclaration a_this  ) 
 

Increases the ref count of the current instance of CRDeclaration.

Parameters:
a_this the current instance of CRDeclaration.

Definition at line 486 of file cr-declaration.c.

References _CRDeclaration::ref_count.

Referenced by cr_statement_at_font_face_rule_add_decl(), cr_statement_at_font_face_rule_set_decls(), cr_statement_at_page_rule_set_declarations(), and cr_statement_new_at_page_rule().

guchar* cr_declaration_to_string CRDeclaration a_this,
gulong  a_indent
 

Serializes the declaration into a string.

Parameters:
a_this the current instance of CRDeclaration.
a_indent the number of indentation white char to put before the actual serialisation.

Definition at line 416 of file cr-declaration.c.

References cr_term_to_string(), cr_utils_dump_n_chars2(), _CRDeclaration::property, and _CRDeclaration::value.

CRDeclaration* cr_declaration_unlink CRDeclaration a_decl  ) 
 

Unlinks the declaration from the declaration list.

Parameters:
a_decl the declaration to unlink.
Returns:
a pointer to the unlinked declaration in case of a successfull completion, NULL otherwise.

Definition at line 252 of file cr-declaration.c.

References AT_FONT_FACE_RULE_STMT, AT_PAGE_RULE_STMT, _CRAtFontFaceRule::decl_list, _CRRuleSet::decl_list, _CRStatement::font_face_rule, _CRStatement::kind, _CRDeclaration::next, _CRStatement::page_rule, _CRDeclaration::parent_statement, _CRDeclaration::prev, _CRStatement::ruleset, RULESET_STMT, and _CRStatement::type.

gboolean cr_declaration_unref CRDeclaration a_this  ) 
 

Decrements the ref count of the current instance of CRDeclaration.

If the ref count reaches zero, the current instance of CRDeclaration if destroyed.

Parameters:
a_this the current instance of CRDeclaration.
Returns:
TRUE if the current instance of CRDeclaration has been destroyed (ref count reached zero), FALSE otherwise.

Definition at line 502 of file cr-declaration.c.

References cr_declaration_destroy(), and _CRDeclaration::ref_count.

Referenced by cr_statement_at_font_face_rule_set_decls(), and cr_statement_at_page_rule_set_declarations().


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