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

cr-statement.c File Reference

Definition of the CRStatement class. More...

#include <string.h>
#include "cr-statement.h"
#include "cr-parser.h"

Go to the source code of this file.

Defines

#define DECLARATION_INDENT_NB   2

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.

CRStatementcr_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.

CRStatementcr_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.

CRStatementcr_statement_new_ruleset (CRStyleSheet *a_sheet, CRSelector *a_sel_list, CRDeclaration *a_decl_list, CRStatement *a_parent_media_rule)
 Creates a new instance of CRStatement of type #CRRulSet.

CRStatementcr_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.

CRStatementcr_statement_new_at_media_rule (CRStyleSheet *a_sheet, CRStatement *a_rulesets, GList *a_media)
 Instanciates an instance of CRStatement of type AT_MEDIA_RULE_STMT ( ruleset).

CRStatementcr_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.

CRStatementcr_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.

CRStatementcr_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.

CRStatementcr_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.

CRStatementcr_statement_new_at_charset_rule (CRStyleSheet *a_sheet, GString *a_charset)
 Creates a new instance of CRStatement of type CRAtCharsetRule.

CRStatementcr_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.

CRStatementcr_statement_new_at_font_face_rule (CRStyleSheet *a_sheet, CRDeclaration *a_font_decls)
 Creates an instance of CRStatement of type CRAtFontFaceRule.

CRStatementcr_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.

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.

CRStatementcr_statement_append (CRStatement *a_this, CRStatement *a_new)
 Appends a new statement to the statement list.

CRStatementcr_statement_prepend (CRStatement *a_this, CRStatement *a_new)
 Prepends the an instance of CRStatement to the current statement list.

CRStatementcr_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_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_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_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_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.


Detailed Description

Definition of the CRStatement class.

Definition in file cr-statement.c.


Define Documentation

#define DECLARATION_INDENT_NB   2
 

Definition at line 36 of file cr-statement.c.


Function Documentation

CRStatement* cr_statement_append CRStatement a_this,
CRStatement a_new
 

Appends a new statement to the statement list.

Parameters:
a_this the current instance of the statement list.
a_this a_new the new instance of CRStatement to append.
Returns:
the new list statement list, or NULL in cas of failure.

Definition at line 1766 of file cr-statement.c.

References _CRStatement::next, and _CRStatement::prev.

Referenced by cr_statement_new_ruleset().

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.

Parameters:
a_this the current rule statement.
a_charset out parameter. The returned charset string if and only if the function returned CR_OK.

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.

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.

Parameters:
a_buf the buffer to parse.
the character encoding of the buffer.
Returns:
the newly built instance of CRStatement.

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().

enum CRStatus cr_statement_at_charset_rule_set_charset CRStatement a_this,
GString *  a_charset
 

Sets the charset of the current rule statement.

Parameters:
a_this the current rule statement.
a_charset the charset to set.
Returns:
CR_OK upon successfull completion, an error code otherwise.

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.

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.

Parameters:
a_this the current -face rule statement.
a_prop the property of the declaration.
a_value the value of the declaration.
Returns:
CR_OK upon successfull completion, an error code otherwise.

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.

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.

Parameters:
a_this the current -face rule statement.
a_decls out parameter. The returned declaration list if and only if this function returns CR_OK.
Returns:
CR_OK upon successfull completion, an error code otherwise.

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.

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.

Parameters:
a_this the current -face rule statement.
a_decls the declarations list to set.
Returns:
CR_OK upon successfull completion, an error code otherwise.

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.

enum CRStatus cr_statement_at_import_rule_get_imported_sheet CRStatement a_this,
CRStyleSheet **  a_sheet
 

Gets the stylesheet contained by the rule statement.

Parameters:
a_this the current rule statement.
a_sheet out parameter. The returned stylesheet if and only if the function returns CR_OK.
Returns:
CR_OK upon sucessfull completion, an error code otherwise.

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.

enum CRStatus cr_statement_at_import_rule_get_url CRStatement a_this,
GString **  a_url
 

Gets the url of the rule statement.

Parameters:
the current rule statement.
a_url out parameter. The returned url if and only if the function returned CR_OK.

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.

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.

