Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 38753) +++ trunk/src/draw.c (revision 38754) @@ -533,6 +533,11 @@ } } + if (Layer->plugin_draw != NULL) { + Layer->plugin_draw(info, Layer); + goto out; + } + lflg = pcb_layer_flags_(Layer); if (PCB_LAYERFLG_ON_VISIBLE_SIDE(lflg)) pcb_draw_out.active_padGC = pcb_draw_out.padGC; Index: trunk/src/draw.h =================================================================== --- trunk/src/draw.h (revision 38753) +++ trunk/src/draw.h (revision 38754) @@ -32,6 +32,7 @@ #include "config.h" #include #include "layer.h" +#include "global_typedefs.h" /* holds information about output window */ typedef struct { @@ -50,7 +51,7 @@ } pcb_pstk_draw_hole_t; /* Some low level draw callback depend on this in their void *cl */ -typedef struct pcb_draw_info_s { +struct pcb_draw_info_s { pcb_board_t *pcb; int exporting; /* 1 if doing an export, 0 if working to screen */ const char *export_name; /* name of the export plugin */ @@ -78,7 +79,7 @@ int per_side; } subc; } objcb; -} pcb_draw_info_t; +}; /* Temporarily inhibid drawing if this is non-zero. A function that calls a lot of other functions that would call pcb_draw() a lot in turn may increase Index: trunk/src/global_typedefs.h =================================================================== --- trunk/src/global_typedefs.h (revision 38753) +++ trunk/src/global_typedefs.h (revision 38754) @@ -64,4 +64,6 @@ typedef struct pcb_view_s pcb_view_t; +typedef struct pcb_draw_info_s pcb_draw_info_t; + #endif Index: trunk/src/layer.h =================================================================== --- trunk/src/layer.h (revision 38753) +++ trunk/src/layer.h (revision 38754) @@ -117,7 +117,9 @@ #include "obj_poly_list.h" #include "obj_text_list.h" #include "obj_gfx_list.h" +#include "global_typedefs.h" + struct pcb_layer_s { /* holds information about one layer */ PCB_ANY_OBJ_FIELDS; @@ -156,6 +158,11 @@ } meta; unsigned is_bound:1; + + /* Optional: if not NULL, call this instead of rendering objects from + layer data, after setting up info an info->xform; lets plugins + implement their own custom draw functions */ + void (*plugin_draw)(pcb_draw_info_t *info, const pcb_layer_t *Layer); }; /* returns the layer number for the passed copper or silk layer pointer */