Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 28104) +++ trunk/src/plug_io.c (revision 28105) @@ -977,7 +977,7 @@ { if ((pcb_io_incompat_lst_enable) && (conf_core.editor.io_incomp_popup)) { - pcb_view_t *violation = pcb_view_new(type, title, description); + pcb_view_t *violation = pcb_view_new(&PCB->hidlib, type, title, description); if ((obj != NULL) && (obj->type & PCB_OBJ_CLASS_REAL)) { pcb_view_append_obj(violation, 0, obj); pcb_view_set_bbox_by_objs(PCB->Data, violation); Index: trunk/src/view.c =================================================================== --- trunk/src/view.c (revision 28104) +++ trunk/src/view.c (revision 28105) @@ -100,9 +100,6 @@ return NULL; } -TODO("remove this when pcb_view_goto loses PCB->hidlib") -#include "board.h" - void pcb_view_goto(pcb_view_t *item) { if (item->have_bbox) { @@ -112,11 +109,11 @@ argv[2].type = FGW_COORD; fgw_coord(&argv[2]) = item->bbox.Y1; argv[3].type = FGW_COORD; fgw_coord(&argv[3]) = item->bbox.X2; argv[4].type = FGW_COORD; fgw_coord(&argv[4]) = item->bbox.Y2; - pcb_actionv_bin(&PCB->hidlib, "zoom", &res, 5, argv); + pcb_actionv_bin(item->hidlib, "zoom", &res, 5, argv); } } -pcb_view_t *pcb_view_new(const char *type, const char *title, const char *description) +pcb_view_t *pcb_view_new(pcb_hidlib_t *hl, const char *type, const char *title, const char *description) { pcb_view_t *v = calloc(sizeof(pcb_view_t), 1); @@ -130,6 +127,7 @@ v->type = pcb_strdup(type); v->title = pcb_strdup(title); v->description = pcb_strdup(description); + v->hidlib = hl; return v; } Index: trunk/src/view.h =================================================================== --- trunk/src/view.h (revision 28104) +++ trunk/src/view.h (revision 28105) @@ -47,6 +47,8 @@ struct pcb_view_s { unsigned long int uid; /* ID unique for each view (for GUI identification) - 0 means invalid */ + pcb_hidlib_t *hidlib; + char *type; char *title; char *description; @@ -104,7 +106,7 @@ void pcb_view_goto(pcb_view_t *item); /* Allocate a new, floating (unlinked) view with no data or bbox */ -pcb_view_t *pcb_view_new(const char *type, const char *title, const char *description); +pcb_view_t *pcb_view_new(pcb_hidlib_t *hl, const char *type, const char *title, const char *description); /* Append obj to one of the object groups in view (resolving to idpath) */ void pcb_view_append_obj(pcb_view_t *view, int grp, pcb_any_obj_t *obj); Index: trunk/src_plugins/drc_orig/drc_orig.c =================================================================== --- trunk/src_plugins/drc_orig/drc_orig.c (revision 28104) +++ trunk/src_plugins/drc_orig/drc_orig.c (revision 28105) @@ -90,7 +90,7 @@ doIsBad: pcb_poly_invalidate_draw(layer, polygon); pcb_draw_obj((pcb_any_obj_t *)ptr2); - violation = pcb_view_new("short", message, "Circuits that are too close may bridge during imaging, etching,\n" "plating, or soldering processes resulting in a direct short."); + violation = pcb_view_new(&PCB->hidlib, "short", message, "Circuits that are too close may bridge during imaging, etching,\n" "plating, or soldering processes resulting in a direct short."); pcb_drc_set_data(violation, NULL, conf_core.design.bloat); pcb_view_append_obj(violation, 0, (pcb_any_obj_t *)ptr2); pcb_view_set_bbox_by_objs(PCB->Data, violation); @@ -106,7 +106,7 @@ return 0; /* automatic thickness is always valid - ensured by the renderer */ if (text->thickness < min_wid) { pcb_text_invalidate_draw(layer, text); - violation = pcb_view_new("thin", "Text thickness is too thin", "Process specifications dictate a minimum feature-width\nthat can reliably be reproduced"); + violation = pcb_view_new(&PCB->hidlib, "thin", "Text thickness is too thin", "Process specifications dictate a minimum feature-width\nthat can reliably be reproduced"); pcb_drc_set_data(violation, &text->thickness, min_wid); pcb_view_append_obj(violation, 0, (pcb_any_obj_t *)text); pcb_view_set_bbox_by_objs(PCB->Data, violation); @@ -139,11 +139,11 @@ if (!IS_FOUND(new_obj, fa) && IS_FOUND(arrived_from, fa)) { if (ctx->shrunk) { - violation = pcb_view_new("broken", "Potential for broken trace", "Insufficient overlap between objects can lead to broken tracks\ndue to registration errors with old wheel style photo-plotters."); + violation = pcb_view_new(&PCB->hidlib, "broken", "Potential for broken trace", "Insufficient overlap between objects can lead to broken tracks\ndue to registration errors with old wheel style photo-plotters."); pcb_drc_set_data(violation, NULL, conf_core.design.shrink); } else { - violation = pcb_view_new("short", "Copper areas too close", "Circuits that are too close may bridge during imaging, etching,\nplating, or soldering processes resulting in a direct short."); + violation = pcb_view_new(&PCB->hidlib, "short", "Copper areas too close", "Circuits that are too close may bridge during imaging, etching,\nplating, or soldering processes resulting in a direct short."); pcb_drc_set_data(violation, NULL, conf_core.design.bloat); } pcb_view_append_obj(violation, 0, (pcb_any_obj_t *)new_obj); @@ -277,7 +277,7 @@ pcb_poly_plows(PCB->Data, PCB_OBJ_LINE, layer, line, drc_callback, lst); if (line->Thickness < conf_core.design.min_wid) { pcb_line_invalidate_draw(layer, line); - violation = pcb_view_new("thin", "Line width is too thin", "Process specifications dictate a minimum feature-width\nthat can reliably be reproduced"); + violation = pcb_view_new(&PCB->hidlib, "thin", "Line width is too thin", "Process specifications dictate a minimum feature-width\nthat can reliably be reproduced"); pcb_drc_set_data(violation, &line->Thickness, conf_core.design.min_wid); pcb_view_append_obj(violation, 0, (pcb_any_obj_t *)line); pcb_view_set_bbox_by_objs(PCB->Data, violation); @@ -297,7 +297,7 @@ pcb_poly_plows(PCB->Data, PCB_OBJ_ARC, layer, arc, drc_callback, lst); if (arc->Thickness < conf_core.design.min_wid) { pcb_arc_invalidate_draw(layer, arc); - violation = pcb_view_new("thin", "Arc width is too thin", "Process specifications dictate a minimum feature-width\nthat can reliably be reproduced"); + violation = pcb_view_new(&PCB->hidlib, "thin", "Arc width is too thin", "Process specifications dictate a minimum feature-width\nthat can reliably be reproduced"); pcb_drc_set_data(violation, &arc->Thickness, conf_core.design.min_wid); pcb_view_append_obj(violation, 0, (pcb_any_obj_t *)arc); pcb_view_set_bbox_by_objs(PCB->Data, violation); @@ -320,7 +320,7 @@ if ((ring > 0) || (hole > 0)) { pcb_pstk_invalidate_draw(padstack); if (ring) { - violation = pcb_view_new("thin", "padstack annular ring too small", "Annular rings that are too small may erode during etching,\nresulting in a broken connection"); + violation = pcb_view_new(&PCB->hidlib, "thin", "padstack annular ring too small", "Annular rings that are too small may erode during etching,\nresulting in a broken connection"); pcb_drc_set_data(violation, &ring, conf_core.design.min_ring); pcb_view_append_obj(violation, 0, (pcb_any_obj_t *)padstack); pcb_view_set_bbox_by_objs(PCB->Data, violation); @@ -327,7 +327,7 @@ pcb_view_list_append(lst, violation); } if (hole > 0) { - violation = pcb_view_new("drill", "Padstack drill size is too small", "Process rules dictate the minimum drill size which can be used"); + violation = pcb_view_new(&PCB->hidlib, "drill", "Padstack drill size is too small", "Process rules dictate the minimum drill size which can be used"); pcb_drc_set_data(violation, &hole, conf_core.design.min_drill); pcb_view_append_obj(violation, 0, (pcb_any_obj_t *)padstack); pcb_view_set_bbox_by_objs(PCB->Data, violation); @@ -348,7 +348,7 @@ { if (line->Thickness < conf_core.design.min_slk) { pcb_line_invalidate_draw(layer, line); - violation = pcb_view_new("thin", "Silk line is too thin", "Process specifications dictate a minimum silkscreen feature-width\nthat can reliably be reproduced"); + violation = pcb_view_new(&PCB->hidlib, "thin", "Silk line is too thin", "Process specifications dictate a minimum silkscreen feature-width\nthat can reliably be reproduced"); pcb_drc_set_data(violation, &line->Thickness, conf_core.design.min_slk); pcb_view_append_obj(violation, 0, (pcb_any_obj_t *)line); pcb_view_set_bbox_by_objs(PCB->Data, violation); @@ -391,7 +391,7 @@ if (message != NULL) { - violation = pcb_view_new("beyond", message, "Object hard to edit or export because being outside of the drawing area."); + violation = pcb_view_new(&PCB->hidlib, "beyond", message, "Object hard to edit or export because being outside of the drawing area."); pcb_drc_set_data(violation, &measured, required); pcb_view_append_obj(violation, 0, o); pcb_view_set_bbox_by_objs(PCB->Data, violation);