Parameters:
a_buf the buffer to parse.
a_encoding the encoding of a_buf.
Returns:
the newly built instance of CRStatement in case of a successfull parsing, NULL otherwise.

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().

enum CRStatus cr_statement_at_import_rule_set_imported_sheet CRStatement a_this,
CRStyleSheet a_sheet
 

Sets a stylesheet to the current rule.

Parameters:
a_this the current rule.
a_sheet the stylesheet. The stylesheet is owned by the current instance of CRStatement, that is, the stylesheet will be destroyed when the current instance of CRStatement will be destroyed.
Returns:
CR_OK upon successfull completion, an error code otherwise.

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.

enum CRStatus cr_statement_at_import_rule_set_url CRStatement a_this,
GString *  a_url
 

Sets an url to the current rule statement.

Parameters:
a_this the current rule statement.
a_url the url to set.
Returns:
CR_OK upon successfull completion, an error code otherwise.

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.

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.

Parameters:
a_buf the input to parse.
a_enc the encoding of the buffer.
Returns:
the statement, or NULL if the buffer could not be successfully parsed.

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().

enum CRStatus cr_statement_at_page_rule_get_declarations CRStatement a_this,
CRDeclaration **  a_decl_list
 

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.

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.

Parameters:
a_buf the character buffer to parse.
a_encoding the character encoding of a_buf.
Returns:
the newly built at page statement in case of successfull parsing, NULL otherwise.

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().

enum CRStatus cr_statement_at_page_rule_set_declarations CRStatement a_this,
CRDeclaration a_decl_list
 

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.

void cr_statement_destroy CRStatement a_this  ) 
 

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().

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.

Parameters:
a_buf the buffer to parse.
a_encoding the character encoding of a_buf.
Returns:
TRUE if the buffer parses against the core grammar, false otherwise.

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.

void cr_statement_dump CRStatement a_this,
FILE *  a_fp,
gulong  a_indent
 

Dumps the css2 statement to a file.

Parameters:
a_this the current css2 statement.
a_fp the destination file pointer.
a_indent the number of white space indentation characters.

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().

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.

Parameters:
a_buf the buffer to parse.
a_encoding the character encoding of a_buf.
Returns:
the newly built instance of CRStatement in case of successufull parsing, NULL otherwise.

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().

enum CRStatus cr_statement_get_parent_sheet CRStatement a_this,
CRStyleSheet **  a_sheet
 

Gets the sheets that contains the current statement.

Parameters:
a_this the current CRStatement.
a_sheet out parameter. A pointer to the sheets that
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 1750 of file cr-statement.c.

References CR_BAD_PARAM_ERROR, CR_OK, and _CRStatement::parent_sheet.

CRStatement* cr_statement_new_at_charset_rule CRStyleSheet a_sheet,
GString *  a_charset
 

Creates a new instance of CRStatement of type CRAtCharsetRule.

Parameters:
a_charset the string representing the charset. Note that the newly built instance of CRStatement becomes the owner of a_charset. The caller must not free a_charset !!!.
Returns:
the newly built instance of CRStatement or NULL if an error arises.

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().

CRStatement* cr_statement_new_at_font_face_rule CRStyleSheet a_sheet,
CRDeclaration a_font_decls
 

Creates an instance of CRStatement of type CRAtFontFaceRule.

Parameters:
a_font_decls a list of instances of CRDeclaration. Each declaration is actually a font declaration.
Returns:
the newly built instance of CRStatement.

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.

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.

Parameters:
a_url the url to connect to the get the file to be imported.
a_sheet the imported parsed stylesheet.
Returns:
the newly built instance of CRStatement.

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().

CRStatement* cr_statement_new_at_media_rule CRStyleSheet a_sheet,
CRStatement a_rulesets,
GList *  a_media
 

Instanciates an instance of CRStatement of type AT_MEDIA_RULE_STMT ( ruleset).

Parameters:
a_ruleset the ruleset statements contained in the rule.
a_media,the media string list. A list of GString pointers.

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.

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.

Parameters:
a_decl_list a list of instances of #CRDeclarations which is actually the list of declarations that applies to this page rule.
a_selector the page rule selector.
Returns:
the newly built instance of CRStatement or NULL in case of error.

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.

