![]() |
![]() |
![]() |
CCSS Reference Manual | ![]() |
---|---|---|---|---|
void ccss_init (ccss_function_t const *vtable); void ccss_shutdown (void); ccss_node_t; typedef ccss_node_class_t; ccss_node_t* (*ccss_node_get_container_f) (ccss_node_t const *self); ccss_node_t* (*ccss_node_get_base_style_f) (ccss_node_t const *self); const char* (*ccss_node_get_id_f) (ccss_node_t const *self); const char* (*ccss_node_get_type_f) (ccss_node_t const *self); const char* (*ccss_node_get_class_f) (ccss_node_t const *self); const char* (*ccss_node_get_pseudo_class_f) (ccss_node_t const *self); char* (*ccss_node_get_attribute_f) (ccss_node_t const *self, char const *name); bool (*ccss_node_get_viewport_f) (ccss_node_t const *self, uint32_t *x, uint32_t *y, uint32_t *width, uint32_t *height); void (*ccss_node_release_f) (ccss_node_t *self); void ccss_node_init (ccss_node_t *self, ccss_node_class_t *node_class);
void ccss_init (ccss_function_t const *vtable);
Initialize the CCSS library before making any calls to it.
|
typedef struct { } ccss_node_t;
Stack-allocatable struct representing a document node. Used for querying the ccss_stylesheet_t.
Memory management: Unless specified otherwise, objects of this kind are under the responsibility of the libccss consumer.
typedef struct ccss_node_class_ ccss_node_class_t;
Dispatch table a CCSS consumer has to fill so the selection engine can retrieve information about the document the document.
The implemented dispatch table needs to be passed to ccss_init.
ccss_node_t* (*ccss_node_get_container_f) (ccss_node_t const *self);
Hook function to query the container of a ccss_node_t.
|
a ccss_node_t. |
Returns : |
newly allocated container node or NULL .
|
ccss_node_t* (*ccss_node_get_base_style_f) (ccss_node_t const *self);
Hook function to query the name of the style a ccss_node_t derives from.
|
a ccss_node_t. |
Returns : |
base style or NULL . The returned value must be valid until
it is released.
|
const char* (*ccss_node_get_id_f) (ccss_node_t const *self);
Hook function to query the ID of a ccss_node_t.
|
a ccss_node_t. |
Returns : |
node ID or NULL . The returned value must be valid until
the current stylesheet query returns.
|
const char* (*ccss_node_get_type_f) (ccss_node_t const *self);
Hook function to query the type name of a ccss_node_t.
|
a ccss_node_t. |
Returns : |
node type name or NULL . The returned value must be valid until
the current stylesheet query returns.
|
const char* (*ccss_node_get_class_f) (ccss_node_t const *self);
Hook function to query the class name of a ccss_node_t.
|
a ccss_node_t. |
Returns : |
node class name or NULL . The returned value must be valid until
the current stylesheet query returns.
|
const char* (*ccss_node_get_pseudo_class_f) (ccss_node_t const *self);
Hook function to query the pseudo-class name of a ccss_node_t.
|
a ccss_node_t. |
Returns : |
node pseudo-class name or NULL . The returned value must be valid until
the current stylesheet query returns.
|
char* (*ccss_node_get_attribute_f) (ccss_node_t const *self, char const *name);
Hook function to query a ccss_node_t's attributes.
|
a ccss_node_t. |
|
attribute name. |
Returns : |
attribute value or NULL . The returned value must be valid until
the current stylesheet query returns.
|
bool (*ccss_node_get_viewport_f) (ccss_node_t const *self, uint32_t *x, uint32_t *y, uint32_t *width, uint32_t *height);
Hook function to determine the position of a node in the viewport.
|
a ccss_node_t. |
|
horizontal position. |
|
vertical position. |
|
|
|
|
Returns : |
void (*ccss_node_release_f) (ccss_node_t *self);
Hook function to deallocate a ccss_node_t instance.
|
a ccss_node_t. |
void ccss_node_init (ccss_node_t *self, ccss_node_class_t *node_class);
Initializes node_class
by filling unset functions with the default
implementations and attaches it to self
.
|
a ccss_node_t embedding structure. |
|
a ccss_node_class_t vtable. |