cr-additional-sel.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. * Author: Dodji Seketeli
  20. * See the COPYRIGHTS file for copyright information.
  21. */
  22. #ifndef __CR_ADD_SEL_H__
  23. #define __CR_ADD_SEL_H__
  24. #include <stdio.h>
  25. #include <glib.h>
  26. #include "cr-utils.h"
  27. #include "cr-attr-sel.h"
  28. #include "cr-pseudo.h"
  29. #include "cr-additional-sel.h"
  30. G_BEGIN_DECLS
  31. enum AddSelectorType
  32. {
  33. NO_ADD_SELECTOR = 0 ,
  34. CLASS_ADD_SELECTOR = 1 ,
  35. PSEUDO_CLASS_ADD_SELECTOR = 1 << 1,
  36. ID_ADD_SELECTOR = 1 << 3,
  37. ATTRIBUTE_ADD_SELECTOR = 1 << 4
  38. } ;
  39. union CRAdditionalSelectorContent
  40. {
  41. CRString *class_name ;
  42. CRString *id_name ;
  43. CRPseudo *pseudo ;
  44. CRAttrSel *attr_sel ;
  45. } ;
  46. typedef struct _CRAdditionalSel CRAdditionalSel ;
  47. struct _CRAdditionalSel
  48. {
  49. enum AddSelectorType type ;
  50. union CRAdditionalSelectorContent content ;
  51. CRAdditionalSel * next ;
  52. CRAdditionalSel * prev ;
  53. CRParsingLocation location ;
  54. } ;
  55. CRAdditionalSel * cr_additional_sel_new (void) ;
  56. CRAdditionalSel * cr_additional_sel_new_with_type (enum AddSelectorType a_sel_type) ;
  57. CRAdditionalSel * cr_additional_sel_append (CRAdditionalSel *a_this,
  58. CRAdditionalSel *a_sel) ;
  59. void cr_additional_sel_set_class_name (CRAdditionalSel *a_this,
  60. CRString *a_class_name) ;
  61. void cr_additional_sel_set_id_name (CRAdditionalSel *a_this,
  62. CRString *a_id) ;
  63. void cr_additional_sel_set_pseudo (CRAdditionalSel *a_this,
  64. CRPseudo *a_pseudo) ;
  65. void cr_additional_sel_set_attr_sel (CRAdditionalSel *a_this,
  66. CRAttrSel *a_sel) ;
  67. CRAdditionalSel * cr_additional_sel_prepend (CRAdditionalSel *a_this,
  68. CRAdditionalSel *a_sel) ;
  69. guchar * cr_additional_sel_to_string (CRAdditionalSel const *a_this) ;
  70. guchar * cr_additional_sel_one_to_string (CRAdditionalSel const *a_this) ;
  71. void cr_additional_sel_dump (CRAdditionalSel const *a_this, FILE *a_fp) ;
  72. void cr_additional_sel_destroy (CRAdditionalSel *a_this) ;
  73. G_END_DECLS
  74. #endif /*__CR_ADD_SEL_H*/