Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 26778) +++ trunk/src/crosshair.c (revision 26779) @@ -472,8 +472,8 @@ void pcbhl_draw_attached(pcb_hidlib_t *hidlib, pcb_bool inhibit_drawing_mode) { if (!inhibit_drawing_mode) { - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, 1, NULL); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE_XOR, 1, NULL); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, 1, NULL); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE_XOR, 1, NULL); } pcb_tool_draw_attached(); @@ -490,7 +490,7 @@ } if (!inhibit_drawing_mode) - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, 1, NULL); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, 1, NULL); } @@ -503,8 +503,8 @@ return; if (!inhibit_drawing_mode) { - 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_gui, PCB_HID_COMP_RESET, 1, NULL); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, 1, NULL); } pcb_gui->draw_line(pcb_crosshair.GC, pcb_marked.X - ms, pcb_marked.Y - ms, pcb_marked.X + ms, pcb_marked.Y + ms); @@ -511,7 +511,7 @@ pcb_gui->draw_line(pcb_crosshair.GC, pcb_marked.X + ms, pcb_marked.Y - ms, pcb_marked.X - ms, pcb_marked.Y + ms); if (!inhibit_drawing_mode) - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, 1, NULL); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, 1, NULL); } /* --------------------------------------------------------------------------- Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 26778) +++ trunk/src/draw.c (revision 26779) @@ -231,8 +231,8 @@ ly = pcb_uilayers.array[i]; if ((ly != NULL) && (ly->meta.real.vis)) { if (!have_canvas) { - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); have_canvas = 1; } pcb_draw_layer(info, ly); @@ -239,7 +239,7 @@ } } if (have_canvas) - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); pcb_gui->end_layer(pcb_gui); } } @@ -248,8 +248,8 @@ static void draw_xor_marks(pcb_draw_info_t *info) { int per_side = conf_core.appearance.subc_layer_per_side; - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE_XOR, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE_XOR, pcb_draw_out.direct, info->drawn_area); pcb_hid_set_line_cap(pcb_draw_out.fgGC, pcb_cap_round); pcb_hid_set_line_width(pcb_draw_out.fgGC, 0); @@ -268,16 +268,16 @@ pcb_event(&PCB->hidlib, PCB_EVENT_GUI_DRAW_OVERLAY_XOR, "p", &pcb_draw_out.fgGC, NULL); pcb_hid_set_draw_xor(pcb_draw_out.fgGC, 0); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); } static void draw_rats(const pcb_box_t *drawn_area) { if (pcb_layer_gui_set_vlayer(PCB, PCB_VLY_RATS, 0, NULL)) { - 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_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, drawn_area); pcb_draw_rats(drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, drawn_area); pcb_gui->end_layer(pcb_gui); } } @@ -286,12 +286,12 @@ { int per_side = conf_core.appearance.subc_layer_per_side; - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); /* Draw pins' and pads' names */ - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); pcb_hid_set_line_cap(pcb_draw_out.fgGC, pcb_cap_round); pcb_hid_set_line_width(pcb_draw_out.fgGC, 0); if (PCB->SubcOn) { @@ -303,7 +303,7 @@ pcb_draw_pstk_labels(info); } pcb_draw_pstk_names(info, conf_core.editor.show_solder_side ? solder : component, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); } @@ -333,7 +333,7 @@ } } - pcb_gui->render_burst(PCB_HID_BURST_START, info->drawn_area); + pcb_gui->render_burst(pcb_gui, PCB_HID_BURST_START, info->drawn_area); memset(do_group, 0, sizeof(do_group)); for (ngroups = 0, i = 0; i < pcb_max_layer; i++) { @@ -364,9 +364,9 @@ pcb_draw_silk_doc(info, side, PCB_LYT_DOC, 0, 1); pcb_draw_silk_doc(info, side, PCB_LYT_SILK, 0, 1); - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); pcb_gui->end_layer(pcb_gui); } @@ -406,11 +406,11 @@ goto finish; /* Draw padstacks below silk */ - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); if (pcb_gui->gui) pcb_draw_ppv(info, conf_core.editor.show_solder_side ? solder : component); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); /* Draw the solder mask if turned on */ gid = pcb_layergrp_get_top_mask(); @@ -437,10 +437,10 @@ } { /* holes_after: draw holes after copper, silk and mask, to make sure it punches through everything. */ - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); draw_everything_holes(info, side_copper_grp); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); } gid = pcb_layergrp_get_top_paste(); @@ -825,8 +825,8 @@ pcb_layergrp_t *grp = pcb_get_layergrp(PCB, group); unsigned int gflg = grp->ltype; - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); for (i = n_entries - 1; i >= 0; i--) { layernum = layers[i]; @@ -853,7 +853,7 @@ if (!pcb_gui->gui) pcb_draw_ppv(info, group); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); } void pcb_erase_obj(int type, void *lptr, void *ptr) @@ -1041,10 +1041,10 @@ pcb_output_t save; expose_begin(&save, hid); - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, 1, &e->view); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, 1, &e->view); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, 1, &e->view); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, 1, &e->view); e->expose_cb(pcb_draw_out.fgGC, e); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, 1, &e->view); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, 1, &e->view); pcb_gui->end_layer(pcb_gui); expose_end(&save); Index: trunk/src/draw_composite.c =================================================================== --- trunk/src/draw_composite.c (revision 26778) +++ trunk/src/draw_composite.c (revision 26779) @@ -50,18 +50,18 @@ static void comp_start_sub_(comp_ctx_t *ctx) { - pcb_gui->set_drawing_mode(PCB_HID_COMP_NEGATIVE, pcb_draw_out.direct, ctx->info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_NEGATIVE, pcb_draw_out.direct, ctx->info->drawn_area); } static void comp_start_add_(comp_ctx_t *ctx) { - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, ctx->info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, ctx->info->drawn_area); } static void comp_start_sub(comp_ctx_t *ctx) { if (ctx->thin) { - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, ctx->info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, ctx->info->drawn_area); pcb_gui->set_color(pcb_draw_out.pmGC, ctx->color); return; } @@ -75,7 +75,7 @@ static void comp_start_add(comp_ctx_t *ctx) { if (ctx->thin) { - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, ctx->info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, ctx->info->drawn_area); return; } @@ -87,12 +87,12 @@ static void comp_finish(comp_ctx_t *ctx) { - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, ctx->info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, ctx->info->drawn_area); } static void comp_init(comp_ctx_t *ctx, int negative) { - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, ctx->info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, ctx->info->drawn_area); if (ctx->thin) return; @@ -102,7 +102,7 @@ if ((!ctx->thin) && (negative)) { /* drawing the big poly for the negative */ - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, ctx->info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, ctx->info->drawn_area); comp_fill_board(ctx); } } Index: trunk/src/draw_ly_spec.c =================================================================== --- trunk/src/draw_ly_spec.c (revision 26778) +++ trunk/src/draw_ly_spec.c (revision 26779) @@ -60,9 +60,9 @@ cctx.invert = 0; if ((cctx.grp == NULL) || (cctx.grp->len == 0)) { /* fallback: no layers -> original code: draw a single auto-add */ - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); } else { comp_draw_layer(&cctx, pcb_draw_paste_auto_, &side); @@ -163,11 +163,11 @@ if ((lyt_type & PCB_LYT_SILK) && (pcb_is_silk_old_style(&cctx, lid))) { /* fallback: implicit layer -> original code: draw auto+manual */ - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); pcb_draw_layer(info, LAYER_PTR(lid)); pcb_draw_silk_auto(&cctx, &lyt_side); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); } else { comp_draw_layer(&cctx, pcb_draw_silk_auto, &lyt_side); @@ -248,13 +248,13 @@ if (pcb_layer_gui_set_layer(gid, g, (numobj == 0), &info->xform_exporter)) { /* boundary does NOT support compisiting, everything is drawn in positive */ - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); for(n = 0; n < g->len; n++) { pcb_layer_t *ly = LAYER_PTR(g->lid[n]); pcb_draw_layer(info, ly); } - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); pcb_gui->end_layer(pcb_gui); } } @@ -264,8 +264,8 @@ We should check for pcb_gui->gui here, but it's kinda cool seeing the auto-outline magically disappear when you first add something to the outline layer. */ - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); pcb_gui->set_color(pcb_draw_out.fgGC, &PCB->Data->Layer[goutl->lid[0]].meta.real.color); pcb_hid_set_line_cap(pcb_draw_out.fgGC, pcb_cap_round); @@ -272,7 +272,7 @@ pcb_hid_set_line_width(pcb_draw_out.fgGC, conf_core.design.min_wid); pcb_gui->draw_rect(pcb_draw_out.fgGC, 0, 0, PCB->hidlib.size_x, PCB->hidlib.size_y); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); pcb_gui->end_layer(pcb_gui); } @@ -284,19 +284,19 @@ if ((uslot != NULL) && (uslot->meta.real.vis)) { if (pcb_layer_gui_set_glayer(PCB, uslot->meta.real.grp, unplated > 0, &info->xform)) { - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); pcb_draw_pstk_slots(info, uslot->meta.real.grp, PCB_PHOLE_UNPLATED | PCB_PHOLE_BB); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); pcb_gui->end_layer(pcb_gui); } } if ((pslot != NULL) && (pslot->meta.real.vis)) { if (pcb_layer_gui_set_glayer(PCB, pslot->meta.real.grp, plated > 0, &info->xform)) { - pcb_gui->set_drawing_mode(PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); - pcb_gui->set_drawing_mode(PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, info->drawn_area); pcb_draw_pstk_slots(info, pslot->meta.real.grp, PCB_PHOLE_PLATED | PCB_PHOLE_BB); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); pcb_gui->end_layer(pcb_gui); } } @@ -307,10 +307,10 @@ static void pcb_draw_rats(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_gui, PCB_HID_COMP_RESET, pcb_draw_out.direct, drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_POSITIVE, pcb_draw_out.direct, drawn_area); pcb_r_search(PCB->Data->rat_tree, drawn_area, NULL, pcb_rat_draw_callback, NULL, NULL); - pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, drawn_area); + pcb_gui->set_drawing_mode(pcb_gui, PCB_HID_COMP_FLUSH, pcb_draw_out.direct, drawn_area); } static void pcb_draw_assembly(pcb_draw_info_t *info, pcb_layer_type_t lyt_side) Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 26778) +++ trunk/src/hid.h (revision 26779) @@ -279,11 +279,11 @@ /* Composite layer drawing: manipulate the sketch canvas and set positive or negative drawing mode. The canvas covers the screen box. */ - void (*set_drawing_mode)(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen); + void (*set_drawing_mode)(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen); /* Announce start/end of a render burst for a specific screen screen box; A GUI hid should set the coord_per_pix value here for proper optimization. */ - void (*render_burst)(pcb_burst_op_t op, const pcb_box_t *screen); + void (*render_burst)(pcb_hid_t *hid, pcb_burst_op_t op, const pcb_box_t *screen); /*** gc vs. pcb_hid_t *: pcb_core_gc_t contains ->hid, so these calls don't need to get it as first arg. ***/ Index: trunk/src/hid_nogui.c =================================================================== --- trunk/src/hid_nogui.c (revision 26778) +++ trunk/src/hid_nogui.c (revision 26779) @@ -100,12 +100,12 @@ { } -static void nogui_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) +static void nogui_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) { CRASH("set_drawing_mode"); } -static void nogui_render_burst(pcb_burst_op_t op, const pcb_box_t *screen) +static void nogui_render_burst(pcb_hid_t *hid, pcb_burst_op_t op, const pcb_box_t *screen) { /* the HID may decide to ignore this hook */ } Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 26778) +++ trunk/src_plugins/export_dxf/dxf.c (revision 26779) @@ -438,7 +438,7 @@ free(gc); } -static void dxf_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) +static void dxf_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) { if (direct) return; Index: trunk/src_plugins/export_excellon/excellon.c =================================================================== --- trunk/src_plugins/export_excellon/excellon.c (revision 26778) +++ trunk/src_plugins/export_excellon/excellon.c (revision 26779) @@ -320,7 +320,7 @@ free(gc); } -static void excellon_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *drw_screen) +static void excellon_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *drw_screen) { switch(op) { case PCB_HID_COMP_RESET: Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 26778) +++ trunk/src_plugins/export_gerber/gerber.c (revision 26779) @@ -909,7 +909,7 @@ free(gc); } -static void gerber_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *drw_screen) +static void gerber_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *drw_screen) { gerber_drawing_mode = op; if ((f != NULL) && (gerber_debug)) Index: trunk/src_plugins/export_openems/export_openems.c =================================================================== --- trunk/src_plugins/export_openems/export_openems.c (revision 26778) +++ trunk/src_plugins/export_openems/export_openems.c (revision 26779) @@ -708,7 +708,7 @@ free(gc); } -static void openems_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) +static void openems_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) { switch(op) { case PCB_HID_COMP_RESET: Index: trunk/src_plugins/export_openscad/export_openscad.c =================================================================== --- trunk/src_plugins/export_openscad/export_openscad.c (revision 26778) +++ trunk/src_plugins/export_openscad/export_openscad.c (revision 26779) @@ -426,7 +426,7 @@ free(gc); } -static void openscad_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) +static void openscad_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) { switch(op) { case PCB_HID_COMP_RESET: Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 26778) +++ trunk/src_plugins/export_png/png.c (revision 26779) @@ -1388,7 +1388,7 @@ } static pcb_composite_op_t drawing_mode; -static void png_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) +static void png_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) { static gdImagePtr dst_im; drawing_mode = op; Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 26778) +++ trunk/src_plugins/export_ps/eps.c (revision 26779) @@ -466,7 +466,7 @@ free(gc); } -static void eps_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) +static void eps_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) { if (direct) return; Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 26778) +++ trunk/src_plugins/export_ps/ps.c (revision 26779) @@ -954,7 +954,7 @@ free(gc); } -static void ps_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) +static void ps_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) { global.drawing_mode = op; } Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 26778) +++ trunk/src_plugins/export_svg/svg.c (revision 26779) @@ -479,7 +479,7 @@ free(gc); } -static void svg_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) +static void svg_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) { drawing_mode = op; Index: trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 26778) +++ trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 26779) @@ -377,7 +377,7 @@ priv->out_clip = priv->sketch_clip; } -static void ghid_gdk_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) +static void ghid_gdk_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) { render_priv_t *priv = ghidgui->port.render_priv; @@ -431,7 +431,7 @@ curr_drawing_mode = op; } -static void ghid_gdk_render_burst(pcb_burst_op_t op, const pcb_box_t *screen) +static void ghid_gdk_render_burst(pcb_hid_t *hid, pcb_burst_op_t op, const pcb_box_t *screen) { pcb_gui->coord_per_pix = ghidgui->port.view.coord_per_px; } Index: trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c =================================================================== --- trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 26778) +++ trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 26779) @@ -60,7 +60,7 @@ gchar xor; } hid_gc_s; -void ghid_gl_render_burst(pcb_burst_op_t op, const pcb_box_t *screen) +void ghid_gl_render_burst(pcb_hid_t *hid, pcb_burst_op_t op, const pcb_box_t *screen) { pcb_gui->coord_per_pix = ghidgui->port.view.coord_per_px; } Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 26778) +++ trunk/src_plugins/hid_lesstif/main.c (revision 26779) @@ -2244,12 +2244,12 @@ free(gc); } -static void lesstif_render_burst(pcb_burst_op_t op, const pcb_box_t *screen) +static void lesstif_render_burst(pcb_hid_t *hid, pcb_burst_op_t op, const pcb_box_t *screen) { pcb_gui->coord_per_pix = view_zoom; } -static void lesstif_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *drw_screen) +static void lesstif_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *drw_screen) { lesstif_drawing_mode = op; Index: trunk/src_plugins/hid_remote/remote.c =================================================================== --- trunk/src_plugins/hid_remote/remote.c (revision 26778) +++ trunk/src_plugins/hid_remote/remote.c (revision 26779) @@ -192,7 +192,7 @@ } static const char *drawing_mode_names[] = { "reset", "positive", "negative", "flush"}; -static void remote_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *drw_screen) +static void remote_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *drw_screen) { if ((op >= 0) && (op < sizeof(drawing_mode_names) / sizeof(drawing_mode_names[0]))) proto_send_set_drawing_mode(drawing_mode_names[op], direct); Index: trunk/src_plugins/loghid/hid-logger.c =================================================================== --- trunk/src_plugins/loghid/hid-logger.c (revision 26778) +++ trunk/src_plugins/loghid/hid-logger.c (revision 26779) @@ -84,19 +84,19 @@ delegatee_->destroy_gc(hid, gc); } -static void log_set_drawing_mode(pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) +static void log_set_drawing_mode(pcb_hid_t *hid, pcb_composite_op_t op, pcb_bool direct, const pcb_box_t *screen) { if (screen != NULL) pcb_fprintf(out_, "set_drawing_mode(%d,%d,[%mm;%mm,%mm;%mm])\n", op, direct, screen->X1, screen->Y1, screen->X2, screen->Y2); else pcb_fprintf(out_, "set_drawing_mode(%d,%d,[NULL-screen])\n", op, direct); - delegatee_->set_drawing_mode(op, direct, screen); + delegatee_->set_drawing_mode(hid, op, direct, screen); } -static void log_render_burst(pcb_burst_op_t op, const pcb_box_t *screen) +static void log_render_burst(pcb_hid_t *hid, pcb_burst_op_t op, const pcb_box_t *screen) { pcb_fprintf(out_, "render_burst(%d,[%mm;%mm,%mm;%mm])\n", op, screen->X1, screen->Y1, screen->X2, screen->Y2); - delegatee_->render_burst(op, screen); + delegatee_->render_burst(hid, op, screen); pcb_gui->coord_per_pix = delegatee_->coord_per_pix; }