Index: trunk/src_plugins/export_png/draw_png.c =================================================================== --- trunk/src_plugins/export_png/draw_png.c (revision 36223) +++ trunk/src_plugins/export_png/draw_png.c (revision 36224) @@ -78,7 +78,7 @@ void *me_pointer; rnd_cap_style_t cap; int width, r, g, b; - color_struct *color; + rnd_png_color_struct_t *color; gdImagePtr brush; int is_erase; } hid_gc_t; @@ -117,19 +117,19 @@ if (fmt == NULL) format_error = rnd_true; - else if (strcmp(fmt, FMT_gif) == 0) + else if (strcmp(fmt, RND_PNG_FMT_gif) == 0) #ifdef PCB_HAVE_GDIMAGEGIF gdImageGif(pctx->im, f); #else format_error = rnd_true; #endif - else if (strcmp(fmt, FMT_jpg) == 0) + else if (strcmp(fmt, RND_PNG_FMT_jpg) == 0) #ifdef PCB_HAVE_GDIMAGEJPEG gdImageJpeg(pctx->im, f, -1); #else format_error = rnd_true; #endif - else if (strcmp(fmt, FMT_png) == 0) + else if (strcmp(fmt, RND_PNG_FMT_png) == 0) #ifdef PCB_HAVE_GDIMAGEPNG gdImagePng(pctx->im, f); #else @@ -258,7 +258,7 @@ pctx->master_im = pctx->im; /* Allocate white and black; the first color allocated becomes the background color */ - pctx->white = (color_struct *)malloc(sizeof(color_struct)); + pctx->white = (rnd_png_color_struct_t *)malloc(sizeof(rnd_png_color_struct_t)); pctx->white->r = pctx->white->g = pctx->white->b = 255; if (use_alpha) pctx->white->a = 127; @@ -271,7 +271,7 @@ } - pctx->black = (color_struct *)malloc(sizeof(color_struct)); + pctx->black = (rnd_png_color_struct_t *)malloc(sizeof(rnd_png_color_struct_t)); pctx->black->r = pctx->black->g = pctx->black->b = pctx->black->a = 0; pctx->black->c = gdImageColorAllocate(pctx->im, pctx->black->r, pctx->black->g, pctx->black->b); if (pctx->black->c == RND_PNG_BADC) { @@ -289,7 +289,7 @@ rv->me_pointer = &rnd_png_me; rv->cap = rnd_cap_round; rv->width = 1; - rv->color = (color_struct *) malloc(sizeof(color_struct)); + rv->color = (rnd_png_color_struct_t *) malloc(sizeof(rnd_png_color_struct_t)); rv->color->r = rv->color->g = rv->color->b = rv->color->a = 0; rv->color->c = 0; rv->is_erase = 0; @@ -364,7 +364,7 @@ void rnd_png_set_color(rnd_png_t *pctx, rnd_hid_gc_t gc, const rnd_color_t *color) { - color_struct *cc; + rnd_png_color_struct_t *cc; if (pctx->im == NULL) return; @@ -385,7 +385,7 @@ } if (!pctx->color_cache_inited) { - rnd_clrcache_init(&pctx->color_cache, sizeof(color_struct), NULL); + rnd_clrcache_init(&pctx->color_cache, sizeof(rnd_png_color_struct_t), NULL); pctx->color_cache_inited = 1; } Index: trunk/src_plugins/export_png/draw_png.h =================================================================== --- trunk/src_plugins/export_png/draw_png.h (revision 36223) +++ trunk/src_plugins/export_png/draw_png.h (revision 36224) @@ -28,10 +28,10 @@ #include -typedef struct color_struct { +typedef struct rnd_png_color_struct_s { int c; /* the descriptor used by the gd library */ unsigned int r, g, b, a; /* so I can figure out what rgb value c refers to */ -} color_struct; +} rnd_png_color_struct_t; #ifndef FROM_DRAW_PNG_C typedef struct gdImage_s gdImage; @@ -55,7 +55,7 @@ int brush_cache_inited; int w, h; /* in pixels */ int dpi, xmax, ymax; - color_struct *black, *white; + rnd_png_color_struct_t *black, *white; gdImage *im, *master_im, *comp_im, *erase_im; int last_color_r, last_color_g, last_color_b, last_cap; gdImage *lastbrush; @@ -65,9 +65,9 @@ int photo_mode, is_photo_drill, is_photo_mech, doing_outline, have_outline; } rnd_png_t; -#define FMT_gif "GIF" -#define FMT_jpg "JPEG" -#define FMT_png "PNG" +#define RND_PNG_FMT_gif "GIF" +#define RND_PNG_FMT_jpg "JPEG" +#define RND_PNG_FMT_png "PNG" void rnd_png_init(rnd_png_t *pctx, rnd_hidlib_t *hidlib); void rnd_png_uninit(rnd_png_t *pctx); Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 36223) +++ trunk/src_plugins/export_png/png.c (revision 36224) @@ -86,17 +86,17 @@ static const char *filetypes[] = { #ifdef PCB_HAVE_GDIMAGEPNG - FMT_png, + RND_PNG_FMT_png, #define HAVE_SOME_FORMAT 1 #endif #ifdef PCB_HAVE_GDIMAGEGIF - FMT_gif, + RND_PNG_FMT_gif, #define HAVE_SOME_FORMAT 1 #endif #ifdef PCB_HAVE_GDIMAGEJPEG - FMT_jpg, + RND_PNG_FMT_jpg, #define HAVE_SOME_FORMAT 1 #endif @@ -326,11 +326,11 @@ fmt = filetypes[png_values[HA_filetype].lng]; if (fmt == NULL) { /* Do nothing */ } - else if (strcmp(fmt, FMT_gif) == 0) + else if (strcmp(fmt, RND_PNG_FMT_gif) == 0) result = ".gif"; - else if (strcmp(fmt, FMT_jpg) == 0) + else if (strcmp(fmt, RND_PNG_FMT_jpg) == 0) result = ".jpg"; - else if (strcmp(fmt, FMT_png) == 0) + else if (strcmp(fmt, RND_PNG_FMT_png) == 0) result = ".png"; if (result == NULL) { Index: trunk/src_plugins/export_png/png_photo1.c =================================================================== --- trunk/src_plugins/export_png/png_photo1.c (revision 36223) +++ trunk/src_plugins/export_png/png_photo1.c (revision 36224) @@ -52,7 +52,7 @@ to use separate color_structs for the multiplication and addition parts of the mask math. */ -static const color_struct mask_colours[] = { +static const rnd_png_color_struct_t mask_colours[] = { #define MASK_COLOUR_GREEN 0 {0x3CA03CFF, 60, 160, 60, 255}, #define MASK_COLOUR_RED 1 @@ -86,7 +86,7 @@ NULL }; -static const color_struct silk_colours[] = { +static const rnd_png_color_struct_t silk_colours[] = { #define SILK_COLOUR_WHITE 0 {0xE0E0E0FF, 224, 224, 224, 255}, #define SILK_COLOUR_BLACK 1 @@ -95,8 +95,8 @@ {0xB9B90AFF, 185, 185, 10, 255} }; -static const color_struct silk_top_shadow = {0x151515FF, 21, 21, 21, 255}; -static const color_struct silk_bottom_shadow = {0x0E0E0EFF, 14, 14, 14, 255}; +static const rnd_png_color_struct_t silk_top_shadow = {0x151515FF, 21, 21, 21, 255}; +static const rnd_png_color_struct_t silk_bottom_shadow = {0x0E0E0EFF, 14, 14, 14, 255}; static int smshadows[3][3] = { {1, 0, -1}, Index: trunk/src_plugins/export_png/png_photo2.c =================================================================== --- trunk/src_plugins/export_png/png_photo2.c (revision 36223) +++ trunk/src_plugins/export_png/png_photo2.c (revision 36224) @@ -30,7 +30,7 @@ * Heavily based on the ps HID written by DJ Delorie */ -static void rgb(color_struct *dest, int r, int g, int b) +static void rgb(rnd_png_color_struct_t *dest, int r, int g, int b) { dest->r = r; dest->g = g; @@ -84,7 +84,7 @@ } } -static void clip(color_struct * dest, color_struct * source) +static void clip(rnd_png_color_struct_t * dest, rnd_png_color_struct_t * source) { #define CLIP(var) \ dest->var = source->var; \ @@ -97,7 +97,7 @@ #undef CLIP } -static void blend(color_struct * dest, float a_amount, color_struct * a, color_struct * b) +static void blend(rnd_png_color_struct_t * dest, float a_amount, rnd_png_color_struct_t * a, rnd_png_color_struct_t * b) { dest->r = a->r * a_amount + b->r * (1 - a_amount); dest->g = a->g * a_amount + b->g * (1 - a_amount); @@ -104,7 +104,7 @@ dest->b = a->b * a_amount + b->b * (1 - a_amount); } -static void multiply(color_struct * dest, color_struct * a, color_struct * b) +static void multiply(rnd_png_color_struct_t * dest, rnd_png_color_struct_t * a, rnd_png_color_struct_t * b) { dest->r = (a->r * b->r) / 255; dest->g = (a->g * b->g) / 255; @@ -111,7 +111,7 @@ dest->b = (a->b * b->b) / 255; } -static void add(color_struct * dest, double a_amount, const color_struct * a, double b_amount, const color_struct * b) +static void add(rnd_png_color_struct_t * dest, double a_amount, const rnd_png_color_struct_t * a, double b_amount, const rnd_png_color_struct_t * b) { dest->r = a->r * a_amount + b->r * b_amount; dest->g = a->g * a_amount + b->g * b_amount; @@ -120,7 +120,7 @@ clip(dest, dest); } -static void subtract(color_struct * dest, double a_amount, const color_struct * a, double b_amount, const color_struct * b) +static void subtract(rnd_png_color_struct_t * dest, double a_amount, const rnd_png_color_struct_t * a, double b_amount, const rnd_png_color_struct_t * b) { dest->r = a->r * a_amount - b->r * b_amount; dest->g = a->g * a_amount - b->g * b_amount; @@ -183,7 +183,7 @@ } if (!*photo_im) { - static color_struct *black = NULL, *white = NULL; + static rnd_png_color_struct_t *black = NULL, *white = NULL; *photo_im = gdImageCreate(gdImageSX(pctx->im), gdImageSY(pctx->im)); if (photo_im == NULL) { rnd_message(RND_MSG_ERROR, "png_set_layer(): gdImageCreate(%d, %d) returned NULL. Aborting export.\n", gdImageSX(pctx->im), gdImageSY(pctx->im)); @@ -191,7 +191,7 @@ } - white = (color_struct *) malloc(sizeof(color_struct)); + white = (rnd_png_color_struct_t *) malloc(sizeof(rnd_png_color_struct_t)); white->r = white->g = white->b = 255; white->a = 0; white->c = gdImageColorAllocate(*photo_im, white->r, white->g, white->b); @@ -200,7 +200,7 @@ return 0; } - black = (color_struct *) malloc(sizeof(color_struct)); + black = (rnd_png_color_struct_t *) malloc(sizeof(rnd_png_color_struct_t)); black->r = black->g = black->b = black->a = 0; black->c = gdImageColorAllocate(*photo_im, black->r, black->g, black->b); if (black->c == RND_PNG_BADC) { @@ -223,7 +223,7 @@ static void png_photo_foot(void) { int x, y, darken, lg; - color_struct white, black, fr4; + rnd_png_color_struct_t white, black, fr4; rgb(&white, 255, 255, 255); rgb(&black, 0, 0, 0); @@ -255,8 +255,8 @@ for (x = 0; x < gdImageSX(pctx->im); x++) { for (y = 0; y < gdImageSY(pctx->im); y++) { - color_struct p, cop; - color_struct mask_colour, silk_colour; + rnd_png_color_struct_t p, cop; + rnd_png_color_struct_t mask_colour, silk_colour; int cc, mask, silk; int transparent;