Libcroco
cr-sel-eng.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  * Author: Dodji Seketeli
21  * See COPYRIGHTS file for copyrights information.
22  */
23 
24 #ifndef __CR_SEL_ENG_H__
25 #define __CR_SEL_ENG_H__
26 
27 #include "cr-utils.h"
28 #include "cr-stylesheet.h"
29 #include "cr-cascade.h"
30 #include "cr-style.h"
31 #include "cr-prop-list.h"
32 
33 #include <libxml/tree.h>
34 
35 /**
36  *@file:
37  *The declaration of the #CRSelEng class.
38  *The #CRSelEng is actually the "Selection Engine"
39  *class.
40  */
41 
42 G_BEGIN_DECLS
43 
44 typedef struct _CRSelEng CRSelEng ;
45 typedef struct _CRSelEngPriv CRSelEngPriv ;
46 
47 /**
48  *The Selection engine class.
49  *The main service provided by this class, is
50  *the ability to interpret a libcroco implementation
51  *of css2 selectors, and given an xml node, say if
52  *the selector matches the node or not.
53  */
54 struct _CRSelEng
55 {
57 } ;
58 
59 
60 typedef gboolean (*CRPseudoClassSelectorHandler) (CRSelEng* a_this,
61  CRAdditionalSel *a_add_sel,
62  xmlNode *a_node) ;
63 CRSelEng * cr_sel_eng_new (void) ;
64 
66  guchar *a_pseudo_class_sel_name,
67  enum CRPseudoType a_pseudo_class_type,
68  CRPseudoClassSelectorHandler a_handler) ;
69 
71  guchar *a_pseudo_class_sel_name,
72  enum CRPseudoType a_pseudo_class_type) ;
73 
75 
77  guchar *a_pseudo_class_sel_name,
78  enum CRPseudoType a_pseudo_class_type,
79  CRPseudoClassSelectorHandler *a_handler) ;
80 
82  CRSimpleSel *a_sel,
83  xmlNode *a_node,
84  gboolean *a_result) ;
85 
87  CRStyleSheet *a_sheet,
88  xmlNode *a_node,
89  CRStatement ***a_rulesets,
90  gulong *a_len) ;
91 
92 enum CRStatus
94  CRCascade *a_cascade,
95  xmlNode *a_node,
96  CRPropList **a_props) ;
97 
99  CRCascade *a_cascade,
100  xmlNode *a_node,
101  CRStyle *a_parent_style,
102  CRStyle **a_style,
103  gboolean a_set_props_to_initial_values) ;
104 
105 void cr_sel_eng_destroy (CRSelEng *a_this) ;
106 
107 G_END_DECLS
108 
109 
110 #endif/*__CR_SEL_ENG_H__*/
the declaration of the CRCascade class.
enum CRStatus cr_sel_eng_unregister_pseudo_class_sel_handler(CRSelEng *a_this, guchar *a_pseudo_class_sel_name, enum CRPseudoType a_pseudo_class_type)
Definition: cr-sel-eng.c:1195
enum CRStatus cr_sel_eng_get_matched_style(CRSelEng *a_this, CRCascade *a_cascade, xmlNode *a_node, CRStyle *a_parent_style, CRStyle **a_style, gboolean a_set_props_to_initial_values)
Definition: cr-sel-eng.c:1515
The Selection engine class.
Definition: cr-sel-eng.h:54
The declaration of the CRStyleSheet class.
An abstraction of a css stylesheet as defined by the css2 spec in chapter 4.
Definition: cr-stylesheet.h:57
The Croco library basic types definitions And global definitions.
enum CRStatus cr_sel_eng_matches_node(CRSelEng *a_this, CRSimpleSel *a_sel, xmlNode *a_node, gboolean *a_result)
cr_sel_eng_matches_node: @a_this: the selection engine.
Definition: cr-sel-eng.c:1312
CRSelEngPriv * priv
Definition: cr-sel-eng.h:56
enum CRStatus cr_sel_eng_get_matched_rulesets(CRSelEng *a_this, CRStyleSheet *a_sheet, xmlNode *a_node, CRStatement ***a_rulesets, gulong *a_len)
cr_sel_eng_get_matched_rulesets: @a_this: the current instance of the selection engine.
Definition: cr-sel-eng.c:1348
enum CRStatus cr_sel_eng_register_pseudo_class_sel_handler(CRSelEng *a_this, guchar *a_pseudo_class_sel_name, enum CRPseudoType a_pseudo_class_type, CRPseudoClassSelectorHandler a_handler)
cr_sel_eng_register_pseudo_class_sel_handler: @a_this: the current instance of CRSelEng @a_pseudo_cla...
Definition: cr-sel-eng.c:1164
CRStatus
The status type returned by the methods of the croco library.
Definition: cr-utils.h:43
enum CRStatus cr_sel_eng_get_pseudo_class_selector_handler(CRSelEng *a_this, guchar *a_pseudo_class_sel_name, enum CRPseudoType a_pseudo_class_type, CRPseudoClassSelectorHandler *a_handler)
Definition: cr-sel-eng.c:1266
CRSelEng * cr_sel_eng_new(void)
cr_sel_eng_new: Creates a new instance of CRSelEng.
Definition: cr-sel-eng.c:1121
typedefG_BEGIN_DECLS struct _CRPropList CRPropList
Definition: cr-prop-list.h:31
enum CRStatus cr_sel_eng_get_matched_properties_from_cascade(CRSelEng *a_this, CRCascade *a_cascade, xmlNode *a_node, CRPropList **a_props)
Definition: cr-sel-eng.c:1414
void cr_sel_eng_destroy(CRSelEng *a_this)
cr_sel_eng_destroy: @a_this: the current instance of the selection engine.
Definition: cr-sel-eng.c:1562
The abstraction of a css2 simple selection list as defined by the right part of the "selector" produc...
Definition: cr-simple-sel.h:74
The abstraction of css statement as defined in the chapter 4 and appendix D.1 of the css2 spec.
Definition: cr-statement.h:182
enum CRStatus cr_sel_eng_unregister_all_pseudo_class_sel_handlers(CRSelEng *a_this)
cr_sel_eng_unregister_all_pseudo_class_sel_handlers: @a_this: the current instance of CRSelEng .
Definition: cr-sel-eng.c:1239
The declaration of the CRStyle class.
CRPseudoType
Definition: cr-pseudo.h:33
gboolean(* CRPseudoClassSelectorHandler)(CRSelEng *a_this, CRAdditionalSel *a_add_sel, xmlNode *a_node)
Definition: cr-sel-eng.h:60
typedefG_BEGIN_DECLS struct _CRSelEng CRSelEng
Definition: cr-sel-eng.h:44
typedefG_BEGIN_DECLS struct _CRStyle CRStyle
Definition: cr-style.h:38