CRStatement* cr_statement_new_ruleset CRStyleSheet a_sheet,
CRSelector a_sel_list,
CRDeclaration a_decl_list,
CRStatement a_parent_media_rule
 

Creates a new instance of CRStatement of type #CRRulSet.

Parameters:
a_sel_list the list of CRSimpleSel (selectors) the rule applies to.
a_decl_list the list of instances of CRDeclaration that composes the ruleset.
a_media_types a list of instances of GString that describe the media list this ruleset applies to.
Returns:
the new instance of CRStatement or NULL if something went wrong.

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.

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.

TODO: at support of "@import" rules.

Parameters:
a_buf the buffer to parse.
a_encoding the character encoding of a_buf.
Returns:
the newly built instance of CRStatement in case of successfull parsing, NULL otherwise.

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().

CRStatement* cr_statement_prepend CRStatement a_this,
CRStatement a_new
 

Prepends the an instance of CRStatement to the current statement list.

Parameters:
a_this the current instance of CRStatement.
a_new the new statement to prepend.
Returns:
the new list with the new statement prepended, or NULL in case of an error.

Definition at line 1796 of file cr-statement.c.

References _CRStatement::next, and _CRStatement::prev.

enum CRStatus cr_statement_ruleset_append_decl CRStatement a_this,
CRDeclaration a_decl
 

Appends a declaration to the current statement.

Parameters:
a_this the current statement.
a_declaration the declaration to append.
Returns:
CR_OK upon sucessfull completion, an error code otherwise.

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.

enum CRStatus cr_statement_ruleset_append_decl2 CRStatement a_this,
GString *  a_prop,
CRTerm a_value
 

Appends a declaration to the current ruleset statement.

Parameters:
a_this the current statement.
a_prop the property of the declaration.
a_value the value of the declaration.
Returns:
CR_OK uppon successfull completion, an error code otherwise.

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.

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.

Parameters:
a_this the current instance of CRStatement. out parameter. A pointer to the the returned list of declaration. Must not be NULL.
Returns:
CR_OK upon successfull completion, an error code if something bad happened.

Definition at line 1907 of file cr-statement.c.

References CR_BAD_PARAM_ERROR, CR_OK, _CRStatement::kind, RULESET_STMT, and _CRStatement::type.

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.

Parameters:
a_this the current ruleset statement.
a_list out parameter. The returned selector list, if and only if the function returned CR_OK.
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 1930 of file cr-statement.c.

References CR_BAD_PARAM_ERROR, CR_OK, _CRStatement::kind, RULESET_STMT, and _CRStatement::type.

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.

Parameters:
a_buf the buffer to parse.
a_enc the character encoding of a_buf.
the newly built instance of CRStatement in case of successfull parsing, NULL otherwise.

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().

enum CRStatus cr_statement_ruleset_set_decl_list CRStatement a_this,
CRDeclaration a_list
 

Sets a declaration list to the current ruleset statement.

Parameters:
a_this the current ruleset statement.
a_list the declaration list to be added to the current ruleset statement.
Returns:
CR_OK upon successfull completion, an error code otherwise.

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.

enum CRStatus cr_statement_ruleset_set_sel_list CRStatement a_this,
CRSelector a_sel_list
 

Sets a selector list to a ruleset statement.

Parameters:
a_this the current ruleset statement.
a_sel_list the selector list to set. Note that this function increments the ref count of a_sel_list. The sel list will be destroyed at the destruction of the current instance of CRStatement.
Returns:
CR_OK upon successfull completion, an error code otherwise.

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.

enum CRStatus cr_statement_set_parent_sheet CRStatement a_this,
CRStyleSheet a_sheet
 

Sets the container stylesheet.

Parameters:
a_this the current instance of CRStatement.
a_sheet the sheet that contains the current statement.
Returns:
CR_OK upon successfull completion, an errror code otherwise.

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().

CRStatement* cr_statement_unlink CRStatement a_stmt  ) 
 

Unlinks a statement from the statements list.

Parameters:
a_this the current statements list.
a_to_unlink the statement to unlink from the list.
Returns:
the new list where a_to_unlink has been unlinked from, or NULL in case of error.
Some sanity checks first

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.


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