cr-stylesheet.h 2.5 KB

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