Port to modified libcss API.

svn path=/trunk/netsurf/; revision=8997
This commit is contained in:
John Mark Bell 2009-08-02 19:19:43 +00:00
parent 9d678ef7cd
commit 0665611cc2
8 changed files with 53 additions and 53 deletions

View File

@ -1421,7 +1421,7 @@ void browser_window_mouse_action_html(struct browser_window *bw,
while ((next_box = box_at_point(box, x, y, &box_x, &box_y, &content)) != while ((next_box = box_at_point(box, x, y, &box_x, &box_y, &content)) !=
NULL) { NULL) {
enum css_overflow overflow = CSS_OVERFLOW_VISIBLE; enum css_overflow_e overflow = CSS_OVERFLOW_VISIBLE;
box = next_box; box = next_box;
@ -2469,7 +2469,7 @@ gui_pointer_shape get_pointer_shape(struct browser_window *bw, struct box *box,
{ {
gui_pointer_shape pointer; gui_pointer_shape pointer;
css_computed_style *style; css_computed_style *style;
enum css_cursor cursor; enum css_cursor_e cursor;
lwc_string **cursor_uris; lwc_string **cursor_uris;
assert(bw); assert(bw);

View File

@ -121,8 +121,8 @@ enum box_side { TOP, RIGHT, BOTTOM, LEFT };
* Container for box border details * Container for box border details
*/ */
struct box_border { struct box_border {
enum css_border_style style; /**< border-style */ enum css_border_style_e style; /**< border-style */
enum css_border_color color; /**< border-color type */ enum css_border_color_e color; /**< border-color type */
css_color c; /**< border-color value */ css_color c; /**< border-color value */
int width; /**< border-width (pixels) */ int width; /**< border-width (pixels) */
}; };

View File

@ -105,7 +105,7 @@ bool box_construct_text(xmlNode *n, struct content *content,
static css_computed_style * box_get_style(struct content *c, static css_computed_style * box_get_style(struct content *c,
const css_computed_style *parent_style, xmlNode *n); const css_computed_style *parent_style, xmlNode *n);
static void box_text_transform(char *s, unsigned int len, static void box_text_transform(char *s, unsigned int len,
enum css_text_transform tt); enum css_text_transform_e tt);
#define BOX_SPECIAL_PARAMS xmlNode *n, struct content *content, \ #define BOX_SPECIAL_PARAMS xmlNode *n, struct content *content, \
struct box *box, bool *convert_children struct box *box, bool *convert_children
static bool box_a(BOX_SPECIAL_PARAMS); static bool box_a(BOX_SPECIAL_PARAMS);
@ -724,7 +724,7 @@ bool box_construct_text(xmlNode *n, struct content *content,
/* white-space: pre */ /* white-space: pre */
char *text = cnv_space2nbsp((char *) n->content); char *text = cnv_space2nbsp((char *) n->content);
char *current; char *current;
enum css_white_space white_space = enum css_white_space_e white_space =
css_computed_white_space(parent_style); css_computed_white_space(parent_style);
/* note: pre-wrap/pre-line are unimplemented */ /* note: pre-wrap/pre-line are unimplemented */
@ -892,7 +892,7 @@ css_computed_style *box_get_style(struct content *c,
* \param tt transform type * \param tt transform type
*/ */
void box_text_transform(char *s, unsigned int len, enum css_text_transform tt) void box_text_transform(char *s, unsigned int len, enum css_text_transform_e tt)
{ {
unsigned int i; unsigned int i;
if (len == 0) if (len == 0)
@ -947,7 +947,7 @@ void box_text_transform(char *s, unsigned int len, enum css_text_transform tt)
bool box_body(BOX_SPECIAL_PARAMS) bool box_body(BOX_SPECIAL_PARAMS)
{ {
enum css_background_color type; enum css_background_color_e type;
css_color color; css_color color;
type = css_computed_background_color(box->style, &color); type = css_computed_background_color(box->style, &color);

View File

@ -22,10 +22,10 @@
#include "render/font.h" #include "render/font.h"
static plot_font_generic_family_t plot_font_generic_family( static plot_font_generic_family_t plot_font_generic_family(
enum css_font_family css); enum css_font_family_e css);
static int plot_font_weight(enum css_font_weight css); static int plot_font_weight(enum css_font_weight_e css);
static plot_font_flags_t plot_font_flags(enum css_font_style style, static plot_font_flags_t plot_font_flags(enum css_font_style_e style,
enum css_font_variant variant); enum css_font_variant_e variant);
/** /**
* Populate a font style using data from a computed CSS style * Populate a font style using data from a computed CSS style
@ -72,7 +72,7 @@ void font_plot_style_from_css(const css_computed_style *css,
* \return Plot font family * \return Plot font family
*/ */
plot_font_generic_family_t plot_font_generic_family( plot_font_generic_family_t plot_font_generic_family(
enum css_font_family css) enum css_font_family_e css)
{ {
plot_font_generic_family_t plot; plot_font_generic_family_t plot;
@ -104,7 +104,7 @@ plot_font_generic_family_t plot_font_generic_family(
* \param css CSS font weight * \param css CSS font weight
* \return Plot weight * \return Plot weight
*/ */
int plot_font_weight(enum css_font_weight css) int plot_font_weight(enum css_font_weight_e css)
{ {
int weight; int weight;
@ -151,8 +151,8 @@ int plot_font_weight(enum css_font_weight css)
* \param variant CSS font variant * \param variant CSS font variant
* \return Computed plot flags * \return Computed plot flags
*/ */
plot_font_flags_t plot_font_flags(enum css_font_style style, plot_font_flags_t plot_font_flags(enum css_font_style_e style,
enum css_font_variant variant) enum css_font_variant_e variant)
{ {
plot_font_flags_t flags = FONTF_NONE; plot_font_flags_t flags = FONTF_NONE;

View File

@ -68,7 +68,7 @@ static bool html_redraw_borders(struct box *box, int x_parent, int y_parent,
bool html_redraw_inline_borders(struct box *box, int x0, int y0, int x1, int y1, bool html_redraw_inline_borders(struct box *box, int x0, int y0, int x1, int y1,
float scale, bool first, bool last); float scale, bool first, bool last);
static bool html_redraw_border_plot(int i, int *p, colour c, static bool html_redraw_border_plot(int i, int *p, colour c,
enum css_border_style style, int thickness); enum css_border_style_e style, int thickness);
static bool html_redraw_checkbox(int x, int y, int width, int height, static bool html_redraw_checkbox(int x, int y, int width, int height,
bool selected); bool selected);
static bool html_redraw_radio(int x, int y, int width, int height, static bool html_redraw_radio(int x, int y, int width, int height,
@ -1174,7 +1174,7 @@ static plot_style_t plot_style_fillbdr_dlight = {
*/ */
bool html_redraw_border_plot(int i, int *p, colour c, bool html_redraw_border_plot(int i, int *p, colour c,
enum css_border_style style, int thickness) enum css_border_style_e style, int thickness)
{ {
int z[8]; int z[8];
unsigned int light = i; unsigned int light = i;
@ -1839,7 +1839,7 @@ bool html_redraw_text_decoration(struct box *box,
int x_parent, int y_parent, float scale, int x_parent, int y_parent, float scale,
colour background_colour) colour background_colour)
{ {
static const enum css_text_decoration decoration[] = { static const enum css_text_decoration_e decoration[] = {
CSS_TEXT_DECORATION_UNDERLINE, CSS_TEXT_DECORATION_OVERLINE, CSS_TEXT_DECORATION_UNDERLINE, CSS_TEXT_DECORATION_OVERLINE,
CSS_TEXT_DECORATION_LINE_THROUGH }; CSS_TEXT_DECORATION_LINE_THROUGH };
static const float line_ratio[] = { 0.9, 0.1, 0.5 }; static const float line_ratio[] = { 0.9, 0.1, 0.5 };

View File

@ -80,7 +80,7 @@ static void layout_find_dimensions(int available_width, int viewport_height,
int margin[4], int padding[4], struct box_border border[4]); int margin[4], int padding[4], struct box_border border[4]);
static void layout_tweak_form_dimensions(struct box *box, bool percentage, static void layout_tweak_form_dimensions(struct box *box, bool percentage,
int available_width, bool setwidth, int *dimension); int available_width, bool setwidth, int *dimension);
static int layout_clear(struct box *fl, enum css_clear clear); static int layout_clear(struct box *fl, enum css_clear_e clear);
static void find_sides(struct box *fl, int y0, int y1, static void find_sides(struct box *fl, int y0, int y1,
int *x0, int *x1, struct box **left, struct box **right); int *x0, int *x1, struct box **left, struct box **right);
static void layout_minmax_inline_container(struct box *inline_container, static void layout_minmax_inline_container(struct box *inline_container,
@ -389,7 +389,7 @@ bool layout_block_context(struct box *block, int viewport_height,
layout_block_add_scrollbar(box, BOTTOM); layout_block_add_scrollbar(box, BOTTOM);
} }
} else if (box->type == BOX_TABLE) { } else if (box->type == BOX_TABLE) {
enum css_width wtype; enum css_width_e wtype;
css_fixed width = 0; css_fixed width = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -495,7 +495,7 @@ bool layout_block_context(struct box *block, int viewport_height,
struct box *left, *right; struct box *left, *right;
y = cy; y = cy;
while (1) { while (1) {
enum css_width wtype; enum css_width_e wtype;
css_fixed width = 0; css_fixed width = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -650,7 +650,7 @@ void layout_minmax_block(struct box *block,
int min = 0, max = 0; int min = 0, max = 0;
int extra_fixed = 0; int extra_fixed = 0;
float extra_frac = 0; float extra_frac = 0;
enum css_width wtype; enum css_width_e wtype;
css_fixed width = 0; css_fixed width = 0;
css_unit wunit = CSS_UNIT_PX; css_unit wunit = CSS_UNIT_PX;
@ -902,7 +902,7 @@ bool layout_apply_minmax_height(struct box *box, struct box *container)
} }
if (box->style) { if (box->style) {
enum css_height htype = CSS_HEIGHT_AUTO; enum css_height_e htype = CSS_HEIGHT_AUTO;
css_fixed length = 0; css_fixed length = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -983,7 +983,7 @@ bool layout_apply_minmax_height(struct box *box, struct box *container)
void layout_block_add_scrollbar(struct box *box, int which) void layout_block_add_scrollbar(struct box *box, int which)
{ {
enum css_overflow overflow; enum css_overflow_e overflow;
assert(box->type == BOX_BLOCK && (which == RIGHT || which == BOTTOM)); assert(box->type == BOX_BLOCK && (which == RIGHT || which == BOTTOM));
@ -1233,7 +1233,7 @@ void layout_find_dimensions(int available_width, int viewport_height,
bool percentage; bool percentage;
if (width) { if (width) {
enum css_width wtype; enum css_width_e wtype;
css_fixed value = 0; css_fixed value = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -1262,7 +1262,7 @@ void layout_find_dimensions(int available_width, int viewport_height,
} }
if (height) { if (height) {
enum css_height htype; enum css_height_e htype;
css_fixed value = 0; css_fixed value = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -1270,7 +1270,7 @@ void layout_find_dimensions(int available_width, int viewport_height,
if (htype == CSS_HEIGHT_SET) { if (htype == CSS_HEIGHT_SET) {
if (unit == CSS_UNIT_PCT) { if (unit == CSS_UNIT_PCT) {
enum css_height cbhtype; enum css_height_e cbhtype;
if (css_computed_position(box->style) == if (css_computed_position(box->style) ==
CSS_POSITION_ABSOLUTE) { CSS_POSITION_ABSOLUTE) {
@ -1354,7 +1354,7 @@ void layout_find_dimensions(int available_width, int viewport_height,
} }
if (max_width) { if (max_width) {
enum css_max_width type; enum css_max_width_e type;
css_fixed value = 0; css_fixed value = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -1384,7 +1384,7 @@ void layout_find_dimensions(int available_width, int viewport_height,
} }
if (min_width) { if (min_width) {
enum css_min_width type; enum css_min_width_e type;
css_fixed value = 0; css_fixed value = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -1415,7 +1415,7 @@ void layout_find_dimensions(int available_width, int viewport_height,
for (i = 0; i != 4; i++) { for (i = 0; i != 4; i++) {
if (margin) { if (margin) {
enum css_margin type = CSS_MARGIN_AUTO;; enum css_margin_e type = CSS_MARGIN_AUTO;
css_fixed value = 0; css_fixed value = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -1452,7 +1452,7 @@ void layout_find_dimensions(int available_width, int viewport_height,
} }
if (padding) { if (padding) {
enum css_padding type; enum css_padding_e type;
css_fixed value = 0; css_fixed value = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -1486,9 +1486,9 @@ void layout_find_dimensions(int available_width, int viewport_height,
/* Table cell borders are populated in table.c */ /* Table cell borders are populated in table.c */
if (border && box->type != BOX_TABLE_CELL) { if (border && box->type != BOX_TABLE_CELL) {
enum css_border_width wtype; enum css_border_width_e wtype;
enum css_border_style bstyle = CSS_BORDER_STYLE_NONE; enum css_border_style_e bstyle = CSS_BORDER_STYLE_NONE;
enum css_border_color bcolor = enum css_border_color_e bcolor =
CSS_BORDER_COLOR_TRANSPARENT; CSS_BORDER_COLOR_TRANSPARENT;
css_color color = 0; css_color color = 0;
css_fixed value = 0; css_fixed value = 0;
@ -1597,7 +1597,7 @@ void layout_tweak_form_dimensions(struct box *box, bool percentage,
* \return y coordinate relative to ancestor box for floats * \return y coordinate relative to ancestor box for floats
*/ */
int layout_clear(struct box *fl, enum css_clear clear) int layout_clear(struct box *fl, enum css_clear_e clear)
{ {
int y = 0; int y = 0;
for (; fl; fl = fl->next_float) { for (; fl; fl = fl->next_float) {
@ -1686,7 +1686,7 @@ bool layout_inline_container(struct box *inline_container, int width,
bool is_pre = false; bool is_pre = false;
if (c->style) { if (c->style) {
enum css_white_space whitespace; enum css_white_space_e whitespace;
whitespace = css_computed_white_space(c->style); whitespace = css_computed_white_space(c->style);
@ -1768,7 +1768,7 @@ void layout_minmax_inline_container(struct box *inline_container,
int line_height(const css_computed_style *style) int line_height(const css_computed_style *style)
{ {
enum css_line_height lhtype; enum css_line_height_e lhtype;
css_fixed lhvalue = 0; css_fixed lhvalue = 0;
css_unit lhunit = CSS_UNIT_PX; css_unit lhunit = CSS_UNIT_PX;
css_fixed line_height; css_fixed line_height;
@ -1872,8 +1872,8 @@ bool layout_line(struct box *first, int *width, int *y,
* keep in sync with the loop in layout_minmax_line() */ * keep in sync with the loop in layout_minmax_line() */
LOG(("x0 %i, x1 %i, x1 - x0 %i", x0, x1, x1 - x0)); LOG(("x0 %i, x1 %i, x1 - x0 %i", x0, x1, x1 - x0));
for (x = 0, b = first; x <= x1 - x0 && b != 0; b = b->next) { for (x = 0, b = first; x <= x1 - x0 && b != 0; b = b->next) {
enum css_width wtype; enum css_width_e wtype;
enum css_height htype; enum css_height_e htype;
css_fixed value = 0; css_fixed value = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -2507,8 +2507,8 @@ struct box *layout_minmax_line(struct box *first,
/* corresponds to the pass 1 loop in layout_line() */ /* corresponds to the pass 1 loop in layout_line() */
for (b = first; b; b = b->next) { for (b = first; b; b = b->next) {
enum css_width wtype; enum css_width_e wtype;
enum css_height htype; enum css_height_e htype;
css_fixed value = 0; css_fixed value = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -2838,8 +2838,8 @@ bool layout_table(struct box *table, int available_width,
struct box **row_span_cell; struct box **row_span_cell;
struct column *col; struct column *col;
const css_computed_style *style = table->style; const css_computed_style *style = table->style;
enum css_width wtype; enum css_width_e wtype;
enum css_height htype; enum css_height_e htype;
css_fixed value = 0; css_fixed value = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -3280,7 +3280,7 @@ bool layout_table(struct box *table, int available_width,
row_group = row_group->next) { row_group = row_group->next) {
for (row = row_group->children; row; row = row->next) { for (row = row_group->children; row; row = row->next) {
for (c = row->children; c; c = c->next) { for (c = row->children; c; c = c->next) {
enum css_vertical_align vertical_align; enum css_vertical_align_e vertical_align;
/* unextended bottom padding is in /* unextended bottom padding is in
* c->descendant_y1, and unextended * c->descendant_y1, and unextended
@ -3354,7 +3354,7 @@ void layout_minmax_table(struct box *table,
float extra_frac = 0; float extra_frac = 0;
struct column *col = table->col; struct column *col = table->col;
struct box *row_group, *row, *cell; struct box *row_group, *row, *cell;
enum css_width wtype; enum css_width_e wtype;
css_fixed value = 0; css_fixed value = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -3578,7 +3578,7 @@ void calculate_mbp_width(const css_computed_style *style, unsigned int side,
/* margin */ /* margin */
if (margin) { if (margin) {
enum css_margin type; enum css_margin_e type;
type = margin_funcs[side](style, &value, &unit); type = margin_funcs[side](style, &value, &unit);
if (type == CSS_MARGIN_SET) { if (type == CSS_MARGIN_SET) {

View File

@ -59,7 +59,7 @@ static const int list_counter_decimal[] = { 1, 4, 5, 9,
static struct list_counter *render_list_find_counter(const char *name); static struct list_counter *render_list_find_counter(const char *name);
static char *render_list_encode_counter(struct list_counter_state *state, static char *render_list_encode_counter(struct list_counter_state *state,
enum css_list_style_type style); enum css_list_style_type_e style);
static char *render_list_encode_roman(int value); static char *render_list_encode_roman(int value);
/* /*
@ -292,7 +292,7 @@ char *render_list_counter(const css_computed_content_item *css_counter) {
* \return a textual representation of the counter state, or NULL on failure * \return a textual representation of the counter state, or NULL on failure
*/ */
static char *render_list_encode_counter(struct list_counter_state *state, static char *render_list_encode_counter(struct list_counter_state *state,
enum css_list_style_type style) { enum css_list_style_type_e style) {
char *result = NULL; char *result = NULL;
int i; int i;

View File

@ -35,8 +35,8 @@
* Container for border values during table border calculations * Container for border values during table border calculations
*/ */
struct border { struct border {
enum css_border_style style; /**< border-style */ enum css_border_style_e style; /**< border-style */
enum css_border_color color; /**< border-color type */ enum css_border_color_e color; /**< border-color type */
css_color c; /**< border-color value */ css_color c; /**< border-color value */
css_fixed width; /**< border-width length */ css_fixed width; /**< border-width length */
css_unit unit; /**< border-width units */ css_unit unit; /**< border-width units */
@ -90,7 +90,7 @@ bool table_calculate_column_types(struct box *table)
for (row_group = table->children; row_group; row_group =row_group->next) for (row_group = table->children; row_group; row_group =row_group->next)
for (row = row_group->children; row; row = row->next) for (row = row_group->children; row; row = row->next)
for (cell = row->children; cell; cell = cell->next) { for (cell = row->children; cell; cell = cell->next) {
enum css_width type; enum css_width_e type;
css_fixed value = 0; css_fixed value = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;
@ -141,7 +141,7 @@ bool table_calculate_column_types(struct box *table)
unsigned int fixed_columns = 0, percent_columns = 0, unsigned int fixed_columns = 0, percent_columns = 0,
auto_columns = 0, unknown_columns = 0; auto_columns = 0, unknown_columns = 0;
int fixed_width = 0, percent_width = 0; int fixed_width = 0, percent_width = 0;
enum css_width type; enum css_width_e type;
css_fixed value = 0; css_fixed value = 0;
css_unit unit = CSS_UNIT_PX; css_unit unit = CSS_UNIT_PX;