Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 25489) +++ trunk/src/draw.c (revision 25490) @@ -989,7 +989,7 @@ pcb_gui = pcb_draw_out.hid; } -void pcb_hid_expose_all(pcb_hid_t * hid, const pcb_hid_expose_ctx_t *ctx, pcb_xform_t *xform_caller) +void pcbhl_expose_main(pcb_hid_t * hid, const pcb_hid_expose_ctx_t *ctx, pcb_xform_t *xform_caller) { if (!pcb_draw_inhibit) { pcb_output_t save; @@ -1006,7 +1006,7 @@ } } -void pcb_hid_expose_generic(pcb_hid_t *hid, const pcb_hid_expose_ctx_t *e) +void pcbhl_expose_preview(pcb_hid_t *hid, const pcb_hid_expose_ctx_t *e) { pcb_output_t save; expose_begin(&save, hid); Index: trunk/src/draw.h =================================================================== --- trunk/src/draw.h (revision 25489) +++ trunk/src/draw.h (revision 25490) @@ -178,10 +178,4 @@ #define PCB_DRAW_TERM_GFX_WIDTH (-3) -/* Normal expose: draw all layers with all flags (no .content is used) */ -void pcb_hid_expose_all(pcb_hid_t *hid, const pcb_hid_expose_ctx_t *region, pcb_xform_t *xform_caller); - -/* generic, dialog/callbakc based preview expose */ -void pcb_hid_expose_generic(pcb_hid_t *hid, const pcb_hid_expose_ctx_t *e); - #endif Index: trunk/src/global_typedefs.h =================================================================== --- trunk/src/global_typedefs.h (revision 25489) +++ trunk/src/global_typedefs.h (revision 25490) @@ -81,6 +81,10 @@ typedef struct pcb_event_arg_s pcb_event_arg_t; +typedef struct pcb_hid_expose_ctx_s pcb_hid_expose_ctx_t; +typedef struct pcb_hid_s pcb_hid_t; +typedef struct pcb_xform_s pcb_xform_t; + #include "pcb_bool.h" #include "unit.h" Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 25489) +++ trunk/src/hid.h (revision 25490) @@ -170,8 +170,6 @@ extern int pcb_dock_is_vert[PCB_HID_DOCK_max]; /* 1 if a new dock box (parent of a new sub-DAD) should be a vbox, 0 if hbox */ extern int pcb_dock_has_frame[PCB_HID_DOCK_max]; /* 1 if a new dock box (parent of a new sub-DAD) should be framed */ -typedef struct pcb_hid_s pcb_hid_t; - /* This is the main HID structure. */ struct pcb_hid_s { /* The size of this structure. We use this as a compatibility @@ -569,9 +567,6 @@ Do *not* assume that the hid that is passed is the GUI hid. This callback is also used for printing and exporting. */ - -typedef struct pcb_hid_expose_ctx_s pcb_hid_expose_ctx_t; - typedef void (*pcb_hid_expose_cb_t)(pcb_hid_gc_t gc, const pcb_hid_expose_ctx_t *e); struct pcb_hid_expose_ctx_s { Index: trunk/src/hidlib.h =================================================================== --- trunk/src/hidlib.h (revision 25489) +++ trunk/src/hidlib.h (revision 25490) @@ -64,4 +64,12 @@ /* Draw any mark following the crosshair on XOR overlay; if inhibit_drawing_mode is true, do not call ->set_drawing_mode */ void pcbhl_draw_attached(pcb_hidlib_t *hidlib, pcb_bool inhibit_drawing_mode); +/* Main expose: draw the design in the top window + (pcb-rnd: all layers with all flags (no .content is used) */ +void pcbhl_expose_main(pcb_hid_t *hid, const pcb_hid_expose_ctx_t *region, pcb_xform_t *xform_caller); + +/* Preview expose: generic, dialog based, used in preview widgets */ +void pcbhl_expose_preview(pcb_hid_t *hid, const pcb_hid_expose_ctx_t *e); + + #endif Index: trunk/src/obj_common.h =================================================================== --- trunk/src/obj_common.h (revision 25489) +++ trunk/src/obj_common.h (revision 25490) @@ -96,13 +96,13 @@ typedef double pcb_xform_mx_t[9]; #define PCB_XFORM_MX_IDENT {1,0,0, 0,1,0, 0,0,1} -typedef struct pcb_xform_s { /* generic object transformation */ +struct pcb_xform_s { /* generic object transformation */ pcb_coord_t bloat; /* if non-zero, bloat (positive) or shrink (negative) by this value */ unsigned layer_faded:1; /* draw layer colors faded */ /* WARNING: After adding new fields, make sure to update pcb_xform_add() and pcb_xform_is_nop() below */ -} pcb_xform_t; +}; #define pcb_xform_clear(dst) memset(dst, 0, sizeof(pcb_xform_t)) #define pcb_xform_copy(dst, src) memcpy(dst, src, sizeof(pcb_xform_t)) Index: trunk/src_plugins/dialogs/dlg_netlist.c =================================================================== --- trunk/src_plugins/dialogs/dlg_netlist.c (revision 25489) +++ trunk/src_plugins/dialogs/dlg_netlist.c (revision 25490) @@ -282,7 +282,7 @@ /* draw the board */ memset(&xform, 0, sizeof(xform)); xform.layer_faded = 1; - pcb_hid_expose_all(pcb_gui, e, &xform); + pcbhl_expose_main(pcb_gui, e, &xform); if (net != NULL) {/* restore object color */ for(n = 0, p = netlist_color_save.array; n < netlist_color_save.used; n+=2,p+=2) { Index: trunk/src_plugins/dialogs/dlg_view.c =================================================================== --- trunk/src_plugins/dialogs/dlg_view.c (revision 25489) +++ trunk/src_plugins/dialogs/dlg_view.c (revision 25490) @@ -242,7 +242,7 @@ pcb_draw_force_termlab = 1; memset(&xform, 0, sizeof(xform)); xform.layer_faded = 1; - pcb_hid_expose_all(pcb_gui, e, &xform); + pcbhl_expose_main(pcb_gui, e, &xform); pcb_draw_force_termlab = old_termlab; /* restore object color */ Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 25489) +++ trunk/src_plugins/export_dxf/dxf.c (revision 25490) @@ -235,7 +235,7 @@ dxf_ctx.drill_fill = options[HA_drill_fill].int_value; dxf_ctx.drill_contour = options[HA_drill_contour].int_value; - pcb_hid_expose_all(&dxf_hid, &hectx, NULL); + pcbhl_expose_main(&dxf_hid, &hectx, NULL); conf_update(NULL, -1); /* restore forced sets */ } Index: trunk/src_plugins/export_excellon/excellon.c =================================================================== --- trunk/src_plugins/export_excellon/excellon.c (revision 25489) +++ trunk/src_plugins/export_excellon/excellon.c (revision 25490) @@ -244,11 +244,11 @@ lastwidth = -1; finding_apertures = 1; - pcb_hid_expose_all(&excellon_hid, &ctx, NULL); + pcbhl_expose_main(&excellon_hid, &ctx, NULL); lastwidth = -1; finding_apertures = 0; - pcb_hid_expose_all(&excellon_hid, &ctx, NULL); + pcbhl_expose_main(&excellon_hid, &ctx, NULL); conf_update(NULL, -1); /* resotre forced sets */ Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 25489) +++ trunk/src_plugins/export_gcode/gcode.c (revision 25490) @@ -353,7 +353,7 @@ lastbrush = (gdImagePtr) ((void *) -1); lastcolor = -1; - pcb_hid_expose_all(&gcode_hid, &ctx, NULL); + pcbhl_expose_main(&gcode_hid, &ctx, NULL); } static void gcode_do_export(pcb_hidlib_t *hidlib, pcb_hid_attr_val_t *options) Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 25489) +++ trunk/src_plugins/export_gerber/gerber.c (revision 25490) @@ -613,12 +613,12 @@ lastgroup = -1; layer_list_idx = 0; finding_apertures = 1; - pcb_hid_expose_all(&gerber_hid, &ctx, NULL); + pcbhl_expose_main(&gerber_hid, &ctx, NULL); lastgroup = -2; layer_list_idx = 0; finding_apertures = 0; - pcb_hid_expose_all(&gerber_hid, &ctx, NULL); + pcbhl_expose_main(&gerber_hid, &ctx, NULL); memcpy(pcb_layer_stack, saved_layer_stack, sizeof(pcb_layer_stack)); Index: trunk/src_plugins/export_openems/export_openems.c =================================================================== --- trunk/src_plugins/export_openems/export_openems.c (revision 25489) +++ trunk/src_plugins/export_openems/export_openems.c (revision 25490) @@ -622,7 +622,7 @@ openems_write_outline(&wctx); fprintf(wctx.f, "%%%%%% Copper objects\n"); - pcb_hid_expose_all(&openems_hid, &ctx, NULL); + pcbhl_expose_main(&openems_hid, &ctx, NULL); fprintf(wctx.f, "%%%%%% Port(s) on terminals\n"); openems_write_testpoints(&wctx, wctx.pcb->Data); Index: trunk/src_plugins/export_openscad/export_openscad.c =================================================================== --- trunk/src_plugins/export_openscad/export_openscad.c (revision 25489) +++ trunk/src_plugins/export_openscad/export_openscad.c (revision 25490) @@ -158,7 +158,7 @@ /* conf_force_set_bool(conf_core.editor.check_planes, 0);*/ conf_force_set_bool(conf_core.editor.show_solder_side, 0); - pcb_hid_expose_all(&openscad_hid, &ctx, NULL); + pcbhl_expose_main(&openscad_hid, &ctx, NULL); conf_update(NULL, -1); /* restore forced sets */ } Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 25489) +++ trunk/src_plugins/export_png/png.c (revision 25490) @@ -958,7 +958,7 @@ } ctx.view = *bounds; - pcb_hid_expose_all(&png_hid, &ctx, NULL); + pcbhl_expose_main(&png_hid, &ctx, NULL); memcpy(pcb_layer_stack, saved_layer_stack, sizeof(pcb_layer_stack)); conf_update(NULL, -1); /* restore forced sets */ Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 25489) +++ trunk/src_plugins/export_ps/eps.c (revision 25490) @@ -323,7 +323,7 @@ eps_print_header(f, pcb_hid_export_fn(filename)); ctx.view = *bounds; - pcb_hid_expose_all(&eps_hid, &ctx, NULL); + pcbhl_expose_main(&eps_hid, &ctx, NULL); eps_print_footer(f); Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 25489) +++ trunk/src_plugins/export_ps/ps.c (revision 25490) @@ -591,14 +591,14 @@ fprintf(the_file, "/tocp { /y y 12 sub def 90 y moveto rightshow } bind def\n"); global.doing_toc = 1; - global.pagecount = 1; /* 'pagecount' is modified by pcb_hid_expose_all() call */ - pcb_hid_expose_all(&ps_hid, &global.exps, NULL); + global.pagecount = 1; /* 'pagecount' is modified by pcbhl_expose_main() call */ + pcbhl_expose_main(&ps_hid, &global.exps, NULL); } global.pagecount = 1; /* Reset 'pagecount' if single file */ global.doing_toc = 0; ps_set_layer_group(&PCB->hidlib, -1, NULL, -1, -1, 0, -1, NULL); /* reset static vars */ - pcb_hid_expose_all(&ps_hid, &global.exps, NULL); + pcbhl_expose_main(&ps_hid, &global.exps, NULL); if (the_file) fprintf(the_file, "showpage\n"); Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 25489) +++ trunk/src_plugins/export_svg/svg.c (revision 25490) @@ -250,7 +250,7 @@ gds_init(&sbright); gds_init(&sdark); gds_init(&snormal); - pcb_hid_expose_all(&svg_hid, &ctx, NULL); + pcbhl_expose_main(&svg_hid, &ctx, NULL); conf_update(NULL, -1); /* restore forced sets */ } Index: trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 25489) +++ trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 25490) @@ -1097,7 +1097,7 @@ ghid_gdk_draw_bg_image(hidlib); - pcb_hid_expose_all(>k2_gdk_hid, &ctx, NULL); + pcbhl_expose_main(>k2_gdk_hid, &ctx, NULL); ghid_gdk_draw_grid(hidlib); /* In some cases we are called with the crosshair still off */ Index: trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c =================================================================== --- trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 25489) +++ trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 25490) @@ -880,7 +880,7 @@ ghid_gl_invalidate_current_gc(); glMatrixMode(GL_PROJECTION); glPushMatrix(); - pcb_hid_expose_all(>k2_gl_hid, &ctx, NULL); + pcbhl_expose_main(>k2_gl_hid, &ctx, NULL); drawgl_flush(); glMatrixMode(GL_PROJECTION); glPopMatrix(); Index: trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c =================================================================== --- trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 25489) +++ trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 25490) @@ -1089,7 +1089,7 @@ ghid_cairo_draw_bg_image(hidlib); - pcb_hid_expose_all(>k3_cairo_hid, &ctx, NULL); + pcbhl_expose_main(>k3_cairo_hid, &ctx, NULL); ghid_cairo_draw_grid(hidlib); /* Draws "GUI" information on top of design */ Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 25489) +++ trunk/src_plugins/hid_lesstif/main.c (revision 25490) @@ -608,7 +608,7 @@ time(&start); do { XFillRectangle(display, pixmap, bg_gc, 0, 0, view_width, view_height); - pcb_hid_expose_all(&lesstif_hid, &ctx, NULL); + pcbhl_expose_main(&lesstif_hid, &ctx, NULL); XSync(display, 0); time(&end); i++; @@ -2008,7 +2008,7 @@ } } DrawBackgroundImage(); - pcb_hid_expose_all(&lesstif_hid, &ctx, NULL); + pcbhl_expose_main(&lesstif_hid, &ctx, NULL); lesstif_drawing_mode = PCB_HID_COMP_POSITIVE; draw_grid(); show_crosshair(0); /* To keep the drawn / not drawn info correct */ Index: trunk/src_plugins/hid_lesstif/wt_preview.c =================================================================== --- trunk/src_plugins/hid_lesstif/wt_preview.c (revision 25489) +++ trunk/src_plugins/hid_lesstif/wt_preview.c (revision 25490) @@ -131,7 +131,7 @@ pd->exp_ctx.view.X2 = pd->x2; pd->exp_ctx.view.Y2 = pd->y2; - pcb_hid_expose_generic(&lesstif_hid, &pd->exp_ctx); + pcbhl_expose_preview(&lesstif_hid, &pd->exp_ctx); XCopyArea(lesstif_display, pixmap, XtWindow(pd->pw), gc, 0, 0, pd->v_width, pd->v_height, 0, 0); XtReleaseGC(pd->pw, gc); Index: trunk/src_plugins/hid_remote/remote.c =================================================================== --- trunk/src_plugins/hid_remote/remote.c (revision 25489) +++ trunk/src_plugins/hid_remote/remote.c (revision 25490) @@ -106,7 +106,7 @@ if (remote_proto_send_ready() != 0) exit(1); - pcb_hid_expose_all(&remote_hid, &ctx, NULL); + pcbhl_expose_main(&remote_hid, &ctx, NULL); /* main loop, parser */ if (remote_proto_parse_all() != 0) Index: trunk/src_plugins/lib_gtk_common/wt_preview.c =================================================================== --- trunk/src_plugins/lib_gtk_common/wt_preview.c (revision 25489) +++ trunk/src_plugins/lib_gtk_common/wt_preview.c (revision 25490) @@ -238,7 +238,7 @@ conf_force_set_bool(pcbhl_conf.editor.view.flip_x, 0); conf_force_set_bool(pcbhl_conf.editor.view.flip_y, 0); - res = preview->expose(widget, ev, pcb_hid_expose_generic, &preview->expose_data); + res = preview->expose(widget, ev, pcbhl_expose_preview, &preview->expose_data); conf_force_set_bool(pcbhl_conf.editor.view.flip_x, save_fx); conf_force_set_bool(pcbhl_conf.editor.view.flip_y, save_fy);