Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 28066) +++ trunk/src/gui_act.c (revision 28067) @@ -897,7 +897,7 @@ return 0; } if (layer != CURRENT) { - pcb_layervis_change_group_vis(pcb_layer_id(PCB->Data, layer), pcb_true, pcb_true); + pcb_layervis_change_group_vis(PCB_ACT_HIDLIB, pcb_layer_id(PCB_ACT_BOARD->Data, layer), pcb_true, pcb_true); pcb_hid_redraw(PCB); } PCB_ACT_IRES(0); @@ -1438,7 +1438,7 @@ if (pcb_strcasecmp(name, "silk") == 0) { PCB->RatDraw = 0; if (pcb_layer_list(PCB, PCB_LYT_VISIBLE_SIDE() | PCB_LYT_SILK, &lid, 1) > 0) { - pcb_layervis_change_group_vis(lid, 1, 1); + pcb_layervis_change_group_vis(PCB_ACT_HIDLIB, lid, 1, 1); } else { pcb_message(PCB_MSG_ERROR, "Can't find this-side silk layer\n"); @@ -1462,7 +1462,7 @@ } PCB->RatDraw = 0; - pcb_layervis_change_group_vis(atoi(name)-1, 1, 1); + pcb_layervis_change_group_vis(PCB_ACT_HIDLIB, atoi(name)-1, 1, 1); pcb_gui->invalidate_all(pcb_gui); pcb_event(PCB_ACT_HIDLIB, PCB_EVENT_LAYERVIS_CHANGED, NULL); return 0; @@ -1550,7 +1550,7 @@ } else if (pcb_strcasecmp(name, "silk") == 0) { if (pcb_layer_list(PCB, PCB_LYT_VISIBLE_SIDE() | PCB_LYT_SILK, &lid, 1) > 0) - pcb_layervis_change_group_vis(lid, -1, 0); + pcb_layervis_change_group_vis(PCB_ACT_HIDLIB, lid, -1, 0); else pcb_message(PCB_MSG_ERROR, "Can't find this-side silk layer\n"); } @@ -1579,7 +1579,7 @@ char *end; int id = strtol(name, &end, 10) - 1; if (*end == '\0') { /* integer layer */ - pcb_layervis_change_group_vis(id, -1, 0); + pcb_layervis_change_group_vis(PCB_ACT_HIDLIB, id, -1, 0); pcb_gui->invalidate_all(pcb_gui); pcb_event(PCB_ACT_HIDLIB, PCB_EVENT_LAYERVIS_CHANGED, NULL); return 0; Index: trunk/src/hid_cam.c =================================================================== --- trunk/src/hid_cam.c (revision 28066) +++ trunk/src/hid_cam.c (revision 28067) @@ -472,7 +472,7 @@ } if (pcb->LayerGroups.grp[gid].len <= 0) continue; - pcb_layervis_change_group_vis(pcb->LayerGroups.grp[gid].lid[0], 1, 0); + pcb_layervis_change_group_vis(&pcb->hidlib, pcb->LayerGroups.grp[gid].lid[0], 1, 0); dst->grp_vis[gid] = 1; parse_layer_supplements(spk, spv, spc, &purpose, &xf, &xf_); @@ -507,7 +507,7 @@ offs--; if ((offs >= 0) && (offs < len)) { pcb_layergrp_id_t gid = gids[offs]; - pcb_layervis_change_group_vis(pcb->LayerGroups.grp[gid].lid[0], 1, 0); + pcb_layervis_change_group_vis(&pcb->hidlib, pcb->LayerGroups.grp[gid].lid[0], 1, 0); dst->grp_vis[gid] = 1; if (xf != NULL) { dst->xform[gid] = &dst->xform_[gid]; @@ -518,7 +518,7 @@ else { for(n = 0; n < len; n++) { pcb_layergrp_id_t gid = gids[n]; - pcb_layervis_change_group_vis(pcb->LayerGroups.grp[gid].lid[0], 1, 0); + pcb_layervis_change_group_vis(&pcb->hidlib, pcb->LayerGroups.grp[gid].lid[0], 1, 0); dst->grp_vis[gid] = 1; if (xf != NULL) { dst->xform[gid] = &dst->xform_[gid]; Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 28066) +++ trunk/src/layer.c (revision 28067) @@ -697,7 +697,7 @@ g->lid[grp_idx] = new_lid; g->len++; pcb_event(&pcb->hidlib, PCB_EVENT_LAYERS_CHANGED, NULL); - pcb_layervis_change_group_vis(new_lid, 1, 1); + pcb_layervis_change_group_vis(&pcb->hidlib, new_lid, 1, 1); pcb_event(&pcb->hidlib, PCB_EVENT_LAYERVIS_CHANGED, NULL); at = new_lid; } Index: trunk/src/layer_vis.c =================================================================== --- trunk/src/layer_vis.c (revision 28066) +++ trunk/src/layer_vis.c (revision 28067) @@ -78,7 +78,7 @@ * changes the visibility of all layers in a group * returns the number of changed layers */ -int pcb_layervis_change_group_vis(pcb_layer_id_t Layer, int On, pcb_bool ChangeStackOrder) +int pcb_layervis_change_group_vis(pcb_hidlib_t *hl, pcb_layer_id_t Layer, int On, pcb_bool ChangeStackOrder) { pcb_layergrp_id_t group; int i, changed = 1; /* at least the current layer changes */ @@ -123,7 +123,7 @@ done:; /* update control panel and exit */ - pcb_event(&PCB->hidlib, PCB_EVENT_LAYERVIS_CHANGED, NULL); + pcb_event(hl, PCB_EVENT_LAYERVIS_CHANGED, NULL); return changed; } @@ -156,7 +156,7 @@ /* Bring the top copper group to the front and make it active. */ if (pcb_layer_list(PCB, PCB_LYT_TOP | PCB_LYT_COPPER, &comp, 1) > 0) - pcb_layervis_change_group_vis(comp, 1, 1); + pcb_layervis_change_group_vis(&PCB->hidlib, comp, 1, 1); } /* --------------------------------------------------------------------------- Index: trunk/src/layer_vis.h =================================================================== --- trunk/src/layer_vis.h (revision 28066) +++ trunk/src/layer_vis.h (revision 28067) @@ -36,7 +36,7 @@ /* changes the visibility of all layers in a group; returns the number of changed layers; on should be 0 or 1 for setting the state or -1 for toggling it */ -int pcb_layervis_change_group_vis(pcb_layer_id_t Layer, int On, pcb_bool ChangeStackOrder); +int pcb_layervis_change_group_vis(pcb_hidlib_t *hl, pcb_layer_id_t Layer, int On, pcb_bool ChangeStackOrder); /* resets the layer visibility stack setting */ void pcb_layervis_reset_stack(void); Index: trunk/src_plugins/cam/cam_compile.c =================================================================== --- trunk/src_plugins/cam/cam_compile.c (revision 28066) +++ trunk/src_plugins/cam/cam_compile.c (revision 28067) @@ -171,7 +171,7 @@ if (have_gui) { pcb_hid_restore_layer_ons(save_l_ons); pcb_hid_restore_layergrp_ons(save_g_ons); - pcb_layervis_change_group_vis(currly, 1, 1); + pcb_layervis_change_group_vis(&PCB->hidlib, currly, 1, 1); pcb_event(&PCB->hidlib, PCB_EVENT_LAYERVIS_CHANGED, NULL); } Index: trunk/src_plugins/dialogs/dlg_export.c =================================================================== --- trunk/src_plugins/dialogs/dlg_export.c (revision 28066) +++ trunk/src_plugins/dialogs/dlg_export.c (revision 28067) @@ -98,7 +98,7 @@ if (have_gui) { pcb_hid_restore_layer_ons(save_l_ons); pcb_hid_restore_layergrp_ons(save_g_ons); - pcb_layervis_change_group_vis(currly, 1, 1); + pcb_layervis_change_group_vis(&PCB->hidlib, currly, 1, 1); pcb_event(&PCB->hidlib, PCB_EVENT_LAYERVIS_CHANGED, NULL); } } Index: trunk/src_plugins/draw_csect/draw_csect.c =================================================================== --- trunk/src_plugins/draw_csect/draw_csect.c (revision 28066) +++ trunk/src_plugins/draw_csect/draw_csect.c (revision 28067) @@ -859,7 +859,7 @@ case PCB_HID_MOUSE_POPUP: lid = get_layer_coords(x, y); if (lid >= 0) { - pcb_layervis_change_group_vis(lid, 1, 1); + pcb_layervis_change_group_vis(&PCB->hidlib, lid, 1, 1); pcb_actionva(&PCB->hidlib, "Popup", "layer", NULL); } else if ((x > 0) && (x < PCB_MM_TO_COORD(GROUP_WIDTH_MM))) { Index: trunk/src_plugins/lib_hid_pcbui/act.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/act.c (revision 28066) +++ trunk/src_plugins/lib_hid_pcbui/act.c (revision 28067) @@ -286,7 +286,7 @@ lyt = (pcb_layer_flags_(CURRENT) & PCB_LYT_ANYTHING) | (!conf_core.editor.show_solder_side ? PCB_LYT_BOTTOM : PCB_LYT_TOP); lid = pcb_layer_vis_last_lyt(lyt); if (lid >= 0) - pcb_layervis_change_group_vis(lid, 1, 1); + pcb_layervis_change_group_vis(&PCB->hidlib, lid, 1, 1); } } @@ -296,9 +296,9 @@ pcb_bool new_solder_vis = conf_core.editor.show_solder_side; if (comp_group >= 0) - pcb_layervis_change_group_vis(PCB->LayerGroups.grp[comp_group].lid[0], !new_solder_vis, !new_solder_vis); + pcb_layervis_change_group_vis(&PCB->hidlib, PCB->LayerGroups.grp[comp_group].lid[0], !new_solder_vis, !new_solder_vis); if (solder_group >= 0) - pcb_layervis_change_group_vis(PCB->LayerGroups.grp[solder_group].lid[0], new_solder_vis, new_solder_vis); + pcb_layervis_change_group_vis(&PCB->hidlib, PCB->LayerGroups.grp[solder_group].lid[0], new_solder_vis, new_solder_vis); } pcb_draw_inhibit_dec(); Index: trunk/src_plugins/lib_hid_pcbui/layersel.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/layersel.c (revision 28066) +++ trunk/src_plugins/lib_hid_pcbui/layersel.c (revision 28067) @@ -263,7 +263,7 @@ if (lys->ly != NULL) { if (lys->grp_vis) { pcb_layer_id_t lid = lys->ly - PCB->Data->Layer; - pcb_layervis_change_group_vis(lid, 1, 1); + pcb_layervis_change_group_vis(&PCB->hidlib, lid, 1, 1); } else { vis = &lys->ly->meta.real.vis; @@ -383,7 +383,7 @@ change_selection:; lid = pcb_layer_id(PCB->Data, l); - pcb_layervis_change_group_vis(lid, 1, 1); + pcb_layervis_change_group_vis(&PCB->hidlib, lid, 1, 1); lys = lys_get(ls, &ls->real_layer, lid, 0); if (lys != 0) @@ -407,7 +407,7 @@ if (lys->grp_vis) { pcb_layer_id_t lid = lys->ly - PCB->Data->Layer; - pcb_layervis_change_group_vis(lid, !*vis, 1); + pcb_layervis_change_group_vis(&PCB->hidlib, lid, !*vis, 1); } else { *vis = !(*vis);