|
libcss
|
#include <libcss/errors.h>#include <libcss/functypes.h>#include <libcss/hint.h>#include <libcss/types.h>#include <libcss/computed.h>#include <libcss/unit.h>Go to the source code of this file.
Classes | |
| struct | css_select_results |
| struct | css_select_handler |
| struct | css_select_font_faces_results |
Typedefs | |
| typedef enum css_pseudo_element | css_pseudo_element |
| typedef struct css_select_results | css_select_results |
| typedef enum css_select_handler_version | css_select_handler_version |
| typedef struct css_select_handler | css_select_handler |
| typedef struct css_select_font_faces_results | css_select_font_faces_results |
Enumerations | |
| enum | css_pseudo_element { CSS_PSEUDO_ELEMENT_NONE = 0 , CSS_PSEUDO_ELEMENT_FIRST_LINE = 1 , CSS_PSEUDO_ELEMENT_FIRST_LETTER = 2 , CSS_PSEUDO_ELEMENT_BEFORE = 3 , CSS_PSEUDO_ELEMENT_AFTER = 4 , CSS_PSEUDO_ELEMENT_COUNT = 5 } |
| enum | css_select_handler_version { CSS_SELECT_HANDLER_VERSION_1 = 1 } |
| enum | css_node_data_action { CSS_NODE_DELETED , CSS_NODE_MODIFIED , CSS_NODE_ANCESTORS_MODIFIED , CSS_NODE_CLONED } |
| typedef enum css_pseudo_element css_pseudo_element |
| typedef struct css_select_font_faces_results css_select_font_faces_results |
Font face selection result set
| typedef struct css_select_handler css_select_handler |
| typedef enum css_select_handler_version css_select_handler_version |
| typedef struct css_select_results css_select_results |
Style selection result set
| enum css_node_data_action |
| enum css_pseudo_element |
| css_error css_libcss_node_data_handler | ( | css_select_handler * | handler, |
| css_node_data_action | action, | ||
| void * | pw, | ||
| void * | node, | ||
| void * | clone_node, | ||
| void * | libcss_node_data | ||
| ) |
Handle libcss_node_data on DOM changes/deletion.
When a DOM node is deleted, if it has libcss_node_data, call with action CSS_NODE_DELETED, to ensure the libcss_node_data is not leaked. Does not call handler->set_libcss_node_data.
When a DOM node is modified, if the node has libcss_node_data, call with CSS_NODE_MODIFIED. This will result in a call to handler->set_libcss_node_data for the node.
When a DOM node's ancestors are modified, if the node has libcss_node_data, call with CSS_NODE_ANCESTORS_MODIFIED. This will result in a call to handler->set_libcss_node_data for the node.
When a DOM node with libcss_node_data is cloned, and its ancestors are also clones, call with CSS_NODE_CLONED. This will result in a call to handler->set_libcss_node_data for the clone node.
| handler | Selection handler vtable |
| action | Type of node action. |
| pw | Client data |
| node | DOM node to get data from |
| clone_node | Clone node, or NULL |
| libcss_node_data | Node data (non-NULL) |
| css_error css_select_ctx_append_sheet | ( | css_select_ctx * | ctx, |
| const css_stylesheet * | sheet, | ||
| css_origin | origin, | ||
| const char * | media | ||
| ) |
Append a stylesheet to a selection context
| ctx | The context to append to |
| sheet | The sheet to append |
| origin | Origin of the sheet |
| media | Media string for the stylesheet |
| css_error css_select_ctx_count_sheets | ( | css_select_ctx * | ctx, |
| uint32_t * | count | ||
| ) |
Count the number of top-level sheets in a selection context
| ctx | Context to consider |
| count | Pointer to location to receive count of sheets |
| css_error css_select_ctx_create | ( | css_select_ctx ** | result | ) |
Create a selection context
| result | Pointer to location to receive created context |
| css_error css_select_ctx_destroy | ( | css_select_ctx * | ctx | ) |
Destroy a selection context
| ctx | The context to destroy |
| css_error css_select_ctx_get_sheet | ( | css_select_ctx * | ctx, |
| uint32_t | index, | ||
| const css_stylesheet ** | sheet | ||
| ) |
Retrieve a sheet from a selection context
| ctx | Context to look in |
| index | Index in context to look |
| sheet | Pointer to location to receive sheet |
| css_error css_select_ctx_insert_sheet | ( | css_select_ctx * | ctx, |
| const css_stylesheet * | sheet, | ||
| uint32_t | index, | ||
| css_origin | origin, | ||
| const char * | media | ||
| ) |
Insert a stylesheet into a selection context
| ctx | The context to insert into |
| sheet | Sheet to insert |
| index | Index in context to insert sheet |
| origin | Origin of the sheet |
| media | Media string for the stylesheet |
| css_error css_select_ctx_remove_sheet | ( | css_select_ctx * | ctx, |
| const css_stylesheet * | sheet | ||
| ) |
Remove a sheet from a selection context
| ctx | The context to remove from |
| sheet | Sheet to remove |
| css_error css_select_default_style | ( | css_select_ctx * | ctx, |
| css_select_handler * | handler, | ||
| void * | pw, | ||
| css_computed_style ** | style | ||
| ) |
Get a default style, e.g. for an implied element's anonymous box
| ctx | Selection context (used to avoid recreating default) |
| handler | Dispatch table of handler functions |
| pw | Client-specific private data for handler functions |
| style | Pointer to location to receive default style |
| css_error css_select_font_faces | ( | css_select_ctx * | ctx, |
| const css_media * | media, | ||
| const css_unit_ctx * | unit_ctx, | ||
| lwc_string * | font_family, | ||
| css_select_font_faces_results ** | result | ||
| ) |
Search a selection context for defined font faces
| ctx | Selection context |
| media | Currently active media spec |
| unit_ctx | Current unit conversion context. |
| font_family | Font family to search for |
| result | Pointer to location to receive result |
| css_error css_select_font_faces_results_destroy | ( | css_select_font_faces_results * | results | ) |
Destroy a font-face result set
| results | Result set to destroy |
| css_error css_select_results_destroy | ( | css_select_results * | results | ) |
Destroy a selection result set
| results | Result set to destroy |
| css_error css_select_style | ( | css_select_ctx * | ctx, |
| void * | node, | ||
| const css_unit_ctx * | unit_ctx, | ||
| const css_media * | media, | ||
| const css_stylesheet * | inline_style, | ||
| css_select_handler * | handler, | ||
| void * | pw, | ||
| css_select_results ** | result | ||
| ) |
Select a style for the given node
| ctx | Selection context to use |
| node | Node to select style for |
| unit_ctx | Context for length unit conversions. |
| media | Currently active media specification |
| inline_style | Corresponding inline style for node, or NULL |
| handler | Dispatch table of handler functions |
| pw | Client-specific private data for handler functions |
| result | Pointer to location to receive result set |
In computing the style, no reference is made to the parent node's style. Therefore, the resultant computed style is not ready for immediate use, as some properties may be marked as inherited. Use css_computed_style_compose() to obtain a fully computed style.
This two-step approach to style computation is designed to allow the client to store the partially computed style and efficiently update the fully computed style for a node when layout changes.