Libcroco
cr-stylesheet.h
Go to the documentation of this file.
1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
2 
3 /*
4  * This file is part of The Croco Library
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of version 2.1 of the GNU Lesser General Public
8  * License as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18  * USA
19  *
20  * see COPYRIGHTS file for copyright information.
21  */
22 
23 
24 #ifndef __CR_STYLESHEET_H__
25 #define __CR_STYLESHEET_H__
26 
27 #include "cr-utils.h"
28 #include "cr-statement.h"
29 
30 G_BEGIN_DECLS
31 
32 /**
33  *@file
34  *The declaration of the #CRStyleSheet class.
35  */
36 
37 
39 {
40  /*Please don't change the order of
41  *the values enumerated here ...
42  *New values should be added at the end,
43  *just before ORIGIN_END.
44  */
45  ORIGIN_UA = 0,
48 
49  /*must always be the last one*/
51 } ;
52 
53 /**
54  *An abstraction of a css stylesheet as defined
55  *by the css2 spec in chapter 4.
56  */
58 {
59  /**The css statements list*/
61 
63 
64  /*the parent import rule, if any.*/
66 
67  /**custom data used by libcroco*/
68  gpointer croco_data ;
69 
70  /**
71  *custom application data pointer
72  *Can be used by applications.
73  */
74  gpointer app_data ;
75 
76  /**
77  *the reference count of this insance
78  *Please, don't never ever modify it
79  *directly. Use cr_stylesheet_ref()
80  *and cr_stylesheet_unref() instead.
81  */
82  gulong ref_count ;
83 } ;
84 
86 
87 gchar * cr_stylesheet_to_string (CRStyleSheet const *a_this) ;
88 void cr_stylesheet_dump (CRStyleSheet const *a_this, FILE *a_fp) ;
89 
90 gint cr_stylesheet_nr_rules (CRStyleSheet const *a_this) ;
91 
93 
94 void cr_stylesheet_ref (CRStyleSheet *a_this) ;
95 
96 gboolean cr_stylesheet_unref (CRStyleSheet *a_this) ;
97 
98 void cr_stylesheet_destroy (CRStyleSheet *a_this) ;
99 
100 G_END_DECLS
101 
102 #endif /*__CR_STYLESHEET_H__*/
ORIGIN_USER
@ ORIGIN_USER
Definition: cr-stylesheet.h:46
_CRStyleSheet
An abstraction of a css stylesheet as defined by the css2 spec in chapter 4.
Definition: cr-stylesheet.h:57
cr_stylesheet_to_string
gchar * cr_stylesheet_to_string(CRStyleSheet const *a_this)
Definition: cr-stylesheet.c:60
_CRStyleSheet::parent_import_rule
CRStatement * parent_import_rule
Definition: cr-stylesheet.h:65
cr_stylesheet_destroy
void cr_stylesheet_destroy(CRStyleSheet *a_this)
Destructor of the CRStyleSheet class.
Definition: cr-stylesheet.c:169
ORIGIN_AUTHOR
@ ORIGIN_AUTHOR
Definition: cr-stylesheet.h:47
CRStyleOrigin
CRStyleOrigin
Definition: cr-stylesheet.h:38
cr_stylesheet_ref
void cr_stylesheet_ref(CRStyleSheet *a_this)
Definition: cr-stylesheet.c:141
cr_stylesheet_unref
gboolean cr_stylesheet_unref(CRStyleSheet *a_this)
Definition: cr-stylesheet.c:149
cr_stylesheet_nr_rules
gint cr_stylesheet_nr_rules(CRStyleSheet const *a_this)
Return the number of rules in the stylesheet.
Definition: cr-stylesheet.c:118
_CRStatement
The abstraction of css statement as defined in the chapter 4 and appendix D.1 of the css2 spec.
Definition: cr-statement.h:182
cr_stylesheet_statement_get_from_list
CRStatement * cr_stylesheet_statement_get_from_list(CRStyleSheet *a_this, int itemnr)
Use an index to get a CRStatement from the rules in a given stylesheet.
Definition: cr-stylesheet.c:133
_CRStyleSheet::croco_data
gpointer croco_data
custom data used by libcroco
Definition: cr-stylesheet.h:68
ORIGIN_UA
@ ORIGIN_UA
Definition: cr-stylesheet.h:45
_CRStyleSheet::app_data
gpointer app_data
custom application data pointer Can be used by applications.
Definition: cr-stylesheet.h:74
_CRStyleSheet::ref_count
gulong ref_count
the reference count of this insance Please, don't never ever modify it directly.
Definition: cr-stylesheet.h:82
cr-statement.h
cr_stylesheet_dump
void cr_stylesheet_dump(CRStyleSheet const *a_this, FILE *a_fp)
Dumps the current css2 stylesheet to a file.
Definition: cr-stylesheet.c:98
cr-utils.h
cr_stylesheet_new
CRStyleSheet * cr_stylesheet_new(CRStatement *a_stmts)
Constructor of the CRStyleSheet class.
Definition: cr-stylesheet.c:37
_CRStyleSheet::statements
CRStatement * statements
The css statements list.
Definition: cr-stylesheet.h:60
NB_ORIGINS
@ NB_ORIGINS
Definition: cr-stylesheet.h:50
_CRStyleSheet::origin
enum CRStyleOrigin origin
Definition: cr-stylesheet.h:62