Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 17269) +++ trunk/src/crosshair.c (revision 17270) @@ -476,7 +476,7 @@ void pcb_draw_attached(void) { pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, 1, NULL); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, 1, NULL); + pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE_XOR, 1, NULL); pcb_tool_draw_attached(); Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 17269) +++ trunk/src/draw.c (revision 17270) @@ -259,7 +259,7 @@ static void draw_xor_marks(const pcb_box_t *drawn_area) { pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, drawn_area); + pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE_XOR, pcb_draw_out.direct, drawn_area); pcb_hid_set_line_cap(pcb_draw_out.fgGC, pcb_cap_round); pcb_hid_set_line_width(pcb_draw_out.fgGC, 0); Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 17269) +++ trunk/src/hid.h (revision 17270) @@ -144,7 +144,8 @@ typedef enum pcb_composite_op_s { PCB_HID_COMP_RESET, /* reset (allocate and clear) the sketch canvas */ - PCB_HID_COMP_POSITIVE, /* draw subsequent objects in positive, with color */ + PCB_HID_COMP_POSITIVE, /* draw subsequent objects in positive, with color, no XOR allowed */ + PCB_HID_COMP_POSITIVE_XOR, /* draw subsequent objects in positive, with color, XOR allowed */ PCB_HID_COMP_NEGATIVE, /* draw subsequent objects in negative, ignore color */ PCB_HID_COMP_FLUSH /* combine the sketch canvas onto the output buffer and discard the sketch canvas */ } pcb_composite_op_t; Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 17269) +++ trunk/src_plugins/export_dxf/dxf.c (revision 17270) @@ -401,6 +401,7 @@ break; case PCB_HID_COMP_POSITIVE: + case PCB_HID_COMP_POSITIVE_XOR: case PCB_HID_COMP_NEGATIVE: break; Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 17269) +++ trunk/src_plugins/export_gerber/gerber.c (revision 17270) @@ -928,7 +928,7 @@ static void use_gc(pcb_hid_gc_t gc, int radius) { if ((f != NULL) && (gerber_drawing_mode != drawing_mode_issued)) { - if (gerber_drawing_mode == PCB_HID_COMP_POSITIVE) { + if ((gerber_drawing_mode == PCB_HID_COMP_POSITIVE) || (gerber_drawing_mode == PCB_HID_COMP_POSITIVE_XOR)) { fprintf(f, "%%LPD*%%\r\n"); drawing_mode_issued = gerber_drawing_mode; } @@ -1209,7 +1209,7 @@ int firstTime = 1; pcb_coord_t startX = 0, startY = 0; - if (is_mask && (gerber_drawing_mode != PCB_HID_COMP_POSITIVE) && (gerber_drawing_mode != PCB_HID_COMP_NEGATIVE)) + if (is_mask && (gerber_drawing_mode != PCB_HID_COMP_POSITIVE) && (gerber_drawing_mode != PCB_HID_COMP_POSITIVE_XOR) && (gerber_drawing_mode != PCB_HID_COMP_NEGATIVE)) return; use_gc(gc, 10 * 100); Index: trunk/src_plugins/export_openems/export_openems.c =================================================================== --- trunk/src_plugins/export_openems/export_openems.c (revision 17269) +++ trunk/src_plugins/export_openems/export_openems.c (revision 17270) @@ -684,6 +684,7 @@ case PCB_HID_COMP_RESET: break; case PCB_HID_COMP_POSITIVE: + case PCB_HID_COMP_POSITIVE_XOR: break; case PCB_HID_COMP_NEGATIVE: pcb_message(PCB_MSG_ERROR, "Can't draw composite layer, especially not on copper\n"); Index: trunk/src_plugins/export_openscad/export_openscad.c =================================================================== --- trunk/src_plugins/export_openscad/export_openscad.c (revision 17269) +++ trunk/src_plugins/export_openscad/export_openscad.c (revision 17270) @@ -436,6 +436,7 @@ break; case PCB_HID_COMP_POSITIVE: + case PCB_HID_COMP_POSITIVE_XOR: scad_new_layer(1); break; case PCB_HID_COMP_NEGATIVE: Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 17269) +++ trunk/src_plugins/export_png/png.c (revision 17270) @@ -1348,6 +1348,7 @@ break; case PCB_HID_COMP_POSITIVE: + case PCB_HID_COMP_POSITIVE_XOR: im = comp_im; break; case PCB_HID_COMP_NEGATIVE: Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 17269) +++ trunk/src_plugins/export_ps/eps.c (revision 17270) @@ -420,6 +420,7 @@ break; case PCB_HID_COMP_POSITIVE: + case PCB_HID_COMP_POSITIVE_XOR: case PCB_HID_COMP_NEGATIVE: break; Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 17269) +++ trunk/src_plugins/export_svg/svg.c (revision 17270) @@ -434,6 +434,7 @@ break; case PCB_HID_COMP_POSITIVE: + case PCB_HID_COMP_POSITIVE_XOR: case PCB_HID_COMP_NEGATIVE: break; @@ -456,7 +457,7 @@ static const char *svg_clip_color(pcb_hid_gc_t gc) { - if (drawing_mode == PCB_HID_COMP_POSITIVE) + if ((drawing_mode == PCB_HID_COMP_POSITIVE) || (drawing_mode == PCB_HID_COMP_POSITIVE_XOR)) return "#FFFFFF"; if (drawing_mode == PCB_HID_COMP_NEGATIVE) return "#000000"; Index: trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 17269) +++ trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 17270) @@ -450,6 +450,7 @@ break; case PCB_HID_COMP_POSITIVE: + case PCB_HID_COMP_POSITIVE_XOR: priv->clip_color.pixel = 1; break; @@ -660,7 +661,7 @@ GdkWindow *window = gtk_widget_get_window(gport->top_window); int need_setup = 0; - assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); + assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_POSITIVE_XOR) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); if (gc->me_pointer != >k2_gdk_hid) { fprintf(stderr, "Fatal: GC from another HID passed to GTK HID\n"); @@ -701,7 +702,7 @@ double dx1, dy1, dx2, dy2; render_priv_t *priv = gport->render_priv; - assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); + assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_POSITIVE_XOR) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); dx1 = Vx((double) x1); dy1 = Vy((double) y1); @@ -736,7 +737,7 @@ double w, h, radius; render_priv_t *priv = gport->render_priv; - assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); + assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_POSITIVE_XOR) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); w = gport->view.canvas_width * gport->view.coord_per_px; h = gport->view.canvas_height * gport->view.coord_per_px; @@ -785,7 +786,7 @@ gint w, h, lw, sx1, sy1; render_priv_t *priv = gport->render_priv; - assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); + assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_POSITIVE_XOR) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); lw = gc->width; w = gport->view.canvas_width * gport->view.coord_per_px; @@ -838,7 +839,7 @@ gint w, h, vr; render_priv_t *priv = gport->render_priv; - assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); + assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_POSITIVE_XOR) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); w = gport->view.canvas_width * gport->view.coord_per_px; h = gport->view.canvas_height * gport->view.coord_per_px; @@ -877,7 +878,7 @@ render_priv_t *priv = gport->render_priv; USE_GC(gc); - assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); + assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_POSITIVE_XOR) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); if (npoints < n_coords) { npoints = n_coords + 1; @@ -923,7 +924,7 @@ pcb_coord_t lsx, lsy, lastx = PCB_MAX_COORD, lasty = PCB_MAX_COORD, mindist = gport->view.coord_per_px * 2; USE_GC(gc); - assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); + assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_POSITIVE_XOR) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); if (npoints < n_coords) { npoints = n_coords + 1; @@ -964,7 +965,7 @@ gint w, h, lw, xx, yy, sx1, sy1; render_priv_t *priv = gport->render_priv; - assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); + assert((curr_drawing_mode == PCB_HID_COMP_POSITIVE) || (curr_drawing_mode == PCB_HID_COMP_POSITIVE_XOR) || (curr_drawing_mode == PCB_HID_COMP_NEGATIVE)); lw = gc->width; w = gport->view.canvas_width * gport->view.coord_per_px; Index: trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c =================================================================== --- trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 17269) +++ trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 17270) @@ -60,7 +60,6 @@ const char *colorname; double alpha_mult; pcb_coord_t width; - gint cap, join; gchar xor; } hid_gc_s; @@ -496,7 +495,6 @@ void ghid_gl_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style) { - gc->cap = style; } void ghid_gl_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) @@ -549,7 +547,7 @@ { USE_GC(gc); - hidgl_draw_line(gc->cap, gc->width, x1, y1, x2, y2, gport->view.coord_per_px); + hidgl_draw_line(gc->core_gc.cap, gc->width, x1, y1, x2, y2, gport->view.coord_per_px); } void ghid_gl_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle) Index: trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c =================================================================== --- trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 17269) +++ trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 17270) @@ -593,6 +593,7 @@ break; case PCB_HID_COMP_POSITIVE: + case PCB_HID_COMP_POSITIVE_XOR: //priv->clip_color.pixel = 1; cairo_set_operator(priv->cr, CAIRO_OPERATOR_SOURCE); break; Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 17269) +++ trunk/src_plugins/hid_lesstif/main.c (revision 17270) @@ -235,7 +235,7 @@ PCB_REGISTER_ATTRIBUTES(lesstif_attribute_list, lesstif_cookie) static pcb_composite_op_t lesstif_drawing_mode = 0; -#define use_mask() ((lesstif_drawing_mode == PCB_HID_COMP_POSITIVE) || (lesstif_drawing_mode == PCB_HID_COMP_NEGATIVE)) +#define use_mask() ((lesstif_drawing_mode == PCB_HID_COMP_POSITIVE) || (lesstif_drawing_mode == PCB_HID_COMP_POSITIVE_XOR) || (lesstif_drawing_mode == PCB_HID_COMP_NEGATIVE)) static void zoom_max(); static void zoom_to(double factor, pcb_coord_t x, pcb_coord_t y); @@ -2897,6 +2897,7 @@ break; case PCB_HID_COMP_POSITIVE: + case PCB_HID_COMP_POSITIVE_XOR: mask_gc = bset_gc; break; Index: trunk/src_plugins/lib_hid_gl/hidgl.c =================================================================== --- trunk/src_plugins/lib_hid_gl/hidgl.c (revision 17269) +++ trunk/src_plugins/lib_hid_gl/hidgl.c (revision 17270) @@ -149,6 +149,7 @@ switch(op) { case PCB_HID_COMP_RESET : mode_reset(direct,screen); break; + case PCB_HID_COMP_POSITIVE_XOR: case PCB_HID_COMP_POSITIVE : mode_positive(direct,screen); break; case PCB_HID_COMP_NEGATIVE : mode_negative(direct,screen); break; case PCB_HID_COMP_FLUSH : mode_flush(direct,screen); break; @@ -454,7 +455,7 @@ int slices; int i; - assert((composite_op == PCB_HID_COMP_POSITIVE) || (composite_op == PCB_HID_COMP_NEGATIVE)); + assert((composite_op == PCB_HID_COMP_POSITIVE) || (composite_op == PCB_HID_COMP_POSITIVE_XOR) || (composite_op == PCB_HID_COMP_NEGATIVE)); slices = calc_slices(vr / scale, 2 * M_PI);