|
libcss
|
Go to the source code of this file.
Classes | |
| struct | css_system_font |
| struct | css_stylesheet_params |
Typedefs | |
| typedef css_error(* | css_url_resolution_fn) (void *pw, const char *base, lwc_string *rel, lwc_string **abs) |
| typedef css_error(* | css_import_notification_fn) (void *pw, css_stylesheet *parent, lwc_string *url) |
| typedef css_error(* | css_color_resolution_fn) (void *pw, lwc_string *name, css_color *color) |
| typedef struct css_system_font | css_system_font |
| typedef css_error(* | css_font_resolution_fn) (void *pw, lwc_string *name, css_system_font *system_font) |
| typedef enum css_stylesheet_params_version | css_stylesheet_params_version |
| typedef struct css_stylesheet_params | css_stylesheet_params |
Enumerations | |
| enum | css_stylesheet_params_version { CSS_STYLESHEET_PARAMS_VERSION_1 = 1 } |
Callback use to resolve system colour names to RGB values
| pw | Client data |
| name | System colour name |
| color | Pointer to location to receive color value |
| typedef css_error(* css_font_resolution_fn) (void *pw, lwc_string *name, css_system_font *system_font) |
Callback use to resolve system font names to font values
| pw | Client data |
| name | System font identifier |
| system_font | Pointer to system font descriptor to be filled |
| typedef css_error(* css_import_notification_fn) (void *pw, css_stylesheet *parent, lwc_string *url) |
Callback to be notified of the need for an imported stylesheet
| pw | Client data |
| parent | Stylesheet requesting the import |
| url | URL of the imported sheet |
| typedef struct css_stylesheet_params css_stylesheet_params |
Parameter block for css_stylesheet_create()
| typedef struct css_system_font css_system_font |
System font callback result data.
| typedef css_error(* css_url_resolution_fn) (void *pw, const char *base, lwc_string *rel, lwc_string **abs) |
Callback to resolve an URL
| pw | Client data |
| dict | String internment context |
| base | Base URI (absolute) |
| rel | URL to resolve, either absolute or relative to base |
| abs | Pointer to location to receive result |
| css_error css_stylesheet_append_data | ( | css_stylesheet * | sheet, |
| const uint8_t * | data, | ||
| size_t | len | ||
| ) |
Append source data to a stylesheet
| sheet | The stylesheet to append data to |
| data | Pointer to data to append |
| len | Length, in bytes, of data to append |
| css_error css_stylesheet_create | ( | const css_stylesheet_params * | params, |
| css_stylesheet ** | stylesheet | ||
| ) |
Create a stylesheet
| params | Stylesheet parameters |
| stylesheet | Pointer to location to receive stylesheet |
| css_error css_stylesheet_data_done | ( | css_stylesheet * | sheet | ) |
Flag that the last of a stylesheet's data has been seen
| sheet | The stylesheet in question |
| css_error css_stylesheet_destroy | ( | css_stylesheet * | sheet | ) |
Destroy a stylesheet
| sheet | The stylesheet to destroy |
| css_error css_stylesheet_get_disabled | ( | css_stylesheet * | sheet, |
| bool * | disabled | ||
| ) |
Get disabled status of a stylesheet
| sheet | The stylesheet to consider |
| disabled | Pointer to location to receive disabled state |
| css_error css_stylesheet_get_language_level | ( | css_stylesheet * | sheet, |
| css_language_level * | level | ||
| ) |
Retrieve the language level of a stylesheet
| sheet | The stylesheet to retrieve the language level of |
| level | Pointer to location to receive language level |
| css_error css_stylesheet_get_title | ( | css_stylesheet * | sheet, |
| const char ** | title | ||
| ) |
Retrieve the title associated with a stylesheet
| sheet | The stylesheet to retrieve the title from |
| title | Pointer to location to receive pointer to title |
| css_error css_stylesheet_get_url | ( | css_stylesheet * | sheet, |
| const char ** | url | ||
| ) |
Retrieve the URL associated with a stylesheet
| sheet | The stylesheet to retrieve the URL from |
| url | Pointer to location to receive pointer to URL |
| css_error css_stylesheet_next_pending_import | ( | css_stylesheet * | parent, |
| lwc_string ** | url | ||
| ) |
Retrieve the next pending import for the parent stylesheet
| parent | Parent stylesheet |
| url | Pointer to object to be populated with details of URL of imported stylesheet (potentially relative) |
The client must resolve the absolute URL of the imported stylesheet, using the parent's URL as the base. It must then fetch the imported stylesheet, and parse it to completion, including fetching any stylesheets it may import. The resultant sheet must then be registered with the parent using css_stylesheet_register_import().
The client must then call this function again, to determine if there are any further imports for the parent stylesheet, and, if so, process them as described above.
If the client is unable to fetch an imported stylesheet, it must register an empty stylesheet with the parent in its place.
| css_error css_stylesheet_quirks_allowed | ( | css_stylesheet * | sheet, |
| bool * | allowed | ||
| ) |
Determine whether quirky parsing was permitted on a stylesheet
| sheet | The stylesheet to consider |
| quirks | Pointer to location to receive quirkyness |
| css_error css_stylesheet_register_import | ( | css_stylesheet * | parent, |
| css_stylesheet * | import | ||
| ) |
Register an imported stylesheet with its parent
| parent | Parent stylesheet |
| import | Imported sheet |
Ownership of the imported stylesheet is retained by the client.
| css_error css_stylesheet_set_disabled | ( | css_stylesheet * | sheet, |
| bool | disabled | ||
| ) |
Set a stylesheet's disabled state
| sheet | The stylesheet to modify |
| disabled | The new disabled state |
| css_error css_stylesheet_size | ( | css_stylesheet * | sheet, |
| size_t * | size | ||
| ) |
Determine the memory-resident size of a stylesheet
| sheet | Sheet to consider |
| size | Pointer to location to receive byte count |
| css_error css_stylesheet_used_quirks | ( | css_stylesheet * | sheet, |
| bool * | quirks | ||
| ) |
Determine whether quirky parsing was used on a stylesheet
| sheet | The stylesheet to consider |
| quirks | Pointer to location to receive quirkyness |