![]() |
![]() |
![]() |
CCD Reference Manual | ![]() |
---|---|---|---|---|
void ccd_init (ccd_node_class_t const *node_class, ccd_function_t const *vtable); void ccd_shutdown (void); typedef ccd_node_t; ccd_node_class_t; ccd_node_t* (*ccd_node_get_container_f) (ccd_node_t const *self); ccd_node_t* (*ccd_node_get_base_style_f) (ccd_node_t const *self); const char* (*ccd_node_get_id_f) (ccd_node_t const *self); const char* (*ccd_node_get_type_f) (ccd_node_t const *self); const char* (*ccd_node_get_class_f) (ccd_node_t const *self); const char* (*ccd_node_get_pseudo_class_f) (ccd_node_t const *self); char* (*ccd_node_get_attribute_f) (ccd_node_t const *self, char const *name); void (*ccd_node_release_f) (ccd_node_t *self);
void ccd_init (ccd_node_class_t const *node_class, ccd_function_t const *vtable);
Initialize the CCD library before making any calls to it.
|
dispatch table as described at ccd_node_class_t. |
|
typedef void * ccd_node_t;
Stack-allocatable struct representing a document node. Used for querying the ccd_stylesheet_t.
Memory management: Unless specified otherwise, objects of this kind are under the responsibility of the libccd consumer.
typedef struct { ccd_node_is_a_f is_a; ccd_node_get_container_f get_container; ccd_node_get_base_style_f get_base_style; ccd_node_get_id_f get_id; ccd_node_get_type_f get_type; ccd_node_get_class_f get_class; ccd_node_get_pseudo_class_f get_pseudo_class; ccd_node_get_attribute_f get_attribute; ccd_node_release_f release; } ccd_node_class_t;
Dispatch table a CCD 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 ccd_init.
ccd_node_is_a_f |
|
ccd_node_get_container_f |
a ccd_node_get_container_f. |
ccd_node_get_base_style_f |
a ccd_node_get_base_style_f. |
ccd_node_get_id_f |
a ccd_node_get_id_f. |
ccd_node_get_type_f |
a ccd_node_get_type_f. |
ccd_node_get_class_f |
a ccd_node_get_class_f. |
ccd_node_get_pseudo_class_f |
a ccd_node_get_pseudo_class_f. |
ccd_node_get_attribute_f |
a ccd_node_get_attribute_f. |
ccd_node_release_f |
a ccd_node_release_f. |
ccd_node_t* (*ccd_node_get_container_f) (ccd_node_t const *self);
Hook function to query the container of a ccd_node_t.
|
a ccd_node_t. |
Returns : |
newly allocated container node or NULL .
|
ccd_node_t* (*ccd_node_get_base_style_f) (ccd_node_t const *self);
Hook function to query the name of the style a ccd_node_t derives from.
|
a ccd_node_t. |
Returns : |
base style or NULL . The returned value must be valid until
it is released.
|
const char* (*ccd_node_get_id_f) (ccd_node_t const *self);
Hook function to query the ID of a ccd_node_t.
|
a ccd_node_t. |
Returns : |
node ID or NULL . The returned value must be valid until
the current stylesheet query returns.
|
const char* (*ccd_node_get_type_f) (ccd_node_t const *self);
Hook function to query the type name of a ccd_node_t.
|
a ccd_node_t. |
Returns : |
node type name or NULL . The returned value must be valid until
the current stylesheet query returns.
|
const char* (*ccd_node_get_class_f) (ccd_node_t const *self);
Hook function to query the class name of a ccd_node_t.
|
a ccd_node_t. |
Returns : |
node class name or NULL . The returned value must be valid until
the current stylesheet query returns.
|
const char* (*ccd_node_get_pseudo_class_f) (ccd_node_t const *self);
Hook function to query the pseudo-class name of a ccd_node_t.
|
a ccd_node_t. |
Returns : |
node pseudo-class name or NULL . The returned value must be valid until
the current stylesheet query returns.
|
char* (*ccd_node_get_attribute_f) (ccd_node_t const *self, char const *name);
Hook function to query a ccd_node_t's attributes.
|
a ccd_node_t. |
|
attribute name. |
Returns : |
attribute value or NULL . The returned value must be valid until
the current stylesheet query returns.
|
void (*ccd_node_release_f) (ccd_node_t *self);
Hook function to deallocate a ccd_node_t instance.
|
a ccd_node_t. |