diff options
author | Dodji Seketeli <dodji@gnome.org> | 2004-02-29 11:54:43 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@src.gnome.org> | 2004-02-29 11:54:43 +0000 |
commit | 6a2cb75412be707fd68b20399e2e1376b10b9f33 (patch) | |
tree | 5bea8663419646af5f3dd7f1aa734c74baa4b4f6 /src/cr-stylesheet.c | |
parent | 3ead86bfa0d3c7dd5749649a3ba805a944b33689 (diff) | |
download | libcroco-6a2cb75412be707fd68b20399e2e1376b10b9f33.tar.gz |
applied a patch from Rob BUIS that provides new apis to manipulate CSS
2004-02-29 Dodji Seketeli <dodji@gnome.org>
* src/cr-statement.[ch],src/cr-stylesheet.[ch]:
applied a patch from Rob BUIS that provides new apis
to manipulate CSS statements.
Diffstat (limited to 'src/cr-stylesheet.c')
-rw-r--r-- | src/cr-stylesheet.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/cr-stylesheet.c b/src/cr-stylesheet.c index 06b1c5f..a1b8b01 100644 --- a/src/cr-stylesheet.c +++ b/src/cr-stylesheet.c @@ -78,6 +78,34 @@ cr_stylesheet_dump (CRStyleSheet *a_this, FILE *a_fp) } } +/** + *Return the number of rules in the stylesheet. + *@param a_this the current instance of #CRStyleSheet. + *@return number of rules in the stylesheet. + */ +int +cr_stylesheets_nr_rules (CRStyleSheet *a_this) +{ + g_return_val_if_fail (a_this, -1) ; + + return cr_statement_nr_rules (a_this->statements); +} + +/** + *Use an index to get a CRStatement from the rules in a given stylesheet. + *@param a_this the current instance of #CRStatement. + *@param itemnr the index into the rules. + *@return CRStatement at position itemnr, if itemnr > number of rules - 1, + *it will return NULL. + */ +CRStatement * +cr_stylesheet_statement_get_from_list (CRStyleSheet *a_this, int itemnr) +{ + g_return_val_if_fail (a_this, NULL) ; + + return cr_statement_get_from_list (a_this->statements, itemnr); +} + void cr_stylesheet_ref (CRStyleSheet *a_this) { |