summaryrefslogtreecommitdiff
path: root/docs/usage.txt
blob: c8b5b59226f921b7455bd42a9e2d082bbfc86cda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
initial author: Dodji Seketeli <dodji@seketeli.org>

Note: 
----
Users can generate an html doc of all the functions of libcroco.
This is documentation is an unvaluable tool to master the libcroco
usage and internals.
To generate the documentation, just cd into the libcroco project
directory and type 'make apidoc' ;
This will generate the documenation in the docs/api directory.


Usage of the libcroco css2 parsing library
===========================================

libcroco has two main user programming interfaces:
the SAC parser, and the CSSOM parser.


The SAC parser
''''''''''''''''

The SAC (Simple Api for CSS) is the lowest level parsing api
provided by libcroco.
It is an event driven api in which the parser notifies the
caller whenever it encounters a remarquable css construction.

The SAC parser is implemented in the CRParser class.
To use it, one must first instanciate a CRParser.

I said earlier the the SAC parser notifies it caller
whenever it encounters certain css language constructions during
the parsing. "Notifies" actually means that it calls a subset of given
callback function pointers set. This set of function pointers is
called a "Document Handler". So, by overriding some function pointers
of the document handler, the user can define the actions to be
performed when a given css language construction is encountered.

The SAC parser's api is defined in cr-parser.h and
the document handler's api is defined in cr-doc-handler.h .


The CSSOM parser
'''''''''''''''''