Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 17689) +++ trunk/src/action_helper.c (revision 17690) @@ -1,120 +1 @@ -/* - * COPYRIGHT - * - * pcb-rnd, interactive printed circuit board design - * (this file is based on PCB, interactive printed circuit board design) - * Copyright (C) 1994,1995,1996 Thomas Nau - * Copyright (C) 1997, 1998, 1999, 2000, 2001 Harry Eaton - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact: - * Project page: http://repo.hu/projects/pcb-rnd - * lead developer: email to pcb-rnd (at) igor2.repo.hu - * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") - * - * - * Old contact info: - * Harry Eaton, 6697 Buttonhole Ct, Columbia, MD 21044, USA - * haceaton@aplcomm.jhuapl.edu - * - */ - -#include "config.h" - -#include "conf_core.h" - -#include "action_helper.h" -#include "board.h" -#include "change.h" -#include "copy.h" -#include "data.h" -#include "draw.h" -#include "find.h" -#include "insert.h" -#include "polygon.h" -#include "remove.h" -#include "rotate.h" -#include "search.h" -#include "select.h" -#include "undo.h" -#include "funchash_core.h" -#include "actions.h" -#include "compat_misc.h" -#include "compat_nls.h" -#include "event.h" - -#include "obj_line_draw.h" -#include "obj_arc_draw.h" -#include "obj_text_draw.h" -#include "obj_rat_draw.h" -#include "obj_poly_draw.h" -#include "obj_pstk_draw.h" - -#include "tool.h" - -void pcb_clear_warnings() -{ - pcb_rtree_it_t it; - pcb_box_t *n; - int li; - pcb_layer_t *l; - - conf_core.temp.rat_warn = pcb_false; - - for(n = pcb_r_first(PCB->Data->padstack_tree, &it); n != NULL; n = pcb_r_next(&it)) { - if (PCB_FLAG_TEST(PCB_FLAG_WARN, (pcb_any_obj_t *)n)) { - PCB_FLAG_CLEAR(PCB_FLAG_WARN, (pcb_any_obj_t *)n); - pcb_pstk_invalidate_draw((pcb_pstk_t *)n); - } - } - pcb_r_end(&it); - - for(li = 0, l = PCB->Data->Layer; li < PCB->Data->LayerN; li++,l++) { - for(n = pcb_r_first(l->line_tree, &it); n != NULL; n = pcb_r_next(&it)) { - if (PCB_FLAG_TEST(PCB_FLAG_WARN, (pcb_any_obj_t *)n)) { - PCB_FLAG_CLEAR(PCB_FLAG_WARN, (pcb_any_obj_t *)n); - pcb_line_invalidate_draw(l, (pcb_line_t *)n); - } - } - pcb_r_end(&it); - - for(n = pcb_r_first(l->arc_tree, &it); n != NULL; n = pcb_r_next(&it)) { - if (PCB_FLAG_TEST(PCB_FLAG_WARN, (pcb_any_obj_t *)n)) { - PCB_FLAG_CLEAR(PCB_FLAG_WARN, (pcb_any_obj_t *)n); - pcb_arc_invalidate_draw(l, (pcb_arc_t *)n); - } - } - pcb_r_end(&it); - - for(n = pcb_r_first(l->polygon_tree, &it); n != NULL; n = pcb_r_next(&it)) { - if (PCB_FLAG_TEST(PCB_FLAG_WARN, (pcb_any_obj_t *)n)) { - PCB_FLAG_CLEAR(PCB_FLAG_WARN, (pcb_any_obj_t *)n); - pcb_poly_invalidate_draw(l, (pcb_poly_t *)n); - } - } - pcb_r_end(&it); - - for(n = pcb_r_first(l->text_tree, &it); n != NULL; n = pcb_r_next(&it)) { - if (PCB_FLAG_TEST(PCB_FLAG_WARN, (pcb_any_obj_t *)n)) { - PCB_FLAG_CLEAR(PCB_FLAG_WARN, (pcb_any_obj_t *)n); - pcb_text_invalidate_draw(l, (pcb_text_t *)n); - } - } - pcb_r_end(&it); - } - - pcb_draw(); -} +/* scheduled for removal */ Index: trunk/src/action_helper.h =================================================================== --- trunk/src/action_helper.h (revision 17689) +++ trunk/src/action_helper.h (revision 17690) @@ -1,38 +1 @@ -/* - * COPYRIGHT - * - * pcb-rnd, interactive printed circuit board design - * (this file is based on PCB, interactive printed circuit board design) - * Copyright (C) 1994,1995,1996 Thomas Nau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Contact: - * Project page: http://repo.hu/projects/pcb-rnd - * lead developer: email to pcb-rnd (at) igor2.repo.hu - * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") - * - */ - -#ifndef PCB_ACTION_HELPER_H -#define PCB_ACTION_HELPER_H - -#include "global_typedefs.h" - -/* Clear warning color from pins/pads */ -void pcb_clear_warnings(void); - - -#endif +/* scheduled for removal */ Index: trunk/src/data.c =================================================================== --- trunk/src/data.c (revision 17689) +++ trunk/src/data.c (revision 17690) @@ -661,3 +661,62 @@ pcb_data_flag_change(((pcb_subc_t *)o)->data, mask, how, flags); } } + +#warning TODO: rewrite to be more generic +#include "obj_pstk_draw.h" +#include "obj_text_draw.h" +#include "obj_poly_draw.h" +#include "obj_arc_draw.h" +#include "obj_line_draw.h" +#include "conf_core.h" +void pcb_clear_warnings() +{ + pcb_rtree_it_t it; + pcb_box_t *n; + int li; + pcb_layer_t *l; + + conf_core.temp.rat_warn = pcb_false; + + for(n = pcb_r_first(PCB->Data->padstack_tree, &it); n != NULL; n = pcb_r_next(&it)) { + if (PCB_FLAG_TEST(PCB_FLAG_WARN, (pcb_any_obj_t *)n)) { + PCB_FLAG_CLEAR(PCB_FLAG_WARN, (pcb_any_obj_t *)n); + pcb_pstk_invalidate_draw((pcb_pstk_t *)n); + } + } + pcb_r_end(&it); + + for(li = 0, l = PCB->Data->Layer; li < PCB->Data->LayerN; li++,l++) { + for(n = pcb_r_first(l->line_tree, &it); n != NULL; n = pcb_r_next(&it)) { + if (PCB_FLAG_TEST(PCB_FLAG_WARN, (pcb_any_obj_t *)n)) { + PCB_FLAG_CLEAR(PCB_FLAG_WARN, (pcb_any_obj_t *)n); + pcb_line_invalidate_draw(l, (pcb_line_t *)n); + } + } + pcb_r_end(&it); + + for(n = pcb_r_first(l->arc_tree, &it); n != NULL; n = pcb_r_next(&it)) { + if (PCB_FLAG_TEST(PCB_FLAG_WARN, (pcb_any_obj_t *)n)) { + PCB_FLAG_CLEAR(PCB_FLAG_WARN, (pcb_any_obj_t *)n); + pcb_arc_invalidate_draw(l, (pcb_arc_t *)n); + } + } + pcb_r_end(&it); + + for(n = pcb_r_first(l->polygon_tree, &it); n != NULL; n = pcb_r_next(&it)) { + if (PCB_FLAG_TEST(PCB_FLAG_WARN, (pcb_any_obj_t *)n)) { + PCB_FLAG_CLEAR(PCB_FLAG_WARN, (pcb_any_obj_t *)n); + pcb_poly_invalidate_draw(l, (pcb_poly_t *)n); + } + } + pcb_r_end(&it); + + for(n = pcb_r_first(l->text_tree, &it); n != NULL; n = pcb_r_next(&it)) { + if (PCB_FLAG_TEST(PCB_FLAG_WARN, (pcb_any_obj_t *)n)) { + PCB_FLAG_CLEAR(PCB_FLAG_WARN, (pcb_any_obj_t *)n); + pcb_text_invalidate_draw(l, (pcb_text_t *)n); + } + } + pcb_r_end(&it); + } +} Index: trunk/src/data.h =================================================================== --- trunk/src/data.h (revision 17689) +++ trunk/src/data.h (revision 17690) @@ -197,4 +197,7 @@ /* Recursively change flags of data; how is one of pcb_change_flag_t */ void pcb_data_flag_change(pcb_data_t *data, pcb_objtype_t mask, int how, unsigned long flags); +/* Clear warning color from pins/pads */ +void pcb_clear_warnings(void); + #endif Index: trunk/src/rats_act.c =================================================================== --- trunk/src/rats_act.c (revision 17689) +++ trunk/src/rats_act.c (revision 17690) @@ -84,8 +84,10 @@ PCB_ACT_CONVARG(1, FGW_KEYWORD, AddRats, op = fgw_keyword(&argv[1])); - if (conf_core.temp.rat_warn) + if (conf_core.temp.rat_warn) { pcb_clear_warnings(); + pcb_draw(); + } switch (op) { case F_AllRats: if (pcb_rat_add_all(pcb_false, NULL)) @@ -215,8 +217,10 @@ PCB_ACT_CONVARG(1, FGW_KEYWORD, DeleteRats, op = fgw_keyword(&argv[1])); - if (conf_core.temp.rat_warn) + if (conf_core.temp.rat_warn) { pcb_clear_warnings(); + pcb_draw(); + } switch(op) { case F_AllRats: if (pcb_rats_destroy(pcb_false))