#include <stdio.h>
#include "cr-utils.h"
#include "cr-term.h"
#include "cr-selector.h"
#include "cr-declaration.h"
Go to the source code of this file.
Data Structures | |
struct | _CRAtCharsetRule |
struct | _CRAtFontFaceRule |
struct | _CRAtImportRule |
struct | _CRAtMediaRule |
abstraction of an rule More... | |
struct | _CRRuleSet |
The abstraction of a css ruleset. More... | |
struct | _CRStatement |
Typedefs | |
typedef _CRAtMediaRule | CRAtMediaRule |
typedef _CRRuleSet | CRRuleSet |
typedef _CRStyleSheet | CRStyleSheet |
typedef _CRAtImportRule | CRAtImportRule |
The rule abstraction. | |
typedef _CRAtPageRule | CRAtPageRule |
typedef _CRAtCharsetRule | CRAtCharsetRule |
The rule abstraction. | |
typedef _CRAtFontFaceRule | CRAtFontFaceRule |
The abstaction of the -face rule. | |
Enumerations | |
enum | CRStatementType { AT_RULE_STMT = 0, RULESET_STMT, AT_IMPORT_RULE_STMT, AT_MEDIA_RULE_STMT, AT_PAGE_RULE_STMT, AT_CHARSET_RULE_STMT, AT_FONT_FACE_RULE_STMT } |
The possible types of css2 statements. More... | |
Functions | |
gboolean | cr_statement_does_buf_parses_against_core (const guchar *a_buf, enum CREncoding a_encoding) |
Tries to parse a buffer and says whether if the content of the buffer is a css statement as defined by the "Core CSS Grammar" (chapter 4 of the css spec) or not. | |
CRStatement * | cr_statement_parse_from_buf (const guchar *a_buf, enum CREncoding a_encoding) |
Parses a buffer that contains a css statement and returns an instance of CRStatement in case of successfull parsing. | |
CRStatement * | cr_statement_new_ruleset (CRStyleSheet *a_sheet, CRSelector *a_sel_list, CRDeclaration *a_decl_list, CRStatement *a_media_rule) |
Creates a new instance of CRStatement of type #CRRulSet. | |
CRStatement * | cr_statement_ruleset_parse_from_buf (const guchar *a_buf, enum CREncoding a_enc) |
Parses a buffer that contains a ruleset statement an instanciates a CRStatement of type RULESET_STMT. | |
CRStatement * | cr_statement_new_at_import_rule (CRStyleSheet *a_container_sheet, GString *a_url, GList *a_media_list, CRStyleSheet *a_imported_sheet) |
Creates a new instance of #CRStatment of type CRAtImportRule. | |
CRStatement * | cr_statement_at_import_rule_parse_from_buf (const guchar *a_buf, enum CREncoding a_encoding) |
Parses a buffer that contains an "@import" rule and instanciate a CRStatement of type AT_IMPORT_RULE_STMT. | |
CRStatement * | cr_statement_new_at_media_rule (CRStyleSheet *a_sheet, CRStatement *a_ruleset, GList *a_media) |
Instanciates an instance of CRStatement of type AT_MEDIA_RULE_STMT ( ruleset). | |
CRStatement * | cr_statement_at_media_rule_parse_from_buf (const guchar *a_buf, enum CREncoding a_enc) |
Parses a buffer that contains an "@media" declaration and builds an css statement. | |
CRStatement * | cr_statement_new_at_charset_rule (CRStyleSheet *a_sheet, GString *a_charset) |
Creates a new instance of CRStatement of type CRAtCharsetRule. | |
CRStatement * | cr_statement_at_charset_rule_parse_from_buf (const guchar *a_buf, enum CREncoding a_encoding) |
Parses a buffer that contains an '' rule and creates an instance of CRStatement of type AT_CHARSET_RULE_STMT. | |
CRStatement * | cr_statement_new_at_font_face_rule (CRStyleSheet *a_sheet, CRDeclaration *a_font_decls) |
Creates an instance of CRStatement of type CRAtFontFaceRule. | |
CRStatement * | cr_statement_font_face_rule_parse_from_buf (const guchar *a_buf, enum CREncoding a_encoding) |
Parses a buffer that contains an "@font-face" rule and builds an instance of CRStatement of type AT_FONT_FACE_RULE_STMT out of it. | |
CRStatement * | cr_statement_new_at_page_rule (CRStyleSheet *a_sheet, CRDeclaration *a_decl_list, GString *a_name, GString *a_pseudo) |
Creates a new instance of CRStatement of type CRAtPageRule. | |
CRStatement * | cr_statement_at_page_rule_parse_from_buf (const guchar *a_buf, enum CREncoding a_encoding) |
Parses a buffer that contains an "@page" production and, if the parsing succeeds, builds the page statement. | |
enum CRStatus | cr_statement_set_parent_sheet (CRStatement *a_this, CRStyleSheet *a_sheet) |
Sets the container stylesheet. | |
enum CRStatus | cr_statement_get_parent_sheet (CRStatement *a_this, CRStyleSheet **a_sheet) |
Gets the sheets that contains the current statement. | |
CRStatement * | cr_statement_append (CRStatement *a_this, CRStatement *a_new) |
Appends a new statement to the statement list. | |
CRStatement * | cr_statement_prepend (CRStatement *a_this, CRStatement *a_new) |
Prepends the an instance of CRStatement to the current statement list. | |
CRStatement * | cr_statement_unlink (CRStatement *a_stmt) |
Unlinks a statement from the statements list. | |
enum CRStatus | cr_statement_ruleset_set_sel_list (CRStatement *a_this, CRSelector *a_sel_list) |
Sets a selector list to a ruleset statement. | |
enum CRStatus | cr_statement_ruleset_get_sel_list (CRStatement *a_this, CRSelector **a_list) |
Gets a pointer to the selector list contained in the current ruleset statement. | |
enum CRStatus | cr_statement_ruleset_set_decl_list (CRStatement *a_this, CRDeclaration *a_list) |
Sets a declaration list to the current ruleset statement. | |
enum CRStatus | cr_statement_ruleset_get_declarations (CRStatement *a_this, CRDeclaration **a_decl_list) |
Gets a pointer to the list of declaration contained in the ruleset statement. | |
enum CRStatus | cr_statement_ruleset_append_decl2 (CRStatement *a_this, GString *a_prop, CRTerm *a_value) |
Appends a declaration to the current ruleset statement. | |
enum CRStatus | cr_statement_ruleset_append_decl (CRStatement *a_this, CRDeclaration *a_decl) |
Appends a declaration to the current statement. | |
enum CRStatus | cr_statement_at_import_rule_set_imported_sheet (CRStatement *a_this, CRStyleSheet *a_sheet) |
Sets a stylesheet to the current rule. | |
enum CRStatus | cr_statement_at_import_rule_get_imported_sheet (CRStatement *a_this, CRStyleSheet **a_sheet) |
Gets the stylesheet contained by the rule statement. | |
enum CRStatus | cr_statement_at_import_rule_set_url (CRStatement *a_this, GString *a_url) |
Sets an url to the current rule statement. | |
enum CRStatus | cr_statement_at_import_rule_get_url (CRStatement *a_this, GString **a_url) |
Gets the url of the rule statement. | |
enum CRStatus | cr_statement_at_page_rule_set_sel (CRStatement *a_this, CRSelector *a_sel) |
enum CRStatus | cr_statement_at_page_rule_get_sel (CRStatement *a_this, CRSelector **a_sel) |
enum CRStatus | cr_statement_at_page_rule_set_declarations (CRStatement *a_this, CRDeclaration *a_decl_list) |
enum CRStatus | cr_statement_at_page_rule_get_declarations (CRStatement *a_this, CRDeclaration **a_decl_list) |
enum CRStatus | cr_statement_at_charset_rule_set_charset (CRStatement *a_this, GString *a_charset) |
Sets the charset of the current rule statement. | |
enum CRStatus | cr_statement_at_charset_rule_get_charset (CRStatement *a_this, GString **a_charset) |
Gets the charset string associated to the current rule statement. | |
enum CRStatus | cr_statement_at_font_face_rule_set_decls (CRStatement *a_this, CRDeclaration *a_decls) |
Sets a declaration list to the current -face rule statement. | |
enum CRStatus | cr_statement_at_font_face_rule_get_decls (CRStatement *a_this, CRDeclaration **a_decls) |
Gets the declaration list associated to the current instance of -face rule statement. | |
enum CRStatus | cr_statement_at_font_face_rule_add_decl (CRStatement *a_this, GString *a_prop, CRTerm *a_value) |
Adds a declaration to the current -face rule statement. | |
void | cr_statement_dump (CRStatement *a_this, FILE *a_fp, gulong a_indent) |
Dumps the css2 statement to a file. | |
void | cr_statement_destroy (CRStatement *a_this) |
Destructor of CRStatement. | |
Variables | |
CRDeclaration * | decl_list |
GString * | name |
page selector. | |
GString * | pseudo |
Definition in file cr-statement.h.
|
The rule abstraction.
Definition at line 129 of file cr-statement.h. |
|
The abstaction of the -face rule.
Definition at line 136 of file cr-statement.h. |
|
The rule abstraction.
Definition at line 91 of file cr-statement.h. |
|
Definition at line 57 of file cr-statement.h. |
|
Definition at line 116 of file cr-statement.h. Referenced by cr_statement_new_at_page_rule(). |
|
Definition at line 59 of file cr-statement.h. |
|
Definition at line 87 of file cr-statement.h. |
|
The possible types of css2 statements.
Definition at line 147 of file cr-statement.h. |
|
Appends a new statement to the statement list.
Definition at line 1766 of file cr-statement.c. References _CRStatement::next, and _CRStatement::prev. Referenced by cr_statement_new_ruleset(). |
|
Gets the charset string associated to the current rule statement.
Definition at line 2198 of file cr-statement.c. References AT_CHARSET_RULE_STMT, CR_BAD_PARAM_ERROR, CR_OK, _CRStatement::kind, and _CRStatement::type. |
|
Parses a buffer that contains an '' rule and creates an instance of CRStatement of type AT_CHARSET_RULE_STMT.
Definition at line 1573 of file cr-statement.c. References CR_OK, cr_parser_destroy(), cr_parser_new_from_buf(), cr_parser_parse_charset(), cr_parser_try_to_skip_spaces_and_comments(), cr_statement_new_at_charset_rule(), cr_utils_trace_info, and CRStatus. Referenced by cr_statement_parse_from_buf(). |
|
Sets the charset of the current rule statement.
Definition at line 2171 of file cr-statement.c. References AT_CHARSET_RULE_STMT, CR_BAD_PARAM_ERROR, CR_OK, _CRStatement::kind, and _CRStatement::type. |
|
Adds a declaration to the current -face rule statement.
Definition at line 2272 of file cr-statement.c. References AT_FONT_FACE_RULE_STMT, CR_BAD_PARAM_ERROR, cr_declaration_append2(), cr_declaration_ref(), CR_ERROR, CR_OK, _CRStatement::kind, and _CRStatement::type. |
|
Gets the declaration list associated to the current instance of -face rule statement.
Definition at line 2249 of file cr-statement.c. References AT_FONT_FACE_RULE_STMT, CR_BAD_PARAM_ERROR, CR_OK, _CRStatement::kind, and _CRStatement::type. |
|
Sets a declaration list to the current -face rule statement.
Definition at line 2219 of file cr-statement.c. References AT_FONT_FACE_RULE_STMT, CR_BAD_PARAM_ERROR, cr_declaration_ref(), cr_declaration_unref(), CR_OK, _CRStatement::kind, and _CRStatement::type. |
|
Gets the stylesheet contained by the rule statement.
Definition at line 2052 of file cr-statement.c. References AT_IMPORT_RULE_STMT, CR_BAD_PARAM_ERROR, CR_OK, _CRStatement::kind, and _CRStatement::type. |
|
Gets the url of the rule statement.
Definition at line 2097 of file cr-statement.c. References AT_IMPORT_RULE_STMT, CR_BAD_PARAM_ERROR, CR_OK, _CRStatement::kind, and _CRStatement::type. |
|
Parses a buffer that contains an "@import" rule and instanciate a CRStatement of type AT_IMPORT_RULE_STMT.
Definition at line 1329 of file cr-statement.c. References CR_OK, cr_parser_destroy(), cr_parser_new_from_buf(), cr_parser_parse_import(), cr_parser_try_to_skip_spaces_and_comments(), cr_statement_new_at_import_rule(), cr_utils_trace_info, and CRStatus. Referenced by cr_statement_parse_from_buf(). |
|
Sets a stylesheet to the current rule.
Definition at line 2030 of file cr-statement.c. References AT_IMPORT_RULE_STMT, CR_BAD_PARAM_ERROR, CR_OK, _CRStatement::kind, and _CRStatement::type. |
|
Sets an url to the current rule statement.
Definition at line 2071 of file cr-statement.c. References AT_IMPORT_RULE_STMT, CR_BAD_PARAM_ERROR, CR_OK, _CRStatement::kind, and _CRStatement::type. |
|
Parses a buffer that contains an "@media" declaration and builds an css statement.
Definition at line 1140 of file cr-statement.c. References cr_doc_handler_get_result(), cr_doc_handler_new(), cr_doc_handler_unref(), CR_OK, cr_parser_destroy(), cr_parser_new_from_buf(), cr_parser_parse_media(), cr_parser_set_sac_handler(), cr_parser_try_to_skip_spaces_and_comments(), cr_utils_trace_info, CRDocHandler, and CRStatus. Referenced by cr_statement_parse_from_buf(). |
|
Definition at line 2150 of file cr-statement.c. References AT_PAGE_RULE_STMT, CR_BAD_PARAM_ERROR, CR_OK, _CRStatement::kind, and _CRStatement::type. |
|
|
|
Parses a buffer that contains an "@page" production and, if the parsing succeeds, builds the page statement.
Definition at line 1455 of file cr-statement.c. References cr_doc_handler_get_result(), cr_doc_handler_new(), cr_doc_handler_unref(), CR_OK, cr_parser_destroy(), cr_parser_new_from_buf(), cr_parser_parse_page(), cr_parser_set_sac_handler(), cr_parser_try_to_skip_spaces_and_comments(), cr_utils_trace_info, CRDocHandler, and CRStatus. Referenced by cr_statement_parse_from_buf(). |
|
Definition at line 2118 of file cr-statement.c. References AT_PAGE_RULE_STMT, CR_BAD_PARAM_ERROR, cr_declaration_ref(), cr_declaration_unref(), CR_OK, _CRStatement::kind, and _CRStatement::type. |
|
|
|
Destructor of CRStatement.
Definition at line 2351 of file cr-statement.c. References _CRStatement::next, and _CRStatement::prev. Referenced by cr_statement_ruleset_parse_from_buf(), and cr_stylesheet_destroy(). |
|
Tries to parse a buffer and says whether if the content of the buffer is a css statement as defined by the "Core CSS Grammar" (chapter 4 of the css spec) or not.
Definition at line 872 of file cr-statement.c. References CR_OK, cr_parser_destroy(), cr_parser_new_from_buf(), cr_parser_parse_statement_core(), cr_parser_set_use_core_grammar(), and CRStatus. |
|
Dumps the css2 statement to a file.
Definition at line 2304 of file cr-statement.c. References AT_CHARSET_RULE_STMT, AT_FONT_FACE_RULE_STMT, AT_IMPORT_RULE_STMT, AT_MEDIA_RULE_STMT, AT_PAGE_RULE_STMT, _CRStatement::prev, RULESET_STMT, and _CRStatement::type. Referenced by cr_stylesheet_dump(). |
|
Parses a buffer that contains an "@font-face" rule and builds an instance of CRStatement of type AT_FONT_FACE_RULE_STMT out of it.
Definition at line 1668 of file cr-statement.c. References cr_doc_handler_get_result(), cr_doc_handler_new(), cr_doc_handler_unref(), CR_OK, cr_parser_destroy(), cr_parser_new_from_buf(), cr_parser_parse_font_face(), cr_parser_set_sac_handler(), cr_parser_try_to_skip_spaces_and_comments(), CRDocHandler, and CRStatus. Referenced by cr_statement_parse_from_buf(). |
|
Gets the sheets that contains the current statement.
Definition at line 1750 of file cr-statement.c. References CR_BAD_PARAM_ERROR, CR_OK, and _CRStatement::parent_sheet. |
|
Creates a new instance of CRStatement of type CRAtCharsetRule.
Definition at line 1531 of file cr-statement.c. References AT_CHARSET_RULE_STMT, cr_statement_set_parent_sheet(), cr_utils_trace_info, _CRStatement::kind, and _CRStatement::type. Referenced by cr_statement_at_charset_rule_parse_from_buf(). |
|
Creates an instance of CRStatement of type CRAtFontFaceRule.
Definition at line 1625 of file cr-statement.c. References AT_FONT_FACE_RULE_STMT, cr_statement_set_parent_sheet(), cr_utils_trace_info, _CRStatement::kind, and _CRStatement::type. |
|
Creates a new instance of #CRStatment of type CRAtImportRule.
Definition at line 1282 of file cr-statement.c. References AT_IMPORT_RULE_STMT, cr_statement_set_parent_sheet(), cr_utils_trace_info, _CRStatement::kind, and _CRStatement::type. Referenced by cr_statement_at_import_rule_parse_from_buf(). |
|
Instanciates an instance of CRStatement of type AT_MEDIA_RULE_STMT ( ruleset).
Definition at line 1218 of file cr-statement.c. References AT_MEDIA_RULE_STMT, cr_statement_set_parent_sheet(), cr_utils_trace_info, _CRStatement::kind, _CRStatement::next, RULESET_STMT, and _CRStatement::type. |
|
Creates a new instance of CRStatement of type CRAtPageRule.
Definition at line 1404 of file cr-statement.c. References AT_PAGE_RULE_STMT, cr_declaration_ref(), cr_statement_set_parent_sheet(), cr_utils_trace_info, CRAtPageRule, _CRStatement::kind, and _CRStatement::type. |
|
Creates a new instance of CRStatement of type #CRRulSet.
Definition at line 1072 of file cr-statement.c. References AT_MEDIA_RULE_STMT, cr_selector_ref(), cr_statement_append(), cr_statement_set_parent_sheet(), cr_utils_trace_info, _CRStatement::kind, RULESET_STMT, and _CRStatement::type. |
|
Parses a buffer that contains a css statement and returns an instance of CRStatement in case of successfull parsing. TODO: at support of "@import" rules.
Definition at line 914 of file cr-statement.c. References cr_statement_at_charset_rule_parse_from_buf(), cr_statement_at_import_rule_parse_from_buf(), cr_statement_at_media_rule_parse_from_buf(), cr_statement_at_page_rule_parse_from_buf(), cr_statement_font_face_rule_parse_from_buf(), and cr_statement_ruleset_parse_from_buf(). |
|
Prepends the an instance of CRStatement to the current statement list.
Definition at line 1796 of file cr-statement.c. References _CRStatement::next, and _CRStatement::prev. |
|
Appends a declaration to the current statement.
Definition at line 2003 of file cr-statement.c. References CR_BAD_PARAM_ERROR, cr_declaration_append(), CR_ERROR, CR_OK, _CRStatement::kind, RULESET_STMT, and _CRStatement::type. |
|
Appends a declaration to the current ruleset statement.
Definition at line 1979 of file cr-statement.c. References CR_BAD_PARAM_ERROR, cr_declaration_append2(), CR_ERROR, CR_OK, _CRStatement::kind, RULESET_STMT, and _CRStatement::type. |
|
Gets a pointer to the list of declaration contained in the ruleset statement.
Definition at line 1907 of file cr-statement.c. References CR_BAD_PARAM_ERROR, CR_OK, _CRStatement::kind, RULESET_STMT, and _CRStatement::type. |
|
Gets a pointer to the selector list contained in the current ruleset statement.
Definition at line 1930 of file cr-statement.c. References CR_BAD_PARAM_ERROR, CR_OK, _CRStatement::kind, RULESET_STMT, and _CRStatement::type. |
|
Parses a buffer that contains a ruleset statement an instanciates a CRStatement of type RULESET_STMT.
Definition at line 1002 of file cr-statement.c. References cr_doc_handler_get_result(), cr_doc_handler_new(), cr_doc_handler_unref(), CR_OK, cr_parser_destroy(), cr_parser_new_from_buf(), cr_parser_parse_ruleset(), cr_parser_set_sac_handler(), cr_parser_try_to_skip_spaces_and_comments(), cr_statement_destroy(), CRDocHandler, and CRStatus. Referenced by cr_statement_parse_from_buf(). |
|
Sets a declaration list to the current ruleset statement.
Definition at line 1950 of file cr-statement.c. References CR_BAD_PARAM_ERROR, cr_declaration_destroy(), CR_OK, _CRStatement::kind, RULESET_STMT, and _CRStatement::type. |
|
Sets a selector list to a ruleset statement.
Definition at line 1880 of file cr-statement.c. References CR_BAD_PARAM_ERROR, CR_OK, cr_selector_ref(), cr_selector_unref(), _CRStatement::kind, RULESET_STMT, and _CRStatement::type. |
|
Sets the container stylesheet.
Definition at line 1735 of file cr-statement.c. References CR_BAD_PARAM_ERROR, CR_OK, and _CRStatement::parent_sheet. Referenced by cr_statement_new_at_charset_rule(), cr_statement_new_at_font_face_rule(), cr_statement_new_at_import_rule(), cr_statement_new_at_media_rule(), cr_statement_new_at_page_rule(), and cr_statement_new_ruleset(). |
|
Unlinks a statement from the statements list.
Now, the real unlinking job. Definition at line 1823 of file cr-statement.c. References _CRStatement::next, _CRStatement::parent_sheet, _CRStatement::prev, and _CRStyleSheet::statements. |
|
Definition at line 121 of file cr-statement.h. |
|
page selector. Is a pseudo selector Definition at line 124 of file cr-statement.h. Referenced by cr_additional_sel_to_string(), cr_attr_sel_to_string(), cr_enc_handler_resolve_enc_alias(), cr_pseudo_to_string(), and cr_rgb_set_from_name(). |
|
Definition at line 125 of file cr-statement.h. |