Index: trunk/src_plugins/cam/cam_compile.c =================================================================== --- trunk/src_plugins/cam/cam_compile.c (revision 27617) +++ trunk/src_plugins/cam/cam_compile.c (revision 27618) @@ -77,6 +77,20 @@ /* ignore */ break; + case PCB_CAM_PARTIAL: + if (code->op.partial.arg != NULL) { + int ret; + ctx->partial = 1; + ret = pcb_actionl("query", "setflag:exportsel", code->op.partial.arg, NULL); + } + else { + if (ctx->partial) { + pcb_data_clear_flag(PCB->Data, PCB_FLAG_EXPORTSEL, 0, 0); + ctx->partial = 0; + } + } + break; + case PCB_CAM_WRITE: if (ctx->exporter == NULL) { pcb_message(PCB_MSG_ERROR, "cam: no exporter selected before write\n"); @@ -129,7 +143,10 @@ { int res = 0, n, have_gui, currly = INDEXOFCURRENT; int save_l_ons[PCB_MAX_LAYER], save_g_ons[PCB_MAX_LAYERGRP]; - + + if (ctx->has_partial) + pcb_data_clear_flag(PCB->Data, PCB_FLAG_EXPORTSEL, 0, 0); + have_gui = (pcb_gui != NULL) && pcb_gui->gui; if (have_gui) { pcb_hid_save_and_show_layer_ons(save_l_ons); @@ -143,6 +160,11 @@ } } + if (ctx->partial) { + pcb_data_clear_flag(PCB->Data, PCB_FLAG_EXPORTSEL, 0, 0); + ctx->partial = 0; + } + if (have_gui) { pcb_hid_restore_layer_ons(save_l_ons); pcb_hid_restore_layergrp_ons(save_g_ons); @@ -163,6 +185,18 @@ code->inst = PCB_CAM_WRITE; code->op.write.arg = pcb_strdup(arg); } + else if (strcmp(cmd, "partial") == 0) { + ctx->has_partial = 1; + code->inst = PCB_CAM_PARTIAL; + if ((arg == NULL) || (*arg == '\0')) + code->op.partial.arg = NULL; + else + code->op.partial.arg = pcb_strdup(arg); + } + else if (strcmp(cmd, "full") == 0) { + code->inst = PCB_CAM_PARTIAL; + code->op.write.arg = NULL; + } else if (strcmp(cmd, "plugin") == 0) { char *curr, *next; int maxa; Index: trunk/src_plugins/cam/cam_compile.h =================================================================== --- trunk/src_plugins/cam/cam_compile.h (revision 27617) +++ trunk/src_plugins/cam/cam_compile.h (revision 27618) @@ -32,7 +32,8 @@ typedef enum { PCB_CAM_DESC, PCB_CAM_PLUGIN, - PCB_CAM_WRITE + PCB_CAM_WRITE, + PCB_CAM_PARTIAL } pcb_cam_inst_t; typedef struct { @@ -51,6 +52,9 @@ } write; struct { char *arg; + } partial; + struct { + char *arg; } prefix; } op; } pcb_cam_code_t; @@ -71,7 +75,10 @@ typedef struct { char *prefix; /* strdup'd file name prefix from the last prefix command */ pcb_hid_t *exporter; + unsigned partial:1; /* when 1, there are objects marked with the EXPORTSEL flag */ + unsigned has_partial:1; /* the code has partial in it so an initial flag reset is needed */ + char *args; /* strdup'd argument string from the last plugin command - already split up */ char **argv; /* [0] and [1] are for --cam; the rest point into args */ int argc;