#include <stdio.h>
#include "cr-utils.h"
#include "cr-term.h"
#include "cr-parsing-location.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 | |
CRDeclaration * | cr_declaration_new (CRStatement *a_statement, CRString *a_property, CRTerm *a_value) |
Constructor of CRDeclaration. | |
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. | |
CRDeclaration * | cr_declaration_parse_list_from_buf (const guchar *a_str, enum CREncoding a_enc) |
Parses a ';' separated list of properties declaration. | |
CRDeclaration * | cr_declaration_append (CRDeclaration *a_this, CRDeclaration *a_new) |
Appends a new declaration to the current declarations list. | |
CRDeclaration * | cr_declaration_append2 (CRDeclaration *a_this, CRString *a_prop, CRTerm *a_value) |
Appends a declaration to the current declaration list. | |
CRDeclaration * | cr_declaration_prepend (CRDeclaration *a_this, CRDeclaration *a_new) |
prepends a declaration to the current declaration list. | |
CRDeclaration * | cr_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. | |
void | cr_declaration_dump_one (CRDeclaration *a_this, FILE *a_fp, glong a_indent) |
Dumps the first declaration of the declaration list to a file. | |
gint | cr_declaration_nr_props (CRDeclaration *a_this) |
Return the number of properties in the declaration;. | |
CRDeclaration * | cr_declaration_get_from_list (CRDeclaration *a_this, int itemnr) |
Use an index to get a CRDeclaration from the declaration list. | |
CRDeclaration * | cr_declaration_get_by_prop_name (CRDeclaration *a_this, const guchar *a_str) |
Use property name to get a CRDeclaration from the declaration list. | |
gchar * | cr_declaration_to_string (CRDeclaration *a_this, gulong a_indent) |
Serializes the declaration into a string. | |
guchar * | cr_declaration_list_to_string (CRDeclaration *a_this, gulong a_indent) |
Serializes the declaration list into a string. | |
guchar * | cr_declaration_list_to_string2 (CRDeclaration *a_this, gulong a_indent, gboolean a_one_decl_per_line) |
Serializes the declaration list 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. |
Definition in file cr-declaration.h.
|
|
|
Appends a new declaration to the current declarations list.
Definition at line 279 of file cr-declaration.c. References CRDeclaration, _CRDeclaration::next, and _CRDeclaration::prev. Referenced by cr_declaration_append2(), cr_declaration_parse_list_from_buf(), and cr_statement_ruleset_append_decl(). |
|
Appends a declaration to the current declaration list.
Definition at line 404 of file cr-declaration.c. References cr_declaration_append(), cr_declaration_new(), CRDeclaration, CRString, CRTerm, and _CRDeclaration::parent_statement. Referenced by cr_statement_at_font_face_rule_add_decl(), and cr_statement_ruleset_append_decl2(). |
|
Destructor of the declaration list.
Definition at line 718 of file cr-declaration.c. References cr_string_destroy(), cr_term_destroy(), CRDeclaration, _CRDeclaration::next, _CRDeclaration::prev, _CRDeclaration::property, and _CRDeclaration::value. Referenced by cr_declaration_parse_list_from_buf(), cr_declaration_unref(), and cr_statement_ruleset_set_decl_list(). |
|
Dumps a declaration list to a file.
Definition at line 428 of file cr-declaration.c. References CRDeclaration, _CRDeclaration::next, and _CRDeclaration::prev. |
|
Dumps the first declaration of the declaration list to a file.
Definition at line 453 of file cr-declaration.c. References CRDeclaration. |
|
Use property name to get a CRDeclaration from the declaration list.
Definition at line 656 of file cr-declaration.c. References CRDeclaration, _CRDeclaration::next, _CRDeclaration::property, and _CRString::stryng. |
|
Use an index to get a CRDeclaration from the declaration list.
Definition at line 636 of file cr-declaration.c. References CRDeclaration, and _CRDeclaration::next. |
|
Serializes the declaration list into a string.
Definition at line 534 of file cr-declaration.c. References cr_declaration_to_string(), CRDeclaration, and _CRDeclaration::next. |
|
Serializes the declaration list into a string.
Definition at line 568 of file cr-declaration.c. References cr_declaration_to_string(), CRDeclaration, and _CRDeclaration::next. |
|
Constructor of CRDeclaration.
Definition at line 64 of file cr-declaration.c. References AT_FONT_FACE_RULE_STMT, AT_PAGE_RULE_STMT, cr_term_ref(), cr_utils_trace_info, CRDeclaration, CRStatement, CRString, CRTerm, _CRDeclaration::parent_statement, _CRDeclaration::property, RULESET_STMT, and _CRDeclaration::value. Referenced by cr_declaration_append2(), cr_declaration_parse_from_buf(), and cr_declaration_parse_list_from_buf(). |
|
Return the number of properties in the declaration;.
Definition at line 616 of file cr-declaration.c. References CRDeclaration, and _CRDeclaration::next. |
|
Parses a text buffer that contains a css declaration.
Definition at line 107 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_string_destroy(), cr_term_destroy(), CRDeclaration, CRParser, CRStatement, CRStatus, CRString, CRTerm, _CRDeclaration::important, and RULESET_STMT. |
|
Parses a ';' separated list of properties declaration.
Definition at line 169 of file cr-declaration.c. References cr_declaration_append(), cr_declaration_destroy(), cr_declaration_new(), CR_OK, cr_parser_destroy(), cr_parser_get_tknzr(), cr_parser_new_from_buf(), cr_parser_parse_declaration(), cr_parser_try_to_skip_spaces_and_comments(), cr_string_destroy(), cr_term_destroy(), cr_tknzr_peek_char(), cr_tknzr_read_char(), CRDeclaration, CRParser, CRStatus, CRString, CRTerm, CRTknzr, and _CRDeclaration::important. |
|
prepends a declaration to the current declaration list.
Definition at line 378 of file cr-declaration.c. References CRDeclaration, _CRDeclaration::next, and _CRDeclaration::prev. |
|
Increases the ref count of the current instance of CRDeclaration.
Definition at line 682 of file cr-declaration.c. References CRDeclaration, and _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(). |
|
Serializes the declaration into a string.
Definition at line 467 of file cr-declaration.c. References cr_term_to_string(), cr_utils_dump_n_chars2(), CRDeclaration, _CRDeclaration::important, _CRDeclaration::property, _CRString::stryng, and _CRDeclaration::value. Referenced by cr_declaration_list_to_string(), and cr_declaration_list_to_string2(). |
|
Unlinks the declaration from the declaration list.
Definition at line 303 of file cr-declaration.c. References AT_FONT_FACE_RULE_STMT, AT_PAGE_RULE_STMT, CRDeclaration, _CRAtFontFaceRule::decl_list, _CRRuleSet::decl_list, _CRStatement::font_face_rule, _CRStatement::kind, _CRStatement::next, _CRDeclaration::next, _CRStatement::page_rule, _CRDeclaration::parent_statement, _CRDeclaration::prev, _CRStatement::ruleset, and RULESET_STMT. |
|
Decrements the ref count of the current instance of CRDeclaration. If the ref count reaches zero, the current instance of CRDeclaration if destroyed.
Definition at line 698 of file cr-declaration.c. References cr_declaration_destroy(), CRDeclaration, and _CRDeclaration::ref_count. Referenced by cr_statement_at_font_face_rule_set_decls(), and cr_statement_at_page_rule_set_declarations(). |