Index: trunk/src/Makefile.dep =================================================================== --- trunk/src/Makefile.dep (revision 4621) +++ trunk/src/Makefile.dep (revision 4622) @@ -2917,7 +2917,8 @@ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h font.h \ box.h move.h misc_util.h data.h crosshair.h rubberband.h vtonpoint.h \ hid.h error.h drc.h buffer.h draw.h rotate.h rtree.h stub_draw_fab.h \ - obj_all.h obj_pad_draw.h obj_pinvia_draw.h obj_elem_draw.h + obj_all.h obj_pad_draw.h obj_pinvia_draw.h obj_elem_draw.h \ + obj_line_draw.h error.o: error.c ../config.h data.h globalconst.h global_typedefs.h \ pcb_bool.h unit.h layer.h attrib.h obj_all_list.h obj_arc_list.h \ obj_common.h ../src_3rd/genlist/gendlist.h flag.h obj_arc.h \ @@ -3371,8 +3372,8 @@ ../src_3rd/liblihata/genht/htsp.h ../src_3rd/liblihata/genht/ht.h \ ../src_3rd/genvector/vtp0.h list_conf.h conf_core.h compat_nls.h \ compat_misc.h rotate.h remove.h polygon.h rtree.h undo.h obj_pinvia_op.h \ - operation.h obj_pad_op.h obj_pinvia_draw.h obj_pad_draw.h obj_elem_op.h \ - draw.h + operation.h obj_pad_op.h obj_pinvia_draw.h obj_pad_draw.h \ + obj_line_draw.h obj_elem_op.h draw.h obj_elem_list.o: obj_elem_list.c ../config.h obj_elem.h obj_common.h \ ../src_3rd/genlist/gendlist.h flag.h globalconst.h attrib.h \ global_typedefs.h pcb_bool.h unit.h obj_arc_list.h obj_arc.h \ Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 4621) +++ trunk/src/draw.c (revision 4622) @@ -43,6 +43,7 @@ #include "obj_pad_draw.h" #include "obj_pinvia_draw.h" #include "obj_elem_draw.h" +#include "obj_line_draw.h" #undef NDEBUG #include @@ -135,49 +136,6 @@ r_search(PCB->Data->via_tree, drawn_area, NULL, draw_hole_callback, &plated, NULL); } -void _draw_line(LineType * line) -{ - gui->set_line_cap(Output.fgGC, Trace_Cap); - if (conf_core.editor.thin_draw) - gui->set_line_width(Output.fgGC, 0); - else - gui->set_line_width(Output.fgGC, line->Thickness); - - gui->draw_line(Output.fgGC, line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y); -} - -static void draw_line(LayerType * layer, LineType * line) -{ - const char *color; - char buf[sizeof("#XXXXXX")]; - - if (TEST_FLAG(PCB_FLAG_WARN, line)) - color = PCB->WarnColor; - else if (TEST_FLAG(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, line)) { - if (TEST_FLAG(PCB_FLAG_SELECTED, line)) - color = layer->SelectedColor; - else - color = PCB->ConnectedColor; - } - else - color = layer->Color; - - if (TEST_FLAG(PCB_FLAG_ONPOINT, line)) { - assert(color != NULL); - LightenColor(color, buf, 1.75); - color = buf; - } - - gui->set_color(Output.fgGC, color); - _draw_line(line); -} - -static r_dir_t line_callback(const BoxType * b, void *cl) -{ - draw_line((LayerType *) cl, (LineType *) b); - return R_DIR_FOUND_CONTINUE; -} - static r_dir_t rat_callback(const BoxType * b, void *cl) { RatType *rat = (RatType *) b; @@ -623,7 +581,7 @@ return; /* draw all visible lines this layer */ - r_search(Layer->line_tree, screen, NULL, line_callback, Layer, NULL); + r_search(Layer->line_tree, screen, NULL, draw_line_callback, Layer, NULL); /* draw the layer arcs on screen */ r_search(Layer->arc_tree, screen, NULL, arc_callback, Layer, NULL); Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 4621) +++ trunk/src/obj_elem.c (revision 4622) @@ -44,6 +44,7 @@ #include "obj_pinvia_draw.h" #include "obj_pad_draw.h" +#include "obj_line_draw.h" #include "obj_elem.h" #include "obj_elem_list.h" Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 4621) +++ trunk/src/obj_line.c (revision 4622) @@ -699,3 +699,47 @@ Draw(); return (line); } + +/*** draw ***/ +void _draw_line(LineType * line) +{ + gui->set_line_cap(Output.fgGC, Trace_Cap); + if (conf_core.editor.thin_draw) + gui->set_line_width(Output.fgGC, 0); + else + gui->set_line_width(Output.fgGC, line->Thickness); + + gui->draw_line(Output.fgGC, line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y); +} + +void draw_line(LayerType * layer, LineType * line) +{ + const char *color; + char buf[sizeof("#XXXXXX")]; + + if (TEST_FLAG(PCB_FLAG_WARN, line)) + color = PCB->WarnColor; + else if (TEST_FLAG(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, line)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, line)) + color = layer->SelectedColor; + else + color = PCB->ConnectedColor; + } + else + color = layer->Color; + + if (TEST_FLAG(PCB_FLAG_ONPOINT, line)) { + assert(color != NULL); + LightenColor(color, buf, 1.75); + color = buf; + } + + gui->set_color(Output.fgGC, color); + _draw_line(line); +} + +r_dir_t draw_line_callback(const BoxType * b, void *cl) +{ + draw_line((LayerType *) cl, (LineType *) b); + return R_DIR_FOUND_CONTINUE; +} Index: trunk/src/obj_line_draw.h =================================================================== --- trunk/src/obj_line_draw.h (nonexistent) +++ trunk/src/obj_line_draw.h (revision 4622) @@ -0,0 +1,31 @@ +/* + * COPYRIGHT + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Contact addresses for paper mail and Email: + * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany + * Thomas.Nau@rz.uni-ulm.de + * + */ + +/*** Standard draw of lines ***/ +void _draw_line(LineType * line); +void draw_line(LayerType * layer, LineType * line); +r_dir_t draw_line_callback(const BoxType * b, void *cl); +