Index: trunk/src/librnd/core/hidlib.h =================================================================== --- trunk/src/librnd/core/hidlib.h (revision 32699) +++ trunk/src/librnd/core/hidlib.h (revision 32700) @@ -115,7 +115,23 @@ /* Draw any mark following the crosshair on XOR overlay; if inhibit_drawing_mode is true, do not call ->set_drawing_mode */ void (*draw_attached)(rnd_hidlib_t *hidlib, rnd_bool inhibit_drawing_mode); + /*** One of these two functions will be called whenever (parts of) the screen + needs redrawing (on screen, print or export, board or preview). The expose + function does the following: + - allocate any GCs needed + - set drawing mode + - cycle through the layers, calling set_layer for each layer to be + drawn, and only drawing objects (all or specified) of desired + layers. ***/ + /* Mandatory: main expose: draw the design in the top window + (in pcb-rnd: all layers with all flags (no .content is used) */ + void (*expose_main)(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *region, rnd_xform_t *xform_caller); + + /* Mandatory: preview expose: generic, dialog based, used in preview + widgets */ + void (*expose_preview)(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *e); + /* Spare: see doc/developer/spare.txt */ void (*spare_f1)(void), (*spare_f2)(void), (*spare_f3)(void), (*spare_f4)(void), (*spare_f5)(void), (*spare_f6)(void); long spare_l1, spare_l2, spare_l3, spare_l4; @@ -122,6 +138,7 @@ void *spare_p1, *spare_p2, *spare_p3, *spare_p4; double spare_d1, spare_d2, spare_d3, spare_d4; } rnd_app_t; + extern rnd_app_t rnd_app; void rnd_hidlib_event_uninit(void); @@ -138,25 +155,10 @@ -/*** One of these two functions will be called whenever (parts of) the screen - needs redrawing (on screen, print or export, board or preview). The expose - function does the following: - - allocate any GCs needed - - set drawing mode - - cycle through the layers, calling set_layer for each layer to be - drawn, and only drawing objects (all or specified) of desired - layers. ***/ -/* Main expose: draw the design in the top window - (in pcb-rnd: all layers with all flags (no .content is used) */ -void rnd_expose_main(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *region, rnd_xform_t *xform_caller); -/* Preview expose: generic, dialog based, used in preview widgets */ -void rnd_expose_preview(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *e); - - /*** API wrappers provided for plugins (these are translated into calls to the app within the hidlib) ***/ void rnd_hidcore_crosshair_move_to(rnd_hidlib_t *hidlib, rnd_coord_t abs_x, rnd_coord_t abs_y, int mouse_mot); Index: trunk/src/librnd/plugins/hid_gtk2_gdk/gtkhid-gdk.c =================================================================== --- trunk/src/librnd/plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 32699) +++ trunk/src/librnd/plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 32700) @@ -1141,7 +1141,7 @@ ghid_gdk_draw_bg_image(hidlib); - rnd_expose_main(>k2_gdk_hid, &ctx, NULL); + rnd_app.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/librnd/plugins/hid_gtk2_gl/gtkhid-gl.c =================================================================== --- trunk/src/librnd/plugins/hid_gtk2_gl/gtkhid-gl.c (revision 32699) +++ trunk/src/librnd/plugins/hid_gtk2_gl/gtkhid-gl.c (revision 32700) @@ -749,7 +749,7 @@ ghid_gl_invalidate_current_gc(); glMatrixMode(GL_PROJECTION); glPushMatrix(); - rnd_expose_main(>k2_gl_hid, &ctx, NULL); + rnd_app.expose_main(>k2_gl_hid, &ctx, NULL); drawgl_flush(); glMatrixMode(GL_PROJECTION); glPopMatrix(); Index: trunk/src/librnd/plugins/hid_lesstif/main.c =================================================================== --- trunk/src/librnd/plugins/hid_lesstif/main.c (revision 32699) +++ trunk/src/librnd/plugins/hid_lesstif/main.c (revision 32700) @@ -618,7 +618,7 @@ time(&start); do { XFillRectangle(display, pixmap, bg_gc, 0, 0, view_width, view_height); - rnd_expose_main(&lesstif_hid, &ctx, NULL); + rnd_app.expose_main(&lesstif_hid, &ctx, NULL); XSync(display, 0); time(&end); i++; @@ -2104,7 +2104,7 @@ } } DrawBackgroundImage(); - rnd_expose_main(&lesstif_hid, &ctx, NULL); + rnd_app.expose_main(&lesstif_hid, &ctx, NULL); lesstif_drawing_mode = RND_HID_COMP_POSITIVE; draw_grid(); show_crosshair(0); /* To keep the drawn / not drawn info correct */ Index: trunk/src/librnd/plugins/hid_lesstif/wt_preview.c =================================================================== --- trunk/src/librnd/plugins/hid_lesstif/wt_preview.c (revision 32699) +++ trunk/src/librnd/plugins/hid_lesstif/wt_preview.c (revision 32700) @@ -145,7 +145,7 @@ pd->exp_ctx.view.Y2 = pd->y2; rnd_gui->coord_per_pix = view_zoom; - rnd_expose_preview(&lesstif_hid, &pd->exp_ctx); + rnd_app.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/librnd/plugins/hid_remote/remote.c =================================================================== --- trunk/src/librnd/plugins/hid_remote/remote.c (revision 32699) +++ trunk/src/librnd/plugins/hid_remote/remote.c (revision 32700) @@ -72,7 +72,7 @@ if (remote_proto_send_ready() != 0) exit(1); - rnd_expose_main(&remote_hid, &ctx, NULL); + rnd_app.expose_main(&remote_hid, &ctx, NULL); /* main loop, parser */ if (remote_proto_parse_all() != 0) Index: trunk/src/librnd/plugins/lib_gtk_common/wt_preview.c =================================================================== --- trunk/src/librnd/plugins/lib_gtk_common/wt_preview.c (revision 32699) +++ trunk/src/librnd/plugins/lib_gtk_common/wt_preview.c (revision 32700) @@ -245,7 +245,7 @@ save_fy = rnd_conf.editor.view.flip_y; flip_apply(preview); - res = preview->expose(widget, ev, rnd_expose_preview, &preview->expose_data); + res = preview->expose(widget, ev, rnd_app.expose_preview, &preview->expose_data); rnd_conf_force_set_bool(rnd_conf.editor.view.flip_x, save_fx); rnd_conf_force_set_bool(rnd_conf.editor.view.flip_y, save_fy); Index: trunk/src/test-rnd.c =================================================================== --- trunk/src/test-rnd.c (revision 32699) +++ trunk/src/test-rnd.c (revision 32700) @@ -100,17 +100,6 @@ rnd_hid_notify_crosshair_change(hl, rnd_true); } - -/*** draw ***/ -void rnd_expose_main(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *region, rnd_xform_t *xform_caller) -{ -} - -void rnd_expose_preview(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *e) -{ -} - - /*** gui support ***/ static void gui_support_plugins(int load) { Index: trunk/tests/librnd/glue.c =================================================================== --- trunk/tests/librnd/glue.c (revision 32699) +++ trunk/tests/librnd/glue.c (revision 32700) @@ -35,11 +35,3 @@ { rnd_conf_reg_field_(NULL, 1, RND_CFN_COORD, "should_never_match", "dummy", 0); } - -void rnd_expose_main(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *region, rnd_xform_t *xform_caller) -{ -} - -void rnd_expose_preview(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *e) -{ -} Index: trunk/tests/rnd_printf/glue.c =================================================================== --- trunk/tests/rnd_printf/glue.c (revision 32699) +++ trunk/tests/rnd_printf/glue.c (revision 32700) @@ -41,10 +41,3 @@ { } -void rnd_expose_main(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *region, rnd_xform_t *xform_caller) -{ -} - -void rnd_expose_preview(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *e) -{ -}