Index: trunk/src/Makefile.dep =================================================================== --- trunk/src/Makefile.dep (revision 4622) +++ trunk/src/Makefile.dep (revision 4623) @@ -2918,7 +2918,7 @@ 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_line_draw.h + obj_line_draw.h obj_arc_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 \ @@ -3336,7 +3336,11 @@ obj_text_list.h obj_rat_list.h obj_rat.h library.h rats_patch.h font.h \ box.h math_helper.h move.h misc_util.h data.h crosshair.h rubberband.h \ vtonpoint.h hid.h error.h drc.h buffer.h polygon.h rtree.h undo.h \ - rotate.h obj_arc_op.h operation.h draw.h + rotate.h conf_core.h conf.h pcb-printf.h ../src_3rd/genvector/gds_char.h \ + ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/dom.h \ + ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h \ + ../src_3rd/liblihata/genht/htsp.h ../src_3rd/liblihata/genht/ht.h \ + ../src_3rd/genvector/vtp0.h list_conf.h obj_arc_op.h operation.h draw.h obj_arc_list.o: obj_arc_list.c obj_arc_list.h obj_common.h \ ../src_3rd/genlist/gendlist.h flag.h globalconst.h ../config.h attrib.h \ global_typedefs.h pcb_bool.h unit.h obj_arc.h \ @@ -3373,7 +3377,7 @@ ../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_line_draw.h obj_elem_op.h draw.h + obj_line_draw.h obj_arc_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 4622) +++ trunk/src/draw.c (revision 4623) @@ -44,6 +44,7 @@ #include "obj_pinvia_draw.h" #include "obj_elem_draw.h" #include "obj_line_draw.h" +#include "obj_arc_draw.h" #undef NDEBUG #include @@ -166,51 +167,6 @@ return R_DIR_FOUND_CONTINUE; } -void _draw_arc(ArcType * arc) -{ - if (!arc->Thickness) - return; - - if (conf_core.editor.thin_draw) - gui->set_line_width(Output.fgGC, 0); - else - gui->set_line_width(Output.fgGC, arc->Thickness); - gui->set_line_cap(Output.fgGC, Trace_Cap); - - gui->draw_arc(Output.fgGC, arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta); -} - -static void draw_arc(LayerType * layer, ArcType * arc) -{ - const char *color; - char buf[sizeof("#XXXXXX")]; - - if (TEST_FLAG(PCB_FLAG_WARN, arc)) - color = PCB->WarnColor; - else if (TEST_FLAG(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, arc)) { - if (TEST_FLAG(PCB_FLAG_SELECTED, arc)) - color = layer->SelectedColor; - else - color = PCB->ConnectedColor; - } - else - color = layer->Color; - - if (TEST_FLAG(PCB_FLAG_ONPOINT, arc)) { - assert(color != NULL); - LightenColor(color, buf, 1.75); - color = buf; - } - gui->set_color(Output.fgGC, color); - _draw_arc(arc); -} - -static r_dir_t arc_callback(const BoxType * b, void *cl) -{ - draw_arc((LayerTypePtr) cl, (ArcTypePtr) b); - return R_DIR_FOUND_CONTINUE; -} - /* --------------------------------------------------------------------------- * prints assembly drawing. */ @@ -584,7 +540,7 @@ 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); + r_search(Layer->arc_tree, screen, NULL, draw_arc_callback, Layer, NULL); /* draw the layer text on screen */ r_search(Layer->text_tree, screen, NULL, text_callback, Layer, NULL); Index: trunk/src/obj_arc.c =================================================================== --- trunk/src/obj_arc.c (revision 4622) +++ trunk/src/obj_arc.c (revision 4623) @@ -35,6 +35,8 @@ #include "undo.h" #include "rotate.h" #include "move.h" +#include "conf_core.h" + #include "obj_arc.h" #include "obj_arc_op.h" @@ -41,8 +43,6 @@ /* TODO: could be removed if draw.c could be split up */ #include "draw.h" - - ArcTypePtr GetArcMemory(LayerType * layer) { ArcType *new_obj; @@ -549,3 +549,49 @@ Draw(); return (Arc); } + +/*** draw ***/ +void _draw_arc(ArcType * arc) +{ + if (!arc->Thickness) + return; + + if (conf_core.editor.thin_draw) + gui->set_line_width(Output.fgGC, 0); + else + gui->set_line_width(Output.fgGC, arc->Thickness); + gui->set_line_cap(Output.fgGC, Trace_Cap); + + gui->draw_arc(Output.fgGC, arc->X, arc->Y, arc->Width, arc->Height, arc->StartAngle, arc->Delta); +} + +void draw_arc(LayerType * layer, ArcType * arc) +{ + const char *color; + char buf[sizeof("#XXXXXX")]; + + if (TEST_FLAG(PCB_FLAG_WARN, arc)) + color = PCB->WarnColor; + else if (TEST_FLAG(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, arc)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, arc)) + color = layer->SelectedColor; + else + color = PCB->ConnectedColor; + } + else + color = layer->Color; + + if (TEST_FLAG(PCB_FLAG_ONPOINT, arc)) { + assert(color != NULL); + LightenColor(color, buf, 1.75); + color = buf; + } + gui->set_color(Output.fgGC, color); + _draw_arc(arc); +} + +r_dir_t draw_arc_callback(const BoxType * b, void *cl) +{ + draw_arc((LayerTypePtr) cl, (ArcTypePtr) b); + return R_DIR_FOUND_CONTINUE; +} Index: trunk/src/obj_arc_draw.h =================================================================== --- trunk/src/obj_arc_draw.h (nonexistent) +++ trunk/src/obj_arc_draw.h (revision 4623) @@ -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 arcs ***/ +r_dir_t draw_arc_callback(const BoxType * b, void *cl); + +void _draw_arc(ArcType * arc); +void draw_arc(LayerType * layer, ArcType * arc); Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 4622) +++ trunk/src/obj_elem.c (revision 4623) @@ -45,6 +45,7 @@ #include "obj_pinvia_draw.h" #include "obj_pad_draw.h" #include "obj_line_draw.h" +#include "obj_arc_draw.h" #include "obj_elem.h" #include "obj_elem_list.h"