Friday, 18 May 2012

Re: More examples using libcss [Xpost from netsurf-users]

On Fri, May 18, 2012 at 4:46 PM, John-Mark Bell <jmb@netsurf-browser.org> wrote:
On Fri, 2012-05-18 at 16:39 +0530, Syed Mushtaq wrote:
>
> Hi,
>
> I wanted to write a css spriter using libcss to parse css files. I was
> looking at the example provided in the code, I find that the example
> is very limited and not very clear. Is there some place where I can
> find more examples which use libcss. What I am looking at is some kind
> of event based API where my functions get called when parsing a
> ruleset,rule, etc. Similar to libcroco.

LibCSS does not provide this kind of API. Its parser is to be considered
a black box by the outside world. The existing example demonstrates
using LibCSS to parse a stylesheet and then apply the resultant style
information to a document tree. What is unclear about it?


J
 
Maybe I am getting the example wrong. So you begin by giving creating a selector context with the node to be search as the selector ( h1 to h7 ) in the example. At this point the parse tree would have already been created. The function css_select_style() stores the result of the search in a css_select_results * . Now I am unable to understand why we pass a  handler struct which contains various function pointers. When will those functions get called ?

Thanks
-Syed

No comments:

Post a Comment