Logo Search packages:      
Sourcecode: inkscape version File versions

static gchar* cr_statement_at_page_rule_to_string ( CRStatement *  a_this,
gulong  a_indent 
) [static]

Serialises the at page rule statement into a string

Parameters:
a_this the current instance of CRStatement. Must be an "@page" rule statement.
Returns:
the serialized string. Must be freed by the caller

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

References cr_declaration_list_to_string2().

Referenced by cr_statement_to_string().

{
        gchar *result = NULL ;

        GString *stringue = (GString *)g_string_new (NULL) ;

        cr_utils_dump_n_chars2 (' ', stringue, a_indent) ;
        g_string_append (stringue, "@page");
      if (a_this->kind.page_rule->name
          && a_this->kind.page_rule->name->stryng) {
            g_string_append_printf 
              (stringue, " %s",
               a_this->kind.page_rule->name->stryng->str) ;
        } else {
                g_string_append (stringue, " ");
        }
      if (a_this->kind.page_rule->pseudo
          && a_this->kind.page_rule->pseudo->stryng) {
            g_string_append_printf 
              (stringue,  " :%s",
               a_this->kind.page_rule->pseudo->stryng->str) ;
        }
        if (a_this->kind.page_rule->decl_list) {
                gchar *str = NULL ;
                g_string_append (stringue, " {\n");
                str = (gchar *)cr_declaration_list_to_string2
                        (a_this->kind.page_rule->decl_list,
                         a_indent + DECLARATION_INDENT_NB, TRUE) ;
                if (str) {
                        g_string_append (stringue, str) ;
                        g_free (str) ;
                        str = NULL ;
                }
                g_string_append (stringue, "\n}\n");
        }
        result = stringue->str ;
        g_string_free (stringue, FALSE) ;
        stringue = NULL ;
        return result ;
}


Generated by  Doxygen 1.6.0   Back to index