Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 17202) +++ trunk/src/hid.h (revision 17203) @@ -60,7 +60,8 @@ be used to make octagonal pads by giving the same x,y coordinate twice. */ typedef enum { - Trace_Cap, /* This means we're drawing a trace, which has round caps. */ + pcb_cap_invalid = -1, + Trace_Cap = 0, /* This means we're drawing a trace, which has round caps. */ Square_Cap, /* Square pins or pads. */ Round_Cap, /* Round pins or round-ended pads, thermals. */ Beveled_Cap /* Octagon pins or bevel-cornered pads. */ @@ -74,11 +75,18 @@ void *ptr; } pcb_hidval_t; +typedef struct { + pcb_coord_t width; /* as set by set_line_width */ + pcb_cap_style_t cap; /* as set by set_line_cap */ +} pcb_core_gc_t; + /* This graphics context is an opaque pointer defined by the HID. GCs are HID-specific; attempts to use one HID's GC for a different HID - will result in a fatal error. */ + will result in a fatal error. The first field must be: + pcb_core_gc_t core_gc; */ typedef struct hid_gc_s *pcb_hid_gc_t; + #define PCB_HIDCONCAT(a,b) a##b /* This is used to register the action callbacks (for menus and Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 17202) +++ trunk/src_plugins/export_dxf/dxf.c (revision 17203) @@ -83,6 +83,7 @@ static dxf_ctx_t dxf_ctx; typedef struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_hid_t *me_pointer; pcb_cap_style_t cap; pcb_coord_t width; @@ -93,6 +94,7 @@ } hid_gc_s; static struct hid_gc_s thin = { + {0}, NULL, 0, 1, NULL, 0, 0 Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 17202) +++ trunk/src_plugins/export_gcode/gcode.c (revision 17203) @@ -88,6 +88,7 @@ }; struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_hid_t *me_pointer; pcb_cap_style_t cap; int width; Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 17202) +++ trunk/src_plugins/export_gerber/gerber.c (revision 17203) @@ -245,6 +245,7 @@ static pcb_hid_t gerber_hid; typedef struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_cap_style_t cap; int width; int color; Index: trunk/src_plugins/export_nelma/nelma.c =================================================================== --- trunk/src_plugins/export_nelma/nelma.c (revision 17202) +++ trunk/src_plugins/export_nelma/nelma.c (revision 17203) @@ -101,6 +101,7 @@ }; struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_hid_t *me_pointer; pcb_cap_style_t cap; pcb_coord_t width; Index: trunk/src_plugins/export_openems/export_openems.c =================================================================== --- trunk/src_plugins/export_openems/export_openems.c (revision 17202) +++ trunk/src_plugins/export_openems/export_openems.c (revision 17203) @@ -60,6 +60,7 @@ #define MESH_NAME "openems" typedef struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_hid_t *me_pointer; pcb_cap_style_t cap; int width; Index: trunk/src_plugins/export_openscad/export_openscad.c =================================================================== --- trunk/src_plugins/export_openscad/export_openscad.c (revision 17202) +++ trunk/src_plugins/export_openscad/export_openscad.c (revision 17203) @@ -66,6 +66,7 @@ typedef struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_hid_t *me_pointer; pcb_cap_style_t cap; int width; Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 17202) +++ trunk/src_plugins/export_png/png.c (revision 17203) @@ -105,6 +105,7 @@ } color_struct; typedef struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_hid_t *me_pointer; pcb_cap_style_t cap; int width; Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 17202) +++ trunk/src_plugins/export_ps/eps.c (revision 17203) @@ -51,6 +51,7 @@ /*----------------------------------------------------------------------------*/ typedef struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_cap_style_t cap; pcb_coord_t width; int color; Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 17202) +++ trunk/src_plugins/export_ps/ps.c (revision 17203) @@ -37,6 +37,7 @@ static void use_gc(pcb_hid_gc_t gc); typedef struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_hid_t *me_pointer; pcb_cap_style_t cap; pcb_coord_t width; Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 17202) +++ trunk/src_plugins/export_svg/svg.c (revision 17203) @@ -68,6 +68,7 @@ typedef struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_hid_t *me_pointer; pcb_cap_style_t cap; int width; Index: trunk/src_plugins/hid_batch/batch.c =================================================================== --- trunk/src_plugins/hid_batch/batch.c (revision 17202) +++ trunk/src_plugins/hid_batch/batch.c (revision 17203) @@ -28,7 +28,7 @@ non-GUI needs. */ typedef struct hid_gc_s { - int nothing_interesting_here; + pcb_core_gc_t core_gc; } hid_gc_s; static pcb_hid_attribute_t *batch_get_export_options(int *n_ret) Index: trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 17202) +++ trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 17203) @@ -54,6 +54,7 @@ typedef struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_hid_t *me_pointer; GdkGC *pixel_gc; GdkGC *clip_gc; Index: trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c =================================================================== --- trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 17202) +++ trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 17203) @@ -54,6 +54,7 @@ typedef struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_hid_t *me_pointer; const char *colorname; Index: trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c =================================================================== --- trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 17202) +++ trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 17203) @@ -90,6 +90,7 @@ } render_priv_t; typedef struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_hid_t *me_pointer; const char *colorname; /* current color name for this GC. */ Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 17202) +++ trunk/src_plugins/hid_lesstif/main.c (revision 17203) @@ -69,6 +69,7 @@ #define UUNIT conf_core.editor.grid_unit->allow typedef struct hid_gc_s { + pcb_core_gc_t core_gc; pcb_hid_t *me_pointer; Pixel color; char *colorname; Index: trunk/src_plugins/hid_remote/remote.c =================================================================== --- trunk/src_plugins/hid_remote/remote.c (revision 17202) +++ trunk/src_plugins/hid_remote/remote.c (revision 17203) @@ -26,6 +26,7 @@ static pcb_hid_t remote_hid; typedef struct hid_gc_s { + pcb_core_gc_t core_gc; int nop; } hid_gc_s;