diff options
Diffstat (limited to 'include/libcss')
-rw-r--r-- | include/libcss/select.h | 8 | ||||
-rw-r--r-- | include/libcss/stylesheet.h | 5 | ||||
-rw-r--r-- | include/libcss/types.h | 137 |
3 files changed, 139 insertions, 11 deletions
diff --git a/include/libcss/select.h b/include/libcss/select.h index f1de409..ca57456 100644 --- a/include/libcss/select.h +++ b/include/libcss/select.h @@ -206,10 +206,10 @@ css_error css_select_ctx_destroy(css_select_ctx *ctx); css_error css_select_ctx_append_sheet(css_select_ctx *ctx, const css_stylesheet *sheet, - css_origin origin, uint64_t media); + css_origin origin, const char *media); css_error css_select_ctx_insert_sheet(css_select_ctx *ctx, const css_stylesheet *sheet, uint32_t index, - css_origin origin, uint64_t media); + css_origin origin, const char *media); css_error css_select_ctx_remove_sheet(css_select_ctx *ctx, const css_stylesheet *sheet); @@ -221,13 +221,13 @@ css_error css_select_default_style(css_select_ctx *ctx, css_select_handler *handler, void *pw, css_computed_style **style); css_error css_select_style(css_select_ctx *ctx, void *node, - uint64_t media, const css_stylesheet *inline_style, + const css_media *media, const css_stylesheet *inline_style, css_select_handler *handler, void *pw, css_select_results **result); css_error css_select_results_destroy(css_select_results *results); css_error css_select_font_faces(css_select_ctx *ctx, - uint64_t media, lwc_string *font_family, + const css_media *media, lwc_string *font_family, css_select_font_faces_results **result); css_error css_select_font_faces_results_destroy( css_select_font_faces_results *results); diff --git a/include/libcss/stylesheet.h b/include/libcss/stylesheet.h index 68c4dfc..542f199 100644 --- a/include/libcss/stylesheet.h +++ b/include/libcss/stylesheet.h @@ -36,7 +36,6 @@ typedef css_error (*css_url_resolution_fn)(void *pw, * \param pw Client data * \param parent Stylesheet requesting the import * \param url URL of the imported sheet - * \param media Applicable media for the imported sheet * \return CSS_OK on success, appropriate error otherwise * * \note This function will be invoked for notification purposes @@ -46,7 +45,7 @@ typedef css_error (*css_url_resolution_fn)(void *pw, * registration API. */ typedef css_error (*css_import_notification_fn)(void *pw, - css_stylesheet *parent, lwc_string *url, uint64_t media); + css_stylesheet *parent, lwc_string *url); /** * Callback use to resolve system colour names to RGB values @@ -145,7 +144,7 @@ css_error css_stylesheet_append_data(css_stylesheet *sheet, css_error css_stylesheet_data_done(css_stylesheet *sheet); css_error css_stylesheet_next_pending_import(css_stylesheet *parent, - lwc_string **url, uint64_t *media); + lwc_string **url); css_error css_stylesheet_register_import(css_stylesheet *parent, css_stylesheet *child); diff --git a/include/libcss/types.h b/include/libcss/types.h index 4f35737..44aef12 100644 --- a/include/libcss/types.h +++ b/include/libcss/types.h @@ -60,10 +60,10 @@ typedef enum css_media_type { CSS_MEDIA_TTY = (1 << 8), CSS_MEDIA_TV = (1 << 9), CSS_MEDIA_ALL = CSS_MEDIA_AURAL | CSS_MEDIA_BRAILLE | - CSS_MEDIA_EMBOSSED | CSS_MEDIA_HANDHELD | - CSS_MEDIA_PRINT | CSS_MEDIA_PROJECTION | - CSS_MEDIA_SCREEN | CSS_MEDIA_SPEECH | - CSS_MEDIA_TTY | CSS_MEDIA_TV + CSS_MEDIA_EMBOSSED | CSS_MEDIA_HANDHELD | + CSS_MEDIA_PRINT | CSS_MEDIA_PROJECTION | + CSS_MEDIA_SCREEN | CSS_MEDIA_SPEECH | + CSS_MEDIA_TTY | CSS_MEDIA_TV } css_media_type; /** @@ -116,6 +116,135 @@ typedef enum css_unit { } css_unit; /** + * Media orienations + */ +typedef enum css_media_orientation { + CSS_MEDIA_ORIENTATION_PORTRAIT = 0, + CSS_MEDIA_ORIENTATION_LANDSCAPE = 1 +} css_media_orientation; + +/** + * Media scans + */ +typedef enum css_media_scan { + CSS_MEDIA_SCAN_PROGRESSIVE = 0, + CSS_MEDIA_SCAN_INTERLACE = 1 +} css_media_scan; + +/** + * Media update-frequencies + */ +typedef enum css_media_update_frequency { + CSS_MEDIA_UPDATE_FREQUENCY_NORMAL = 0, + CSS_MEDIA_UPDATE_FREQUENCY_SLOW = 1, + CSS_MEDIA_UPDATE_FREQUENCY_NONE = 2 +} css_media_update_frequency; + +/** + * Media block overflows + */ +typedef enum css_media_overflow_block { + CSS_MEDIA_OVERFLOW_BLOCK_NONE = 0, + CSS_MEDIA_OVERFLOW_BLOCK_SCROLL = 1, + CSS_MEDIA_OVERFLOW_BLOCK_OPTIONAL_PAGED = 2, + CSS_MEDIA_OVERFLOW_BLOCK_PAGED = 3 +} css_media_overflow_block; + +/** + * Media inline overflows + */ +typedef enum css_media_overflow_inline { + CSS_MEDIA_OVERFLOW_INLINE_NONE = 0, + CSS_MEDIA_OVERFLOW_INLINE_SCROLL = 1 +} css_media_overflow_inline; + +/** + * Media pointers + */ +typedef enum css_media_pointer { + CSS_MEDIA_POINTER_NONE = 0, + CSS_MEDIA_POINTER_COARSE = 1, + CSS_MEDIA_POINTER_FINE = 2 +} css_media_pointer; + +/** + * Media hovers + */ +typedef enum css_media_hover { + CSS_MEDIA_HOVER_NONE = 0, + CSS_MEDIA_HOVER_ON_DEMAND = 1, + CSS_MEDIA_HOVER_HOVER = 2 +} css_media_hover; + +/** + * Media light-levels + */ +typedef enum css_media_light_level { + CSS_MEDIA_LIGHT_LEVEL_NORMAL = 0, + CSS_MEDIA_LIGHT_LEVEL_DIM = 1, + CSS_MEDIA_LIGHT_LEVEL_WASHED = 2 +} css_media_light_level; + +/** + * Media scriptings + */ +typedef enum css_media_scripting { + CSS_MEDIA_SCRIPTING_NONE = 0, + CSS_MEDIA_SCRIPTING_INITIAL_ONLY = 1, + CSS_MEDIA_SCRIPTING_ENABLED = 2 +} css_media_scripting; + +typedef struct css_media_length { + css_fixed value; + css_unit unit; +} css_media_length; + +typedef struct css_media_resolution { + css_fixed value; + css_unit unit; +} css_media_resolution; + +/** + * Media specification + */ +typedef struct css_media { + /* Media type */ + css_media_type type; + + /* Screen / Device media features */ + css_media_length width; + css_media_length height; + css_fixed aspect_ratio; + css_media_orientation orientation; + + /* Display quality media features */ + css_media_resolution resolution; + css_media_scan scan; + css_fixed grid; /** boolean: {0|1} */ + css_media_update_frequency update; + css_media_overflow_block overflow_block; + css_media_overflow_inline overflow_inline; + + /* Color media features */ + css_fixed color; /* colour bpp (0 for monochrome) */ + css_fixed color_index; + css_fixed monochrome; /* monochrome bpp (0 for colour) */ + css_fixed inverted_colors; /** boolean: {0|1} */ + + /* Interaction media features */ + css_media_pointer pointer; + css_media_pointer any_pointer; + css_media_hover hover; + css_media_hover any_hover; + + /* Environmental media features */ + css_media_light_level light_level; + + /* Scripting media features */ + css_media_scripting scripting; +} css_media; + +/** * Type of a qualified name */ typedef struct css_qname { |