Logo Search packages:      
Sourcecode: inkscape version File versions

CRStatement* cr_statement_new_at_page_rule ( CRStyleSheet a_sheet,
CRDeclaration a_decl_list,
CRString *  a_name,
CRString *  a_pseudo 

Creates a new instance of CRStatement of type CRAtPageRule.

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.
the newly built instance of CRStatement or NULL in case of error.

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

References AT_PAGE_RULE_STMT, cr_declaration_ref(), cr_statement_set_parent_sheet(), and cr_utils_trace_info.

        CRStatement *result = (CRStatement *)g_try_malloc (sizeof (CRStatement));

        if (!result) {
                cr_utils_trace_info ("Out of memory");
                return NULL;

        memset (result, 0, sizeof (CRStatement));
        result->type = AT_PAGE_RULE_STMT;

        result->kind.page_rule = (CRAtPageRule *)g_try_malloc (sizeof (CRAtPageRule));

        if (!result->kind.page_rule) {
                cr_utils_trace_info ("Out of memory");
                g_free (result);
                return NULL;

        memset (result->kind.page_rule, 0, sizeof (CRAtPageRule));
        if (a_decl_list) {
                result->kind.page_rule->decl_list = a_decl_list;
                cr_declaration_ref (a_decl_list);
        result->kind.page_rule->name = a_name;
        result->kind.page_rule->pseudo = a_pseudo;
        if (a_sheet)
                cr_statement_set_parent_sheet (result, a_sheet);

        return result;

Generated by  Doxygen 1.6.0   Back to index