Re: [libcroco-list] About CRStyle datastructure



MenTaLguY wrote:
On Thu, 2004-04-15 at 04:33, dodji seketeli org wrote:

Anyway there will certainly be other renderers than libcroco ( an svg renderer for example ) that will need some parsed property and not just a pair composed of a property name and of some CrTerm's.

They will then build their own style datastructure. The SVG rendering model (for
example) is really different from the CSS2 rendering model. SVG guys use CSS
only as a syntaxic vector to carry style properties. They don't need our
CRStyle. They need to build their own one.

Agreed.  Inkscape should be able to use much of libcroco, but CRStyle is
definitely more appropriate to sewfox.

I still think that the function set_property*_from_term() are definitely sharable, it is just simple switch logic but still useful to share i think.
Maybe changing their signature to(for example):
enum CRStatus cr_property_set_white_space_from_term(CRWhiteSpaceType *a_white_space_type, CRTerm *a_term);
with their counterparts:
void cr_property_white_space_get_string(CRWhiteSpaceType *a_white_space);

In this new module cr-property.{c,h} we could add enum for all the properties we could dream off:) Without bloating sewfox with property he doesn't care about...

we would just keep cr_style_set_from_decl, *resolve_inherited, *set_props_to_default and *set_props_to_initial, other functions really related to CRStyle in <cr-style.*> .

A+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]