From 8365d46eb71035a28a4f58713588aea7b9f70b38 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 14 Jul 2009 10:57:07 +0000 Subject: Rename TRANSPARENT to NS_TRANSPARENT to avoid clash on Windows. By MarkieB. svn path=/trunk/netsurf/; revision=8513 --- amiga/plotters.c | 6 ++--- css/css.c | 8 +++---- css/css.h | 2 +- css/ruleset.c | 4 ++-- desktop/save_pdf/pdf_plotters.c | 44 +++++++++++++++++------------------ gtk/gtk_plotters.c | 6 ++--- image/svg.c | 2 +- render/html.c | 2 +- render/html_redraw.c | 51 ++++++++++++++++++++++------------------- riscos/plotters.c | 4 ++-- riscos/save_draw.c | 4 ++-- 11 files changed, 68 insertions(+), 65 deletions(-) diff --git a/amiga/plotters.c b/amiga/plotters.c index f7a4dff5e..f2ae1cc4e 100755 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -750,10 +750,10 @@ bool ami_path(const float *p, unsigned int n, colour fill, float width, cairo_set_matrix(glob->cr, &old_ctm); /* Now draw path */ - if (fill != TRANSPARENT) { + if (fill != NS_TRANSPARENT) { ami_cairo_set_colour(glob->cr,fill); - if (c != TRANSPARENT) { + if (c != NS_TRANSPARENT) { /* Fill & Stroke */ cairo_fill_preserve(glob->cr); ami_cairo_set_colour(glob->cr,c); @@ -762,7 +762,7 @@ bool ami_path(const float *p, unsigned int n, colour fill, float width, /* Fill only */ cairo_fill(glob->cr); } - } else if (c != TRANSPARENT) { + } else if (c != NS_TRANSPARENT) { /* Stroke only */ ami_cairo_set_colour(glob->cr,c); cairo_stroke(glob->cr); diff --git a/css/css.c b/css/css.c index 0f652c2e6..b035323d4 100644 --- a/css/css.c +++ b/css/css.c @@ -314,7 +314,7 @@ const struct css_style css_empty_style = { * and the 'Initial value' otherwise. */ const struct css_style css_blank_style = { CSS_BACKGROUND_ATTACHMENT_SCROLL, - TRANSPARENT, + NS_TRANSPARENT, { CSS_BACKGROUND_IMAGE_NONE, 0 }, { { CSS_BACKGROUND_POSITION_PERCENT, { 0.0 } }, { CSS_BACKGROUND_POSITION_PERCENT, { 0.0 } } }, @@ -1596,7 +1596,7 @@ void css_dump_style(FILE *stream, const struct css_style * const style) #define DUMP_COLOR(z, s) \ if (style->z != CSS_COLOR_NOT_SET) { \ - if (style->z == TRANSPARENT) \ + if (style->z == NS_TRANSPARENT) \ fprintf(stream, s ": transparent; "); \ else if (style->z == CSS_COLOR_NONE) \ fprintf(stream, s ": none; "); \ @@ -1751,7 +1751,7 @@ void css_dump_style(FILE *stream, const struct css_style * const style) css_border_style_name[ style->border[i].style]); - if (style->border[i].color == TRANSPARENT) + if (style->border[i].color == NS_TRANSPARENT) fprintf(stream, " transparent"); else if (style->border[i].color == CSS_COLOR_NONE) fprintf(stream, " none"); @@ -2144,7 +2144,7 @@ void css_dump_style(FILE *stream, const struct css_style * const style) fprintf(stream, " invert"); break; case CSS_OUTLINE_COLOR_COLOR: - if (style->outline.color.value == TRANSPARENT) + if (style->outline.color.value == NS_TRANSPARENT) fprintf(stream, " transparent"); else if (style->outline.color.value == CSS_COLOR_NONE) fprintf(stream, " none"); diff --git a/css/css.h b/css/css.h index b3ff34ea0..11aa6a195 100644 --- a/css/css.h +++ b/css/css.h @@ -42,7 +42,7 @@ typedef uint32_t colour; /* 0xbbggrr */ -#define TRANSPARENT 0x1000000 +#define NS_TRANSPARENT 0x1000000 #define CSS_COLOR_INHERIT 0x2000000 #define CSS_COLOR_NONE 0x3000000 #define CSS_COLOR_NOT_SET 0x4000000 diff --git a/css/ruleset.c b/css/ruleset.c index 43efdcd05..46bc5e2a5 100644 --- a/css/ruleset.c +++ b/css/ruleset.c @@ -462,7 +462,7 @@ static const struct css_colour_entry css_colour_table[] = { { "teal", 0x808000 }, { "thistle", 0xd8bfd8 }, { "tomato", 0x4763ff }, - { "transparent", TRANSPARENT }, + { "transparent", NS_TRANSPARENT }, { "turquoise", 0xd0e040 }, { "violet", 0xee82ee }, { "violetred", 0x9020d0 }, /* not SVG-1.0*/ @@ -902,7 +902,7 @@ bool parse_uri(const struct css_node *v, char **uri) void parse_background(struct css_style * const s, const struct css_node * v) { - colour c = TRANSPARENT, c2; + colour c = NS_TRANSPARENT, c2; css_background_image_type bi = CSS_BACKGROUND_IMAGE_NONE, bi2; char *bi_uri = 0; css_background_repeat br = CSS_BACKGROUND_REPEAT_REPEAT, br2; diff --git a/desktop/save_pdf/pdf_plotters.c b/desktop/save_pdf/pdf_plotters.c index 70dee78bf..84e0a5506 100644 --- a/desktop/save_pdf/pdf_plotters.c +++ b/desktop/save_pdf/pdf_plotters.c @@ -151,7 +151,7 @@ bool pdf_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *psty if (pstyle->fill_type != PLOT_OP_TYPE_NONE) { - apply_clip_and_mode(false, pstyle->fill_colour, TRANSPARENT, 0., DashPattern_eNone); + apply_clip_and_mode(false, pstyle->fill_colour, NS_TRANSPARENT, 0., DashPattern_eNone); /* Normalize boundaries of the area - to prevent overflows. It is needed only in a few functions, @@ -187,7 +187,7 @@ bool pdf_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *psty } apply_clip_and_mode(false, - TRANSPARENT, + NS_TRANSPARENT, pstyle->stroke_colour, pstyle->stroke_width, dash); @@ -219,7 +219,7 @@ bool pdf_plot_line(int x0, int y0, int x1, int y1, const plot_style_t *pstyle) } apply_clip_and_mode(false, - TRANSPARENT, + NS_TRANSPARENT, pstyle->stroke_colour, pstyle->stroke_width, dash); @@ -242,7 +242,7 @@ bool pdf_plot_polygon(const int *p, unsigned int n, const plot_style_t *style) if (n == 0) return true; - apply_clip_and_mode(false, style->fill_colour, TRANSPARENT, 0., DashPattern_eNone); + apply_clip_and_mode(false, style->fill_colour, NS_TRANSPARENT, 0., DashPattern_eNone); HPDF_Page_MoveTo(pdf_page, p[0], page_height - p[1]); for (i = 1 ; ifill_type != PLOT_OP_TYPE_NONE) { apply_clip_and_mode(false, style->fill_colour, - TRANSPARENT, + NS_TRANSPARENT, 1., DashPattern_eNone); HPDF_Page_Circle(pdf_page, x, page_height - y, radius); @@ -337,7 +337,7 @@ bool pdf_plot_disc(int x, int y, int radius, const plot_style_t *style) if (style->stroke_type != PLOT_OP_TYPE_NONE) { /* FIXME: line width 1 is ok ? */ apply_clip_and_mode(false, - TRANSPARENT, + NS_TRANSPARENT, style->stroke_colour, 1., DashPattern_eNone); @@ -356,7 +356,7 @@ bool pdf_plot_arc(int x, int y, int radius, int angle1, int angle2, const plot_s #endif /* FIXME: line width 1 is ok ? */ - apply_clip_and_mode(false, TRANSPARENT, style->fill_colour, 1., DashPattern_eNone); + apply_clip_and_mode(false, NS_TRANSPARENT, style->fill_colour, 1., DashPattern_eNone); /* Normalize angles */ angle1 %= 360; @@ -386,7 +386,7 @@ bool pdf_plot_bitmap_tile(int x, int y, int width, int height, if (width == 0 || height == 0) return true; - apply_clip_and_mode(false, TRANSPARENT, TRANSPARENT, 0., DashPattern_eNone); + apply_clip_and_mode(false, NS_TRANSPARENT, NS_TRANSPARENT, 0., DashPattern_eNone); image = pdf_extract_image(bitmap); if (!image) @@ -497,14 +497,14 @@ HPDF_Image pdf_extract_image(struct bitmap *bitmap) * colour, line width and dash pattern parameters. * \param selectTextMode true if text mode needs to be entered if required; * false otherwise. - * \param fillCol Desired fill colour, use TRANSPARENT if no update is + * \param fillCol Desired fill colour, use NS_TRANSPARENT if no update is * required. - * \param strokeCol Desired stroke colour, use TRANSPARENT if no update is + * \param strokeCol Desired stroke colour, use NS_TRANSPARENT if no update is * required. * \param lineWidth Desired line width. Only taken into account when strokeCol - * is different from TRANSPARENT. + * is different from NS_TRANSPARENT. * \param dash Desired dash pattern. Only taken into account when strokeCol - * is different from TRANSPARENT. + * is different from NS_TRANSPARENT. */ static void apply_clip_and_mode(bool selectTextMode, colour fillCol, colour strokeCol, float lineWidth, DashPattern_e dash) @@ -518,9 +518,9 @@ static void apply_clip_and_mode(bool selectTextMode, colour fillCol, * outside the text mode anyway (i.e. selectTextMode is false). */ if (in_text_mode && (!selectTextMode || clip_update_needed - || (fillCol != TRANSPARENT + || (fillCol != NS_TRANSPARENT && fillCol != pdfw_gs[pdfw_gs_level].fillColour) - /* || (strokeCol != TRANSPARENT + /* || (strokeCol != NS_TRANSPARENT && (strokeCol != pdfw_gs[pdfw_gs_level].strokeColour || lineWidth != pdfw_gs[pdfw_gs_level].lineWidth || dash != pdfw_gs[pdfw_gs_level].dash)) */)) { @@ -532,9 +532,9 @@ static void apply_clip_and_mode(bool selectTextMode, colour fillCol, pdfw_gs_restore(pdf_page); /* Update fill/stroke colour, linewidth and dash when needed. */ - if (fillCol != TRANSPARENT) + if (fillCol != NS_TRANSPARENT) pdfw_gs_fillcolour(pdf_page, fillCol); - if (strokeCol != TRANSPARENT) { + if (strokeCol != NS_TRANSPARENT) { pdfw_gs_strokecolour(pdf_page, strokeCol); pdfw_gs_linewidth(pdf_page, lineWidth); pdfw_gs_dash(pdf_page, dash); @@ -583,7 +583,7 @@ bool pdf_plot_path(const float *p, unsigned int n, colour fill, float width, if (n == 0) return true; - if (c == TRANSPARENT && fill == TRANSPARENT) + if (c == NS_TRANSPARENT && fill == NS_TRANSPARENT) return true; if (p[0] != PLOTTER_PATH_MOVE) @@ -629,8 +629,8 @@ bool pdf_plot_path(const float *p, unsigned int n, colour fill, float width, return true; } - if (fill != TRANSPARENT) { - if (c != TRANSPARENT) + if (fill != NS_TRANSPARENT) { + if (c != NS_TRANSPARENT) HPDF_Page_FillStroke(pdf_page); else HPDF_Page_Fill(pdf_page); @@ -689,7 +689,7 @@ bool pdf_next_page(void) #endif clip_update_needed = false; if (pdf_page != NULL) { - apply_clip_and_mode(false, TRANSPARENT, TRANSPARENT, 0., + apply_clip_and_mode(false, NS_TRANSPARENT, NS_TRANSPARENT, 0., DashPattern_eNone); pdfw_gs_restore(pdf_page); } @@ -726,7 +726,7 @@ void pdf_end(void) #endif clip_update_needed = false; if (pdf_page != NULL) { - apply_clip_and_mode(false, TRANSPARENT, TRANSPARENT, 0., + apply_clip_and_mode(false, NS_TRANSPARENT, NS_TRANSPARENT, 0., DashPattern_eNone); pdfw_gs_restore(pdf_page); } diff --git a/gtk/gtk_plotters.c b/gtk/gtk_plotters.c index 1c181a9e4..8f906113c 100644 --- a/gtk/gtk_plotters.c +++ b/gtk/gtk_plotters.c @@ -469,10 +469,10 @@ static bool nsgtk_plot_path(const float *p, unsigned int n, colour fill, float w cairo_set_matrix(current_cr, &old_ctm); /* Now draw path */ - if (fill != TRANSPARENT) { + if (fill != NS_TRANSPARENT) { nsgtk_set_colour(fill); - if (c != TRANSPARENT) { + if (c != NS_TRANSPARENT) { /* Fill & Stroke */ cairo_fill_preserve(current_cr); nsgtk_set_colour(c); @@ -481,7 +481,7 @@ static bool nsgtk_plot_path(const float *p, unsigned int n, colour fill, float w /* Fill only */ cairo_fill(current_cr); } - } else if (c != TRANSPARENT) { + } else if (c != NS_TRANSPARENT) { /* Stroke only */ nsgtk_set_colour(c); cairo_stroke(current_cr); diff --git a/image/svg.c b/image/svg.c index 69933ecfe..ef4671658 100644 --- a/image/svg.c +++ b/image/svg.c @@ -108,7 +108,7 @@ bool svg_redraw(struct content *c, int x, int y, transform[4] = x; transform[5] = y; -#define BGR(c) ((c) == svgtiny_TRANSPARENT ? TRANSPARENT : ((svgtiny_RED((c))) | (svgtiny_GREEN((c)) << 8) | (svgtiny_BLUE((c)) << 16))) +#define BGR(c) ((c) == svgtiny_TRANSPARENT ? NS_TRANSPARENT : ((svgtiny_RED((c))) | (svgtiny_GREEN((c)) << 8) | (svgtiny_BLUE((c)) << 16))) for (i = 0; i != diagram->shape_count; i++) { if (diagram->shape[i].path) { diff --git a/render/html.c b/render/html.c index aff24afe1..1905e8bc3 100644 --- a/render/html.c +++ b/render/html.c @@ -113,7 +113,7 @@ bool html_create(struct content *c, const char *params[]) html->base_url = c->url; html->base_target = NULL; html->layout = 0; - html->background_colour = TRANSPARENT; + html->background_colour = NS_TRANSPARENT; html->stylesheet_count = 0; html->stylesheet_content = 0; html->style = 0; diff --git a/render/html_redraw.c b/render/html_redraw.c index 518bc0204..107b9323f 100644 --- a/render/html_redraw.c +++ b/render/html_redraw.c @@ -146,7 +146,7 @@ bool html_redraw(struct content *c, int x, int y, /* clear to background colour */ result = plot.clip(clip_x0, clip_y0, clip_x1, clip_y1); - if (c->data.html.background_colour != TRANSPARENT) + if (c->data.html.background_colour != NS_TRANSPARENT) pstyle_fill_bg.fill_colour = c->data.html.background_colour; result &= plot.rectangle(clip_x0, clip_y0, clip_x1, clip_y1, &pstyle_fill_bg); @@ -368,17 +368,19 @@ bool html_redraw_box(struct box *box, if (!box->parent) { /* Root box */ if (box->style && - (box->style->background_color != TRANSPARENT || + (box->style->background_color != + NS_TRANSPARENT || box->background)) { /* With its own background */ bg_box = box; } else if (!box->style || - (box->style->background_color == TRANSPARENT && + (box->style->background_color == + NS_TRANSPARENT && !box->background)) { /* Without its own background */ if (box->children && box->children->style && (box->children->style-> - background_color != TRANSPARENT || + background_color != NS_TRANSPARENT || box->children->background)) { /* But body has one, so use that */ bg_box = box->children; @@ -387,12 +389,13 @@ bool html_redraw_box(struct box *box, } else if (box->parent && !box->parent->parent) { /* Body box */ if (box->style && - (box->style->background_color != TRANSPARENT || + (box->style->background_color != + NS_TRANSPARENT || box->background)) { /* With a background */ if (box->parent->style && (box->parent->style->background_color != - TRANSPARENT || + NS_TRANSPARENT || box->parent->background)) { /* Root has own background; process normally */ bg_box = box; @@ -413,7 +416,7 @@ bool html_redraw_box(struct box *box, bg_box->type != BOX_TEXT && bg_box->type != BOX_INLINE_END && (bg_box->type != BOX_INLINE || bg_box->object) && - ((bg_box->style->background_color != TRANSPARENT) || + ((bg_box->style->background_color != NS_TRANSPARENT) || (bg_box->background))) { /* find intersection of clip box and border edge */ int px0, py0, px1, py1; @@ -469,7 +472,7 @@ bool html_redraw_box(struct box *box, /* backgrounds and borders for non-replaced inlines */ if (box->style && box->type == BOX_INLINE && box->inline_end && - (box->style->background_color != TRANSPARENT || + (box->style->background_color != NS_TRANSPARENT || box->background || border_top || border_right || border_bottom || border_left)) { /* inline backgrounds and borders span other boxes and may @@ -1112,7 +1115,7 @@ bool html_redraw_border_plot(int i, int *p, colour c, plot_style_t *plot_style_bdr_in; plot_style_t *plot_style_bdr_out; - if (c == TRANSPARENT) + if (c == NS_TRANSPARENT) return true; plot_style_bdr.stroke_type = PLOT_OP_TYPE_DASH; @@ -1313,35 +1316,35 @@ bool html_redraw_radio(int x, int y, int width, int height, bool selected) { /* plot background of radio button */ - if (!plot.disc(x + width * 0.5, + if (!plot.disc(x + width * 0.5, y + height * 0.5, - width * 0.5 - 1, + width * 0.5 - 1, plot_style_fill_wbasec)) return false; /* plot dark arc */ - if (!plot.arc(x + width * 0.5, + if (!plot.arc(x + width * 0.5, y + height * 0.5, - width * 0.5 - 1, - 45, - 225, + width * 0.5 - 1, + 45, + 225, plot_style_fill_darkwbasec)) return false; /* plot light arc */ - if (!plot.arc(x + width * 0.5, + if (!plot.arc(x + width * 0.5, y + height * 0.5, - width * 0.5 - 1, - 225, - 45, + width * 0.5 - 1, + 225, + 45, plot_style_fill_lightwbasec)) return false; if (selected) { /* plot selection blob */ - if (!plot.disc(x + width * 0.5, + if (!plot.disc(x + width * 0.5, y + height * 0.5, - width * 0.3 - 1, + width * 0.3 - 1, plot_style_fill_wblobc)) return false; } @@ -1543,7 +1546,7 @@ bool html_redraw_background(int x, int y, struct box *box, float scale, /* attributes override */ if ((clip_x0 >= clip_x1) || (clip_y0 >= clip_y1) || (clip_box->style->background_color != - TRANSPARENT) || + NS_TRANSPARENT) || (clip_box->background && clip_box->background->bitmap && bitmap_get_opaque( @@ -1552,7 +1555,7 @@ bool html_redraw_background(int x, int y, struct box *box, float scale, } /* plot the background colour */ - if (background->style->background_color != TRANSPARENT) { + if (background->style->background_color != NS_TRANSPARENT) { *background_colour = background->style->background_color; pstyle_fill_bg.fill_colour = @@ -1720,7 +1723,7 @@ bool html_redraw_inline_background(int x, int y, struct box *box, float scale, } /* plot the background colour */ - if (box->style->background_color != TRANSPARENT) { + if (box->style->background_color != NS_TRANSPARENT) { *background_colour = box->style->background_color; pstyle_fill_bg.fill_colour = diff --git a/riscos/plotters.c b/riscos/plotters.c index 23ea2783f..38971d57c 100644 --- a/riscos/plotters.c +++ b/riscos/plotters.c @@ -311,7 +311,7 @@ bool ro_plot_path(const float *p, unsigned int n, colour fill, float width, trfm.entries[2][0] = (ro_plot_origin_x + transform[4] * 2) * 256; trfm.entries[2][1] = (ro_plot_origin_y - transform[5] * 2) * 256; - if (fill != TRANSPARENT) { + if (fill != NS_TRANSPARENT) { error = xcolourtrans_set_gcol(fill << 8, 0, os_ACTION_OVERWRITE, 0, 0); if (error) { @@ -328,7 +328,7 @@ bool ro_plot_path(const float *p, unsigned int n, colour fill, float width, } } - if (c != TRANSPARENT) { + if (c != NS_TRANSPARENT) { error = xcolourtrans_set_gcol(c << 8, 0, os_ACTION_OVERWRITE, 0, 0); if (error) { diff --git a/riscos/save_draw.c b/riscos/save_draw.c index d832d199d..6dbd50ddb 100644 --- a/riscos/save_draw.c +++ b/riscos/save_draw.c @@ -326,8 +326,8 @@ bool ro_save_draw_path(const float *p, unsigned int n, colour fill, } pencil_code code = pencil_path(ro_save_draw_diagram, path, i + 1, - fill == TRANSPARENT ? pencil_TRANSPARENT : fill << 8, - c == TRANSPARENT ? pencil_TRANSPARENT : c << 8, + fill == NS_TRANSPARENT ? pencil_TRANSPARENT : fill << 8, + c == NS_TRANSPARENT ? pencil_TRANSPARENT : c << 8, width, pencil_JOIN_MITRED, pencil_CAP_BUTT, pencil_CAP_BUTT, 0, 0, false, pencil_SOLID); -- cgit v1.2.3