TOJsoft.net

TOJsoft.net - tsCSS

tsCSS

This library has the aim to provide an interface in which applications that wants to use CSS can easily extract style data from elements in an XML-like structure. The interface uses standard C++ library features only and style data is reperesented in a platform independent way. It is up to the application to create pens/brushes/backgrounds etc from the parsed data.

Style-able node

Each node that can be styled needs to implement a few features for the selectors of CSS to work properly:

readonly NodeList childNodes

readonly Node parentNode

readonly string name

string getAttribute(string attribute)
	

Usage

The main usage of the library lies in a few function calls. One is to obtain styles for a specific node:

StyleAttributes Stylesheet::getActiveStyles(Node node)

The style attributes can be used to create a StyleDef:

void StyleDef::addStyles(StyleAttributes attributes)
Then each StyleDef has the following properties (list will grow):

What is CSS?

CSS stands for cascaded style sheets and is a way to separate style and look from meaning..

Sample

Recently I have compiled a sample of the library and released it under this license. You will find it here.

Authors

Thomas Jansson - thomasj

(c) 2007 TOJsoft.net