diff options
Diffstat (limited to 'include/libcss')
-rw-r--r-- | include/libcss/font_face.h | 24 | ||||
-rw-r--r-- | include/libcss/fpmath.h | 36 | ||||
-rw-r--r-- | include/libcss/select.h | 12 | ||||
-rw-r--r-- | include/libcss/stylesheet.h | 8 |
4 files changed, 40 insertions, 40 deletions
diff --git a/include/libcss/font_face.h b/include/libcss/font_face.h index 6b18433..135682c 100644 --- a/include/libcss/font_face.h +++ b/include/libcss/font_face.h @@ -15,7 +15,7 @@ extern "C" #endif #include <libwapcaplet/libwapcaplet.h> - + #include <libcss/errors.h> #include <libcss/functypes.h> #include <libcss/properties.h> @@ -32,15 +32,15 @@ typedef enum css_font_face_format { /* Embedded OpenType; .eot */ CSS_FONT_FACE_FORMAT_SVG = 0x08, /* SVG Font; .svg, .svgz */ - + CSS_FONT_FACE_FORMAT_UNKNOWN = 0x10, /* Format specified, but not recognised */ - - /* We don't define CSS_FONT_FACE_SRC_FORMAT_TRUETYPE as might be - * expected, because the CSS3 specification + + /* We don't define CSS_FONT_FACE_SRC_FORMAT_TRUETYPE as might be + * expected, because the CSS3 specification * (http://www.w3.org/TR/css3-fonts/, ยง4.3) says: * "Given the overlap in common usage between TrueType and - * OpenType, the format hints "truetype" and "opentype" must be + * OpenType, the format hints "truetype" and "opentype" must be * considered as synonymous" * so we compute a hint of 'truetype' to css_font_face_format_opentype. */ @@ -52,19 +52,19 @@ typedef enum css_font_face_location_type { CSS_FONT_FACE_LOCATION_TYPE_URI = 2, } css_font_face_location_type; - + css_error css_font_face_get_font_family( - const css_font_face *font_face, + const css_font_face *font_face, lwc_string **font_family); - -css_error css_font_face_count_srcs(const css_font_face *font_face, + +css_error css_font_face_count_srcs(const css_font_face *font_face, uint32_t *count); css_error css_font_face_get_src(const css_font_face *font_face, uint32_t index, const css_font_face_src **src); - + css_error css_font_face_src_get_location(const css_font_face_src *src, lwc_string **location); - + css_font_face_location_type css_font_face_src_location_type( const css_font_face_src *src); css_font_face_format css_font_face_src_format(const css_font_face_src *src); diff --git a/include/libcss/fpmath.h b/include/libcss/fpmath.h index 91f2b7e..1e3fa43 100644 --- a/include/libcss/fpmath.h +++ b/include/libcss/fpmath.h @@ -22,66 +22,66 @@ extern "C" /* type for fixed point numbers */ typedef int32_t css_fixed; -static inline css_fixed +static inline css_fixed css_add_fixed(const css_fixed x, const css_fixed y) { int32_t ux = x; int32_t uy = y; int32_t res = ux + uy; - + /* Calculate overflowed result. (Don't change the sign bit of ux) */ ux = (ux >> 31) + INT_MAX; - + /* Force compiler to use cmovns instruction */ if ((int32_t) ((ux ^ uy) | ~(uy ^ res)) >= 0) { res = ux; } - + return res; } -static inline css_fixed +static inline css_fixed css_subtract_fixed(const css_fixed x, const css_fixed y) { int32_t ux = x; int32_t uy = y; int32_t res = ux - uy; - + ux = (ux >> 31) + INT_MAX; - + /* Force compiler to use cmovns instruction */ if ((int32_t)((ux ^ uy) & (ux ^ res)) < 0) { res = ux; } - + return res; } -static inline css_fixed +static inline css_fixed css_divide_fixed(const css_fixed x, const css_fixed y) { int64_t xx = ((int64_t)x << CSS_RADIX_POINT) / y; - + if (xx < INT_MIN) xx = INT_MIN; if (xx > INT_MAX) xx = INT_MAX; - + return xx; } -static inline css_fixed +static inline css_fixed css_multiply_fixed(const css_fixed x, const css_fixed y) { int64_t xx = ((int64_t)x * (int64_t)y) >> CSS_RADIX_POINT; - + if (xx < INT_MIN) xx = INT_MIN; if (xx > INT_MAX) xx = INT_MAX; - + return xx; } -static inline css_fixed +static inline css_fixed css_int_to_fixed(const int a) { int64_t xx = ((int64_t) a) << CSS_RADIX_POINT; @@ -90,11 +90,11 @@ css_int_to_fixed(const int a) { if (xx > INT_MAX) xx = INT_MAX; - + return xx; } -static inline css_fixed +static inline css_fixed css_float_to_fixed(const float a) { float xx = a * (float) (1 << CSS_RADIX_POINT); @@ -103,7 +103,7 @@ css_float_to_fixed(const float a) { if (xx > INT_MAX) xx = INT_MAX; - + return (css_fixed) xx; } diff --git a/include/libcss/select.h b/include/libcss/select.h index 3f1e14a..f1de409 100644 --- a/include/libcss/select.h +++ b/include/libcss/select.h @@ -34,9 +34,9 @@ typedef enum css_pseudo_element { */ typedef struct css_select_results { /** - * Array of pointers to computed styles, + * Array of pointers to computed styles, * indexed by css_pseudo_element. If there - * was no styling for a given pseudo element, + * was no styling for a given pseudo element, * then no computed style will be created and * the corresponding pointer will be set to NULL */ @@ -157,7 +157,7 @@ typedef struct css_select_handler { */ typedef struct css_select_font_faces_results { /** - * Array of pointers to computed font faces. + * Array of pointers to computed font faces. */ css_font_face **font_faces; uint32_t n_font_faces; @@ -204,8 +204,8 @@ css_error css_libcss_node_data_handler(css_select_handler *handler, css_error css_select_ctx_create(css_select_ctx **result); 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_error css_select_ctx_append_sheet(css_select_ctx *ctx, + const css_stylesheet *sheet, css_origin origin, uint64_t media); css_error css_select_ctx_insert_sheet(css_select_ctx *ctx, const css_stylesheet *sheet, uint32_t index, @@ -224,7 +224,7 @@ css_error css_select_style(css_select_ctx *ctx, void *node, uint64_t 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_results_destroy(css_select_results *results); css_error css_select_font_faces(css_select_ctx *ctx, uint64_t media, lwc_string *font_family, diff --git a/include/libcss/stylesheet.h b/include/libcss/stylesheet.h index f92d870..68c4dfc 100644 --- a/include/libcss/stylesheet.h +++ b/include/libcss/stylesheet.h @@ -65,12 +65,12 @@ typedef struct css_system_font { enum css_font_style_e style; enum css_font_variant_e variant; enum css_font_weight_e weight; - struct { - css_fixed size; + struct { + css_fixed size; css_unit unit; } size; - struct { - css_fixed size; + struct { + css_fixed size; css_unit unit; } line_height; /* Note: must be a single family name only */ |