Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 4897) +++ trunk/doc-rnd/hacking/renames (revision 4898) @@ -406,3 +406,11 @@ hid_cfg_keys_gen_accel -> pcb_hid_cfg_keys_gen_accel hid_cfg_keys_input -> pcb_hid_cfg_keys_input hid_cfg_keys_action -> pcb_hid_cfg_keys_action +hid_cache_color -> pcb_hid_cache_color +common_fill_pcb_polygon -> pcb_dhlp_fill_pcb_polygon +common_thindraw_pcb_polygon -> pcb_dhlp_thindraw_pcb_polygon +common_fill_pcb_pad -> pcb_dhlp_fill_pcb_pad +common_thindraw_pcb_pad -> pcb_dhlp_thindraw_pcb_pad +common_fill_pcb_pv -> pcb_dhlp_fill_pcb_pv +common_thindraw_pcb_pv -> pcb_dhlp_thindraw_pcb_pv +common_draw_helpers_init -> pcb_dhlp_draw_helpers_init Index: trunk/src/hid_color.c =================================================================== --- trunk/src/hid_color.c (revision 4897) +++ trunk/src/hid_color.c (revision 4898) @@ -17,7 +17,7 @@ #undef HT -int hid_cache_color(int set, const char *name, pcb_hidval_t * val, void **vcache) +int pcb_hid_cache_color(int set, const char *name, pcb_hidval_t * val, void **vcache) { htsh_t *cache; htsh_entry_t *e; Index: trunk/src/hid_color.h =================================================================== --- trunk/src/hid_color.h (revision 4897) +++ trunk/src/hid_color.h (revision 4898) @@ -10,6 +10,6 @@ and if found sets val and returns nonzero. If not found, it returns zero. If set is nonzero, name/val is added to the cache. */ -int hid_cache_color(int set, const char *name, pcb_hidval_t * val, void **cache); +int pcb_hid_cache_color(int set, const char *name, pcb_hidval_t * val, void **cache); #endif Index: trunk/src/hid_draw_helpers.c =================================================================== --- trunk/src/hid_draw_helpers.c (revision 4897) +++ trunk/src/hid_draw_helpers.c (revision 4898) @@ -134,7 +134,7 @@ #undef BOUNDS_INSIDE_CLIP_THRESHOLD -void common_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box) +void pcb_dhlp_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box) { if (!poly->NoHolesValid) { /* If enough of the polygon is on-screen, compute the entire @@ -174,13 +174,13 @@ return 0; } -void common_thindraw_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box) +void pcb_dhlp_thindraw_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box) { thindraw_contour(gc, poly->Clipped->contours); PolygonHoles(poly, clip_box, thindraw_hole_cb, gc); } -void common_thindraw_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask) +void pcb_dhlp_thindraw_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask) { pcb_coord_t w = clear ? (mask ? pad->Mask : pad->Thickness + pad->Clearance) : pad->Thickness; @@ -244,7 +244,7 @@ } } -void common_fill_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask) +void pcb_dhlp_fill_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask) { pcb_coord_t w = clear ? (mask ? pad->Mask : pad->Thickness + pad->Clearance) : pad->Thickness; @@ -342,7 +342,7 @@ } -void common_fill_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask) +void pcb_dhlp_fill_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask) { pcb_coord_t w = mask ? pv->Mask : pv->Thickness; pcb_coord_t r = w / 2; @@ -381,7 +381,7 @@ gui->fill_circle(bg_gc, pv->X, pv->Y, pv->DrillingHole / 2); } -void common_thindraw_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask) +void pcb_dhlp_thindraw_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask) { pcb_coord_t w = mask ? pv->Mask : pv->Thickness; pcb_coord_t r = w / 2; @@ -430,12 +430,12 @@ } } -void common_draw_helpers_init(pcb_hid_t * hid) +void pcb_dhlp_draw_helpers_init(pcb_hid_t * hid) { - hid->fill_pcb_polygon = common_fill_pcb_polygon; - hid->thindraw_pcb_polygon = common_thindraw_pcb_polygon; - hid->fill_pcb_pad = common_fill_pcb_pad; - hid->thindraw_pcb_pad = common_thindraw_pcb_pad; - hid->fill_pcb_pv = common_fill_pcb_pv; - hid->thindraw_pcb_pv = common_thindraw_pcb_pv; + hid->fill_pcb_polygon = pcb_dhlp_fill_pcb_polygon; + hid->thindraw_pcb_polygon = pcb_dhlp_thindraw_pcb_polygon; + hid->fill_pcb_pad = pcb_dhlp_fill_pcb_pad; + hid->thindraw_pcb_pad = pcb_dhlp_thindraw_pcb_pad; + hid->fill_pcb_pv = pcb_dhlp_fill_pcb_pv; + hid->thindraw_pcb_pv = pcb_dhlp_thindraw_pcb_pv; } Index: trunk/src/hid_draw_helpers.h =================================================================== --- trunk/src/hid_draw_helpers.h (revision 4897) +++ trunk/src/hid_draw_helpers.h (revision 4898) @@ -1,10 +1,10 @@ #ifndef PCB_HID_DRAW_HELPERS_H #define PCB_HID_DRAW_HELPERS_H -void common_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box); -void common_thindraw_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box); -void common_fill_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask); -void common_thindraw_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask); -void common_fill_pcb_pv(pcb_hid_gc_t gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask); -void common_thindraw_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask); -void common_draw_helpers_init(pcb_hid_t * hid); +void pcb_dhlp_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box); +void pcb_dhlp_thindraw_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box); +void pcb_dhlp_fill_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask); +void pcb_dhlp_thindraw_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask); +void pcb_dhlp_fill_pcb_pv(pcb_hid_gc_t gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask); +void pcb_dhlp_thindraw_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask); +void pcb_dhlp_draw_helpers_init(pcb_hid_t * hid); #endif Index: trunk/src/hid_extents.c =================================================================== --- trunk/src/hid_extents.c (revision 4897) +++ trunk/src/hid_extents.c (revision 4898) @@ -132,7 +132,7 @@ memset(&extents_hid, 0, sizeof(pcb_hid_t)); - common_draw_helpers_init(&extents_hid); + pcb_dhlp_draw_helpers_init(&extents_hid); extents_hid.struct_size = sizeof(pcb_hid_t); extents_hid.name = "extents-extents"; Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 4897) +++ trunk/src_plugins/export_dxf/dxf.c (revision 4898) @@ -5933,7 +5933,7 @@ memset(&dxf_hid, 0, sizeof(pcb_hid_t)); common_nogui_init(&dxf_hid); - common_draw_helpers_init(&dxf_hid); + pcb_dhlp_draw_helpers_init(&dxf_hid); dxf_hid.struct_size = sizeof(pcb_hid_t); dxf_hid.name = "dxf"; dxf_hid.description = "DXF export"; Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 4897) +++ trunk/src_plugins/export_gcode/gcode.c (revision 4898) @@ -672,7 +672,7 @@ } sprintf(name, "#%.2x%.2x%.2x_%c_%d", gc->color->r, gc->color->g, gc->color->b, type, r); - if (hid_cache_color(0, name, &bval, &bcache)) { + if (pcb_hid_cache_color(0, name, &bval, &bcache)) { gc->brush = (gdImagePtr) bval.ptr; } else { @@ -698,7 +698,7 @@ gdImageFilledRectangle(gc->brush, 0, 0, r, r, fg); } bval.ptr = gc->brush; - hid_cache_color(1, name, &bval, &bcache); + pcb_hid_cache_color(1, name, &bval, &bcache); } gdImageSetBrush(gcode_im, gc->brush); @@ -880,7 +880,7 @@ memset(&gcode_hid, 0, sizeof(pcb_hid_t)); common_nogui_init(&gcode_hid); - common_draw_helpers_init(&gcode_hid); + pcb_dhlp_draw_helpers_init(&gcode_hid); gcode_hid.struct_size = sizeof(pcb_hid_t); gcode_hid.name = "gcode"; Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 4897) +++ trunk/src_plugins/export_gerber/gerber.c (revision 4898) @@ -1168,7 +1168,7 @@ memset(&gerber_hid, 0, sizeof(gerber_hid)); common_nogui_init(&gerber_hid); - common_draw_helpers_init(&gerber_hid); + pcb_dhlp_draw_helpers_init(&gerber_hid); gerber_hid.struct_size = sizeof(gerber_hid); gerber_hid.name = "gerber"; Index: trunk/src_plugins/export_nelma/nelma.c =================================================================== --- trunk/src_plugins/export_nelma/nelma.c (revision 4897) +++ trunk/src_plugins/export_nelma/nelma.c (revision 4898) @@ -803,7 +803,7 @@ } sprintf(name, "#%.2x%.2x%.2x_%c_%d", gc->color->r, gc->color->g, gc->color->b, type, r); - if (hid_cache_color(0, name, &bval, &bcache)) { + if (pcb_hid_cache_color(0, name, &bval, &bcache)) { gc->brush = (gdImagePtr) bval.ptr; } else { @@ -829,7 +829,7 @@ gdImageFilledRectangle(gc->brush, 0, 0, r, r, fg); } bval.ptr = gc->brush; - hid_cache_color(1, name, &bval, &bcache); + pcb_hid_cache_color(1, name, &bval, &bcache); } gdImageSetBrush(nelma_im, gc->brush); @@ -989,7 +989,7 @@ memset(&nelma_hid, 0, sizeof(pcb_hid_t)); common_nogui_init(&nelma_hid); - common_draw_helpers_init(&nelma_hid); + pcb_dhlp_draw_helpers_init(&nelma_hid); nelma_hid.struct_size = sizeof(pcb_hid_t); nelma_hid.name = "nelma"; Index: trunk/src_plugins/export_openscad/scad.c =================================================================== --- trunk/src_plugins/export_openscad/scad.c (revision 4897) +++ trunk/src_plugins/export_openscad/scad.c (revision 4898) @@ -1139,7 +1139,7 @@ memset(&scad_hid, 0, sizeof(scad_hid)); common_nogui_init(&scad_hid); - common_draw_helpers_init(&scad_hid); + pcb_dhlp_draw_helpers_init(&scad_hid); scad_hid.struct_size = sizeof(scad_hid); scad_hid.name = "openscad"; Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 4897) +++ trunk/src_plugins/export_png/png.c (revision 4898) @@ -1147,7 +1147,7 @@ return; } - if (hid_cache_color(0, name, &cval, &color_cache)) { + if (pcb_hid_cache_color(0, name, &cval, &color_cache)) { gc->color = (color_struct *) cval.ptr; } else if (name[0] == '#') { @@ -1159,7 +1159,7 @@ return; } cval.ptr = gc->color; - hid_cache_color(1, name, &cval, &color_cache); + pcb_hid_cache_color(1, name, &cval, &color_cache); } else { printf("WE SHOULD NOT BE HERE!!!\n"); @@ -1230,7 +1230,7 @@ sprintf(name, "#%.2x%.2x%.2x_%c_%d", gc->color->r, gc->color->g, gc->color->b, type, r); - if (hid_cache_color(0, name, &bval, &brush_cache)) { + if (pcb_hid_cache_color(0, name, &bval, &brush_cache)) { gc->brush = (gdImagePtr) bval.ptr; } else { @@ -1272,7 +1272,7 @@ gdImageFilledRectangle(gc->brush, 0, 0, r - 1, r - 1, fg); } bval.ptr = gc->brush; - hid_cache_color(1, name, &bval, &brush_cache); + pcb_hid_cache_color(1, name, &bval, &brush_cache); } gdImageSetBrush(im, gc->brush); @@ -1494,7 +1494,7 @@ memset(&png_hid, 0, sizeof(pcb_hid_t)); common_nogui_init(&png_hid); - common_draw_helpers_init(&png_hid); + pcb_dhlp_draw_helpers_init(&png_hid); png_hid.struct_size = sizeof(pcb_hid_t); png_hid.name = "png"; Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 4897) +++ trunk/src_plugins/export_ps/eps.c (revision 4898) @@ -443,7 +443,7 @@ return; } gc->erase = 0; - if (hid_cache_color(0, name, &cval, &cache)) { + if (pcb_hid_cache_color(0, name, &cval, &cache)) { gc->color = cval.lval; } else if (in_mono) { @@ -604,7 +604,7 @@ memset(&eps_hid, 0, sizeof(pcb_hid_t)); common_nogui_init(&eps_hid); - common_draw_helpers_init(&eps_hid); + pcb_dhlp_draw_helpers_init(&eps_hid); eps_hid.struct_size = sizeof(pcb_hid_t); eps_hid.name = "eps"; Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 4897) +++ trunk/src_plugins/export_ps/ps.c (revision 4898) @@ -1613,7 +1613,7 @@ memset(&ps_hid, 0, sizeof(pcb_hid_t)); common_nogui_init(&ps_hid); - common_draw_helpers_init(&ps_hid); + pcb_dhlp_draw_helpers_init(&ps_hid); ps_ps_init(&ps_hid); ps_hid.struct_size = sizeof(pcb_hid_t); Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 4897) +++ trunk/src_plugins/export_svg/svg.c (revision 4898) @@ -698,7 +698,7 @@ memset(&svg_hid, 0, sizeof(pcb_hid_t)); common_nogui_init(&svg_hid); - common_draw_helpers_init(&svg_hid); + pcb_dhlp_draw_helpers_init(&svg_hid); svg_hid.struct_size = sizeof(pcb_hid_t); svg_hid.name = "svg"; Index: trunk/src_plugins/hid_batch/batch.c =================================================================== --- trunk/src_plugins/hid_batch/batch.c (revision 4897) +++ trunk/src_plugins/hid_batch/batch.c (revision 4898) @@ -344,7 +344,7 @@ memset(&batch_hid, 0, sizeof(pcb_hid_t)); common_nogui_init(&batch_hid); - common_draw_helpers_init(&batch_hid); + pcb_dhlp_draw_helpers_init(&batch_hid); batch_hid.struct_size = sizeof(pcb_hid_t); batch_hid.name = "batch"; Index: trunk/src_plugins/hid_gtk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-gdk.c (revision 4897) +++ trunk/src_plugins/hid_gtk/gtkhid-gdk.c (revision 4898) @@ -484,13 +484,13 @@ } else { ColorCache *cc; - if (hid_cache_color(0, name, &cval, &cache)) + if (pcb_hid_cache_color(0, name, &cval, &cache)) cc = (ColorCache *) cval.ptr; else { cc = (ColorCache *) malloc(sizeof(ColorCache)); memset(cc, 0, sizeof(*cc)); cval.ptr = cc; - hid_cache_color(1, name, &cval, &cache); + pcb_hid_cache_color(1, name, &cval, &cache); } if (!cc->color_set) { Index: trunk/src_plugins/hid_gtk/gtkhid-gl.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-gl.c (revision 4897) +++ trunk/src_plugins/hid_gtk/gtkhid-gl.c (revision 4898) @@ -360,13 +360,13 @@ a = 0.85; } else { - if (hid_cache_color(0, gc->colorname, &cval, &cache)) + if (pcb_hid_cache_color(0, gc->colorname, &cval, &cache)) cc = (ColorCache *) cval.ptr; else { cc = (ColorCache *) malloc(sizeof(ColorCache)); memset(cc, 0, sizeof(*cc)); cval.ptr = cc; - hid_cache_color(1, gc->colorname, &cval, &cache); + pcb_hid_cache_color(1, gc->colorname, &cval, &cache); } if (!cc->color_set) { @@ -529,7 +529,7 @@ void ghid_thindraw_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t * poly, const pcb_box_t * clip_box) { - common_thindraw_pcb_polygon(gc, poly, clip_box); + pcb_dhlp_thindraw_pcb_polygon(gc, poly, clip_box); ghid_set_alpha_mult(gc, 0.25); ghid_fill_pcb_polygon(gc, poly, clip_box); ghid_set_alpha_mult(gc, 1.0); @@ -792,7 +792,7 @@ we can't use the hidgl polygon drawing routine */ /* TODO: We could use the GLU tessellator though */ if (hidgl_stencil_bits() == 0) - ghid_hid.fill_pcb_polygon = common_fill_pcb_polygon; + ghid_hid.fill_pcb_polygon = pcb_dhlp_fill_pcb_polygon; glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); Index: trunk/src_plugins/hid_gtk/gtkhid-main.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 4897) +++ trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 4898) @@ -2046,7 +2046,7 @@ memset(&ghid_hid, 0, sizeof(pcb_hid_t)); common_nogui_init(&ghid_hid); - common_draw_helpers_init(&ghid_hid); + pcb_dhlp_draw_helpers_init(&ghid_hid); ghid_hid.struct_size = sizeof(pcb_hid_t); ghid_hid.name = "gtk"; Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 4897) +++ trunk/src_plugins/hid_lesstif/main.c (revision 4898) @@ -2940,7 +2940,7 @@ gc->color = offlimit_color; gc->erase = 0; } - else if (hid_cache_color(0, name, &cval, &cache)) { + else if (pcb_hid_cache_color(0, name, &cval, &cache)) { gc->color = cval.lval; gc->erase = 0; } @@ -2951,7 +2951,7 @@ printf("lesstif_set_color `%s' %08x rgb/%d/%d/%d\n", name, color.pixel, color.red, color.green, color.blue); #endif cval.lval = gc->color = color.pixel; - hid_cache_color(1, name, &cval, &cache); + pcb_hid_cache_color(1, name, &cval, &cache); gc->erase = 0; } if (autofade) { @@ -3765,7 +3765,7 @@ memset(&lesstif_hid, 0, sizeof(pcb_hid_t)); common_nogui_init(&lesstif_hid); - common_draw_helpers_init(&lesstif_hid); + pcb_dhlp_draw_helpers_init(&lesstif_hid); lesstif_hid.struct_size = sizeof(pcb_hid_t); lesstif_hid.name = "lesstif"; Index: trunk/src_plugins/hid_remote/remote.c =================================================================== --- trunk/src_plugins/hid_remote/remote.c (revision 4897) +++ trunk/src_plugins/hid_remote/remote.c (revision 4898) @@ -378,7 +378,7 @@ memset(&remote_hid, 0, sizeof(pcb_hid_t)); common_nogui_init(&remote_hid); - common_draw_helpers_init(&remote_hid); + pcb_dhlp_draw_helpers_init(&remote_hid); remote_hid.struct_size = sizeof(pcb_hid_t); remote_hid.name = "remote";